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
# # # Copyright (c) 2010, Georgia Tech Research Corporation # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # * Neither the name of the Georgia Tech Research Corporation nor the # names of its contributors may be used to endorse or promote products # derived from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY GEORGIA TECH RESEARCH CORPORATION ''AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL GEORGIA TECH BE LIABLE FOR ANY DIRECT, INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # \author Advait Jain (Healthcare Robotics Lab, Georgia Tech.) import mekabot.hrl_robot as hr import hrl_lib.util as ut, hrl_lib.transforms as tr import math, numpy as np import copy import sys sys.path.append('../') import compliant_trajectories as ct import segway_motion_calc as smc def compute_workspace(z, hook_angle): firenze = hr.M3HrlRobot(connect=False) rot_mat = tr.Rz(hook_angle)*tr.Rx(math.radians(0))*tr.Ry(math.radians(-90)) delta_list = [math.radians(d) for d in [0.,0.,0.,0.,10.,10.,10.]] x_list,y_list = [],[] if z < -0.4: xmin = 0.10 xmax = 0.65 else: xmin = 0.15 xmax = 0.65 for x in np.arange(xmin,xmax,.01): for y in np.arange(-0.1,-0.50,-0.01): if x<0.3 and y>-0.2: continue q = firenze.IK('right_arm',np.matrix([x,y,z]).T,rot_mat) if q != None and firenze.within_physical_limits_right(q,delta_list)==True: x_list.append(x) y_list.append(y) return np.matrix([x_list,y_list]) def create_workspace_dict(): dd = {} ha_list = [math.radians(d) for d in [0.,90.,-90.]] for ha in ha_list: d = {} for z in np.arange(-0.1,-0.55,-0.01): print 'z:',z pts2d = compute_workspace(z,hook_angle=ha) d[z] = pts2d dd[ha] = {} dd[ha]['pts'] = d ut.save_pickle(dd,'workspace_dict_'+ut.formatted_time()+'.pkl') def create_workspace_boundary(pkl_name): dd = ut.load_pickle(pkl_name) for ha in dd.keys(): pts_dict = dd[ha]['pts'] bndry_dict = {} for z in pts_dict.keys(): print 'z:',z wrkspc = pts_dict[z] if wrkspc.shape[1] < 100: pts_dict.pop(z) continue bndry = smc.compute_boundary(wrkspc) bndry_dict[z] = bndry dd[ha]['bndry'] = bndry_dict ut.save_pickle(dd, pkl_name) create_workspace_dict() #if len(sys.argv) != 2: # print 'Usage:', sys.argv[0], '<wrkspc dict pkl>' # print 'Exiting ...' # sys.exit() #create_workspace_boundary(sys.argv[1])
ajibawa-2023/Python-Code-Large/train/row_99523
53
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_99523:Import_L32_C0", "label": "mekabot.hrl_robot import hr", "type": "import", "loc": [32, 32], "level": 0, "parent": null, "vector": [1, 0, 0.2963, 0.0093, 0, 0.66, 0.0, 4, 0, 1, 0, 0, 4, 0, 0], "semantic": {"name": "mekabot.hrl_robot", "arg_names": [], "import_names": ["hr"], "rhs_call_name": "", "annotation": ""}, "snippet": "import mekabot.hrl_robot as hr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99523:Import_L33_C0", "label": "hrl_lib.util import ut, tr", "type": "import", "loc": [33, 33], "level": 0, "parent": null, "vector": [1, 0, 0.3056, 0.0093, 0, 0.66, 0.0909, 775, 0, 2, 0, 0, 775, 0, 0], "semantic": {"name": "hrl_lib.util", "arg_names": [], "import_names": ["ut", "tr"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.util as ut, hrl_lib.transforms as tr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99523:Import_L35_C0", "label": "math import math, np", "type": "import", "loc": [35, 35], "level": 0, "parent": null, "vector": [1, 0, 0.3241, 0.0093, 0, 0.66, 0.1818, 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_99523:Import_L36_C0", "label": "copy import copy", "type": "import", "loc": [36, 36], "level": 0, "parent": null, "vector": [1, 0, 0.3333, 0.0093, 0, 0.66, 0.2727, 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_99523:Import_L38_C0", "label": "sys import sys", "type": "import", "loc": [38, 38], "level": 0, "parent": null, "vector": [1, 0, 0.3519, 0.0093, 0, 0.66, 0.3636, 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_99523:Expr_L39_C0", "label": "append()", "type": "expression", "loc": [39, 39], "level": 0, "parent": null, "vector": [8, 0, 0.3611, 0.0093, 0, 0.66, 0.4545, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": "sys.path.append('../')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99523:Import_L40_C0", "label": "compliant_trajectories import ct", "type": "import", "loc": [40, 40], "level": 0, "parent": null, "vector": [1, 0, 0.3704, 0.0093, 0, 0.66, 0.5455, 906, 0, 1, 0, 0, 906, 0, 0], "semantic": {"name": "compliant_trajectories", "arg_names": [], "import_names": ["ct"], "rhs_call_name": "", "annotation": ""}, "snippet": "import compliant_trajectories as ct"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99523:Import_L41_C0", "label": "segway_motion_calc import smc", "type": "import", "loc": [41, 41], "level": 0, "parent": null, "vector": [1, 0, 0.3796, 0.0093, 0, 0.66, 0.6364, 870, 0, 1, 0, 0, 870, 0, 0], "semantic": {"name": "segway_motion_calc", "arg_names": [], "import_names": ["smc"], "rhs_call_name": "", "annotation": ""}, "snippet": "import segway_motion_calc as smc"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99523:FunctionDef_L44_C0", "label": "compute_workspace", "type": "function", "loc": [44, 64], "level": 0, "parent": null, "vector": [2, 0, 0.5, 0.1944, 0, 0.66, 0.7273, 606, 0, 2, 1, 0, 0, 0, 15], "semantic": {"name": "compute_workspace", "arg_names": ["z", "hook_angle"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def compute_workspace(z, hook_angle):\n firenze = hr.M3HrlRobot(connect=False)\n rot_mat = tr.Rz(hook_angle)*tr.Rx(math.radians(0))*tr.Ry(math.radians(-90))\n delta_list = [math.radians(d) for d in [0.,0.,0.,0.,10.,10.,10.]]\n x_list,y_list = [],[]\n if z < -0.4:\n xmin = 0.10\n xmax = 0.65"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99523:Assign_L45_C4", "label": "firenze = M3HrlRobot()", "type": "assigned_variable", "loc": [45, 45], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99523:FunctionDef_L44_C0", "vector": [14, 1, 0.4167, 0.0093, 1, 0.71, 0.0, 736, 3, 1, 0, 0, 305, 10, 1], "semantic": {"name": "firenze", "arg_names": [], "import_names": [], "rhs_call_name": "M3HrlRobot", "annotation": ""}, "snippet": " firenze = hr.M3HrlRobot(connect=False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99523:Assign_L46_C4", "label": "rot_mat =", "type": "assigned_variable", "loc": [46, 46], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99523:FunctionDef_L44_C0", "vector": [14, 1, 0.4259, 0.0093, 1, 0.71, 0.1667, 968, 4, 0, 0, 0, 0, 0, 5], "semantic": {"name": "rot_mat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rot_mat = tr.Rz(hook_angle)*tr.Rx(math.radians(0))*tr.Ry(math.radians(-90))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99523:Assign_L47_C4", "label": "delta_list =", "type": "assigned_variable", "loc": [47, 47], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99523:FunctionDef_L44_C0", "vector": [14, 1, 0.4352, 0.0093, 1, 0.71, 0.3333, 550, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "delta_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " delta_list = [math.radians(d) for d in [0.,0.,0.,0.,10.,10.,10.]]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99523:Assign_L48_C4", "label": "x_list, y_list =", "type": "assigned_variable", "loc": [48, 48], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99523:FunctionDef_L44_C0", "vector": [14, 1, 0.4444, 0.0093, 1, 0.71, 0.5, 548, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "x_list, y_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " x_list,y_list = [],[]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99523:If_L49_C4", "label": "if", "type": "if", "loc": [49, 54], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99523:FunctionDef_L44_C0", "vector": [4, 1, 0.4769, 0.0556, 1, 0.71, 0.6667, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if z < -0.4:\n xmin = 0.10\n xmax = 0.65\n else:\n xmin = 0.15\n xmax = 0.65"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99523:Assign_L50_C8", "label": "xmin =", "type": "assigned_variable", "loc": [50, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99523:If_L49_C4", "vector": [14, 2, 0.463, 0.0093, 2, 0.81, 0.0, 792, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "xmin", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " xmin = 0.10"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99523:Assign_L51_C8", "label": "xmax =", "type": "assigned_variable", "loc": [51, 51], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99523:If_L49_C4", "vector": [14, 2, 0.4722, 0.0093, 2, 0.81, 0.3333, 903, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "xmax", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " xmax = 0.65"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99523:Assign_L53_C8", "label": "xmin =", "type": "assigned_variable", "loc": [53, 53], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99523:If_L49_C4", "vector": [14, 2, 0.4907, 0.0093, 2, 0.81, 0.6667, 792, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "xmin", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " xmin = 0.15"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99523:Assign_L54_C8", "label": "xmax =", "type": "assigned_variable", "loc": [54, 54], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99523:If_L49_C4", "vector": [14, 2, 0.5, 0.0093, 2, 0.81, 1.0, 903, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "xmax", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " xmax = 0.65"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99523:For_L56_C4", "label": "for x", "type": "for", "loc": [56, 63], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99523:FunctionDef_L44_C0", "vector": [6, 1, 0.5509, 0.0741, 1, 0.71, 0.8333, 190, 3, 0, 0, 0, 0, 0, 7], "semantic": {"name": "x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for x in np.arange(xmin,xmax,.01):\n for y in np.arange(-0.1,-0.50,-0.01):\n if x<0.3 and y>-0.2:\n continue\n q = firenze.IK('right_arm',np.matrix([x,y,z]).T,rot_mat)\n if q != None and firenze.within_physical_limits_right(q,delta_list)==True:\n x_list.append(x)\n y_list.append(y)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99523:For_L57_C8", "label": "for y", "type": "for", "loc": [57, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99523:For_L56_C4", "vector": [6, 2, 0.5556, 0.0648, 2, 0.69, 0.0, 304, 3, 0, 0, 0, 0, 0, 6], "semantic": {"name": "y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for y in np.arange(-0.1,-0.50,-0.01):\n if x<0.3 and y>-0.2:\n continue\n q = firenze.IK('right_arm',np.matrix([x,y,z]).T,rot_mat)\n if q != None and firenze.within_physical_limits_right(q,delta_list)==True:\n x_list.append(x)\n y_list.append(y)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99523:If_L58_C12", "label": "if", "type": "if", "loc": [58, 59], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99523:For_L57_C8", "vector": [4, 3, 0.5417, 0.0185, 3, 0.51, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if x<0.3 and y>-0.2:\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99523:Assign_L60_C12", "label": "q = IK()", "type": "assigned_variable", "loc": [60, 60], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99523:For_L57_C8", "vector": [14, 3, 0.5556, 0.0093, 3, 0.51, 0.5, 516, 3, 3, 0, 0, 719, 10, 2], "semantic": {"name": "q", "arg_names": [], "import_names": [], "rhs_call_name": "IK", "annotation": ""}, "snippet": " q = firenze.IK('right_arm',np.matrix([x,y,z]).T,rot_mat)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99523:If_L61_C12", "label": "if", "type": "if", "loc": [61, 63], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99523:For_L57_C8", "vector": [4, 3, 0.5741, 0.0278, 3, 0.51, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if q != None and firenze.within_physical_limits_right(q,delta_list)==True:\n x_list.append(x)\n y_list.append(y)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99523:Expr_L62_C16", "label": "append()", "type": "expression", "loc": [62, 62], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99523:If_L61_C12", "vector": [8, 4, 0.5741, 0.0093, 4, 0.37, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " x_list.append(x)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99523:Expr_L63_C16", "label": "append()", "type": "expression", "loc": [63, 63], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99523:If_L61_C12", "vector": [8, 4, 0.5833, 0.0093, 4, 0.37, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " y_list.append(y)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99523:Return_L64_C4", "label": "return", "type": "return", "loc": [64, 64], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99523:FunctionDef_L44_C0", "vector": [13, 1, 0.5926, 0.0093, 1, 0.71, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return np.matrix([x_list,y_list])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99523:FunctionDef_L66_C0", "label": "create_workspace_dict", "type": "function", "loc": [66, 78], "level": 0, "parent": null, "vector": [2, 0, 0.6667, 0.1204, 0, 0.66, 0.8182, 764, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "create_workspace_dict", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def create_workspace_dict():\n dd = {}\n ha_list = [math.radians(d) for d in [0.,90.,-90.]]\n for ha in ha_list:\n d = {}\n for z in np.arange(-0.1,-0.55,-0.01):\n print('z:',z)\n pts2d = compute_workspace(z,hook_angle=ha)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99523:Assign_L67_C4", "label": "dd =", "type": "assigned_variable", "loc": [67, 67], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99523:FunctionDef_L66_C0", "vector": [14, 1, 0.6204, 0.0093, 1, 0.0, 0.0, 119, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "dd", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " dd = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99523:Assign_L68_C4", "label": "ha_list =", "type": "assigned_variable", "loc": [68, 68], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99523:FunctionDef_L66_C0", "vector": [14, 1, 0.6296, 0.0093, 1, 0.0, 0.3333, 194, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "ha_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ha_list = [math.radians(d) for d in [0.,90.,-90.]]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99523:For_L69_C4", "label": "for ha", "type": "for", "loc": [69, 76], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99523:FunctionDef_L66_C0", "vector": [6, 1, 0.6713, 0.0741, 1, 0.0, 0.6667, 499, 2, 0, 0, 0, 0, 0, 3], "semantic": {"name": "ha", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for ha in ha_list:\n d = {}\n for z in np.arange(-0.1,-0.55,-0.01):\n print('z:',z)\n pts2d = compute_workspace(z,hook_angle=ha)\n d[z] = pts2d\n dd[ha] = {}\n dd[ha]['pts'] = d"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99523:Assign_L70_C8", "label": "d =", "type": "assigned_variable", "loc": [70, 70], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99523:For_L69_C4", "vector": [14, 2, 0.6481, 0.0093, 2, 0.98, 0.0, 355, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " d = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99523:For_L71_C8", "label": "for z", "type": "for", "loc": [71, 74], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99523:For_L69_C4", "vector": [6, 2, 0.6713, 0.037, 2, 0.98, 0.3333, 859, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for z in np.arange(-0.1,-0.55,-0.01):\n print('z:',z)\n pts2d = compute_workspace(z,hook_angle=ha)\n d[z] = pts2d"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99523:Expr_L72_C12", "label": "print()", "type": "expression", "loc": [72, 72], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99523:For_L71_C8", "vector": [8, 3, 0.6667, 0.0093, 3, 0.75, 0.0, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('z:',z)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99523:Assign_L73_C12", "label": "pts2d = compute_workspace()", "type": "assigned_variable", "loc": [73, 73], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99523:For_L71_C8", "vector": [14, 3, 0.6759, 0.0093, 3, 0.75, 0.5, 871, 3, 2, 0, 0, 606, 10, 1], "semantic": {"name": "pts2d", "arg_names": [], "import_names": [], "rhs_call_name": "compute_workspace", "annotation": ""}, "snippet": " pts2d = compute_workspace(z,hook_angle=ha)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99523:Assign_L74_C12", "label": "assign", "type": "assigned_variable", "loc": [74, 74], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99523:For_L71_C8", "vector": [14, 3, 0.6852, 0.0093, 3, 0.75, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " d[z] = pts2d"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99523:Assign_L75_C8", "label": "assign", "type": "assigned_variable", "loc": [75, 75], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99523:For_L69_C4", "vector": [14, 2, 0.6944, 0.0093, 2, 0.98, 0.6667, 0, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " dd[ha] = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99523:Assign_L76_C8", "label": "assign", "type": "assigned_variable", "loc": [76, 76], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99523:For_L69_C4", "vector": [14, 2, 0.7037, 0.0093, 2, 0.98, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " dd[ha]['pts'] = d"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99523:Expr_L78_C4", "label": "save_pickle()", "type": "expression", "loc": [78, 78], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99523:FunctionDef_L66_C0", "vector": [8, 1, 0.7222, 0.0093, 1, 0.0, 1.0, 390, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "save_pickle", "arg_names": [], "import_names": [], "rhs_call_name": "save_pickle", "annotation": ""}, "snippet": " ut.save_pickle(dd,'workspace_dict_'+ut.formatted_time()+'.pkl')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99523:FunctionDef_L81_C0", "label": "create_workspace_boundary", "type": "function", "loc": [81, 95], "level": 0, "parent": null, "vector": [2, 0, 0.8148, 0.1389, 0, 0.66, 0.9091, 669, 0, 1, 0, 0, 0, 0, 7], "semantic": {"name": "create_workspace_boundary", "arg_names": ["pkl_name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def create_workspace_boundary(pkl_name):\n dd = ut.load_pickle(pkl_name)\n for ha in dd.keys():\n pts_dict = dd[ha]['pts']\n bndry_dict = {}\n for z in pts_dict.keys():\n print('z:',z)\n wrkspc = pts_dict[z]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99523:Assign_L82_C4", "label": "dd = load_pickle()", "type": "assigned_variable", "loc": [82, 82], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99523:FunctionDef_L81_C0", "vector": [14, 1, 0.7593, 0.0093, 1, 0.68, 0.0, 119, 3, 1, 0, 0, 65, 10, 1], "semantic": {"name": "dd", "arg_names": [], "import_names": [], "rhs_call_name": "load_pickle", "annotation": ""}, "snippet": " dd = ut.load_pickle(pkl_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99523:For_L83_C4", "label": "for ha", "type": "for", "loc": [83, 94], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99523:FunctionDef_L81_C0", "vector": [6, 1, 0.8194, 0.1111, 1, 0.68, 0.5, 499, 3, 0, 0, 0, 0, 0, 5], "semantic": {"name": "ha", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for ha in dd.keys():\n pts_dict = dd[ha]['pts']\n bndry_dict = {}\n for z in pts_dict.keys():\n print('z:',z)\n wrkspc = pts_dict[z]\n if wrkspc.shape[1] < 100:\n pts_dict.pop(z)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99523:Assign_L84_C8", "label": "pts_dict =", "type": "assigned_variable", "loc": [84, 84], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99523:For_L83_C4", "vector": [14, 2, 0.7778, 0.0093, 2, 0.76, 0.0, 518, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pts_dict", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pts_dict = dd[ha]['pts']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99523:Assign_L85_C8", "label": "bndry_dict =", "type": "assigned_variable", "loc": [85, 85], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99523:For_L83_C4", "vector": [14, 2, 0.787, 0.0093, 2, 0.76, 0.3333, 463, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "bndry_dict", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " bndry_dict = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99523:For_L86_C8", "label": "for z", "type": "for", "loc": [86, 93], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99523:For_L83_C4", "vector": [6, 2, 0.8287, 0.0741, 2, 0.76, 0.6667, 859, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for z in pts_dict.keys():\n print('z:',z)\n wrkspc = pts_dict[z]\n if wrkspc.shape[1] < 100:\n pts_dict.pop(z)\n continue\n bndry = smc.compute_boundary(wrkspc)\n bndry_dict[z] = bndry"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99523:Expr_L87_C12", "label": "print()", "type": "expression", "loc": [87, 87], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99523:For_L86_C8", "vector": [8, 3, 0.8056, 0.0093, 3, 0.39, 0.0, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('z:',z)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99523:Assign_L88_C12", "label": "wrkspc =", "type": "assigned_variable", "loc": [88, 88], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99523:For_L86_C8", "vector": [14, 3, 0.8148, 0.0093, 3, 0.39, 0.25, 746, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "wrkspc", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " wrkspc = pts_dict[z]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99523:If_L89_C12", "label": "if", "type": "if", "loc": [89, 91], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99523:For_L86_C8", "vector": [4, 3, 0.8333, 0.0278, 3, 0.39, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if wrkspc.shape[1] < 100:\n pts_dict.pop(z)\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99523:Expr_L90_C16", "label": "pop()", "type": "expression", "loc": [90, 90], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99523:If_L89_C12", "vector": [8, 4, 0.8333, 0.0093, 4, 0.12, 0.0, 969, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "pop", "arg_names": [], "import_names": [], "rhs_call_name": "pop", "annotation": ""}, "snippet": " pts_dict.pop(z)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99523:Assign_L92_C12", "label": "bndry = compute_boundary()", "type": "assigned_variable", "loc": [92, 92], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99523:For_L86_C8", "vector": [14, 3, 0.8519, 0.0093, 3, 0.39, 0.75, 913, 3, 1, 0, 0, 761, 10, 1], "semantic": {"name": "bndry", "arg_names": [], "import_names": [], "rhs_call_name": "compute_boundary", "annotation": ""}, "snippet": " bndry = smc.compute_boundary(wrkspc)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99523:Assign_L93_C12", "label": "assign", "type": "assigned_variable", "loc": [93, 93], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99523:For_L86_C8", "vector": [14, 3, 0.8611, 0.0093, 3, 0.39, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " bndry_dict[z] = bndry"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99523:Assign_L94_C8", "label": "assign", "type": "assigned_variable", "loc": [94, 94], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99523:For_L83_C4", "vector": [14, 2, 0.8704, 0.0093, 2, 0.76, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " dd[ha]['bndry'] = bndry_dict"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99523:Expr_L95_C4", "label": "save_pickle()", "type": "expression", "loc": [95, 95], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99523:FunctionDef_L81_C0", "vector": [8, 1, 0.8796, 0.0093, 1, 0.68, 1.0, 390, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "save_pickle", "arg_names": [], "import_names": [], "rhs_call_name": "save_pickle", "annotation": ""}, "snippet": " ut.save_pickle(dd, pkl_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99523:Expr_L99_C0", "label": "create_workspace_dict()", "type": "expression", "loc": [99, 99], "level": 0, "parent": null, "vector": [8, 0, 0.9167, 0.0093, 0, 0.66, 1.0, 764, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "create_workspace_dict", "arg_names": [], "import_names": [], "rhs_call_name": "create_workspace_dict", "annotation": ""}, "snippet": "create_workspace_dict()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99523:FunctionDef_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99523:Assign_L45_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99523:FunctionDef_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99523:Assign_L46_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99523:FunctionDef_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99523:Assign_L47_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99523:FunctionDef_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99523:Assign_L48_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99523:FunctionDef_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99523:If_L49_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99523:If_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99523:Assign_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99523:If_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99523:Assign_L51_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99523:If_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99523:Assign_L53_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99523:If_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99523:Assign_L54_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99523:FunctionDef_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99523:For_L56_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99523:For_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99523:For_L57_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99523:For_L57_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99523:If_L58_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99523:For_L57_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99523:Assign_L60_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99523:For_L57_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99523:If_L61_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99523:If_L61_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99523:Expr_L62_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99523:If_L61_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99523:Expr_L63_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99523:FunctionDef_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99523:Return_L64_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99523:FunctionDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99523:Assign_L67_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99523:FunctionDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99523:Assign_L68_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99523:FunctionDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99523:For_L69_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99523:For_L69_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99523:Assign_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99523:For_L69_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99523:For_L71_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99523:For_L71_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99523:Expr_L72_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99523:For_L71_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99523:Assign_L73_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99523:For_L71_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99523:Assign_L74_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99523:For_L69_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99523:Assign_L75_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99523:For_L69_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99523:Assign_L76_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99523:FunctionDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99523:Expr_L78_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99523:FunctionDef_L81_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99523:Assign_L82_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99523:FunctionDef_L81_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99523:For_L83_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99523:For_L83_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99523:Assign_L84_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99523:For_L83_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99523:Assign_L85_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99523:For_L83_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99523:For_L86_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99523:For_L86_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99523:Expr_L87_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99523:For_L86_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99523:Assign_L88_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99523:For_L86_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99523:If_L89_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99523:If_L89_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99523:Expr_L90_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99523:For_L86_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99523:Assign_L92_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99523:For_L86_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99523:Assign_L93_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99523:For_L83_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99523:Assign_L94_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99523:FunctionDef_L81_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99523:Expr_L95_C4"}]
# # # Copyright (c) 2010, Georgia Tech Research Corporation # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # * Neither the name of the Georgia Tech Research Corporation nor the # names of its contributors may be used to endorse or promote products # derived from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY GEORGIA TECH RESEARCH CORPORATION ''AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL GEORGIA TECH BE LIABLE FOR ANY DIRECT, INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # \author Advait Jain (Healthcare Robotics Lab, Georgia Tech.) import hrl_lib.util as ut import matplotlib_util.util as mpu import math, numpy as np import sys def plot_workspace(pts,ha,z): if pts.shape[1] == 0: return mpu.figure() good_location = pts.mean(1) mpu.plot_yx(pts[1,:].A1,pts[0,:].A1,label='ha:%.1f'%(math.degrees(ha)), axis='equal',linewidth=0) mpu.plot_yx(good_location[1,:].A1,good_location[0,:].A1, axis='equal',linewidth=0,scatter_size=90,color='k') mpu.savefig('z%.2f_ha%.1f.png'%(z,math.degrees(ha))) argv = sys.argv fname = sys.argv[1] dd = ut.load_pickle(fname) color_list = ['b','y','g'] i = 0 mpu.figure(dpi=100) for ha in dd.keys(): d = dd[ha] l = [] key_list = d['pts'].keys() for k in key_list: pts = d['pts'][k] l.append(pts.shape[1]) #plot_workspace(pts,ha,k) ll = zip(key_list,l) ll.sort() key_list,l = zip(*ll) if ha == 0: label = 'Hook Left' elif abs(ha-math.pi/2) < 0.01: label = 'Hook Down' continue else: label = 'Hook Up' mpu.plot_yx(key_list,l,axis=None,label=label, color=color_list[i], xlabel='\# of points with IK soln', ylabel='Height (m)', scatter_size=8) i += 1 max_idx = np.argmax(l) good_height = key_list[max_idx] print 'good_height:', good_height mpu.plot_yx([good_height],[l[max_idx]],axis=None, color='r', xlabel='\# of points with IK soln', ylabel='Height (m)', scatter_size=8) d['height'] = good_height #ut.save_pickle(dd,fname) #mpu.legend() #mpu.savefig('workspace_npts.png') #mpu.show()
ajibawa-2023/Python-Code-Large/train/row_99524
39
95
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99524:Import_L32_C0", "label": "hrl_lib.util import ut", "type": "import", "loc": [32, 32], "level": 0, "parent": null, "vector": [1, 0, 0.3368, 0.0105, 0, 0.66, 0.0, 775, 0, 1, 0, 0, 775, 0, 0], "semantic": {"name": "hrl_lib.util", "arg_names": [], "import_names": ["ut"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.util as ut"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99524:Import_L33_C0", "label": "matplotlib_util.util import mpu", "type": "import", "loc": [33, 33], "level": 0, "parent": null, "vector": [1, 0, 0.3474, 0.0105, 0, 0.66, 0.0909, 781, 0, 1, 0, 0, 781, 0, 0], "semantic": {"name": "matplotlib_util.util", "arg_names": [], "import_names": ["mpu"], "rhs_call_name": "", "annotation": ""}, "snippet": "import matplotlib_util.util as mpu"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99524:Import_L34_C0", "label": "math import math, np", "type": "import", "loc": [34, 34], "level": 0, "parent": null, "vector": [1, 0, 0.3579, 0.0105, 0, 0.66, 0.1818, 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_99524:Import_L35_C0", "label": "sys import sys", "type": "import", "loc": [35, 35], "level": 0, "parent": null, "vector": [1, 0, 0.3684, 0.0105, 0, 0.66, 0.2727, 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_99524:FunctionDef_L37_C0", "label": "plot_workspace", "type": "function", "loc": [37, 46], "level": 0, "parent": null, "vector": [2, 0, 0.4368, 0.1053, 0, 0.66, 0.3636, 927, 0, 3, 0, 0, 0, 0, 7], "semantic": {"name": "plot_workspace", "arg_names": ["pts", "ha", "z"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def plot_workspace(pts,ha,z):\n if pts.shape[1] == 0:\n return\n mpu.figure()\n good_location = pts.mean(1)\n mpu.plot_yx(pts[1,:].A1,pts[0,:].A1,label='ha:%.1f'%(math.degrees(ha)),\n axis='equal',linewidth=0)\n mpu.plot_yx(good_location[1,:].A1,good_location[0,:].A1,"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99524:If_L38_C4", "label": "if", "type": "if", "loc": [38, 39], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99524:FunctionDef_L37_C0", "vector": [4, 1, 0.4053, 0.0211, 1, 0.86, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if pts.shape[1] == 0:\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99524:Return_L39_C8", "label": "return", "type": "return", "loc": [39, 39], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99524:If_L38_C4", "vector": [13, 2, 0.4105, 0.0105, 2, 0.59, 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_99524:Expr_L40_C4", "label": "figure()", "type": "expression", "loc": [40, 40], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99524:FunctionDef_L37_C0", "vector": [8, 1, 0.4211, 0.0105, 1, 0.86, 0.2, 789, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "figure", "arg_names": [], "import_names": [], "rhs_call_name": "figure", "annotation": ""}, "snippet": " mpu.figure()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99524:Assign_L41_C4", "label": "good_location = mean()", "type": "assigned_variable", "loc": [41, 41], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99524:FunctionDef_L37_C0", "vector": [14, 1, 0.4316, 0.0105, 1, 0.86, 0.4, 945, 3, 1, 0, 0, 856, 10, 1], "semantic": {"name": "good_location", "arg_names": [], "import_names": [], "rhs_call_name": "mean", "annotation": ""}, "snippet": " good_location = pts.mean(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99524:Expr_L42_C4", "label": "plot_yx()", "type": "expression", "loc": [42, 43], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99524:FunctionDef_L37_C0", "vector": [8, 1, 0.4474, 0.0211, 1, 0.86, 0.6, 112, 3, 5, 0, 0, 0, 0, 2], "semantic": {"name": "plot_yx", "arg_names": [], "import_names": [], "rhs_call_name": "plot_yx", "annotation": ""}, "snippet": " mpu.plot_yx(pts[1,:].A1,pts[0,:].A1,label='ha:%.1f'%(math.degrees(ha)),\n axis='equal',linewidth=0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99524:Expr_L44_C4", "label": "plot_yx()", "type": "expression", "loc": [44, 45], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99524:FunctionDef_L37_C0", "vector": [8, 1, 0.4684, 0.0211, 1, 0.86, 0.8, 112, 3, 6, 0, 0, 0, 0, 1], "semantic": {"name": "plot_yx", "arg_names": [], "import_names": [], "rhs_call_name": "plot_yx", "annotation": ""}, "snippet": " mpu.plot_yx(good_location[1,:].A1,good_location[0,:].A1,\n axis='equal',linewidth=0,scatter_size=90,color='k')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99524:Expr_L46_C4", "label": "savefig()", "type": "expression", "loc": [46, 46], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99524:FunctionDef_L37_C0", "vector": [8, 1, 0.4842, 0.0105, 1, 0.86, 1.0, 677, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "savefig", "arg_names": [], "import_names": [], "rhs_call_name": "savefig", "annotation": ""}, "snippet": " mpu.savefig('z%.2f_ha%.1f.png'%(z,math.degrees(ha)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99524:Assign_L48_C0", "label": "argv =", "type": "assigned_variable", "loc": [48, 48], "level": 0, "parent": null, "vector": [14, 0, 0.5053, 0.0105, 0, 0.66, 0.4545, 612, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "argv", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "argv = sys.argv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99524:Assign_L49_C0", "label": "fname =", "type": "assigned_variable", "loc": [49, 49], "level": 0, "parent": null, "vector": [14, 0, 0.5158, 0.0105, 0, 0.66, 0.5455, 190, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "fname", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "fname = sys.argv[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99524:Assign_L50_C0", "label": "dd = load_pickle()", "type": "assigned_variable", "loc": [50, 50], "level": 0, "parent": null, "vector": [14, 0, 0.5263, 0.0105, 0, 0.66, 0.6364, 119, 3, 1, 0, 0, 65, 10, 1], "semantic": {"name": "dd", "arg_names": [], "import_names": [], "rhs_call_name": "load_pickle", "annotation": ""}, "snippet": "dd = ut.load_pickle(fname)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99524:Assign_L52_C0", "label": "color_list =", "type": "assigned_variable", "loc": [52, 52], "level": 0, "parent": null, "vector": [14, 0, 0.5474, 0.0105, 0, 0.66, 0.7273, 570, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "color_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "color_list = ['b','y','g']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99524:Assign_L53_C0", "label": "i =", "type": "assigned_variable", "loc": [53, 53], "level": 0, "parent": null, "vector": [14, 0, 0.5579, 0.0105, 0, 0.66, 0.8182, 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_99524:Expr_L54_C0", "label": "figure()", "type": "expression", "loc": [54, 54], "level": 0, "parent": null, "vector": [8, 0, 0.5684, 0.0105, 0, 0.66, 0.9091, 789, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "figure", "arg_names": [], "import_names": [], "rhs_call_name": "figure", "annotation": ""}, "snippet": "mpu.figure(dpi=100)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99524:For_L55_C0", "label": "for ha", "type": "for", "loc": [55, 87], "level": 0, "parent": null, "vector": [6, 0, 0.7474, 0.3474, 0, 0.66, 1.0, 499, 3, 0, 0, 0, 0, 0, 11], "semantic": {"name": "ha", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "for ha in dd.keys():\n d = dd[ha]\n l = []\n key_list = d['pts'].keys()\n for k in key_list:\n pts = d['pts'][k]\n l.append(pts.shape[1])\n #plot_workspace(pts,ha,k)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99524:Assign_L56_C4", "label": "d =", "type": "assigned_variable", "loc": [56, 56], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99524:For_L55_C0", "vector": [14, 1, 0.5895, 0.0105, 1, 0.93, 0.0, 355, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " d = dd[ha]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99524:Assign_L57_C4", "label": "l =", "type": "assigned_variable", "loc": [57, 57], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99524:For_L55_C0", "vector": [14, 1, 0.6, 0.0105, 1, 0.93, 0.0769, 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_99524:Assign_L58_C4", "label": "key_list = keys()", "type": "assigned_variable", "loc": [58, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99524:For_L55_C0", "vector": [14, 1, 0.6105, 0.0105, 1, 0.93, 0.1538, 422, 3, 0, 0, 0, 204, 10, 1], "semantic": {"name": "key_list", "arg_names": [], "import_names": [], "rhs_call_name": "keys", "annotation": ""}, "snippet": " key_list = d['pts'].keys()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99524:For_L59_C4", "label": "for k", "type": "for", "loc": [59, 61], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99524:For_L55_C0", "vector": [6, 1, 0.6316, 0.0316, 1, 0.93, 0.2308, 954, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "k", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for k in key_list:\n pts = d['pts'][k]\n l.append(pts.shape[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99524:Assign_L60_C8", "label": "pts =", "type": "assigned_variable", "loc": [60, 60], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99524:For_L59_C4", "vector": [14, 2, 0.6316, 0.0105, 2, 0.2, 0.0, 195, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pts = d['pts'][k]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99524:Expr_L61_C8", "label": "append()", "type": "expression", "loc": [61, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99524:For_L59_C4", "vector": [8, 2, 0.6421, 0.0105, 2, 0.2, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " l.append(pts.shape[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99524:Assign_L64_C4", "label": "ll = zip()", "type": "assigned_variable", "loc": [64, 64], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99524:For_L55_C0", "vector": [14, 1, 0.6737, 0.0105, 1, 0.93, 0.3077, 929, 3, 2, 0, 0, 814, 10, 1], "semantic": {"name": "ll", "arg_names": [], "import_names": [], "rhs_call_name": "zip", "annotation": ""}, "snippet": " ll = zip(key_list,l)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99524:Expr_L65_C4", "label": "sort()", "type": "expression", "loc": [65, 65], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99524:For_L55_C0", "vector": [8, 1, 0.6842, 0.0105, 1, 0.93, 0.3846, 489, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "sort", "arg_names": [], "import_names": [], "rhs_call_name": "sort", "annotation": ""}, "snippet": " ll.sort()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99524:Assign_L67_C4", "label": "key_list, l = zip()", "type": "assigned_variable", "loc": [67, 67], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99524:For_L55_C0", "vector": [14, 1, 0.7053, 0.0105, 1, 0.93, 0.4615, 778, 3, 1, 0, 0, 814, 10, 1], "semantic": {"name": "key_list, l", "arg_names": [], "import_names": [], "rhs_call_name": "zip", "annotation": ""}, "snippet": " key_list,l = zip(*ll)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99524:If_L68_C4", "label": "if", "type": "if", "loc": [68, 74], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99524:For_L55_C0", "vector": [4, 1, 0.7474, 0.0737, 1, 0.93, 0.5385, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if ha == 0:\n label = 'Hook Left'\n elif abs(ha-math.pi/2) < 0.01:\n label = 'Hook Down'\n continue\n else:\n label = 'Hook Up'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99524:Assign_L69_C8", "label": "label =", "type": "assigned_variable", "loc": [69, 69], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99524:If_L68_C4", "vector": [14, 2, 0.7263, 0.0105, 2, 0.36, 0.0, 811, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "label", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " label = 'Hook Left'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99524:If_L70_C4", "label": "if", "type": "if", "loc": [70, 74], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99524:If_L68_C4", "vector": [4, 2, 0.7579, 0.0526, 2, 0.36, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif abs(ha-math.pi/2) < 0.01:\n label = 'Hook Down'\n continue\n else:\n label = 'Hook Up'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99524:Assign_L71_C8", "label": "label =", "type": "assigned_variable", "loc": [71, 71], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99524:If_L70_C4", "vector": [14, 3, 0.7474, 0.0105, 3, 0.5, 0.0, 811, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "label", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " label = 'Hook Down'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99524:Assign_L74_C8", "label": "label =", "type": "assigned_variable", "loc": [74, 74], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99524:If_L70_C4", "vector": [14, 3, 0.7789, 0.0105, 3, 0.5, 1.0, 811, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "label", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " label = 'Hook Up'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99524:Expr_L76_C4", "label": "plot_yx()", "type": "expression", "loc": [76, 78], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99524:For_L55_C0", "vector": [8, 1, 0.8105, 0.0316, 1, 0.93, 0.6154, 112, 3, 8, 0, 0, 0, 0, 1], "semantic": {"name": "plot_yx", "arg_names": [], "import_names": [], "rhs_call_name": "plot_yx", "annotation": ""}, "snippet": " mpu.plot_yx(key_list,l,axis=None,label=label, color=color_list[i],\n xlabel='\\# of points with IK soln',\n ylabel='Height (m)', scatter_size=8)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99524:Assign_L80_C4", "label": "max_idx = argmax()", "type": "assigned_variable", "loc": [80, 80], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99524:For_L55_C0", "vector": [14, 1, 0.8421, 0.0105, 1, 0.93, 0.6923, 910, 3, 1, 0, 0, 593, 10, 1], "semantic": {"name": "max_idx", "arg_names": [], "import_names": [], "rhs_call_name": "argmax", "annotation": ""}, "snippet": " max_idx = np.argmax(l)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99524:Assign_L81_C4", "label": "good_height =", "type": "assigned_variable", "loc": [81, 81], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99524:For_L55_C0", "vector": [14, 1, 0.8526, 0.0105, 1, 0.93, 0.7692, 63, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "good_height", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " good_height = key_list[max_idx]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99524:Expr_L82_C4", "label": "print()", "type": "expression", "loc": [82, 82], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99524:For_L55_C0", "vector": [8, 1, 0.8632, 0.0105, 1, 0.93, 0.8462, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('good_height:', good_height)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99524:Expr_L84_C4", "label": "plot_yx()", "type": "expression", "loc": [84, 86], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99524:For_L55_C0", "vector": [8, 1, 0.8947, 0.0316, 1, 0.93, 0.9231, 112, 3, 7, 0, 0, 0, 0, 1], "semantic": {"name": "plot_yx", "arg_names": [], "import_names": [], "rhs_call_name": "plot_yx", "annotation": ""}, "snippet": " mpu.plot_yx([good_height],[l[max_idx]],axis=None,\n color='r', xlabel='\\# of points with IK soln',\n ylabel='Height (m)', scatter_size=8)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99524:Assign_L87_C4", "label": "assign", "type": "assigned_variable", "loc": [87, 87], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99524:For_L55_C0", "vector": [14, 1, 0.9158, 0.0105, 1, 0.93, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " d['height'] = good_height"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99524:FunctionDef_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99524:If_L38_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99524:If_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99524:Return_L39_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99524:FunctionDef_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99524:Expr_L40_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99524:FunctionDef_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99524:Assign_L41_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99524:FunctionDef_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99524:Expr_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99524:FunctionDef_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99524:Expr_L44_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99524:FunctionDef_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99524:Expr_L46_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99524:For_L55_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99524:Assign_L56_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99524:For_L55_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99524:Assign_L57_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99524:For_L55_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99524:Assign_L58_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99524:For_L55_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99524:For_L59_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99524:For_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99524:Assign_L60_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99524:For_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99524:Expr_L61_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99524:For_L55_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99524:Assign_L64_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99524:For_L55_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99524:Expr_L65_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99524:For_L55_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99524:Assign_L67_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99524:For_L55_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99524:If_L68_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99524:If_L68_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99524:Assign_L69_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99524:If_L68_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99524:If_L70_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99524:If_L70_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99524:Assign_L71_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99524:If_L70_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99524:Assign_L74_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99524:For_L55_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99524:Expr_L76_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99524:For_L55_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99524:Assign_L80_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99524:For_L55_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99524:Assign_L81_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99524:For_L55_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99524:Expr_L82_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99524:For_L55_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99524:Expr_L84_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99524:For_L55_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99524:Assign_L87_C4"}]
# # # Copyright (c) 2010, Georgia Tech Research Corporation # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # * Neither the name of the Georgia Tech Research Corporation nor the # names of its contributors may be used to endorse or promote products # derived from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY GEORGIA TECH RESEARCH CORPORATION ''AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL GEORGIA TECH BE LIABLE FOR ANY DIRECT, INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # \author Advait Jain (Healthcare Robotics Lab, Georgia Tech.) import numpy as np import hrl_lib.util as ut #---- X axis ----- #p = ut.load_pickle('eq_pos_2010May01_213254.pkl') #d = ut.load_pickle('stiffness_2010May01_213323.pkl') #n = 0 #--- Y axis ---- #p = ut.load_pickle('eq_pos_2010May01_213832.pkl') #d = ut.load_pickle('stiffness_2010May01_213907.pkl') #n = 1 #--- Z axis p = ut.load_pickle('eq_pos_2010May01_214434.pkl') d = ut.load_pickle('stiffness_2010May01_214512.pkl') n = 2 pos_list = d['pos_list'] force_list = d['force_list'] stiff_list = [] for pos,force in zip(pos_list,force_list): dx = pos[n,0]-p[n,0] f = force[n,0] print 'force:',f print 'dx:',dx stiff_list.append(f/dx) print stiff_list
ajibawa-2023/Python-Code-Large/train/row_99525
15
64
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99525:Import_L31_C0", "label": "numpy import np", "type": "import", "loc": [31, 31], "level": 0, "parent": null, "vector": [1, 0, 0.4844, 0.0156, 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_99525:Import_L32_C0", "label": "hrl_lib.util import ut", "type": "import", "loc": [32, 32], "level": 0, "parent": null, "vector": [1, 0, 0.5, 0.0156, 0, 0.66, 0.1111, 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_99525:Assign_L46_C0", "label": "p = load_pickle()", "type": "assigned_variable", "loc": [46, 46], "level": 0, "parent": null, "vector": [14, 0, 0.7188, 0.0156, 0, 0.66, 0.2222, 491, 3, 1, 0, 0, 65, 10, 1], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "load_pickle", "annotation": ""}, "snippet": "p = ut.load_pickle('eq_pos_2010May01_214434.pkl')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99525:Assign_L47_C0", "label": "d = load_pickle()", "type": "assigned_variable", "loc": [47, 47], "level": 0, "parent": null, "vector": [14, 0, 0.7344, 0.0156, 0, 0.66, 0.3333, 355, 3, 1, 0, 0, 65, 10, 1], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "load_pickle", "annotation": ""}, "snippet": "d = ut.load_pickle('stiffness_2010May01_214512.pkl')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99525:Assign_L48_C0", "label": "n =", "type": "assigned_variable", "loc": [48, 48], "level": 0, "parent": null, "vector": [14, 0, 0.75, 0.0156, 0, 0.66, 0.4444, 773, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "n", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "n = 2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99525:Assign_L50_C0", "label": "pos_list =", "type": "assigned_variable", "loc": [50, 50], "level": 0, "parent": null, "vector": [14, 0, 0.7812, 0.0156, 0, 0.66, 0.5556, 279, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pos_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "pos_list = d['pos_list']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99525:Assign_L51_C0", "label": "force_list =", "type": "assigned_variable", "loc": [51, 51], "level": 0, "parent": null, "vector": [14, 0, 0.7969, 0.0156, 0, 0.66, 0.6667, 906, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "force_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "force_list = d['force_list']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99525:Assign_L54_C0", "label": "stiff_list =", "type": "assigned_variable", "loc": [54, 54], "level": 0, "parent": null, "vector": [14, 0, 0.8438, 0.0156, 0, 0.66, 0.7778, 457, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "stiff_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "stiff_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99525:For_L55_C0", "label": "for pos, force", "type": "for", "loc": [55, 60], "level": 0, "parent": null, "vector": [6, 0, 0.8984, 0.0938, 0, 0.66, 0.8889, 663, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "pos, force", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "for pos,force in zip(pos_list,force_list):\n dx = pos[n,0]-p[n,0]\n f = force[n,0]\n print('force:',f)\n print('dx:',dx)\n stiff_list.append(f/dx)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99525:Assign_L56_C4", "label": "dx =", "type": "assigned_variable", "loc": [56, 56], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99525:For_L55_C0", "vector": [14, 1, 0.875, 0.0156, 1, 0.29, 0.0, 870, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "dx", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " dx = pos[n,0]-p[n,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99525:Assign_L57_C4", "label": "f =", "type": "assigned_variable", "loc": [57, 57], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99525:For_L55_C0", "vector": [14, 1, 0.8906, 0.0156, 1, 0.29, 0.25, 899, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " f = force[n,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99525:Expr_L58_C4", "label": "print()", "type": "expression", "loc": [58, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99525:For_L55_C0", "vector": [8, 1, 0.9062, 0.0156, 1, 0.29, 0.5, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('force:',f)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99525:Expr_L59_C4", "label": "print()", "type": "expression", "loc": [59, 59], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99525:For_L55_C0", "vector": [8, 1, 0.9219, 0.0156, 1, 0.29, 0.75, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('dx:',dx)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99525:Expr_L60_C4", "label": "append()", "type": "expression", "loc": [60, 60], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99525:For_L55_C0", "vector": [8, 1, 0.9375, 0.0156, 1, 0.29, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " stiff_list.append(f/dx)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99525:Expr_L62_C0", "label": "print()", "type": "expression", "loc": [62, 62], "level": 0, "parent": null, "vector": [8, 0, 0.9688, 0.0156, 0, 0.66, 1.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "print(stiff_list)"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99525:For_L55_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99525:Assign_L56_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99525:For_L55_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99525:Assign_L57_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99525:For_L55_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99525:Expr_L58_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99525:For_L55_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99525:Expr_L59_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99525:For_L55_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99525:Expr_L60_C4"}]
# # # Copyright (c) 2010, Georgia Tech Research Corporation # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # * Neither the name of the Georgia Tech Research Corporation nor the # names of its contributors may be used to endorse or promote products # derived from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY GEORGIA TECH RESEARCH CORPORATION ''AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL GEORGIA TECH BE LIABLE FOR ANY DIRECT, INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # \author Advait Jain (Healthcare Robotics Lab, Georgia Tech.) import m3.toolbox as m3t import mekabot.hrl_robot as hr import time import math, numpy as np import hrl_lib.util as ut, hrl_lib.transforms as tr def record_initial(firenze): equilibrium_pos_list = [] for i in range(50): equilibrium_pos_list.append(firenze.end_effector_pos('right_arm')) eq_pos = np.column_stack(equilibrium_pos_list).mean(1) ut.save_pickle(eq_pos,'eq_pos_'+ut.formatted_time()+'.pkl') firenze.bias_wrist_ft('right_arm') def record_joint_displacements(): print 'hit ENTER to start the recording process' k=m3t.get_keystroke() pos_list = [] force_list = [] while k == '\r': print 'hit ENTER to record configuration, something else to exit' k=m3t.get_keystroke() firenze.proxy.step() pos_list.append(firenze.end_effector_pos('right_arm')) force_list.append(firenze.get_wrist_force('right_arm', base_frame=True)) ut.save_pickle({'pos_list':pos_list,'force_list':force_list},'stiffness_'+ut.formatted_time()+'.pkl') firenze.stop() if __name__ == '__main__': settings_r = hr.MekaArmSettings(stiffness_list=[0.1939,0.6713,0.997,0.7272,0.75]) firenze = hr.M3HrlRobot(connect = True, right_arm_settings = settings_r) print 'hit a key to power up the arms.' k = m3t.get_keystroke() firenze.power_on() print 'hit a key to test IK' k = m3t.get_keystroke() rot = tr.Ry(math.radians(-90)) p = np.matrix([0.3,-0.40,-0.2]).T firenze.motors_on() #firenze.go_cartesian('right_arm', p, rot) # jep from springloaded door, trial 15 jep = [-0.30365041761032346, 0.3490658503988659, 0.59866827092412689, 1.7924513637028943, 0.4580617747379146, -0.13602429148726047, -0.48610218950666179] firenze.go_jointangles('right_arm', jep) print 'hit a key to record equilibrium position' k = m3t.get_keystroke() record_initial(firenze) record_joint_displacements() print 'hit a key to end everything' k = m3t.get_keystroke() firenze.stop()
ajibawa-2023/Python-Code-Large/train/row_99526
45
100
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99526:Import_L31_C0", "label": "m3.toolbox import m3t", "type": "import", "loc": [31, 31], "level": 0, "parent": null, "vector": [1, 0, 0.31, 0.01, 0, 0.66, 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_99526:Import_L32_C0", "label": "mekabot.hrl_robot import hr", "type": "import", "loc": [32, 32], "level": 0, "parent": null, "vector": [1, 0, 0.32, 0.01, 0, 0.66, 0.1429, 4, 0, 1, 0, 0, 4, 0, 0], "semantic": {"name": "mekabot.hrl_robot", "arg_names": [], "import_names": ["hr"], "rhs_call_name": "", "annotation": ""}, "snippet": "import mekabot.hrl_robot as hr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99526:Import_L33_C0", "label": "time import time", "type": "import", "loc": [33, 33], "level": 0, "parent": null, "vector": [1, 0, 0.33, 0.01, 0, 0.66, 0.2857, 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_99526:Import_L34_C0", "label": "math import math, np", "type": "import", "loc": [34, 34], "level": 0, "parent": null, "vector": [1, 0, 0.34, 0.01, 0, 0.66, 0.4286, 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_99526:Import_L35_C0", "label": "hrl_lib.util import ut, tr", "type": "import", "loc": [35, 35], "level": 0, "parent": null, "vector": [1, 0, 0.35, 0.01, 0, 0.66, 0.5714, 775, 0, 2, 0, 0, 775, 0, 0], "semantic": {"name": "hrl_lib.util", "arg_names": [], "import_names": ["ut", "tr"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.util as ut, hrl_lib.transforms as tr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99526:FunctionDef_L37_C0", "label": "record_initial", "type": "function", "loc": [37, 44], "level": 0, "parent": null, "vector": [2, 0, 0.405, 0.08, 0, 0.66, 0.7143, 922, 0, 1, 0, 0, 0, 0, 8], "semantic": {"name": "record_initial", "arg_names": ["firenze"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def record_initial(firenze):\n equilibrium_pos_list = []\n for i in range(50):\n equilibrium_pos_list.append(firenze.end_effector_pos('right_arm'))\n\n eq_pos = np.column_stack(equilibrium_pos_list).mean(1)\n ut.save_pickle(eq_pos,'eq_pos_'+ut.formatted_time()+'.pkl')\n firenze.bias_wrist_ft('right_arm')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99526:Assign_L38_C4", "label": "equilibrium_pos_list =", "type": "assigned_variable", "loc": [38, 38], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99526:FunctionDef_L37_C0", "vector": [14, 1, 0.38, 0.01, 1, 0.51, 0.0, 987, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "equilibrium_pos_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " equilibrium_pos_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99526:For_L39_C4", "label": "for i", "type": "for", "loc": [39, 40], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99526:FunctionDef_L37_C0", "vector": [6, 1, 0.395, 0.02, 1, 0.51, 0.25, 826, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(50):\n equilibrium_pos_list.append(firenze.end_effector_pos('right_arm'))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99526:Expr_L40_C8", "label": "append()", "type": "expression", "loc": [40, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99526:For_L39_C4", "vector": [8, 2, 0.4, 0.01, 2, 0.19, 0.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " equilibrium_pos_list.append(firenze.end_effector_pos('right_arm'))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99526:Assign_L42_C4", "label": "eq_pos = mean()", "type": "assigned_variable", "loc": [42, 42], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99526:FunctionDef_L37_C0", "vector": [14, 1, 0.42, 0.01, 1, 0.51, 0.5, 665, 3, 1, 0, 0, 856, 10, 2], "semantic": {"name": "eq_pos", "arg_names": [], "import_names": [], "rhs_call_name": "mean", "annotation": ""}, "snippet": " eq_pos = np.column_stack(equilibrium_pos_list).mean(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99526:Expr_L43_C4", "label": "save_pickle()", "type": "expression", "loc": [43, 43], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99526:FunctionDef_L37_C0", "vector": [8, 1, 0.43, 0.01, 1, 0.51, 0.75, 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(eq_pos,'eq_pos_'+ut.formatted_time()+'.pkl')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99526:Expr_L44_C4", "label": "bias_wrist_ft()", "type": "expression", "loc": [44, 44], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99526:FunctionDef_L37_C0", "vector": [8, 1, 0.44, 0.01, 1, 0.51, 1.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": " firenze.bias_wrist_ft('right_arm')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99526:FunctionDef_L48_C0", "label": "record_joint_displacements", "type": "function", "loc": [48, 63], "level": 0, "parent": null, "vector": [2, 0, 0.555, 0.16, 0, 0.66, 0.8571, 586, 0, 0, 0, 0, 0, 0, 12], "semantic": {"name": "record_joint_displacements", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def record_joint_displacements():\n print('hit ENTER to start the recording process')\n k=m3t.get_keystroke()\n\n pos_list = []\n force_list = []\n\n while k == '\\r':"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99526:Expr_L49_C4", "label": "print()", "type": "expression", "loc": [49, 49], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99526:FunctionDef_L48_C0", "vector": [8, 1, 0.49, 0.01, 1, 0.4, 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 start the recording process')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99526:Assign_L50_C4", "label": "k = get_keystroke()", "type": "assigned_variable", "loc": [50, 50], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99526:FunctionDef_L48_C0", "vector": [14, 1, 0.5, 0.01, 1, 0.4, 0.1667, 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_99526:Assign_L52_C4", "label": "pos_list =", "type": "assigned_variable", "loc": [52, 52], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99526:FunctionDef_L48_C0", "vector": [14, 1, 0.52, 0.01, 1, 0.4, 0.3333, 279, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "pos_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pos_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99526:Assign_L53_C4", "label": "force_list =", "type": "assigned_variable", "loc": [53, 53], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99526:FunctionDef_L48_C0", "vector": [14, 1, 0.53, 0.01, 1, 0.4, 0.5, 906, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "force_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " force_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99526:While_L55_C4", "label": "while", "type": "while", "loc": [55, 60], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99526:FunctionDef_L48_C0", "vector": [5, 1, 0.575, 0.06, 1, 0.4, 0.6667, 0, 0, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while k == '\\r':\n print('hit ENTER to record configuration, something else to exit')\n k=m3t.get_keystroke()\n firenze.proxy.step()\n pos_list.append(firenze.end_effector_pos('right_arm'))\n force_list.append(firenze.get_wrist_force('right_arm', base_frame=True))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99526:Expr_L56_C8", "label": "print()", "type": "expression", "loc": [56, 56], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99526:While_L55_C4", "vector": [8, 2, 0.56, 0.01, 2, 0.77, 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_99526:Assign_L57_C8", "label": "k = get_keystroke()", "type": "assigned_variable", "loc": [57, 57], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99526:While_L55_C4", "vector": [14, 2, 0.57, 0.01, 2, 0.77, 0.25, 954, 3, 0, 0, 0, 773, 10, 1], "semantic": {"name": "k", "arg_names": [], "import_names": [], "rhs_call_name": "get_keystroke", "annotation": ""}, "snippet": " k=m3t.get_keystroke()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99526:Expr_L58_C8", "label": "step()", "type": "expression", "loc": [58, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99526:While_L55_C4", "vector": [8, 2, 0.58, 0.01, 2, 0.77, 0.5, 880, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "step", "arg_names": [], "import_names": [], "rhs_call_name": "step", "annotation": ""}, "snippet": " firenze.proxy.step()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99526:Expr_L59_C8", "label": "append()", "type": "expression", "loc": [59, 59], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99526:While_L55_C4", "vector": [8, 2, 0.59, 0.01, 2, 0.77, 0.75, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " pos_list.append(firenze.end_effector_pos('right_arm'))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99526:Expr_L60_C8", "label": "append()", "type": "expression", "loc": [60, 60], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99526:While_L55_C4", "vector": [8, 2, 0.6, 0.01, 2, 0.77, 1.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " force_list.append(firenze.get_wrist_force('right_arm', base_frame=True))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99526:Expr_L62_C4", "label": "save_pickle()", "type": "expression", "loc": [62, 62], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99526:FunctionDef_L48_C0", "vector": [8, 1, 0.62, 0.01, 1, 0.4, 0.8333, 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({'pos_list':pos_list,'force_list':force_list},'stiffness_'+ut.formatted_time()+'.pkl')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99526:Expr_L63_C4", "label": "stop()", "type": "expression", "loc": [63, 63], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99526:FunctionDef_L48_C0", "vector": [8, 1, 0.63, 0.01, 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": " firenze.stop()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99526:If_L67_C0", "label": "if", "type": "if", "loc": [67, 98], "level": 0, "parent": null, "vector": [4, 0, 0.825, 0.32, 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\n settings_r = hr.MekaArmSettings(stiffness_list=[0.1939,0.6713,0.997,0.7272,0.75])\n firenze = hr.M3HrlRobot(connect = True, right_arm_settings = settings_r)\n\n print('hit a key to power up the arms.')\n k = m3t.get_keystroke()\n firenze.power_on()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99526:Assign_L69_C4", "label": "settings_r = MekaArmSettings()", "type": "assigned_variable", "loc": [69, 69], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99526:If_L67_C0", "vector": [14, 1, 0.69, 0.01, 1, 0.15, 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 = hr.MekaArmSettings(stiffness_list=[0.1939,0.6713,0.997,0.7272,0.75])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99526:Assign_L70_C4", "label": "firenze = M3HrlRobot()", "type": "assigned_variable", "loc": [70, 70], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99526:If_L67_C0", "vector": [14, 1, 0.7, 0.01, 1, 0.15, 0.0556, 736, 3, 2, 0, 0, 305, 10, 1], "semantic": {"name": "firenze", "arg_names": [], "import_names": [], "rhs_call_name": "M3HrlRobot", "annotation": ""}, "snippet": " firenze = hr.M3HrlRobot(connect = True, right_arm_settings = settings_r)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99526:Expr_L72_C4", "label": "print()", "type": "expression", "loc": [72, 72], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99526:If_L67_C0", "vector": [8, 1, 0.72, 0.01, 1, 0.15, 0.1111, 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 power up the arms.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99526:Assign_L73_C4", "label": "k = get_keystroke()", "type": "assigned_variable", "loc": [73, 73], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99526:If_L67_C0", "vector": [14, 1, 0.73, 0.01, 1, 0.15, 0.1667, 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_99526:Expr_L74_C4", "label": "power_on()", "type": "expression", "loc": [74, 74], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99526:If_L67_C0", "vector": [8, 1, 0.74, 0.01, 1, 0.15, 0.2222, 777, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "power_on", "arg_names": [], "import_names": [], "rhs_call_name": "power_on", "annotation": ""}, "snippet": " firenze.power_on()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99526:Expr_L76_C4", "label": "print()", "type": "expression", "loc": [76, 76], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99526:If_L67_C0", "vector": [8, 1, 0.76, 0.01, 1, 0.15, 0.2778, 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 test IK')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99526:Assign_L77_C4", "label": "k = get_keystroke()", "type": "assigned_variable", "loc": [77, 77], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99526:If_L67_C0", "vector": [14, 1, 0.77, 0.01, 1, 0.15, 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_99526:Assign_L79_C4", "label": "rot = Ry()", "type": "assigned_variable", "loc": [79, 79], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99526:If_L67_C0", "vector": [14, 1, 0.79, 0.01, 1, 0.15, 0.3889, 812, 3, 1, 0, 0, 417, 10, 2], "semantic": {"name": "rot", "arg_names": [], "import_names": [], "rhs_call_name": "Ry", "annotation": ""}, "snippet": " rot = tr.Ry(math.radians(-90))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99526:Assign_L80_C4", "label": "p =", "type": "assigned_variable", "loc": [80, 80], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99526:If_L67_C0", "vector": [14, 1, 0.8, 0.01, 1, 0.15, 0.4444, 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.40,-0.2]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99526:Expr_L82_C4", "label": "motors_on()", "type": "expression", "loc": [82, 82], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99526:If_L67_C0", "vector": [8, 1, 0.82, 0.01, 1, 0.15, 0.5, 466, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "motors_on", "arg_names": [], "import_names": [], "rhs_call_name": "motors_on", "annotation": ""}, "snippet": " firenze.motors_on()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99526:Assign_L86_C4", "label": "jep =", "type": "assigned_variable", "loc": [86, 86], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99526:If_L67_C0", "vector": [14, 1, 0.86, 0.01, 1, 0.15, 0.5556, 838, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "jep", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " jep = [-0.30365041761032346, 0.3490658503988659, 0.59866827092412689, 1.7924513637028943, 0.4580617747379146, -0.13602429148726047, -0.48610218950666179] "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99526:Expr_L87_C4", "label": "go_jointangles()", "type": "expression", "loc": [87, 87], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99526:If_L67_C0", "vector": [8, 1, 0.87, 0.01, 1, 0.15, 0.6111, 285, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "go_jointangles", "arg_names": [], "import_names": [], "rhs_call_name": "go_jointangles", "annotation": ""}, "snippet": " firenze.go_jointangles('right_arm', jep)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99526:Expr_L90_C4", "label": "print()", "type": "expression", "loc": [90, 90], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99526:If_L67_C0", "vector": [8, 1, 0.9, 0.01, 1, 0.15, 0.6667, 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 record equilibrium position')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99526:Assign_L91_C4", "label": "k = get_keystroke()", "type": "assigned_variable", "loc": [91, 91], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99526:If_L67_C0", "vector": [14, 1, 0.91, 0.01, 1, 0.15, 0.7222, 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_99526:Expr_L92_C4", "label": "record_initial()", "type": "expression", "loc": [92, 92], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99526:If_L67_C0", "vector": [8, 1, 0.92, 0.01, 1, 0.15, 0.7778, 922, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "record_initial", "arg_names": [], "import_names": [], "rhs_call_name": "record_initial", "annotation": ""}, "snippet": " record_initial(firenze)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99526:Expr_L94_C4", "label": "record_joint_displacements()", "type": "expression", "loc": [94, 94], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99526:If_L67_C0", "vector": [8, 1, 0.94, 0.01, 1, 0.15, 0.8333, 586, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "record_joint_displacements", "arg_names": [], "import_names": [], "rhs_call_name": "record_joint_displacements", "annotation": ""}, "snippet": " record_joint_displacements()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99526:Expr_L96_C4", "label": "print()", "type": "expression", "loc": [96, 96], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99526:If_L67_C0", "vector": [8, 1, 0.96, 0.01, 1, 0.15, 0.8889, 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 end everything')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99526:Assign_L97_C4", "label": "k = get_keystroke()", "type": "assigned_variable", "loc": [97, 97], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99526:If_L67_C0", "vector": [14, 1, 0.97, 0.01, 1, 0.15, 0.9444, 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_99526:Expr_L98_C4", "label": "stop()", "type": "expression", "loc": [98, 98], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99526:If_L67_C0", "vector": [8, 1, 0.98, 0.01, 1, 0.15, 1.0, 343, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "stop", "annotation": ""}, "snippet": " firenze.stop()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99526:FunctionDef_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99526:Assign_L38_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99526:FunctionDef_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99526:For_L39_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99526:For_L39_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99526:Expr_L40_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99526:FunctionDef_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99526:Assign_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99526:FunctionDef_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99526:Expr_L43_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99526:FunctionDef_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99526:Expr_L44_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99526:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99526:Expr_L49_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99526:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99526:Assign_L50_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99526:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99526:Assign_L52_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99526:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99526:Assign_L53_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99526:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99526:While_L55_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99526:While_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99526:Expr_L56_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99526:While_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99526:Assign_L57_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99526:While_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99526:Expr_L58_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99526:While_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99526:Expr_L59_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99526:While_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99526:Expr_L60_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99526:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99526:Expr_L62_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99526:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99526:Expr_L63_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99526:If_L67_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99526:Assign_L69_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99526:If_L67_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99526:Assign_L70_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99526:If_L67_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99526:Expr_L72_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99526:If_L67_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99526:Assign_L73_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99526:If_L67_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99526:Expr_L74_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99526:If_L67_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99526:Expr_L76_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99526:If_L67_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99526:Assign_L77_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99526:If_L67_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99526:Assign_L79_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99526:If_L67_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99526:Assign_L80_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99526:If_L67_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99526:Expr_L82_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99526:If_L67_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99526:Assign_L86_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99526:If_L67_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99526:Expr_L87_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99526:If_L67_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99526:Expr_L90_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99526:If_L67_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99526:Assign_L91_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99526:If_L67_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99526:Expr_L92_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99526:If_L67_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99526:Expr_L94_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99526:If_L67_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99526:Expr_L96_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99526:If_L67_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99526:Assign_L97_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99526:If_L67_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99526:Expr_L98_C4"}]
# # # Copyright (c) 2010, Georgia Tech Research Corporation # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # * Neither the name of the Georgia Tech Research Corporation nor the # names of its contributors may be used to endorse or promote products # derived from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY GEORGIA TECH RESEARCH CORPORATION ''AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL GEORGIA TECH BE LIABLE FOR ANY DIRECT, INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # \author Advait Jain (Healthcare Robotics Lab, Georgia Tech.) import scipy.optimize as so import math, numpy as np import pylab as pl import sys, optparse, time import copy from enthought.mayavi import mlab import mekabot.hrl_robot as hr import mekabot.coord_frames as mcf import matplotlib_util.util as mpu #import util as ut import roslib; roslib.load_manifest('2010_icra_epc_pull') import hrl_lib.util as ut, hrl_lib.transforms as tr import hrl_tilting_hokuyo.display_3d_mayavi as d3m import segway_motion_calc as smc class JointTrajectory(): ''' class to store joint trajectories. data only - use for pickling. ''' def __init__(self): self.time_list = [] # time in seconds self.q_list = [] #each element is a list of 7 joint angles. self.qdot_list = [] #each element is a list of 7 joint angles. self.qdotdot_list = [] #each element is a list of 7 joint angles. ## class to store trajectory of a coord frame executing planar motion (x,y,a) #data only - use for pickling class PlanarTajectory(): def __init__(self): self.time_list = [] # time in seconds self.x_list = [] self.y_list = [] self.a_list = [] class CartesianTajectory(): ''' class to store trajectory of cartesian points. data only - use for pickling ''' def __init__(self): self.time_list = [] # time in seconds self.p_list = [] #each element is a list of 3 coordinates self.v_list = [] #each element is a list of 3 coordinates (velocity) class ForceTrajectory(): ''' class to store time evolution of the force at the end effector. data only - use for pickling ''' def __init__(self): self.time_list = [] # time in seconds self.f_list = [] #each element is a list of 3 coordinates ## # @param traj - JointTrajectory # @return CartesianTajectory after performing FK on traj to compute # cartesian position, velocity def joint_to_cartesian(traj): firenze = hr.M3HrlRobot(connect=False) pts = [] cart_vel = [] for i in range(len(traj.q_list)): q = traj.q_list[i] p = firenze.FK('right_arm', q) pts.append(p.A1.tolist()) if traj.qdot_list != []: qdot = traj.qdot_list[i] jac = firenze.Jac('right_arm', q) vel = jac * np.matrix(qdot).T cart_vel.append(vel.A1[0:3].tolist()) ct = CartesianTajectory() ct.time_list = copy.copy(traj.time_list) ct.p_list = copy.copy(pts) ct.v_list = copy.copy(cart_vel) #return np.matrix(pts).T return ct def plot_forces_quiver(pos_traj,force_traj,color='k'): import arm_trajectories as at #if traj.__class__ == at.JointTrajectory: if isinstance(pos_traj,at.JointTrajectory): pos_traj = joint_to_cartesian(pos_traj) pts = np.matrix(pos_traj.p_list).T label_list = ['X coord (m)', 'Y coord (m)', 'Z coord (m)'] x = pts[0,:].A1.tolist() y = pts[1,:].A1.tolist() forces = np.matrix(force_traj.f_list).T u = (-1*forces[0,:]).A1.tolist() v = (-1*forces[1,:]).A1.tolist() pl.quiver(x,y,u,v,width=0.002,color=color,scale=100.0) # pl.quiver(x,y,u,v,width=0.002,color=color) pl.axis('equal') ## # @param xaxis - x axis for the graph (0,1 or 2) # @param zaxis - for a 3d plot. not implemented. def plot_cartesian(traj, xaxis=None, yaxis=None, zaxis=None, color='b',label='_nolegend_', linewidth=2, scatter_size=10, plot_velocity=False): import arm_trajectories as at #if traj.__class__ == at.JointTrajectory: if isinstance(traj,at.JointTrajectory): traj = joint_to_cartesian(traj) pts = np.matrix(traj.p_list).T label_list = ['X coord (m)', 'Y coord (m)', 'Z coord (m)'] x = pts[xaxis,:].A1.tolist() y = pts[yaxis,:].A1.tolist() if plot_velocity: vels = np.matrix(traj.v_list).T xvel = vels[xaxis,:].A1.tolist() yvel = vels[yaxis,:].A1.tolist() if zaxis == None: mpu.plot_yx(y, x, color, linewidth, '-', scatter_size, label, axis = 'equal', xlabel = label_list[xaxis], ylabel = label_list[yaxis],) if plot_velocity: mpu.plot_quiver_yxv(y, x, np.matrix([xvel,yvel]), width = 0.001, scale = 1.) mpu.legend() else: from numpy import array from enthought.mayavi.api import Engine engine = Engine() engine.start() if len(engine.scenes) == 0: engine.new_scene() z = pts[zaxis,:].A1.tolist() time_list = [t-traj.time_list[0] for t in traj.time_list] mlab.plot3d(x,y,z,time_list,tube_radius=None,line_width=4) mlab.axes() mlab.xlabel(label_list[xaxis]) mlab.ylabel(label_list[yaxis]) mlab.zlabel(label_list[zaxis]) mlab.colorbar(title='Time') # ------------------------------------------- axes = engine.scenes[0].children[0].children[0].children[1] axes.axes.position = array([ 0., 0.]) axes.axes.label_format = '%-#6.2g' axes.title_text_property.font_size=4 ## compute the force that the arm would apply given the stiffness matrix # @param q_actual_traj - Joint Trajectory (actual angles.) # @param q_eq_traj - Joint Trajectory (equilibrium point angles.) # @param torque_traj - JointTrajectory (torques measured at the joints.) # @param rel_stiffness_list - list of 5 elements (stiffness numbers for the joints.) # @return lots of things, look at the code. def compute_forces(q_actual_traj,q_eq_traj,torque_traj,rel_stiffness_list): firenze = hr.M3HrlRobot(connect=False) d_gains_list_mN_deg_sec = [-100,-120,-15,-25,-1.25] d_gains_list = [180./1000.*s/math.pi for s in d_gains_list_mN_deg_sec] stiff_list_mNm_deg = [1800,1300,350,600,60] stiff_list_Nm_rad = [180./1000.*s/math.pi for s in stiff_list_mNm_deg] # stiffness_settings = [0.15,0.7,0.8,0.8,0.8] # dia = np.array(stiffness_settings) * np.array(stiff_list_Nm_rad) dia = np.array(rel_stiffness_list) * np.array(stiff_list_Nm_rad) k_q = np.matrix(np.diag(dia)) dia_inv = 1./dia k_q_inv = np.matrix(np.diag(dia_inv)) actual_cart = joint_to_cartesian(q_actual_traj) eq_cart = joint_to_cartesian(q_eq_traj) force_traj_jacinv = ForceTrajectory() force_traj_stiff = ForceTrajectory() force_traj_torque = ForceTrajectory() k_cart_list = [] for q_actual,q_dot,q_eq,actual_pos,eq_pos,t,tau_m in zip(q_actual_traj.q_list,q_actual_traj.qdot_list,q_eq_traj.q_list,actual_cart.p_list,eq_cart.p_list,q_actual_traj.time_list,torque_traj.q_list): q_eq = firenze.clamp_to_physical_joint_limits('right_arm',q_eq) q_delta = np.matrix(q_actual).T - np.matrix(q_eq).T tau = k_q * q_delta[0:5,0] - np.matrix(np.array(d_gains_list)*np.array(q_dot)[0:5]).T x_delta = np.matrix(actual_pos).T - np.matrix(eq_pos).T jac_full = firenze.Jac('right_arm',q_actual) jac = jac_full[0:3,0:5] jac_full_eq = firenze.Jac('right_arm',q_eq) jac_eq = jac_full_eq[0:3,0:5] k_cart = np.linalg.inv((jac_eq*k_q_inv*jac_eq.T)) # calculating stiff matrix using Jacobian for eq pt. k_cart_list.append(k_cart) pseudo_inv_jac = np.linalg.inv(jac_full*jac_full.T)*jac_full tau_full = np.row_stack((tau,np.matrix(tau_m[5:7]).T)) #force = (-1*pseudo_inv_jac*tau_full)[0:3] force = -1*pseudo_inv_jac[0:3,0:5]*tau force_traj_jacinv.f_list.append(force.A1.tolist()) force_traj_stiff.f_list.append((k_cart*x_delta).A1.tolist()) force_traj_torque.f_list.append((pseudo_inv_jac*np.matrix(tau_m).T)[0:3].A1.tolist()) return force_traj_jacinv,force_traj_stiff,force_traj_torque,k_cart_list ## return two lists containing the radial and tangential components of the forces. # @param f_list - list of forces. (each force is a list of 2 or 3 floats) # @param p_list - list of positions. (each position is a list of 2 or 3 floats) # @param cx - x coord of the center of the circle. # @param cy - y coord of the center of the circle. # @return list of magnitude of radial component, list of magnitude tangential component. def compute_radial_tangential_forces(f_list,p_list,cx,cy): f_rad_l,f_tan_l = [],[] for f,p in zip(f_list,p_list): rad_vec = np.array([p[0]-cx,p[1]-cy]) rad_vec = rad_vec/np.linalg.norm(rad_vec) f_vec = np.array([f[0],f[1]]) f_rad_mag = np.dot(f_vec,rad_vec) f_tan_mag = np.linalg.norm(f_vec-rad_vec*f_rad_mag) f_rad_mag = abs(f_rad_mag) f_rad_l.append(f_rad_mag) f_tan_l.append(f_tan_mag) return f_rad_l,f_tan_l ## find the x and y coord of the center of the circle and the radius that # best matches the data. # @param rad_guess - guess for the radius of the circle # @param x_guess - guess for x coord of center # @param y_guess - guess for y coord of center. # @param pts - 2xN np matrix of points. # @param method - optimization method. ('fmin' or 'fmin_bfgs') # @param verbose - passed onto the scipy optimize functions. whether to print out the convergence info. # @return r,x,y (radius, x and y coord of the center of the circle) def fit_circle(rad_guess,x_guess,y_guess,pts,method,verbose=True): def error_function(params): center = np.matrix((params[0],params[1])).T rad = params[2] #print 'pts.shape', pts.shape #print 'center.shape', center.shape #print 'ut.norm(pts-center).shape',ut.norm(pts-center).shape err = ut.norm(pts-center).A1 - rad res = np.dot(err,err) return res params_1 = [x_guess,y_guess,rad_guess] if method == 'fmin': r = so.fmin(error_function,params_1,xtol=0.0002,ftol=0.000001,full_output=1,disp=verbose) opt_params_1,fopt_1 = r[0],r[1] elif method == 'fmin_bfgs': r = so.fmin_bfgs(error_function, params_1, full_output=1, disp = verbose, gtol=1e-5) opt_params_1,fopt_1 = r[0],r[1] else: raise RuntimeError('unknown method: '+method) params_2 = [x_guess,y_guess+2*rad_guess,rad_guess] if method == 'fmin': r = so.fmin(error_function,params_2,xtol=0.0002,ftol=0.000001,full_output=1,disp=verbose) opt_params_2,fopt_2 = r[0],r[1] elif method == 'fmin_bfgs': r = so.fmin_bfgs(error_function, params_2, full_output=1, disp = verbose, gtol=1e-5) opt_params_2,fopt_2 = r[0],r[1] else: raise RuntimeError('unknown method: '+method) if fopt_2<fopt_1: return opt_params_2[2],opt_params_2[0],opt_params_2[1] else: return opt_params_1[2],opt_params_1[0],opt_params_1[1] ## changes the cartesian trajectory to put everything in the same frame. # NOTE - velocity transformation does not work if the segway is also # moving. This is because I am not logging the velocity of the segway. # @param pts - CartesianTajectory # @param st - object of type PlanarTajectory (segway trajectory) # @return CartesianTajectory def account_segway_motion(cart_traj,st): ct = CartesianTajectory() for i in range(len(cart_traj.p_list)): x,y,a = st.x_list[i], st.y_list[i], st.a_list[i] p_tl = np.matrix(cart_traj.p_list[i]).T p_ts = smc.tsTtl(p_tl, x, y, a) p = p_ts ct.p_list.append(p.A1.tolist()) # this is incorrect. I also need to use the velocity of the # segway. Unclear whether this is useful right now, so not # implementing it. (Advait. Jan 6, 2010.) if cart_traj.v_list != []: v_tl = np.matrix(cart_traj.v_list[i]).T v_ts = smc.tsRtl(v_tl, a) ct.v_list.append(v_ts.A1.tolist()) ct.time_list = copy.copy(cart_traj.time_list) return ct # @param cart_traj - CartesianTajectory # @param z_l - list of zenither heights # @return CartesianTajectory def account_zenithering(cart_traj, z_l): ct = CartesianTajectory() h_start = z_l[0] for i in range(len(cart_traj.p_list)): h = z_l[i] p = cart_traj.p_list[i] p[2] += h - h_start ct.p_list.append(p) # this is incorrect. I also need to use the velocity of the # zenither. Unclear whether this is useful right now, so not # implementing it. (Advait. Jan 6, 2010.) if cart_traj.v_list != []: ct.v_list.append(cart_traj.v_list[i]) ct.time_list = copy.copy(cart_traj.time_list) return ct ## # remove the parts of the trjectory in which the hook is not moving. # @param ct - cartesian trajectory of the end effector in the world frame. # @return 2xN np matrix, reject_idx def filter_cartesian_trajectory(ct): pts_list = ct.p_list ee_start_pos = pts_list[0] l = [pts_list[0]] for i, p in enumerate(pts_list[1:]): l.append(p) pts_2d = (np.matrix(l).T)[0:2,:] st_pt = pts_2d[:,0] end_pt = pts_2d[:,-1] dist_moved = np.linalg.norm(st_pt-end_pt) #if dist_moved < 0.1: if dist_moved < 0.03: reject_idx = i pts_2d = pts_2d[:,reject_idx:] return pts_2d, reject_idx ## # remove the parts of the trjectory in which the hook slipped off # @param ct - cartesian trajectory of the end effector in the world frame. # @param ft - force trajectory # @return cartesian trajectory with the zero force end part removed, force trajectory def filter_trajectory_force(ct, ft): vel_list = copy.copy(ct.v_list) pts_list = copy.copy(ct.p_list) time_list = copy.copy(ct.time_list) ft_list = copy.copy(ft.f_list) f_mag_list = ut.norm(np.matrix(ft.f_list).T).A1.tolist() if len(pts_list) != len(f_mag_list): print 'arm_trajectories.filter_trajectory_force: force and end effector lists are not of the same length.' print 'Exiting ...' sys.exit() n_pts = len(pts_list) i = n_pts - 1 hook_slip_off_threshold = 1.5 # from compliant_trajectories.py while i > 0: if f_mag_list[i] < hook_slip_off_threshold: pts_list.pop() time_list.pop() ft_list.pop() if vel_list != []: vel_list.pop() else: break i -= 1 ct2 = CartesianTajectory() ct2.time_list = time_list ct2.p_list = pts_list ct2.v_list = vel_list ft2 = ForceTrajectory() ft2.time_list = copy.copy(time_list) ft2.f_list = ft_list return ct2, ft2 if __name__ == '__main__': p = optparse.OptionParser() p.add_option('-f', action='store', type='string', dest='fname', help='pkl file to use.', default='') p.add_option('--xy', action='store_true', dest='xy', help='plot the x and y coordinates of the end effector.') p.add_option('--yz', action='store_true', dest='yz', help='plot the y and z coordinates of the end effector.') p.add_option('--xz', action='store_true', dest='xz', help='plot the x and z coordinates of the end effector.') p.add_option('--plot_ellipses', action='store_true', dest='plot_ellipses', help='plot the stiffness ellipse in the x-y plane') p.add_option('--pfc', action='store_true', dest='pfc', help='plot the radial and tangential components of the force.') p.add_option('--pmf', action='store_true', dest='pmf', help='plot things with the mechanism alinged with the axes.') p.add_option('--pff', action='store_true', dest='pff', help='plot the force field corresponding to a stiffness ellipse.') p.add_option('--pev', action='store_true', dest='pev', help='plot the stiffness ellipses for different combinations of the rel stiffnesses.') p.add_option('--plot_forces', action='store_true', dest='plot_forces', help='plot the force in the x-y plane') p.add_option('--plot_forces_error', action='store_true', dest='plot_forces_error', help='plot the error between the computed and measured (ATI) forces in the x-y plane') p.add_option('--xyz', action='store_true', dest='xyz', help='plot in 3d the coordinates of the end effector.') p.add_option('-r', action='store', type='float', dest='rad', help='radius of the joint.', default=None) p.add_option('--noshow', action='store_true', dest='noshow', help='do not display the figure (use while saving figures to disk)') p.add_option('--exptplot', action='store_true', dest='exptplot', help='put all the graphs of an experiment as subplots.') p.add_option('--sturm', action='store_true', dest='sturm', help='make log files to send to sturm') p.add_option('--icra_presentation_plot', action='store_true', dest='icra_presentation_plot', help='plot explaining CEP update.') opt, args = p.parse_args() fname = opt.fname xy_flag = opt.xy yz_flag = opt.yz xz_flag = opt.xz plot_forces_flag = opt.plot_forces plot_ellipses_flag = opt.plot_ellipses plot_forces_error_flag = opt.plot_forces_error plot_force_components_flag = opt.pfc plot_force_field_flag = opt.pff plot_mechanism_frame = opt.pmf xyz_flag = opt.xyz rad = opt.rad show_fig = not(opt.noshow) plot_ellipses_vary_flag = opt.pev expt_plot = opt.exptplot sturm_output = opt.sturm if plot_ellipses_vary_flag: show_fig=False i = 0 ratio_list1 = [0.1,0.3,0.5,0.7,0.9] # coarse search ratio_list2 = [0.1,0.3,0.5,0.7,0.9] # coarse search ratio_list3 = [0.1,0.3,0.5,0.7,0.9] # coarse search # ratio_list1 = [0.7,0.8,0.9,1.0] # ratio_list2 = [0.7,0.8,0.9,1.0] # ratio_list3 = [0.3,0.4,0.5,0.6,0.7] # ratio_list1 = [1.0,2.,3.0] # ratio_list2 = [1.,2.,3.] # ratio_list3 = [0.3,0.4,0.5,0.6,0.7] inv_mean_list,std_list = [],[] x_l,y_l,z_l = [],[],[] s0 = 0.2 #s0 = 0.4 for s1 in ratio_list1: for s2 in ratio_list2: for s3 in ratio_list3: i += 1 s_list = [s0,s1,s2,s3,0.8] #s_list = [s1,s2,s3,s0,0.8] print '################## s_list:', s_list m,s = plot_stiff_ellipse_map(s_list,i) inv_mean_list.append(1./m) std_list.append(s) x_l.append(s1) y_l.append(s2) z_l.append(s3) ut.save_pickle({'x_l':x_l,'y_l':y_l,'z_l':z_l,'inv_mean_list':inv_mean_list,'std_list':std_list}, 'stiff_dict_'+ut.formatted_time()+'.pkl') d3m.plot_points(np.matrix([x_l,y_l,z_l]),scalar_list=inv_mean_list,mode='sphere') mlab.axes() d3m.show() sys.exit() if fname=='': print 'please specify a pkl file (-f option)' print 'Exiting...' sys.exit() d = ut.load_pickle(fname) actual_cartesian_tl = joint_to_cartesian(d['actual']) actual_cartesian = account_segway_motion(actual_cartesian_tl,d['segway']) if d.has_key('zenither_list'): actual_cartesian = account_zenithering(actual_cartesian, d['zenither_list']) eq_cartesian_tl = joint_to_cartesian(d['eq_pt']) eq_cartesian = account_segway_motion(eq_cartesian_tl, d['segway']) if d.has_key('zenither_list'): eq_cartesian = account_zenithering(eq_cartesian, d['zenither_list']) cartesian_force_clean, _ = filter_trajectory_force(actual_cartesian, d['force']) pts_2d, reject_idx = filter_cartesian_trajectory(cartesian_force_clean) if rad != None: #rad = 0.39 # lab cabinet recessed. #rad = 0.42 # kitchen cabinet #rad = 0.80 # lab glass door pts_list = actual_cartesian.p_list eq_pts_list = eq_cartesian.p_list ee_start_pos = pts_list[0] x_guess = ee_start_pos[0] y_guess = ee_start_pos[1] - rad print 'before call to fit_rotary_joint' force_list = d['force'].f_list if sturm_output: str_parts = fname.split('.') sturm_file_name = str_parts[0]+'_sturm.log' print 'Sturm file name:', sturm_file_name sturm_file = open(sturm_file_name,'w') sturm_pts = cartesian_force_clean.p_list print 'len(sturm_pts):', len(sturm_pts) print 'len(pts_list):', len(pts_list) for i,p in enumerate(sturm_pts[1:]): sturm_file.write(" ".join(map(str,p))) sturm_file.write('\n') sturm_file.write('\n') sturm_file.close() rad_guess = rad rad, cx, cy = fit_circle(rad_guess,x_guess,y_guess,pts_2d, method='fmin_bfgs',verbose=False) c_ts = np.matrix([cx, cy, 0.]).T start_angle = tr.angle_within_mod180(math.atan2(pts_2d[0,1]-cy, pts_2d[0,0]-cx) - math.pi/2) end_angle = tr.angle_within_mod180(math.atan2(pts_2d[-1,1]-cy, pts_2d[-1,0]-cx) - math.pi/2) mpu.plot_circle(cx, cy, rad, start_angle, end_angle, label='Actual\_opt', color='r') if opt.icra_presentation_plot: mpu.set_figure_size(30,20) rad = 1.0 x_guess = pts_2d[0,0] y_guess = pts_2d[1,0] - rad rad_guess = rad rad, cx, cy = fit_circle(rad_guess,x_guess,y_guess,pts_2d, method='fmin_bfgs',verbose=False) print 'Estimated rad, cx, cy:', rad, cx, cy start_angle = tr.angle_within_mod180(math.atan2(pts_2d[1,0]-cy, pts_2d[0,0]-cx) - math.pi/2) end_angle = tr.angle_within_mod180(math.atan2(pts_2d[1,-1]-cy, pts_2d[0,-1]-cx) - math.pi/2) subsample_ratio = 1 pts_2d_s = pts_2d[:,::subsample_ratio] cep_force_clean, force_new = filter_trajectory_force(eq_cartesian, d['force']) cep_2d = np.matrix(cep_force_clean.p_list).T[0:2,reject_idx:] # first draw the entire CEP and end effector trajectories mpu.figure() mpu.plot_yx(pts_2d_s[1,:].A1, pts_2d_s[0,:].A1, color='b', label = 'FK', axis = 'equal', alpha = 1.0, scatter_size=7, linewidth=0, marker='x', marker_edge_width = 1.5) cep_2d_s = cep_2d[:,::subsample_ratio] mpu.plot_yx(cep_2d_s[1,:].A1, cep_2d_s[0,:].A1, color='g', label = 'CEP', axis = 'equal', alpha = 1.0, scatter_size=10, linewidth=0, marker='+', marker_edge_width = 1.5) mpu.plot_circle(cx, cy, rad, start_angle, end_angle, label='Estimated Kinematics', color='r', alpha=0.7) mpu.plot_radii(cx, cy, rad, start_angle, end_angle, interval=end_angle-start_angle, color='r', alpha=0.7) mpu.legend() mpu.savefig('one.png') # now zoom in to a small region to show the force # decomposition. zoom_location = 10 pts_2d_zoom = pts_2d[:,:zoom_location] cep_2d_zoom = cep_2d[:,:zoom_location] mpu.figure() mpu.plot_yx(pts_2d_zoom[1,:].A1, pts_2d_zoom[0,:].A1, color='b', label = 'FK', axis = 'equal', alpha = 1.0, scatter_size=7, linewidth=0, marker='x', marker_edge_width = 1.5) mpu.plot_yx(cep_2d_zoom[1,:].A1, cep_2d_zoom[0,:].A1, color='g', label = 'CEP', axis = 'equal', alpha = 1.0, scatter_size=10, linewidth=0, marker='+', marker_edge_width = 1.5) mpu.pl.xlim(0.28, 0.47) mpu.legend() mpu.savefig('two.png') rad, cx, cy = fit_circle(1.0,x_guess,y_guess,pts_2d_zoom, method='fmin_bfgs',verbose=False) print 'Estimated rad, cx, cy:', rad, cx, cy start_angle = tr.angle_within_mod180(math.atan2(pts_2d[1,0]-cy, pts_2d[0,0]-cx) - math.pi/2) end_angle = tr.angle_within_mod180(math.atan2(pts_2d_zoom[1,-1]-cy, pts_2d_zoom[0,-1]-cx) - math.pi/2) mpu.plot_circle(cx, cy, rad, start_angle, end_angle, label='Estimated Kinematics', color='r', alpha=0.7) mpu.pl.xlim(0.28, 0.47) mpu.legend() mpu.savefig('three.png') current_pos = pts_2d_zoom[:,-1] radial_vec = current_pos - np.matrix([cx,cy]).T radial_vec = radial_vec / np.linalg.norm(radial_vec) tangential_vec = np.matrix([[0,-1],[1,0]]) * radial_vec mpu.plot_quiver_yxv([pts_2d_zoom[1,-1]], [pts_2d_zoom[0,-1]], radial_vec, scale=10., width = 0.002) rad_text_loc = pts_2d_zoom[:,-1] + np.matrix([0.001,0.01]).T mpu.pl.text(rad_text_loc[0,0], rad_text_loc[1,0], '\huge{$\hat v_{rad}$}') mpu.plot_quiver_yxv([pts_2d_zoom[1,-1]], [pts_2d_zoom[0,-1]], tangential_vec, scale=10., width = 0.002) tan_text_loc = pts_2d_zoom[:,-1] + np.matrix([-0.012, -0.011]).T mpu.pl.text(tan_text_loc[0,0], tan_text_loc[1,0], s = '\huge{$\hat v_{tan}$}') mpu.pl.xlim(0.28, 0.47) mpu.legend() mpu.savefig('four.png') wrist_force = -np.matrix(force_new.f_list[zoom_location]).T frad = (wrist_force[0:2,:].T * radial_vec)[0,0] * radial_vec mpu.plot_quiver_yxv([pts_2d_zoom[1,-1]], [pts_2d_zoom[0,-1]], wrist_force, scale=50., width = 0.002, color='y') wf_text = rad_text_loc + np.matrix([-0.05,0.015]).T mpu.pl.text(wf_text[0,0], wf_text[1,0], color='y', fontsize = 15, s = 'Wrist Force') mpu.plot_quiver_yxv([pts_2d_zoom[1,-1]], [pts_2d_zoom[0,-1]], frad, scale=50., width = 0.002, color='y') frad_text = rad_text_loc + np.matrix([0.,0.015]).T mpu.pl.text(frad_text[0,0], frad_text[1,0], color='y', s = '\huge{$\hat F_{rad}$}') mpu.pl.xlim(0.28, 0.47) mpu.legend() mpu.savefig('five.png') frad = (wrist_force[0:2,:].T * radial_vec)[0,0] hook_force_motion = -(frad - 5) * radial_vec * 0.001 tangential_motion = 0.01 * tangential_vec total_cep_motion = hook_force_motion + tangential_motion mpu.plot_quiver_yxv([cep_2d_zoom[1,-1]], [cep_2d_zoom[0,-1]], hook_force_motion, scale=0.1, width = 0.002) hw_text = cep_2d_zoom[:,-1] + np.matrix([-0.002,-0.012]).T mpu.pl.text(hw_text[0,0], hw_text[1,0], color='k', fontsize=14, s = '$h[t]$ = $0.1cm/N \cdot (|\hat{F}_{rad}|-5N) \cdot \hat{v}_{rad}$') mpu.pl.xlim(0.28, 0.47) mpu.legend() mpu.savefig('six.png') mpu.plot_quiver_yxv([cep_2d_zoom[1,-1]], [cep_2d_zoom[0,-1]], tangential_motion, scale=0.1, width = 0.002) mw_text = cep_2d_zoom[:,-1] + np.matrix([-0.038,0.001]).T mpu.pl.text(mw_text[0,0], mw_text[1,0], color='k', fontsize=14, s = '$m[t]$ = $1cm \cdot \hat{v}_{tan}$') mpu.pl.xlim(0.28, 0.47) mpu.legend() mpu.savefig('seven.png') mpu.plot_quiver_yxv([cep_2d_zoom[1,-1]], [cep_2d_zoom[0,-1]], total_cep_motion, scale=0.1, width = 0.002) cep_text = cep_2d_zoom[:,-1] + np.matrix([-0.058,-0.013]).T mpu.pl.text(cep_text[0,0], cep_text[1,0], color='k', fontsize=14, s = '$x_{eq}[t]$ = &x_{eq}[t-1] + m[t] + h[t]$') mpu.pl.xlim(0.28, 0.47) mpu.legend() mpu.savefig('eight.png') new_cep = cep_2d_zoom[:,-1] + total_cep_motion mpu.plot_yx(new_cep[1,:].A1, new_cep[0,:].A1, color='g', axis = 'equal', alpha = 1.0, scatter_size=10, linewidth=0, marker='+', marker_edge_width = 1.5) mpu.pl.xlim(0.28, 0.47) mpu.legend() mpu.savefig('nine.png') #mpu.plot_radii(cx, cy, rad, start_angle, end_angle, # interval=end_angle-start_angle, color='r', # alpha=0.7) if plot_mechanism_frame: if expt_plot: pl.subplot(231) # transform points so that the mechanism is in a fixed position. start_pt = actual_cartesian.p_list[0] x_diff = start_pt[0] - cx y_diff = start_pt[1] - cy angle = math.atan2(y_diff,x_diff) - math.radians(90) rot_mat = tr.Rz(angle)[0:2,0:2] translation_mat = np.matrix([cx,cy]).T robot_width,robot_length = 0.1,0.2 robot_x_list = [-robot_width/2,-robot_width/2,robot_width/2,robot_width/2,-robot_width/2] robot_y_list = [-robot_length/2,robot_length/2,robot_length/2,-robot_length/2,-robot_length/2] robot_mat = rot_mat*(np.matrix([robot_x_list,robot_y_list]) - translation_mat) mpu.plot_yx(robot_mat[1,:].A1,robot_mat[0,:].A1,linewidth=2,scatter_size=0, color='k',label='torso', axis='equal') pts2d_actual = (np.matrix(actual_cartesian.p_list).T)[0:2] pts2d_actual_t = rot_mat *(pts2d_actual - translation_mat) mpu.plot_yx(pts2d_actual_t[1,:].A1,pts2d_actual_t[0,:].A1,scatter_size=20,label='FK', axis = 'equal') end_pt = pts2d_actual_t[:,-1] end_angle = tr.angle_within_mod180(math.atan2(end_pt[1,0],end_pt[0,0])-math.radians(90)) mpu.plot_circle(0,0,rad,0.,end_angle,label='Actual_opt',color='r') mpu.plot_radii(0,0,rad,0.,end_angle,interval=math.radians(15),color='r') pl.legend(loc='best') pl.axis('equal') if not(expt_plot): str_parts = fname.split('.') fig_name = str_parts[0]+'_robot_pose.png' pl.savefig(fig_name) pl.figure() else: pl.subplot(232) pl.text(0.1,0.15,d['info']) pl.text(0.1,0.10,'control: '+d['strategy']) pl.text(0.1,0.05,'robot angle: %.2f'%math.degrees(angle)) pl.text(0.1,0,'optimized radius: %.2f'%rad_opt) pl.text(0.1,-0.05,'radius used: %.2f'%rad) pl.text(0.1,-0.10,'opening angle: %.2f'%math.degrees(end_angle)) s_list = d['stiffness'].stiffness_list s_scale = d['stiffness'].stiffness_scale sl = [min(s*s_scale,1.0) for s in s_list] pl.text(0.1,-0.15,'stiffness list: %.2f, %.2f, %.2f, %.2f'%(sl[0],sl[1],sl[2],sl[3])) pl.text(0.1,-0.20,'stop condition: '+d['result']) time_dict = d['time_dict'] pl.text(0.1,-0.25,'time to hook: %.2f'%(time_dict['before_hook']-time_dict['before_pull'])) pl.text(0.1,-0.30,'time to pull: %.2f'%(time_dict['before_pull']-time_dict['after_pull'])) pl.ylim(-0.45,0.25) if not(expt_plot): pl.figure() if xy_flag: st_pt = pts_2d[:,0] end_pt = pts_2d[:,-1] # if rad != None: # start_angle = tr.angle_within_mod180(math.atan2(st_pt[1,0]-cy,st_pt[0,0]-cx) - math.radians(90)) # end_angle = tr.angle_within_mod180(math.atan2(end_pt[1,0]-cy,end_pt[0,0]-cx) - math.radians(90)) # # print 'start_angle, end_angle:', math.degrees(start_angle), math.degrees(end_angle) # print 'angle through which mechanism turned:', math.degrees(end_angle-start_angle) if expt_plot: pl.subplot(233) plot_cartesian(actual_cartesian, xaxis=0, yaxis=1, color='b', label='FK', plot_velocity=False) plot_cartesian(eq_cartesian, xaxis=0,yaxis=1,color='g',label='Eq Point') #leg = pl.legend(loc='best',handletextsep=0.020,handlelen=0.003,labelspacing=0.003) #leg.draw_frame(False) elif yz_flag: plot_cartesian(actual_cartesian,xaxis=1,yaxis=2,color='b',label='FK') plot_cartesian(eq_cartesian, xaxis=1,yaxis=2,color='g',label='Eq Point') elif xz_flag: plot_cartesian(actual_cartesian,xaxis=0,yaxis=2,color='b',label='FK') plot_cartesian(eq_cartesian, xaxis=0,yaxis=2,color='g',label='Eq Point') if plot_forces_flag or plot_forces_error_flag or plot_ellipses_flag or plot_force_components_flag or plot_force_field_flag: arm_stiffness_list = d['stiffness'].stiffness_list scale = d['stiffness'].stiffness_scale asl = [min(scale*s,1.0) for s in arm_stiffness_list] ftraj_jinv,ftraj_stiff,ftraj_torque,k_cart_list=compute_forces(d['actual'],d['eq_pt'], d['torque'],asl) if plot_forces_flag: plot_forces_quiver(actual_cartesian,d['force'],color='k') #plot_forces_quiver(actual_cartesian,ftraj_jinv,color='y') #plot_forces_quiver(actual_cartesian,ftraj_stiff,color='y') if plot_ellipses_flag: #plot_stiff_ellipses(k_cart_list,actual_cartesian) if expt_plot: subplotnum=234 else: pl.figure() subplotnum=111 plot_stiff_ellipses(k_cart_list,eq_cartesian,subplotnum=subplotnum) if plot_forces_error_flag: plot_error_forces(d['force'].f_list,ftraj_jinv.f_list) #plot_error_forces(d['force'].f_list,ftraj_stiff.f_list) if plot_force_components_flag: p_list = actual_cartesian.p_list cx = 45. cy = -0.3 frad_list,ftan_list = compute_radial_tangential_forces(d['force'].f_list,p_list,cx,cy) if expt_plot: pl.subplot(235) else: pl.figure() time_list = d['force'].time_list time_list = [t-time_list[0] for t in time_list] x_coord_list = np.matrix(p_list)[:,0].A1.tolist() mpu.plot_yx(frad_list,x_coord_list,scatter_size=50,color=time_list,cb_label='time',axis=None) pl.xlabel('x coord of end effector (m)') pl.ylabel('magnitude of radial force (N)') pl.title(d['info']) if expt_plot: pl.subplot(236) else: pl.figure() mpu.plot_yx(ftan_list,x_coord_list,scatter_size=50,color=time_list,cb_label='time',axis=None) pl.xlabel('x coord of end effector (m)') pl.ylabel('magnitude of tangential force (N)') pl.title(d['info']) if plot_force_field_flag: plot_stiffness_field(k_cart_list[0],plottitle='start') plot_stiffness_field(k_cart_list[-1],plottitle='end') str_parts = fname.split('.') if d.has_key('strategy'): addon = '' if opt.xy: addon = '_xy' if opt.xz: addon = '_xz' fig_name = str_parts[0]+'_'+d['strategy']+addon+'.png' else: fig_name = str_parts[0]+'_res.png' if expt_plot: f = pl.gcf() curr_size = f.get_size_inches() f.set_size_inches(curr_size[0]*2,curr_size[1]*2) f.savefig(fig_name) if show_fig: pl.show() else: print '################################' print 'show_fig is FALSE' if not(expt_plot): pl.savefig(fig_name) if xyz_flag: plot_cartesian(traj, xaxis=0,yaxis=1,zaxis=2) mlab.show()
ajibawa-2023/Python-Code-Large/train/row_99527
556
921
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Import_L32_C0", "label": "scipy.optimize import so", "type": "import", "loc": [32, 32], "level": 0, "parent": null, "vector": [1, 0, 0.0347, 0.0011, 0, 0.66, 0.0, 359, 0, 1, 0, 0, 359, 0, 0], "semantic": {"name": "scipy.optimize", "arg_names": [], "import_names": ["so"], "rhs_call_name": "", "annotation": ""}, "snippet": "import scipy.optimize as so"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Import_L34_C0", "label": "math import math, np", "type": "import", "loc": [34, 34], "level": 0, "parent": null, "vector": [1, 0, 0.0369, 0.0011, 0, 0.66, 0.0357, 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_99527:Import_L35_C0", "label": "pylab import pl", "type": "import", "loc": [35, 35], "level": 0, "parent": null, "vector": [1, 0, 0.038, 0.0011, 0, 0.66, 0.0714, 735, 0, 1, 0, 0, 735, 0, 0], "semantic": {"name": "pylab", "arg_names": [], "import_names": ["pl"], "rhs_call_name": "", "annotation": ""}, "snippet": "import pylab as pl"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Import_L36_C0", "label": "sys import sys, optparse, time", "type": "import", "loc": [36, 36], "level": 0, "parent": null, "vector": [1, 0, 0.0391, 0.0011, 0, 0.66, 0.1071, 509, 0, 3, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys", "optparse", "time"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys, optparse, time"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Import_L37_C0", "label": "copy import copy", "type": "import", "loc": [37, 37], "level": 0, "parent": null, "vector": [1, 0, 0.0402, 0.0011, 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_99527:ImportFrom_L39_C0", "label": "from enthought.mayavi import mlab", "type": "import", "loc": [39, 39], "level": 0, "parent": null, "vector": [1, 0, 0.0423, 0.0011, 0, 0.66, 0.1786, 226, 0, 1, 0, 0, 226, 0, 0], "semantic": {"name": "enthought.mayavi", "arg_names": [], "import_names": ["mlab"], "rhs_call_name": "", "annotation": ""}, "snippet": "from enthought.mayavi import mlab"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Import_L41_C0", "label": "mekabot.hrl_robot import hr", "type": "import", "loc": [41, 41], "level": 0, "parent": null, "vector": [1, 0, 0.0445, 0.0011, 0, 0.66, 0.2143, 4, 0, 1, 0, 0, 4, 0, 0], "semantic": {"name": "mekabot.hrl_robot", "arg_names": [], "import_names": ["hr"], "rhs_call_name": "", "annotation": ""}, "snippet": "import mekabot.hrl_robot as hr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Import_L42_C0", "label": "mekabot.coord_frames import mcf", "type": "import", "loc": [42, 42], "level": 0, "parent": null, "vector": [1, 0, 0.0456, 0.0011, 0, 0.66, 0.25, 350, 0, 1, 0, 0, 350, 0, 0], "semantic": {"name": "mekabot.coord_frames", "arg_names": [], "import_names": ["mcf"], "rhs_call_name": "", "annotation": ""}, "snippet": "import mekabot.coord_frames as mcf"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Import_L43_C0", "label": "matplotlib_util.util import mpu", "type": "import", "loc": [43, 43], "level": 0, "parent": null, "vector": [1, 0, 0.0467, 0.0011, 0, 0.66, 0.2857, 781, 0, 1, 0, 0, 781, 0, 0], "semantic": {"name": "matplotlib_util.util", "arg_names": [], "import_names": ["mpu"], "rhs_call_name": "", "annotation": ""}, "snippet": "import matplotlib_util.util as mpu"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Import_L46_C0", "label": "roslib import roslib", "type": "import", "loc": [46, 46], "level": 0, "parent": null, "vector": [1, 0, 0.0499, 0.0011, 0, 0.66, 0.3214, 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('2010_icra_epc_pull')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L46_C15", "label": "load_manifest()", "type": "expression", "loc": [46, 46], "level": 0, "parent": null, "vector": [8, 0, 0.0499, 0.0011, 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": "import roslib; roslib.load_manifest('2010_icra_epc_pull')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Import_L47_C0", "label": "hrl_lib.util import ut, tr", "type": "import", "loc": [47, 47], "level": 0, "parent": null, "vector": [1, 0, 0.051, 0.0011, 0, 0.66, 0.3929, 775, 0, 2, 0, 0, 775, 0, 0], "semantic": {"name": "hrl_lib.util", "arg_names": [], "import_names": ["ut", "tr"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.util as ut, hrl_lib.transforms as tr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Import_L48_C0", "label": "hrl_tilting_hokuyo.display_3d_mayavi import d3m", "type": "import", "loc": [48, 48], "level": 0, "parent": null, "vector": [1, 0, 0.0521, 0.0011, 0, 0.66, 0.4286, 181, 0, 1, 0, 0, 181, 0, 0], "semantic": {"name": "hrl_tilting_hokuyo.display_3d_mayavi", "arg_names": [], "import_names": ["d3m"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_tilting_hokuyo.display_3d_mayavi as d3m"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Import_L50_C0", "label": "segway_motion_calc import smc", "type": "import", "loc": [50, 50], "level": 0, "parent": null, "vector": [1, 0, 0.0543, 0.0011, 0, 0.66, 0.4643, 870, 0, 1, 0, 0, 870, 0, 0], "semantic": {"name": "segway_motion_calc", "arg_names": [], "import_names": ["smc"], "rhs_call_name": "", "annotation": ""}, "snippet": "import segway_motion_calc as smc"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:ClassDef_L52_C0", "label": "JointTrajectory", "type": "class", "loc": [52, 60], "level": 0, "parent": null, "vector": [3, 0, 0.0608, 0.0098, 0, 0.66, 0.5, 302, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "JointTrajectory", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class JointTrajectory():\n ''' class to store joint trajectories.\n data only - use for pickling.\n '''\n def __init__(self):\n self.time_list = [] # time in seconds\n self.q_list = [] #each element is a list of 7 joint angles.\n self.qdot_list = [] #each element is a list of 7 joint angles."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L53_C4", "label": "expression", "type": "expression", "loc": [53, 55], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:ClassDef_L52_C0", "vector": [8, 1, 0.0586, 0.0033, 1, 0.21, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' class to store joint trajectories.\n data only - use for pickling.\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L56_C4", "label": "__init__", "type": "function", "loc": [56, 60], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:ClassDef_L52_C0", "vector": [2, 1, 0.063, 0.0054, 1, 0.21, 1.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.time_list = [] # time in seconds\n self.q_list = [] #each element is a list of 7 joint angles.\n self.qdot_list = [] #each element is a list of 7 joint angles.\n self.qdotdot_list = [] #each element is a list of 7 joint angles."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L57_C8", "label": "self.time_list =", "type": "assigned_variable", "loc": [57, 57], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L56_C4", "vector": [14, 2, 0.0619, 0.0011, 2, 0.67, 0.0, 838, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.time_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.time_list = [] # time in seconds"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L58_C8", "label": "self.q_list =", "type": "assigned_variable", "loc": [58, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L56_C4", "vector": [14, 2, 0.063, 0.0011, 2, 0.67, 0.3333, 339, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.q_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.q_list = [] #each element is a list of 7 joint angles."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L59_C8", "label": "self.qdot_list =", "type": "assigned_variable", "loc": [59, 59], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L56_C4", "vector": [14, 2, 0.0641, 0.0011, 2, 0.67, 0.6667, 600, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.qdot_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.qdot_list = [] #each element is a list of 7 joint angles."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L60_C8", "label": "self.qdotdot_list =", "type": "assigned_variable", "loc": [60, 60], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L56_C4", "vector": [14, 2, 0.0651, 0.0011, 2, 0.67, 1.0, 972, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.qdotdot_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.qdotdot_list = [] #each element is a list of 7 joint angles."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:ClassDef_L64_C0", "label": "PlanarTajectory", "type": "class", "loc": [64, 69], "level": 0, "parent": null, "vector": [3, 0, 0.0722, 0.0065, 0, 0.66, 0.5357, 637, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "PlanarTajectory", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class PlanarTajectory():\n def __init__(self):\n self.time_list = [] # time in seconds\n self.x_list = []\n self.y_list = []\n self.a_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L65_C4", "label": "__init__", "type": "function", "loc": [65, 69], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:ClassDef_L64_C0", "vector": [2, 1, 0.0727, 0.0054, 1, 0.07, 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.time_list = [] # time in seconds\n self.x_list = []\n self.y_list = []\n self.a_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L66_C8", "label": "self.time_list =", "type": "assigned_variable", "loc": [66, 66], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L65_C4", "vector": [14, 2, 0.0717, 0.0011, 2, 0.78, 0.0, 838, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.time_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.time_list = [] # time in seconds"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L67_C8", "label": "self.x_list =", "type": "assigned_variable", "loc": [67, 67], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L65_C4", "vector": [14, 2, 0.0727, 0.0011, 2, 0.78, 0.3333, 885, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.x_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.x_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L68_C8", "label": "self.y_list =", "type": "assigned_variable", "loc": [68, 68], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L65_C4", "vector": [14, 2, 0.0738, 0.0011, 2, 0.78, 0.6667, 291, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.y_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.y_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L69_C8", "label": "self.a_list =", "type": "assigned_variable", "loc": [69, 69], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L65_C4", "vector": [14, 2, 0.0749, 0.0011, 2, 0.78, 1.0, 427, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.a_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.a_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:ClassDef_L71_C0", "label": "CartesianTajectory", "type": "class", "loc": [71, 78], "level": 0, "parent": null, "vector": [3, 0, 0.0809, 0.0087, 0, 0.66, 0.5714, 610, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "CartesianTajectory", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class CartesianTajectory():\n ''' class to store trajectory of cartesian points.\n data only - use for pickling\n '''\n def __init__(self):\n self.time_list = [] # time in seconds\n self.p_list = [] #each element is a list of 3 coordinates\n self.v_list = [] #each element is a list of 3 coordinates (velocity)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L72_C4", "label": "expression", "type": "expression", "loc": [72, 74], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:ClassDef_L71_C0", "vector": [8, 1, 0.0793, 0.0033, 1, 0.94, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' class to store trajectory of cartesian points.\n data only - use for pickling\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L75_C4", "label": "__init__", "type": "function", "loc": [75, 78], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:ClassDef_L71_C0", "vector": [2, 1, 0.0831, 0.0043, 1, 0.94, 1.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.time_list = [] # time in seconds\n self.p_list = [] #each element is a list of 3 coordinates\n self.v_list = [] #each element is a list of 3 coordinates (velocity)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L76_C8", "label": "self.time_list =", "type": "assigned_variable", "loc": [76, 76], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L75_C4", "vector": [14, 2, 0.0825, 0.0011, 2, 0.42, 0.0, 838, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.time_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.time_list = [] # time in seconds"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L77_C8", "label": "self.p_list =", "type": "assigned_variable", "loc": [77, 77], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L75_C4", "vector": [14, 2, 0.0836, 0.0011, 2, 0.42, 0.5, 789, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.p_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.p_list = [] #each element is a list of 3 coordinates"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L78_C8", "label": "self.v_list =", "type": "assigned_variable", "loc": [78, 78], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L75_C4", "vector": [14, 2, 0.0847, 0.0011, 2, 0.42, 1.0, 74, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.v_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.v_list = [] #each element is a list of 3 coordinates (velocity)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:ClassDef_L80_C0", "label": "ForceTrajectory", "type": "class", "loc": [80, 86], "level": 0, "parent": null, "vector": [3, 0, 0.0901, 0.0076, 0, 0.66, 0.6071, 306, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "ForceTrajectory", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ForceTrajectory():\n ''' class to store time evolution of the force at the end effector.\n data only - use for pickling\n '''\n def __init__(self):\n self.time_list = [] # time in seconds\n self.f_list = [] #each element is a list of 3 coordinates"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L81_C4", "label": "expression", "type": "expression", "loc": [81, 83], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:ClassDef_L80_C0", "vector": [8, 1, 0.089, 0.0033, 1, 0.11, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' class to store time evolution of the force at the end effector.\n data only - use for pickling\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L84_C4", "label": "__init__", "type": "function", "loc": [84, 86], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:ClassDef_L80_C0", "vector": [2, 1, 0.0923, 0.0033, 1, 0.11, 1.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.time_list = [] # time in seconds\n self.f_list = [] #each element is a list of 3 coordinates"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L85_C8", "label": "self.time_list =", "type": "assigned_variable", "loc": [85, 85], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L84_C4", "vector": [14, 2, 0.0923, 0.0011, 2, 0.16, 0.0, 838, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.time_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.time_list = [] # time in seconds"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L86_C8", "label": "self.f_list =", "type": "assigned_variable", "loc": [86, 86], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L84_C4", "vector": [14, 2, 0.0934, 0.0011, 2, 0.16, 1.0, 589, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.f_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.f_list = [] #each element is a list of 3 coordinates"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L92_C0", "label": "joint_to_cartesian", "type": "function", "loc": [92, 112], "level": 0, "parent": null, "vector": [2, 0, 0.1107, 0.0228, 0, 0.66, 0.6429, 202, 0, 1, 1, 0, 0, 0, 14], "semantic": {"name": "joint_to_cartesian", "arg_names": ["traj"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def joint_to_cartesian(traj):\n firenze = hr.M3HrlRobot(connect=False)\n pts = []\n cart_vel = []\n for i in range(len(traj.q_list)):\n q = traj.q_list[i]\n p = firenze.FK('right_arm', q)\n pts.append(p.A1.tolist())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L93_C4", "label": "firenze = M3HrlRobot()", "type": "assigned_variable", "loc": [93, 93], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L92_C0", "vector": [14, 1, 0.101, 0.0011, 1, 0.57, 0.0, 736, 3, 1, 0, 0, 305, 10, 1], "semantic": {"name": "firenze", "arg_names": [], "import_names": [], "rhs_call_name": "M3HrlRobot", "annotation": ""}, "snippet": " firenze = hr.M3HrlRobot(connect=False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L94_C4", "label": "pts =", "type": "assigned_variable", "loc": [94, 94], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L92_C0", "vector": [14, 1, 0.1021, 0.0011, 1, 0.57, 0.125, 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_99527:Assign_L95_C4", "label": "cart_vel =", "type": "assigned_variable", "loc": [95, 95], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L92_C0", "vector": [14, 1, 0.1031, 0.0011, 1, 0.57, 0.25, 848, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "cart_vel", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cart_vel = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L96_C4", "label": "for i", "type": "for", "loc": [96, 105], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L92_C0", "vector": [6, 1, 0.1091, 0.0109, 1, 0.57, 0.375, 826, 3, 0, 0, 0, 0, 0, 9], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(len(traj.q_list)):\n q = traj.q_list[i]\n p = firenze.FK('right_arm', q)\n pts.append(p.A1.tolist())\n\n if traj.qdot_list != []:\n qdot = traj.qdot_list[i]\n jac = firenze.Jac('right_arm', q)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L97_C8", "label": "q =", "type": "assigned_variable", "loc": [97, 97], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L96_C4", "vector": [14, 2, 0.1053, 0.0011, 2, 0.34, 0.0, 516, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "q", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " q = traj.q_list[i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L98_C8", "label": "p = FK()", "type": "assigned_variable", "loc": [98, 98], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L96_C4", "vector": [14, 2, 0.1064, 0.0011, 2, 0.34, 0.3333, 491, 3, 2, 0, 0, 252, 10, 1], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "FK", "annotation": ""}, "snippet": " p = firenze.FK('right_arm', q)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L99_C8", "label": "append()", "type": "expression", "loc": [99, 99], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L96_C4", "vector": [8, 2, 0.1075, 0.0011, 2, 0.34, 0.6667, 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_99527:If_L101_C8", "label": "if", "type": "if", "loc": [101, 105], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L96_C4", "vector": [4, 2, 0.1118, 0.0054, 2, 0.34, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if traj.qdot_list != []:\n qdot = traj.qdot_list[i]\n jac = firenze.Jac('right_arm', q)\n vel = jac * np.matrix(qdot).T\n cart_vel.append(vel.A1[0:3].tolist())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L102_C12", "label": "qdot =", "type": "assigned_variable", "loc": [102, 102], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L101_C8", "vector": [14, 3, 0.1107, 0.0011, 3, 0.28, 0.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "qdot", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " qdot = traj.qdot_list[i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L103_C12", "label": "jac = Jac()", "type": "assigned_variable", "loc": [103, 103], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L101_C8", "vector": [14, 3, 0.1118, 0.0011, 3, 0.28, 0.3333, 812, 3, 2, 0, 0, 115, 10, 1], "semantic": {"name": "jac", "arg_names": [], "import_names": [], "rhs_call_name": "Jac", "annotation": ""}, "snippet": " jac = firenze.Jac('right_arm', q)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L104_C12", "label": "vel =", "type": "assigned_variable", "loc": [104, 104], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L101_C8", "vector": [14, 3, 0.1129, 0.0011, 3, 0.28, 0.6667, 527, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "vel", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " vel = jac * np.matrix(qdot).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L105_C12", "label": "append()", "type": "expression", "loc": [105, 105], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L101_C8", "vector": [8, 3, 0.114, 0.0011, 3, 0.28, 1.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " cart_vel.append(vel.A1[0:3].tolist())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L107_C4", "label": "ct = CartesianTajectory()", "type": "assigned_variable", "loc": [107, 107], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L92_C0", "vector": [14, 1, 0.1162, 0.0011, 1, 0.57, 0.5, 147, 3, 0, 0, 0, 610, 10, 1], "semantic": {"name": "ct", "arg_names": [], "import_names": [], "rhs_call_name": "CartesianTajectory", "annotation": ""}, "snippet": " ct = CartesianTajectory()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L108_C4", "label": "ct.time_list = copy()", "type": "assigned_variable", "loc": [108, 108], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L92_C0", "vector": [14, 1, 0.1173, 0.0011, 1, 0.57, 0.625, 654, 3, 1, 0, 0, 739, 10, 1], "semantic": {"name": "ct.time_list", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " ct.time_list = copy.copy(traj.time_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L109_C4", "label": "ct.p_list = copy()", "type": "assigned_variable", "loc": [109, 109], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L92_C0", "vector": [14, 1, 0.1183, 0.0011, 1, 0.57, 0.75, 841, 3, 1, 0, 0, 739, 10, 1], "semantic": {"name": "ct.p_list", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " ct.p_list = copy.copy(pts)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L110_C4", "label": "ct.v_list = copy()", "type": "assigned_variable", "loc": [110, 110], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L92_C0", "vector": [14, 1, 0.1194, 0.0011, 1, 0.57, 0.875, 871, 3, 1, 0, 0, 739, 10, 1], "semantic": {"name": "ct.v_list", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " ct.v_list = copy.copy(cart_vel)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Return_L112_C4", "label": "return", "type": "return", "loc": [112, 112], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L92_C0", "vector": [13, 1, 0.1216, 0.0011, 1, 0.57, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ct"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L114_C0", "label": "plot_forces_quiver", "type": "function", "loc": [114, 130], "level": 0, "parent": null, "vector": [2, 0, 0.1325, 0.0185, 0, 0.66, 0.6786, 539, 0, 3, 0, 0, 0, 0, 10], "semantic": {"name": "plot_forces_quiver", "arg_names": ["pos_traj", "force_traj", "color"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def plot_forces_quiver(pos_traj,force_traj,color='k'):\n import arm_trajectories as at\n #if traj.__class__ == at.JointTrajectory:\n if isinstance(pos_traj,at.JointTrajectory):\n pos_traj = joint_to_cartesian(pos_traj)\n\n pts = np.matrix(pos_traj.p_list).T\n label_list = ['X coord (m)', 'Y coord (m)', 'Z coord (m)']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Import_L115_C4", "label": "arm_trajectories import at", "type": "import", "loc": [115, 115], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L114_C0", "vector": [1, 1, 0.1249, 0.0011, 1, 0.14, 0.0, 34, 0, 1, 0, 0, 34, 0, 0], "semantic": {"name": "arm_trajectories", "arg_names": [], "import_names": ["at"], "rhs_call_name": "", "annotation": ""}, "snippet": " import arm_trajectories as at"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L117_C4", "label": "if", "type": "if", "loc": [117, 118], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L114_C0", "vector": [4, 1, 0.1276, 0.0022, 1, 0.14, 0.1, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if isinstance(pos_traj,at.JointTrajectory):\n pos_traj = joint_to_cartesian(pos_traj)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L118_C8", "label": "pos_traj = joint_to_cartesian()", "type": "assigned_variable", "loc": [118, 118], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L117_C4", "vector": [14, 2, 0.1281, 0.0011, 2, 0.55, 0.0, 521, 3, 1, 0, 0, 202, 10, 1], "semantic": {"name": "pos_traj", "arg_names": [], "import_names": [], "rhs_call_name": "joint_to_cartesian", "annotation": ""}, "snippet": " pos_traj = joint_to_cartesian(pos_traj)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L120_C4", "label": "pts =", "type": "assigned_variable", "loc": [120, 120], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L114_C0", "vector": [14, 1, 0.1303, 0.0011, 1, 0.14, 0.2, 195, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "pts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pts = np.matrix(pos_traj.p_list).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L121_C4", "label": "label_list =", "type": "assigned_variable", "loc": [121, 121], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L114_C0", "vector": [14, 1, 0.1314, 0.0011, 1, 0.14, 0.3, 887, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "label_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " label_list = ['X coord (m)', 'Y coord (m)', 'Z coord (m)']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L122_C4", "label": "x = tolist()", "type": "assigned_variable", "loc": [122, 122], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L114_C0", "vector": [14, 1, 0.1325, 0.0011, 1, 0.14, 0.4, 190, 3, 0, 0, 0, 185, 10, 1], "semantic": {"name": "x", "arg_names": [], "import_names": [], "rhs_call_name": "tolist", "annotation": ""}, "snippet": " x = pts[0,:].A1.tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L123_C4", "label": "y = tolist()", "type": "assigned_variable", "loc": [123, 123], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L114_C0", "vector": [14, 1, 0.1336, 0.0011, 1, 0.14, 0.5, 304, 3, 0, 0, 0, 185, 10, 1], "semantic": {"name": "y", "arg_names": [], "import_names": [], "rhs_call_name": "tolist", "annotation": ""}, "snippet": " y = pts[1,:].A1.tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L125_C4", "label": "forces =", "type": "assigned_variable", "loc": [125, 125], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L114_C0", "vector": [14, 1, 0.1357, 0.0011, 1, 0.14, 0.6, 817, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "forces", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " forces = np.matrix(force_traj.f_list).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L126_C4", "label": "u = tolist()", "type": "assigned_variable", "loc": [126, 126], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L114_C0", "vector": [14, 1, 0.1368, 0.0011, 1, 0.14, 0.7, 609, 3, 0, 0, 0, 185, 10, 1], "semantic": {"name": "u", "arg_names": [], "import_names": [], "rhs_call_name": "tolist", "annotation": ""}, "snippet": " u = (-1*forces[0,:]).A1.tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L127_C4", "label": "v = tolist()", "type": "assigned_variable", "loc": [127, 127], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L114_C0", "vector": [14, 1, 0.1379, 0.0011, 1, 0.14, 0.8, 553, 3, 0, 0, 0, 185, 10, 1], "semantic": {"name": "v", "arg_names": [], "import_names": [], "rhs_call_name": "tolist", "annotation": ""}, "snippet": " v = (-1*forces[1,:]).A1.tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L128_C4", "label": "quiver()", "type": "expression", "loc": [128, 128], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L114_C0", "vector": [8, 1, 0.139, 0.0011, 1, 0.14, 0.9, 649, 3, 7, 0, 0, 0, 0, 1], "semantic": {"name": "quiver", "arg_names": [], "import_names": [], "rhs_call_name": "quiver", "annotation": ""}, "snippet": " pl.quiver(x,y,u,v,width=0.002,color=color,scale=100.0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L130_C4", "label": "axis()", "type": "expression", "loc": [130, 130], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L114_C0", "vector": [8, 1, 0.1412, 0.0011, 1, 0.14, 1.0, 860, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "axis", "arg_names": [], "import_names": [], "rhs_call_name": "axis", "annotation": ""}, "snippet": " pl.axis('equal')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L135_C0", "label": "plot_cartesian", "type": "function", "loc": [135, 182], "level": 0, "parent": null, "vector": [2, 0, 0.1721, 0.0521, 0, 0.66, 0.7143, 991, 0, 9, 0, 0, 0, 0, 24], "semantic": {"name": "plot_cartesian", "arg_names": ["traj", "xaxis", "yaxis", "zaxis", "color", "label", "linewidth", "scatter_size", "plot_velocity"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def plot_cartesian(traj, xaxis=None, yaxis=None, zaxis=None, color='b',label='_nolegend_',\n linewidth=2, scatter_size=10, plot_velocity=False):\n\n import arm_trajectories as at\n #if traj.__class__ == at.JointTrajectory:\n if isinstance(traj,at.JointTrajectory):\n traj = joint_to_cartesian(traj)\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Import_L138_C4", "label": "arm_trajectories import at", "type": "import", "loc": [138, 138], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L135_C0", "vector": [1, 1, 0.1498, 0.0011, 1, 0.23, 0.0, 34, 0, 1, 0, 0, 34, 0, 0], "semantic": {"name": "arm_trajectories", "arg_names": [], "import_names": ["at"], "rhs_call_name": "", "annotation": ""}, "snippet": " import arm_trajectories as at"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L140_C4", "label": "if", "type": "if", "loc": [140, 141], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L135_C0", "vector": [4, 1, 0.1526, 0.0022, 1, 0.23, 0.1429, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if isinstance(traj,at.JointTrajectory):\n traj = joint_to_cartesian(traj)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L141_C8", "label": "traj = joint_to_cartesian()", "type": "assigned_variable", "loc": [141, 141], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L140_C4", "vector": [14, 2, 0.1531, 0.0011, 2, 0.79, 0.0, 742, 3, 1, 0, 0, 202, 10, 1], "semantic": {"name": "traj", "arg_names": [], "import_names": [], "rhs_call_name": "joint_to_cartesian", "annotation": ""}, "snippet": " traj = joint_to_cartesian(traj)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L143_C4", "label": "pts =", "type": "assigned_variable", "loc": [143, 143], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L135_C0", "vector": [14, 1, 0.1553, 0.0011, 1, 0.23, 0.2857, 195, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "pts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pts = np.matrix(traj.p_list).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L144_C4", "label": "label_list =", "type": "assigned_variable", "loc": [144, 144], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L135_C0", "vector": [14, 1, 0.1564, 0.0011, 1, 0.23, 0.4286, 887, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "label_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " label_list = ['X coord (m)', 'Y coord (m)', 'Z coord (m)']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L145_C4", "label": "x = tolist()", "type": "assigned_variable", "loc": [145, 145], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L135_C0", "vector": [14, 1, 0.1574, 0.0011, 1, 0.23, 0.5714, 190, 3, 0, 0, 0, 185, 10, 1], "semantic": {"name": "x", "arg_names": [], "import_names": [], "rhs_call_name": "tolist", "annotation": ""}, "snippet": " x = pts[xaxis,:].A1.tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L146_C4", "label": "y = tolist()", "type": "assigned_variable", "loc": [146, 146], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L135_C0", "vector": [14, 1, 0.1585, 0.0011, 1, 0.23, 0.7143, 304, 3, 0, 0, 0, 185, 10, 1], "semantic": {"name": "y", "arg_names": [], "import_names": [], "rhs_call_name": "tolist", "annotation": ""}, "snippet": " y = pts[yaxis,:].A1.tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L148_C4", "label": "if", "type": "if", "loc": [148, 151], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L135_C0", "vector": [4, 1, 0.1623, 0.0043, 1, 0.23, 0.8571, 0, 2, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if plot_velocity:\n vels = np.matrix(traj.v_list).T\n xvel = vels[xaxis,:].A1.tolist()\n yvel = vels[yaxis,:].A1.tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L149_C8", "label": "vels =", "type": "assigned_variable", "loc": [149, 149], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L148_C4", "vector": [14, 2, 0.1618, 0.0011, 2, 0.97, 0.0, 813, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "vels", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " vels = np.matrix(traj.v_list).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L150_C8", "label": "xvel = tolist()", "type": "assigned_variable", "loc": [150, 150], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L148_C4", "vector": [14, 2, 0.1629, 0.0011, 2, 0.97, 0.5, 984, 3, 0, 0, 0, 185, 10, 1], "semantic": {"name": "xvel", "arg_names": [], "import_names": [], "rhs_call_name": "tolist", "annotation": ""}, "snippet": " xvel = vels[xaxis,:].A1.tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L151_C8", "label": "yvel = tolist()", "type": "assigned_variable", "loc": [151, 151], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L148_C4", "vector": [14, 2, 0.164, 0.0011, 2, 0.97, 1.0, 335, 3, 0, 0, 0, 185, 10, 1], "semantic": {"name": "yvel", "arg_names": [], "import_names": [], "rhs_call_name": "tolist", "annotation": ""}, "snippet": " yvel = vels[yaxis,:].A1.tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L153_C4", "label": "if", "type": "if", "loc": [153, 182], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L135_C0", "vector": [4, 1, 0.1819, 0.0326, 1, 0.23, 1.0, 0, 0, 0, 0, 0, 0, 0, 16], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if zaxis == None:\n mpu.plot_yx(y, x, color, linewidth, '-', scatter_size, label,\n axis = 'equal', xlabel = label_list[xaxis],\n ylabel = label_list[yaxis],)\n if plot_velocity:\n mpu.plot_quiver_yxv(y, x, np.matrix([xvel,yvel]),\n width = 0.001, scale = 1.)\n mpu.legend()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L154_C8", "label": "plot_yx()", "type": "expression", "loc": [154, 156], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L153_C4", "vector": [8, 2, 0.1683, 0.0033, 2, 0.06, 0.0, 112, 3, 10, 0, 0, 0, 0, 1], "semantic": {"name": "plot_yx", "arg_names": [], "import_names": [], "rhs_call_name": "plot_yx", "annotation": ""}, "snippet": " mpu.plot_yx(y, x, color, linewidth, '-', scatter_size, label,\n axis = 'equal', xlabel = label_list[xaxis],\n ylabel = label_list[yaxis],)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L157_C8", "label": "if", "type": "if", "loc": [157, 159], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L153_C4", "vector": [4, 2, 0.1716, 0.0033, 2, 0.06, 0.0526, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if plot_velocity:\n mpu.plot_quiver_yxv(y, x, np.matrix([xvel,yvel]),\n width = 0.001, scale = 1.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L158_C12", "label": "plot_quiver_yxv()", "type": "expression", "loc": [158, 159], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L157_C8", "vector": [8, 3, 0.1721, 0.0022, 3, 0.17, 0.0, 776, 3, 5, 0, 0, 0, 0, 2], "semantic": {"name": "plot_quiver_yxv", "arg_names": [], "import_names": [], "rhs_call_name": "plot_quiver_yxv", "annotation": ""}, "snippet": " mpu.plot_quiver_yxv(y, x, np.matrix([xvel,yvel]),\n width = 0.001, scale = 1.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L160_C8", "label": "legend()", "type": "expression", "loc": [160, 160], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L153_C4", "vector": [8, 2, 0.1737, 0.0011, 2, 0.06, 0.1053, 880, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "legend", "arg_names": [], "import_names": [], "rhs_call_name": "legend", "annotation": ""}, "snippet": " mpu.legend()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:ImportFrom_L162_C8", "label": "from numpy import array", "type": "import", "loc": [162, 162], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L153_C4", "vector": [1, 2, 0.1759, 0.0011, 2, 0.06, 0.1579, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["array"], "rhs_call_name": "", "annotation": ""}, "snippet": " from numpy import array"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:ImportFrom_L163_C8", "label": "from enthought.mayavi.api import Engine", "type": "import", "loc": [163, 163], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L153_C4", "vector": [1, 2, 0.177, 0.0011, 2, 0.06, 0.2105, 111, 0, 1, 0, 0, 111, 0, 0], "semantic": {"name": "enthought.mayavi.api", "arg_names": [], "import_names": ["Engine"], "rhs_call_name": "", "annotation": ""}, "snippet": " from enthought.mayavi.api import Engine"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L164_C8", "label": "engine = Engine()", "type": "assigned_variable", "loc": [164, 164], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L153_C4", "vector": [14, 2, 0.1781, 0.0011, 2, 0.06, 0.2632, 3, 3, 0, 0, 0, 298, 10, 1], "semantic": {"name": "engine", "arg_names": [], "import_names": [], "rhs_call_name": "Engine", "annotation": ""}, "snippet": " engine = Engine()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L165_C8", "label": "start()", "type": "expression", "loc": [165, 165], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L153_C4", "vector": [8, 2, 0.1792, 0.0011, 2, 0.06, 0.3158, 511, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "start", "arg_names": [], "import_names": [], "rhs_call_name": "start", "annotation": ""}, "snippet": " engine.start()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L166_C8", "label": "if", "type": "if", "loc": [166, 167], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L153_C4", "vector": [4, 2, 0.1808, 0.0022, 2, 0.06, 0.3684, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(engine.scenes) == 0:\n engine.new_scene()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L167_C12", "label": "new_scene()", "type": "expression", "loc": [167, 167], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L166_C8", "vector": [8, 3, 0.1813, 0.0011, 3, 0.22, 0.0, 16, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "new_scene", "arg_names": [], "import_names": [], "rhs_call_name": "new_scene", "annotation": ""}, "snippet": " engine.new_scene()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L169_C8", "label": "z = tolist()", "type": "assigned_variable", "loc": [169, 169], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L153_C4", "vector": [14, 2, 0.1835, 0.0011, 2, 0.06, 0.4211, 859, 3, 0, 0, 0, 185, 10, 1], "semantic": {"name": "z", "arg_names": [], "import_names": [], "rhs_call_name": "tolist", "annotation": ""}, "snippet": " z = pts[zaxis,:].A1.tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L170_C8", "label": "time_list =", "type": "assigned_variable", "loc": [170, 170], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L153_C4", "vector": [14, 2, 0.1846, 0.0011, 2, 0.06, 0.4737, 941, 5, 0, 0, 0, 0, 0, 0], "semantic": {"name": "time_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " time_list = [t-traj.time_list[0] for t in traj.time_list]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L171_C8", "label": "plot3d()", "type": "expression", "loc": [171, 171], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L153_C4", "vector": [8, 2, 0.1857, 0.0011, 2, 0.06, 0.5263, 290, 3, 6, 0, 0, 0, 0, 1], "semantic": {"name": "plot3d", "arg_names": [], "import_names": [], "rhs_call_name": "plot3d", "annotation": ""}, "snippet": " mlab.plot3d(x,y,z,time_list,tube_radius=None,line_width=4)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L172_C8", "label": "axes()", "type": "expression", "loc": [172, 172], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L153_C4", "vector": [8, 2, 0.1868, 0.0011, 2, 0.06, 0.5789, 590, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "axes", "arg_names": [], "import_names": [], "rhs_call_name": "axes", "annotation": ""}, "snippet": " mlab.axes()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L173_C8", "label": "xlabel()", "type": "expression", "loc": [173, 173], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L153_C4", "vector": [8, 2, 0.1878, 0.0011, 2, 0.06, 0.6316, 676, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "xlabel", "arg_names": [], "import_names": [], "rhs_call_name": "xlabel", "annotation": ""}, "snippet": " mlab.xlabel(label_list[xaxis])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L174_C8", "label": "ylabel()", "type": "expression", "loc": [174, 174], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L153_C4", "vector": [8, 2, 0.1889, 0.0011, 2, 0.06, 0.6842, 584, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "ylabel", "arg_names": [], "import_names": [], "rhs_call_name": "ylabel", "annotation": ""}, "snippet": " mlab.ylabel(label_list[yaxis])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L175_C8", "label": "zlabel()", "type": "expression", "loc": [175, 175], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L153_C4", "vector": [8, 2, 0.19, 0.0011, 2, 0.06, 0.7368, 557, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "zlabel", "arg_names": [], "import_names": [], "rhs_call_name": "zlabel", "annotation": ""}, "snippet": " mlab.zlabel(label_list[zaxis])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L176_C8", "label": "colorbar()", "type": "expression", "loc": [176, 176], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L153_C4", "vector": [8, 2, 0.1911, 0.0011, 2, 0.06, 0.7895, 915, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "colorbar", "arg_names": [], "import_names": [], "rhs_call_name": "colorbar", "annotation": ""}, "snippet": " mlab.colorbar(title='Time')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L179_C8", "label": "axes =", "type": "assigned_variable", "loc": [179, 179], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L153_C4", "vector": [14, 2, 0.1944, 0.0011, 2, 0.06, 0.8421, 590, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "axes", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " axes = engine.scenes[0].children[0].children[0].children[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L180_C8", "label": "axes.axes.position = array()", "type": "assigned_variable", "loc": [180, 180], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L153_C4", "vector": [14, 2, 0.1954, 0.0011, 2, 0.06, 0.8947, 929, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "axes.axes.position", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " axes.axes.position = array([ 0., 0.])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L181_C8", "label": "axes.axes.label_format =", "type": "assigned_variable", "loc": [181, 181], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L153_C4", "vector": [14, 2, 0.1965, 0.0011, 2, 0.06, 0.9474, 354, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "axes.axes.label_format", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " axes.axes.label_format = '%-#6.2g'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L182_C8", "label": "axes.title_text_property.font_size =", "type": "assigned_variable", "loc": [182, 182], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L153_C4", "vector": [14, 2, 0.1976, 0.0011, 2, 0.06, 1.0, 699, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "axes.title_text_property.font_size", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " axes.title_text_property.font_size=4"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L190_C0", "label": "compute_forces", "type": "function", "loc": [190, 237], "level": 0, "parent": null, "vector": [2, 0, 0.2318, 0.0521, 0, 0.66, 0.75, 761, 0, 4, 1, 0, 0, 0, 35], "semantic": {"name": "compute_forces", "arg_names": ["q_actual_traj", "q_eq_traj", "torque_traj", "rel_stiffness_list"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def compute_forces(q_actual_traj,q_eq_traj,torque_traj,rel_stiffness_list):\n firenze = hr.M3HrlRobot(connect=False)\n\n d_gains_list_mN_deg_sec = [-100,-120,-15,-25,-1.25]\n d_gains_list = [180./1000.*s/math.pi for s in d_gains_list_mN_deg_sec]\n\n stiff_list_mNm_deg = [1800,1300,350,600,60]\n stiff_list_Nm_rad = [180./1000.*s/math.pi for s in stiff_list_mNm_deg]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L191_C4", "label": "firenze = M3HrlRobot()", "type": "assigned_variable", "loc": [191, 191], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L190_C0", "vector": [14, 1, 0.2074, 0.0011, 1, 0.75, 0.0, 736, 3, 1, 0, 0, 305, 10, 1], "semantic": {"name": "firenze", "arg_names": [], "import_names": [], "rhs_call_name": "M3HrlRobot", "annotation": ""}, "snippet": " firenze = hr.M3HrlRobot(connect=False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L193_C4", "label": "d_gains_list_mN_deg_sec =", "type": "assigned_variable", "loc": [193, 193], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L190_C0", "vector": [14, 1, 0.2096, 0.0011, 1, 0.75, 0.0625, 995, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "d_gains_list_mN_deg_sec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " d_gains_list_mN_deg_sec = [-100,-120,-15,-25,-1.25]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L194_C4", "label": "d_gains_list =", "type": "assigned_variable", "loc": [194, 194], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L190_C0", "vector": [14, 1, 0.2106, 0.0011, 1, 0.75, 0.125, 818, 5, 0, 0, 0, 0, 0, 0], "semantic": {"name": "d_gains_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " d_gains_list = [180./1000.*s/math.pi for s in d_gains_list_mN_deg_sec]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L196_C4", "label": "stiff_list_mNm_deg =", "type": "assigned_variable", "loc": [196, 196], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L190_C0", "vector": [14, 1, 0.2128, 0.0011, 1, 0.75, 0.1875, 301, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "stiff_list_mNm_deg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " stiff_list_mNm_deg = [1800,1300,350,600,60]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L197_C4", "label": "stiff_list_Nm_rad =", "type": "assigned_variable", "loc": [197, 197], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L190_C0", "vector": [14, 1, 0.2139, 0.0011, 1, 0.75, 0.25, 759, 5, 0, 0, 0, 0, 0, 0], "semantic": {"name": "stiff_list_Nm_rad", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " stiff_list_Nm_rad = [180./1000.*s/math.pi for s in stiff_list_mNm_deg]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L200_C4", "label": "dia =", "type": "assigned_variable", "loc": [200, 200], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L190_C0", "vector": [14, 1, 0.2172, 0.0011, 1, 0.75, 0.3125, 197, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "dia", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " dia = np.array(rel_stiffness_list) * np.array(stiff_list_Nm_rad)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L201_C4", "label": "k_q = matrix()", "type": "assigned_variable", "loc": [201, 201], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L190_C0", "vector": [14, 1, 0.2182, 0.0011, 1, 0.75, 0.375, 608, 3, 1, 0, 0, 162, 10, 2], "semantic": {"name": "k_q", "arg_names": [], "import_names": [], "rhs_call_name": "matrix", "annotation": ""}, "snippet": " k_q = np.matrix(np.diag(dia))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L202_C4", "label": "dia_inv =", "type": "assigned_variable", "loc": [202, 202], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L190_C0", "vector": [14, 1, 0.2193, 0.0011, 1, 0.75, 0.4375, 822, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "dia_inv", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " dia_inv = 1./dia"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L203_C4", "label": "k_q_inv = matrix()", "type": "assigned_variable", "loc": [203, 203], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L190_C0", "vector": [14, 1, 0.2204, 0.0011, 1, 0.75, 0.5, 181, 3, 1, 0, 0, 162, 10, 2], "semantic": {"name": "k_q_inv", "arg_names": [], "import_names": [], "rhs_call_name": "matrix", "annotation": ""}, "snippet": " k_q_inv = np.matrix(np.diag(dia_inv))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L205_C4", "label": "actual_cart = joint_to_cartesian()", "type": "assigned_variable", "loc": [205, 205], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L190_C0", "vector": [14, 1, 0.2226, 0.0011, 1, 0.75, 0.5625, 950, 3, 1, 0, 0, 202, 10, 1], "semantic": {"name": "actual_cart", "arg_names": [], "import_names": [], "rhs_call_name": "joint_to_cartesian", "annotation": ""}, "snippet": " actual_cart = joint_to_cartesian(q_actual_traj)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L206_C4", "label": "eq_cart = joint_to_cartesian()", "type": "assigned_variable", "loc": [206, 206], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L190_C0", "vector": [14, 1, 0.2237, 0.0011, 1, 0.75, 0.625, 945, 3, 1, 0, 0, 202, 10, 1], "semantic": {"name": "eq_cart", "arg_names": [], "import_names": [], "rhs_call_name": "joint_to_cartesian", "annotation": ""}, "snippet": " eq_cart = joint_to_cartesian(q_eq_traj)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L207_C4", "label": "force_traj_jacinv = ForceTrajectory()", "type": "assigned_variable", "loc": [207, 207], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L190_C0", "vector": [14, 1, 0.2248, 0.0011, 1, 0.75, 0.6875, 812, 3, 0, 0, 0, 306, 10, 1], "semantic": {"name": "force_traj_jacinv", "arg_names": [], "import_names": [], "rhs_call_name": "ForceTrajectory", "annotation": ""}, "snippet": " force_traj_jacinv = ForceTrajectory()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L208_C4", "label": "force_traj_stiff = ForceTrajectory()", "type": "assigned_variable", "loc": [208, 208], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L190_C0", "vector": [14, 1, 0.2258, 0.0011, 1, 0.75, 0.75, 242, 3, 0, 0, 0, 306, 10, 1], "semantic": {"name": "force_traj_stiff", "arg_names": [], "import_names": [], "rhs_call_name": "ForceTrajectory", "annotation": ""}, "snippet": " force_traj_stiff = ForceTrajectory()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L209_C4", "label": "force_traj_torque = ForceTrajectory()", "type": "assigned_variable", "loc": [209, 209], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L190_C0", "vector": [14, 1, 0.2269, 0.0011, 1, 0.75, 0.8125, 577, 3, 0, 0, 0, 306, 10, 1], "semantic": {"name": "force_traj_torque", "arg_names": [], "import_names": [], "rhs_call_name": "ForceTrajectory", "annotation": ""}, "snippet": " force_traj_torque = ForceTrajectory()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L211_C4", "label": "k_cart_list =", "type": "assigned_variable", "loc": [211, 211], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L190_C0", "vector": [14, 1, 0.2291, 0.0011, 1, 0.75, 0.875, 858, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "k_cart_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " k_cart_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L213_C4", "label": "for q_actual, q_dot, q_eq, actual_pos, eq_pos, t, tau_m", "type": "for", "loc": [213, 235], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L190_C0", "vector": [6, 1, 0.2432, 0.025, 1, 0.75, 0.9375, 854, 3, 0, 0, 0, 0, 0, 23], "semantic": {"name": "q_actual, q_dot, q_eq, actual_pos, eq_pos, t, tau_m", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for q_actual,q_dot,q_eq,actual_pos,eq_pos,t,tau_m in zip(q_actual_traj.q_list,q_actual_traj.qdot_list,q_eq_traj.q_list,actual_cart.p_list,eq_cart.p_list,q_actual_traj.time_list,torque_traj.q_list):\n q_eq = firenze.clamp_to_physical_joint_limits('right_arm',q_eq)\n q_delta = np.matrix(q_actual).T - np.matrix(q_eq).T\n tau = k_q * q_delta[0:5,0] - np.matrix(np.array(d_gains_list)*np.array(q_dot)[0:5]).T\n\n x_delta = np.matrix(actual_pos).T - np.matrix(eq_pos).T\n\n jac_full = firenze.Jac('right_arm',q_actual)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L214_C8", "label": "q_eq = clamp_to_physical_joint_limits()", "type": "assigned_variable", "loc": [214, 214], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L213_C4", "vector": [14, 2, 0.2324, 0.0011, 2, 0.94, 0.0, 498, 3, 2, 0, 0, 68, 10, 1], "semantic": {"name": "q_eq", "arg_names": [], "import_names": [], "rhs_call_name": "clamp_to_physical_joint_limits", "annotation": ""}, "snippet": " q_eq = firenze.clamp_to_physical_joint_limits('right_arm',q_eq)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L215_C8", "label": "q_delta =", "type": "assigned_variable", "loc": [215, 215], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L213_C4", "vector": [14, 2, 0.2334, 0.0011, 2, 0.94, 0.0667, 607, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "q_delta", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " q_delta = np.matrix(q_actual).T - np.matrix(q_eq).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L216_C8", "label": "tau =", "type": "assigned_variable", "loc": [216, 216], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L213_C4", "vector": [14, 2, 0.2345, 0.0011, 2, 0.94, 0.1333, 329, 4, 0, 0, 0, 0, 0, 3], "semantic": {"name": "tau", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tau = k_q * q_delta[0:5,0] - np.matrix(np.array(d_gains_list)*np.array(q_dot)[0:5]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L218_C8", "label": "x_delta =", "type": "assigned_variable", "loc": [218, 218], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L213_C4", "vector": [14, 2, 0.2367, 0.0011, 2, 0.94, 0.2, 688, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "x_delta", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " x_delta = np.matrix(actual_pos).T - np.matrix(eq_pos).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L220_C8", "label": "jac_full = Jac()", "type": "assigned_variable", "loc": [220, 220], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L213_C4", "vector": [14, 2, 0.2389, 0.0011, 2, 0.94, 0.2667, 250, 3, 2, 0, 0, 115, 10, 1], "semantic": {"name": "jac_full", "arg_names": [], "import_names": [], "rhs_call_name": "Jac", "annotation": ""}, "snippet": " jac_full = firenze.Jac('right_arm',q_actual)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L221_C8", "label": "jac =", "type": "assigned_variable", "loc": [221, 221], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L213_C4", "vector": [14, 2, 0.24, 0.0011, 2, 0.94, 0.3333, 812, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "jac", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " jac = jac_full[0:3,0:5]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L223_C8", "label": "jac_full_eq = Jac()", "type": "assigned_variable", "loc": [223, 223], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L213_C4", "vector": [14, 2, 0.2421, 0.0011, 2, 0.94, 0.4, 376, 3, 2, 0, 0, 115, 10, 1], "semantic": {"name": "jac_full_eq", "arg_names": [], "import_names": [], "rhs_call_name": "Jac", "annotation": ""}, "snippet": " jac_full_eq = firenze.Jac('right_arm',q_eq)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L224_C8", "label": "jac_eq =", "type": "assigned_variable", "loc": [224, 224], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L213_C4", "vector": [14, 2, 0.2432, 0.0011, 2, 0.94, 0.4667, 894, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "jac_eq", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " jac_eq = jac_full_eq[0:3,0:5]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L225_C8", "label": "k_cart = inv()", "type": "assigned_variable", "loc": [225, 225], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L213_C4", "vector": [14, 2, 0.2443, 0.0011, 2, 0.94, 0.5333, 784, 3, 1, 0, 0, 761, 10, 1], "semantic": {"name": "k_cart", "arg_names": [], "import_names": [], "rhs_call_name": "inv", "annotation": ""}, "snippet": " k_cart = np.linalg.inv((jac_eq*k_q_inv*jac_eq.T)) # calculating stiff matrix using Jacobian for eq pt."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L226_C8", "label": "append()", "type": "expression", "loc": [226, 226], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L213_C4", "vector": [8, 2, 0.2454, 0.0011, 2, 0.94, 0.6, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " k_cart_list.append(k_cart)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L228_C8", "label": "pseudo_inv_jac =", "type": "assigned_variable", "loc": [228, 228], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L213_C4", "vector": [14, 2, 0.2476, 0.0011, 2, 0.94, 0.6667, 310, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "pseudo_inv_jac", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pseudo_inv_jac = np.linalg.inv(jac_full*jac_full.T)*jac_full"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L230_C8", "label": "tau_full = row_stack()", "type": "assigned_variable", "loc": [230, 230], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L213_C4", "vector": [14, 2, 0.2497, 0.0011, 2, 0.94, 0.7333, 389, 3, 1, 0, 0, 612, 10, 2], "semantic": {"name": "tau_full", "arg_names": [], "import_names": [], "rhs_call_name": "row_stack", "annotation": ""}, "snippet": " tau_full = np.row_stack((tau,np.matrix(tau_m[5:7]).T))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L232_C8", "label": "force =", "type": "assigned_variable", "loc": [232, 232], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L213_C4", "vector": [14, 2, 0.2519, 0.0011, 2, 0.94, 0.8, 77, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "force", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " force = -1*pseudo_inv_jac[0:3,0:5]*tau"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L233_C8", "label": "append()", "type": "expression", "loc": [233, 233], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L213_C4", "vector": [8, 2, 0.253, 0.0011, 2, 0.94, 0.8667, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " force_traj_jacinv.f_list.append(force.A1.tolist())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L234_C8", "label": "append()", "type": "expression", "loc": [234, 234], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L213_C4", "vector": [8, 2, 0.2541, 0.0011, 2, 0.94, 0.9333, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " force_traj_stiff.f_list.append((k_cart*x_delta).A1.tolist())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L235_C8", "label": "append()", "type": "expression", "loc": [235, 235], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L213_C4", "vector": [8, 2, 0.2552, 0.0011, 2, 0.94, 1.0, 243, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " force_traj_torque.f_list.append((pseudo_inv_jac*np.matrix(tau_m).T)[0:3].A1.tolist())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Return_L237_C4", "label": "return", "type": "return", "loc": [237, 237], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L190_C0", "vector": [13, 1, 0.2573, 0.0011, 1, 0.75, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return force_traj_jacinv,force_traj_stiff,force_traj_torque,k_cart_list"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L245_C0", "label": "compute_radial_tangential_forces", "type": "function", "loc": [245, 257], "level": 0, "parent": null, "vector": [2, 0, 0.2725, 0.0141, 0, 0.66, 0.7857, 224, 0, 4, 1, 0, 0, 0, 9], "semantic": {"name": "compute_radial_tangential_forces", "arg_names": ["f_list", "p_list", "cx", "cy"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def compute_radial_tangential_forces(f_list,p_list,cx,cy):\n f_rad_l,f_tan_l = [],[]\n for f,p in zip(f_list,p_list):\n rad_vec = np.array([p[0]-cx,p[1]-cy])\n rad_vec = rad_vec/np.linalg.norm(rad_vec)\n f_vec = np.array([f[0],f[1]])\n f_rad_mag = np.dot(f_vec,rad_vec)\n f_tan_mag = np.linalg.norm(f_vec-rad_vec*f_rad_mag)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L246_C4", "label": "f_rad_l, f_tan_l =", "type": "assigned_variable", "loc": [246, 246], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L245_C0", "vector": [14, 1, 0.2671, 0.0011, 1, 0.33, 0.0, 127, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "f_rad_l, f_tan_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " f_rad_l,f_tan_l = [],[]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L247_C4", "label": "for f, p", "type": "for", "loc": [247, 255], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L245_C0", "vector": [6, 1, 0.2725, 0.0098, 1, 0.33, 0.5, 749, 3, 0, 0, 0, 0, 0, 9], "semantic": {"name": "f, p", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for f,p in zip(f_list,p_list):\n rad_vec = np.array([p[0]-cx,p[1]-cy])\n rad_vec = rad_vec/np.linalg.norm(rad_vec)\n f_vec = np.array([f[0],f[1]])\n f_rad_mag = np.dot(f_vec,rad_vec)\n f_tan_mag = np.linalg.norm(f_vec-rad_vec*f_rad_mag)\n f_rad_mag = abs(f_rad_mag)\n f_rad_l.append(f_rad_mag)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L248_C8", "label": "rad_vec = array()", "type": "assigned_variable", "loc": [248, 248], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L247_C4", "vector": [14, 2, 0.2693, 0.0011, 2, 0.19, 0.0, 331, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "rad_vec", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " rad_vec = np.array([p[0]-cx,p[1]-cy])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L249_C8", "label": "rad_vec =", "type": "assigned_variable", "loc": [249, 249], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L247_C4", "vector": [14, 2, 0.2704, 0.0011, 2, 0.19, 0.1429, 331, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "rad_vec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rad_vec = rad_vec/np.linalg.norm(rad_vec)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L250_C8", "label": "f_vec = array()", "type": "assigned_variable", "loc": [250, 250], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L247_C4", "vector": [14, 2, 0.2714, 0.0011, 2, 0.19, 0.2857, 231, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "f_vec", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " f_vec = np.array([f[0],f[1]])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L251_C8", "label": "f_rad_mag = dot()", "type": "assigned_variable", "loc": [251, 251], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L247_C4", "vector": [14, 2, 0.2725, 0.0011, 2, 0.19, 0.4286, 421, 3, 2, 0, 0, 310, 10, 1], "semantic": {"name": "f_rad_mag", "arg_names": [], "import_names": [], "rhs_call_name": "dot", "annotation": ""}, "snippet": " f_rad_mag = np.dot(f_vec,rad_vec)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L252_C8", "label": "f_tan_mag = norm()", "type": "assigned_variable", "loc": [252, 252], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L247_C4", "vector": [14, 2, 0.2736, 0.0011, 2, 0.19, 0.5714, 345, 3, 1, 0, 0, 902, 10, 1], "semantic": {"name": "f_tan_mag", "arg_names": [], "import_names": [], "rhs_call_name": "norm", "annotation": ""}, "snippet": " f_tan_mag = np.linalg.norm(f_vec-rad_vec*f_rad_mag)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L253_C8", "label": "f_rad_mag = abs()", "type": "assigned_variable", "loc": [253, 253], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L247_C4", "vector": [14, 2, 0.2747, 0.0011, 2, 0.19, 0.7143, 421, 3, 1, 0, 0, 799, 10, 1], "semantic": {"name": "f_rad_mag", "arg_names": [], "import_names": [], "rhs_call_name": "abs", "annotation": ""}, "snippet": " f_rad_mag = abs(f_rad_mag)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L254_C8", "label": "append()", "type": "expression", "loc": [254, 254], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L247_C4", "vector": [8, 2, 0.2758, 0.0011, 2, 0.19, 0.8571, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " f_rad_l.append(f_rad_mag)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L255_C8", "label": "append()", "type": "expression", "loc": [255, 255], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L247_C4", "vector": [8, 2, 0.2769, 0.0011, 2, 0.19, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " f_tan_l.append(f_tan_mag)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Return_L257_C4", "label": "return", "type": "return", "loc": [257, 257], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L245_C0", "vector": [13, 1, 0.279, 0.0011, 1, 0.33, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return f_rad_l,f_tan_l"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L269_C0", "label": "fit_circle", "type": "function", "loc": [269, 305], "level": 0, "parent": null, "vector": [2, 0, 0.3116, 0.0402, 0, 0.66, 0.8214, 441, 0, 6, 1, 0, 0, 0, 9], "semantic": {"name": "fit_circle", "arg_names": ["rad_guess", "x_guess", "y_guess", "pts", "method", "verbose"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def fit_circle(rad_guess,x_guess,y_guess,pts,method,verbose=True):\n def error_function(params):\n center = np.matrix((params[0],params[1])).T\n rad = params[2]\n #print 'pts.shape', pts.shape\n #print 'center.shape', center.shape\n #print 'ut.norm(pts-center).shape',ut.norm(pts-center).shape\n err = ut.norm(pts-center).A1 - rad"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L270_C4", "label": "error_function", "type": "function", "loc": [270, 278], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L269_C0", "vector": [2, 1, 0.2975, 0.0098, 1, 0.65, 0.0, 875, 0, 1, 1, 0, 0, 0, 3], "semantic": {"name": "error_function", "arg_names": ["params"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def error_function(params):\n center = np.matrix((params[0],params[1])).T\n rad = params[2]\n #print 'pts.shape', pts.shape\n #print 'center.shape', center.shape\n #print 'ut.norm(pts-center).shape',ut.norm(pts-center).shape\n err = ut.norm(pts-center).A1 - rad\n res = np.dot(err,err)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L271_C8", "label": "center =", "type": "assigned_variable", "loc": [271, 271], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L270_C4", "vector": [14, 2, 0.2942, 0.0011, 2, 0.23, 0.0, 546, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "center", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " center = np.matrix((params[0],params[1])).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L272_C8", "label": "rad =", "type": "assigned_variable", "loc": [272, 272], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L270_C4", "vector": [14, 2, 0.2953, 0.0011, 2, 0.23, 0.25, 439, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "rad", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rad = params[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L276_C8", "label": "err =", "type": "assigned_variable", "loc": [276, 276], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L270_C4", "vector": [14, 2, 0.2997, 0.0011, 2, 0.23, 0.5, 541, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "err", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " err = ut.norm(pts-center).A1 - rad"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L277_C8", "label": "res = dot()", "type": "assigned_variable", "loc": [277, 277], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L270_C4", "vector": [14, 2, 0.3008, 0.0011, 2, 0.23, 0.75, 413, 3, 2, 0, 0, 310, 10, 1], "semantic": {"name": "res", "arg_names": [], "import_names": [], "rhs_call_name": "dot", "annotation": ""}, "snippet": " res = np.dot(err,err)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Return_L278_C8", "label": "return", "type": "return", "loc": [278, 278], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L270_C4", "vector": [13, 2, 0.3018, 0.0011, 2, 0.23, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return res"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L280_C4", "label": "params_1 =", "type": "assigned_variable", "loc": [280, 280], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L269_C0", "vector": [14, 1, 0.304, 0.0011, 1, 0.65, 0.2, 908, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "params_1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " params_1 = [x_guess,y_guess,rad_guess]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L281_C4", "label": "if", "type": "if", "loc": [281, 289], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L269_C0", "vector": [4, 1, 0.3094, 0.0098, 1, 0.65, 0.4, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if method == 'fmin':\n r = so.fmin(error_function,params_1,xtol=0.0002,ftol=0.000001,full_output=1,disp=verbose)\n opt_params_1,fopt_1 = r[0],r[1]\n elif method == 'fmin_bfgs':\n r = so.fmin_bfgs(error_function, params_1, full_output=1,\n disp = verbose, gtol=1e-5)\n opt_params_1,fopt_1 = r[0],r[1]\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L282_C8", "label": "r = fmin()", "type": "assigned_variable", "loc": [282, 282], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L281_C4", "vector": [14, 2, 0.3062, 0.0011, 2, 0.39, 0.0, 436, 3, 6, 0, 0, 247, 10, 1], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "fmin", "annotation": ""}, "snippet": " r = so.fmin(error_function,params_1,xtol=0.0002,ftol=0.000001,full_output=1,disp=verbose)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L283_C8", "label": "opt_params_1, fopt_1 =", "type": "assigned_variable", "loc": [283, 283], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L281_C4", "vector": [14, 2, 0.3073, 0.0011, 2, 0.39, 0.5, 75, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "opt_params_1, fopt_1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " opt_params_1,fopt_1 = r[0],r[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L284_C4", "label": "if", "type": "if", "loc": [284, 289], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L281_C4", "vector": [4, 2, 0.3111, 0.0065, 2, 0.39, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif method == 'fmin_bfgs':\n r = so.fmin_bfgs(error_function, params_1, full_output=1,\n disp = verbose, gtol=1e-5)\n opt_params_1,fopt_1 = r[0],r[1]\n else:\n raise RuntimeError('unknown method: '+method)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L285_C8", "label": "r = fmin_bfgs()", "type": "assigned_variable", "loc": [285, 286], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L284_C4", "vector": [14, 3, 0.31, 0.0022, 3, 0.29, 0.0, 436, 3, 5, 0, 0, 613, 10, 1], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "fmin_bfgs", "annotation": ""}, "snippet": " r = so.fmin_bfgs(error_function, params_1, full_output=1,\n disp = verbose, gtol=1e-5)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L287_C8", "label": "opt_params_1, fopt_1 =", "type": "assigned_variable", "loc": [287, 287], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L284_C4", "vector": [14, 3, 0.3116, 0.0011, 3, 0.29, 1.0, 75, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "opt_params_1, fopt_1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " opt_params_1,fopt_1 = r[0],r[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L291_C4", "label": "params_2 =", "type": "assigned_variable", "loc": [291, 291], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L269_C0", "vector": [14, 1, 0.316, 0.0011, 1, 0.65, 0.6, 165, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "params_2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " params_2 = [x_guess,y_guess+2*rad_guess,rad_guess]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L292_C4", "label": "if", "type": "if", "loc": [292, 300], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L269_C0", "vector": [4, 1, 0.3214, 0.0098, 1, 0.65, 0.8, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if method == 'fmin':\n r = so.fmin(error_function,params_2,xtol=0.0002,ftol=0.000001,full_output=1,disp=verbose)\n opt_params_2,fopt_2 = r[0],r[1]\n elif method == 'fmin_bfgs':\n r = so.fmin_bfgs(error_function, params_2, full_output=1,\n disp = verbose, gtol=1e-5)\n opt_params_2,fopt_2 = r[0],r[1]\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L293_C8", "label": "r = fmin()", "type": "assigned_variable", "loc": [293, 293], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L292_C4", "vector": [14, 2, 0.3181, 0.0011, 2, 0.7, 0.0, 436, 3, 6, 0, 0, 247, 10, 1], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "fmin", "annotation": ""}, "snippet": " r = so.fmin(error_function,params_2,xtol=0.0002,ftol=0.000001,full_output=1,disp=verbose)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L294_C8", "label": "opt_params_2, fopt_2 =", "type": "assigned_variable", "loc": [294, 294], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L292_C4", "vector": [14, 2, 0.3192, 0.0011, 2, 0.7, 0.5, 161, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "opt_params_2, fopt_2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " opt_params_2,fopt_2 = r[0],r[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L295_C4", "label": "if", "type": "if", "loc": [295, 300], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L292_C4", "vector": [4, 2, 0.323, 0.0065, 2, 0.7, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif method == 'fmin_bfgs':\n r = so.fmin_bfgs(error_function, params_2, full_output=1,\n disp = verbose, gtol=1e-5)\n opt_params_2,fopt_2 = r[0],r[1]\n else:\n raise RuntimeError('unknown method: '+method)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L296_C8", "label": "r = fmin_bfgs()", "type": "assigned_variable", "loc": [296, 297], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L295_C4", "vector": [14, 3, 0.3219, 0.0022, 3, 0.98, 0.0, 436, 3, 5, 0, 0, 613, 10, 1], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "fmin_bfgs", "annotation": ""}, "snippet": " r = so.fmin_bfgs(error_function, params_2, full_output=1,\n disp = verbose, gtol=1e-5)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L298_C8", "label": "opt_params_2, fopt_2 =", "type": "assigned_variable", "loc": [298, 298], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L295_C4", "vector": [14, 3, 0.3236, 0.0011, 3, 0.98, 1.0, 161, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "opt_params_2, fopt_2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " opt_params_2,fopt_2 = r[0],r[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L302_C4", "label": "if", "type": "if", "loc": [302, 305], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L269_C0", "vector": [4, 1, 0.3295, 0.0043, 1, 0.65, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if fopt_2<fopt_1:\n return opt_params_2[2],opt_params_2[0],opt_params_2[1]\n else:\n return opt_params_1[2],opt_params_1[0],opt_params_1[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Return_L303_C8", "label": "return", "type": "return", "loc": [303, 303], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L302_C4", "vector": [13, 2, 0.329, 0.0011, 2, 0.54, 0.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return opt_params_2[2],opt_params_2[0],opt_params_2[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Return_L305_C8", "label": "return", "type": "return", "loc": [305, 305], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L302_C4", "vector": [13, 2, 0.3312, 0.0011, 2, 0.54, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return opt_params_1[2],opt_params_1[0],opt_params_1[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L314_C0", "label": "account_segway_motion", "type": "function", "loc": [314, 332], "level": 0, "parent": null, "vector": [2, 0, 0.3507, 0.0206, 0, 0.66, 0.8571, 119, 0, 2, 1, 0, 0, 0, 12], "semantic": {"name": "account_segway_motion", "arg_names": ["cart_traj", "st"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def account_segway_motion(cart_traj,st):\n ct = CartesianTajectory()\n for i in range(len(cart_traj.p_list)):\n x,y,a = st.x_list[i], st.y_list[i], st.a_list[i]\n p_tl = np.matrix(cart_traj.p_list[i]).T\n p_ts = smc.tsTtl(p_tl, x, y, a)\n p = p_ts\n ct.p_list.append(p.A1.tolist())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L315_C4", "label": "ct = CartesianTajectory()", "type": "assigned_variable", "loc": [315, 315], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L314_C0", "vector": [14, 1, 0.342, 0.0011, 1, 0.54, 0.0, 147, 3, 0, 0, 0, 610, 10, 1], "semantic": {"name": "ct", "arg_names": [], "import_names": [], "rhs_call_name": "CartesianTajectory", "annotation": ""}, "snippet": " ct = CartesianTajectory()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L316_C4", "label": "for i", "type": "for", "loc": [316, 329], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L314_C0", "vector": [6, 1, 0.3502, 0.0152, 1, 0.54, 0.3333, 826, 3, 0, 0, 0, 0, 0, 10], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(len(cart_traj.p_list)):\n x,y,a = st.x_list[i], st.y_list[i], st.a_list[i]\n p_tl = np.matrix(cart_traj.p_list[i]).T\n p_ts = smc.tsTtl(p_tl, x, y, a)\n p = p_ts\n ct.p_list.append(p.A1.tolist())\n\n # this is incorrect. I also need to use the velocity of the"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L317_C8", "label": "x, y, a =", "type": "assigned_variable", "loc": [317, 317], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L316_C4", "vector": [14, 2, 0.3442, 0.0011, 2, 0.96, 0.0, 465, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "x, y, a", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " x,y,a = st.x_list[i], st.y_list[i], st.a_list[i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L318_C8", "label": "p_tl =", "type": "assigned_variable", "loc": [318, 318], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L316_C4", "vector": [14, 2, 0.3453, 0.0011, 2, 0.96, 0.2, 653, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "p_tl", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p_tl = np.matrix(cart_traj.p_list[i]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L319_C8", "label": "p_ts = tsTtl()", "type": "assigned_variable", "loc": [319, 319], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L316_C4", "vector": [14, 2, 0.3464, 0.0011, 2, 0.96, 0.4, 583, 3, 4, 0, 0, 370, 10, 1], "semantic": {"name": "p_ts", "arg_names": [], "import_names": [], "rhs_call_name": "tsTtl", "annotation": ""}, "snippet": " p_ts = smc.tsTtl(p_tl, x, y, a)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L320_C8", "label": "p =", "type": "assigned_variable", "loc": [320, 320], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L316_C4", "vector": [14, 2, 0.3474, 0.0011, 2, 0.96, 0.6, 491, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p = p_ts"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L321_C8", "label": "append()", "type": "expression", "loc": [321, 321], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L316_C4", "vector": [8, 2, 0.3485, 0.0011, 2, 0.96, 0.8, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " ct.p_list.append(p.A1.tolist())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L326_C8", "label": "if", "type": "if", "loc": [326, 329], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L316_C4", "vector": [4, 2, 0.3556, 0.0043, 2, 0.96, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if cart_traj.v_list != []:\n v_tl = np.matrix(cart_traj.v_list[i]).T\n v_ts = smc.tsRtl(v_tl, a)\n ct.v_list.append(v_ts.A1.tolist())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L327_C12", "label": "v_tl =", "type": "assigned_variable", "loc": [327, 327], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L326_C8", "vector": [14, 3, 0.355, 0.0011, 3, 0.29, 0.0, 836, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "v_tl", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " v_tl = np.matrix(cart_traj.v_list[i]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L328_C12", "label": "v_ts = tsRtl()", "type": "assigned_variable", "loc": [328, 328], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L326_C8", "vector": [14, 3, 0.3561, 0.0011, 3, 0.29, 0.5, 95, 3, 2, 0, 0, 437, 10, 1], "semantic": {"name": "v_ts", "arg_names": [], "import_names": [], "rhs_call_name": "tsRtl", "annotation": ""}, "snippet": " v_ts = smc.tsRtl(v_tl, a)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L329_C12", "label": "append()", "type": "expression", "loc": [329, 329], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L326_C8", "vector": [8, 3, 0.3572, 0.0011, 3, 0.29, 1.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " ct.v_list.append(v_ts.A1.tolist())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L331_C4", "label": "ct.time_list = copy()", "type": "assigned_variable", "loc": [331, 331], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L314_C0", "vector": [14, 1, 0.3594, 0.0011, 1, 0.54, 0.6667, 654, 3, 1, 0, 0, 739, 10, 1], "semantic": {"name": "ct.time_list", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " ct.time_list = copy.copy(cart_traj.time_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Return_L332_C4", "label": "return", "type": "return", "loc": [332, 332], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L314_C0", "vector": [13, 1, 0.3605, 0.0011, 1, 0.54, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ct"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L337_C0", "label": "account_zenithering", "type": "function", "loc": [337, 353], "level": 0, "parent": null, "vector": [2, 0, 0.3746, 0.0185, 0, 0.66, 0.8929, 583, 0, 2, 1, 0, 0, 0, 6], "semantic": {"name": "account_zenithering", "arg_names": ["cart_traj", "z_l"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def account_zenithering(cart_traj, z_l):\n ct = CartesianTajectory()\n h_start = z_l[0]\n for i in range(len(cart_traj.p_list)):\n h = z_l[i]\n p = cart_traj.p_list[i]\n p[2] += h - h_start\n ct.p_list.append(p)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L338_C4", "label": "ct = CartesianTajectory()", "type": "assigned_variable", "loc": [338, 338], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L337_C0", "vector": [14, 1, 0.367, 0.0011, 1, 0.5, 0.0, 147, 3, 0, 0, 0, 610, 10, 1], "semantic": {"name": "ct", "arg_names": [], "import_names": [], "rhs_call_name": "CartesianTajectory", "annotation": ""}, "snippet": " ct = CartesianTajectory()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L339_C4", "label": "h_start =", "type": "assigned_variable", "loc": [339, 339], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L337_C0", "vector": [14, 1, 0.3681, 0.0011, 1, 0.5, 0.25, 804, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "h_start", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " h_start = z_l[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L340_C4", "label": "for i", "type": "for", "loc": [340, 350], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L337_C0", "vector": [6, 1, 0.3746, 0.0119, 1, 0.5, 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(len(cart_traj.p_list)):\n h = z_l[i]\n p = cart_traj.p_list[i]\n p[2] += h - h_start\n ct.p_list.append(p)\n\n # this is incorrect. I also need to use the velocity of the\n # zenither. Unclear whether this is useful right now, so not"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L341_C8", "label": "h =", "type": "assigned_variable", "loc": [341, 341], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L340_C4", "vector": [14, 2, 0.3702, 0.0011, 2, 0.69, 0.0, 686, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "h", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " h = z_l[i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L342_C8", "label": "p =", "type": "assigned_variable", "loc": [342, 342], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L340_C4", "vector": [14, 2, 0.3713, 0.0011, 2, 0.69, 0.3333, 491, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p = cart_traj.p_list[i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L344_C8", "label": "append()", "type": "expression", "loc": [344, 344], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L340_C4", "vector": [8, 2, 0.3735, 0.0011, 2, 0.69, 0.6667, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " ct.p_list.append(p)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L349_C8", "label": "if", "type": "if", "loc": [349, 350], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L340_C4", "vector": [4, 2, 0.3795, 0.0022, 2, 0.69, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if cart_traj.v_list != []:\n ct.v_list.append(cart_traj.v_list[i])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L350_C12", "label": "append()", "type": "expression", "loc": [350, 350], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L349_C8", "vector": [8, 3, 0.38, 0.0011, 3, 0.48, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " ct.v_list.append(cart_traj.v_list[i])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L352_C4", "label": "ct.time_list = copy()", "type": "assigned_variable", "loc": [352, 352], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L337_C0", "vector": [14, 1, 0.3822, 0.0011, 1, 0.5, 0.75, 654, 3, 1, 0, 0, 739, 10, 1], "semantic": {"name": "ct.time_list", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " ct.time_list = copy.copy(cart_traj.time_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Return_L353_C4", "label": "return", "type": "return", "loc": [353, 353], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L337_C0", "vector": [13, 1, 0.3833, 0.0011, 1, 0.5, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ct"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L359_C0", "label": "filter_cartesian_trajectory", "type": "function", "loc": [359, 375], "level": 0, "parent": null, "vector": [2, 0, 0.3985, 0.0185, 0, 0.66, 0.9286, 996, 0, 1, 1, 0, 0, 0, 4], "semantic": {"name": "filter_cartesian_trajectory", "arg_names": ["ct"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def filter_cartesian_trajectory(ct):\n pts_list = ct.p_list\n ee_start_pos = pts_list[0]\n l = [pts_list[0]]\n\n for i, p in enumerate(pts_list[1:]):\n l.append(p)\n pts_2d = (np.matrix(l).T)[0:2,:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L360_C4", "label": "pts_list =", "type": "assigned_variable", "loc": [360, 360], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L359_C0", "vector": [14, 1, 0.3909, 0.0011, 1, 0.57, 0.0, 713, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pts_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pts_list = ct.p_list"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L361_C4", "label": "ee_start_pos =", "type": "assigned_variable", "loc": [361, 361], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L359_C0", "vector": [14, 1, 0.392, 0.0011, 1, 0.57, 0.2, 996, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ee_start_pos", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ee_start_pos = pts_list[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L362_C4", "label": "l =", "type": "assigned_variable", "loc": [362, 362], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L359_C0", "vector": [14, 1, 0.3931, 0.0011, 1, 0.57, 0.4, 810, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " l = [pts_list[0]]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L364_C4", "label": "for i, p", "type": "for", "loc": [364, 372], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L359_C0", "vector": [6, 1, 0.3996, 0.0098, 1, 0.57, 0.6, 816, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "i, p", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i, p in enumerate(pts_list[1:]):\n l.append(p)\n pts_2d = (np.matrix(l).T)[0:2,:]\n st_pt = pts_2d[:,0]\n end_pt = pts_2d[:,-1]\n dist_moved = np.linalg.norm(st_pt-end_pt)\n #if dist_moved < 0.1:\n if dist_moved < 0.03:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L365_C8", "label": "append()", "type": "expression", "loc": [365, 365], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L364_C4", "vector": [8, 2, 0.3963, 0.0011, 2, 0.18, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " l.append(p)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L366_C8", "label": "pts_2d =", "type": "assigned_variable", "loc": [366, 366], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L364_C4", "vector": [14, 2, 0.3974, 0.0011, 2, 0.18, 0.2, 945, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "pts_2d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pts_2d = (np.matrix(l).T)[0:2,:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L367_C8", "label": "st_pt =", "type": "assigned_variable", "loc": [367, 367], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L364_C4", "vector": [14, 2, 0.3985, 0.0011, 2, 0.18, 0.4, 515, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "st_pt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " st_pt = pts_2d[:,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L368_C8", "label": "end_pt =", "type": "assigned_variable", "loc": [368, 368], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L364_C4", "vector": [14, 2, 0.3996, 0.0011, 2, 0.18, 0.6, 292, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "end_pt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " end_pt = pts_2d[:,-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L369_C8", "label": "dist_moved = norm()", "type": "assigned_variable", "loc": [369, 369], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L364_C4", "vector": [14, 2, 0.4007, 0.0011, 2, 0.18, 0.8, 696, 3, 1, 0, 0, 902, 10, 1], "semantic": {"name": "dist_moved", "arg_names": [], "import_names": [], "rhs_call_name": "norm", "annotation": ""}, "snippet": " dist_moved = np.linalg.norm(st_pt-end_pt)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L371_C8", "label": "if", "type": "if", "loc": [371, 372], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L364_C4", "vector": [4, 2, 0.4034, 0.0022, 2, 0.18, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if dist_moved < 0.03:\n reject_idx = i"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L372_C12", "label": "reject_idx =", "type": "assigned_variable", "loc": [372, 372], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L371_C8", "vector": [14, 3, 0.4039, 0.0011, 3, 0.05, 0.0, 647, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "reject_idx", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " reject_idx = i"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L374_C4", "label": "pts_2d =", "type": "assigned_variable", "loc": [374, 374], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L359_C0", "vector": [14, 1, 0.4061, 0.0011, 1, 0.57, 0.8, 945, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pts_2d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pts_2d = pts_2d[:,reject_idx:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Return_L375_C4", "label": "return", "type": "return", "loc": [375, 375], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L359_C0", "vector": [13, 1, 0.4072, 0.0011, 1, 0.57, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return pts_2d, reject_idx"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L382_C0", "label": "filter_trajectory_force", "type": "function", "loc": [382, 416], "level": 0, "parent": null, "vector": [2, 0, 0.4332, 0.038, 0, 0.66, 0.9643, 811, 0, 2, 1, 0, 0, 0, 20], "semantic": {"name": "filter_trajectory_force", "arg_names": ["ct", "ft"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def filter_trajectory_force(ct, ft):\n vel_list = copy.copy(ct.v_list)\n pts_list = copy.copy(ct.p_list)\n time_list = copy.copy(ct.time_list)\n ft_list = copy.copy(ft.f_list)\n f_mag_list = ut.norm(np.matrix(ft.f_list).T).A1.tolist()\n\n if len(pts_list) != len(f_mag_list):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L383_C4", "label": "vel_list = copy()", "type": "assigned_variable", "loc": [383, 383], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L382_C0", "vector": [14, 1, 0.4159, 0.0011, 1, 0.39, 0.0, 169, 3, 1, 0, 0, 739, 10, 1], "semantic": {"name": "vel_list", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " vel_list = copy.copy(ct.v_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L384_C4", "label": "pts_list = copy()", "type": "assigned_variable", "loc": [384, 384], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L382_C0", "vector": [14, 1, 0.4169, 0.0011, 1, 0.39, 0.0588, 713, 3, 1, 0, 0, 739, 10, 1], "semantic": {"name": "pts_list", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " pts_list = copy.copy(ct.p_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L385_C4", "label": "time_list = copy()", "type": "assigned_variable", "loc": [385, 385], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L382_C0", "vector": [14, 1, 0.418, 0.0011, 1, 0.39, 0.1176, 941, 3, 1, 0, 0, 739, 10, 1], "semantic": {"name": "time_list", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " time_list = copy.copy(ct.time_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L386_C4", "label": "ft_list = copy()", "type": "assigned_variable", "loc": [386, 386], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L382_C0", "vector": [14, 1, 0.4191, 0.0011, 1, 0.39, 0.1765, 147, 3, 1, 0, 0, 739, 10, 1], "semantic": {"name": "ft_list", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " ft_list = copy.copy(ft.f_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L387_C4", "label": "f_mag_list = tolist()", "type": "assigned_variable", "loc": [387, 387], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L382_C0", "vector": [14, 1, 0.4202, 0.0011, 1, 0.39, 0.2353, 231, 3, 0, 0, 0, 185, 10, 3], "semantic": {"name": "f_mag_list", "arg_names": [], "import_names": [], "rhs_call_name": "tolist", "annotation": ""}, "snippet": " f_mag_list = ut.norm(np.matrix(ft.f_list).T).A1.tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L389_C4", "label": "if", "type": "if", "loc": [389, 392], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L382_C0", "vector": [4, 1, 0.424, 0.0043, 1, 0.39, 0.2941, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(pts_list) != len(f_mag_list):\n print('arm_trajectories.filter_trajectory_force: force and end effector lists are not of the same length.')\n print('Exiting ...')\n sys.exit()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L390_C8", "label": "print()", "type": "expression", "loc": [390, 390], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L389_C4", "vector": [8, 2, 0.4235, 0.0011, 2, 0.27, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('arm_trajectories.filter_trajectory_force: force and end effector lists are not of the same length.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L391_C8", "label": "print()", "type": "expression", "loc": [391, 391], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L389_C4", "vector": [8, 2, 0.4245, 0.0011, 2, 0.27, 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_99527:Expr_L392_C8", "label": "exit()", "type": "expression", "loc": [392, 392], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L389_C4", "vector": [8, 2, 0.4256, 0.0011, 2, 0.27, 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_99527:Assign_L394_C4", "label": "n_pts = len()", "type": "assigned_variable", "loc": [394, 394], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L382_C0", "vector": [14, 1, 0.4278, 0.0011, 1, 0.39, 0.3529, 156, 3, 1, 0, 0, 890, 10, 1], "semantic": {"name": "n_pts", "arg_names": [], "import_names": [], "rhs_call_name": "len", "annotation": ""}, "snippet": " n_pts = len(pts_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L395_C4", "label": "i =", "type": "assigned_variable", "loc": [395, 395], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L382_C0", "vector": [14, 1, 0.4289, 0.0011, 1, 0.39, 0.4118, 826, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " i = n_pts - 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L396_C4", "label": "hook_slip_off_threshold =", "type": "assigned_variable", "loc": [396, 396], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L382_C0", "vector": [14, 1, 0.43, 0.0011, 1, 0.39, 0.4706, 849, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "hook_slip_off_threshold", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " hook_slip_off_threshold = 1.5 # from compliant_trajectories.py"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:While_L397_C4", "label": "while", "type": "while", "loc": [397, 406], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L382_C0", "vector": [5, 1, 0.4359, 0.0109, 1, 0.39, 0.5294, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while i > 0:\n if f_mag_list[i] < hook_slip_off_threshold:\n pts_list.pop()\n time_list.pop()\n ft_list.pop()\n if vel_list != []:\n vel_list.pop()\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L398_C8", "label": "if", "type": "if", "loc": [398, 405], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:While_L397_C4", "vector": [4, 2, 0.4359, 0.0087, 2, 0.61, 0.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if f_mag_list[i] < hook_slip_off_threshold:\n pts_list.pop()\n time_list.pop()\n ft_list.pop()\n if vel_list != []:\n vel_list.pop()\n else:\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L399_C12", "label": "pop()", "type": "expression", "loc": [399, 399], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L398_C8", "vector": [8, 3, 0.4332, 0.0011, 3, 0.25, 0.0, 969, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "pop", "arg_names": [], "import_names": [], "rhs_call_name": "pop", "annotation": ""}, "snippet": " pts_list.pop()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L400_C12", "label": "pop()", "type": "expression", "loc": [400, 400], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L398_C8", "vector": [8, 3, 0.4343, 0.0011, 3, 0.25, 0.3333, 969, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "pop", "arg_names": [], "import_names": [], "rhs_call_name": "pop", "annotation": ""}, "snippet": " time_list.pop()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L401_C12", "label": "pop()", "type": "expression", "loc": [401, 401], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L398_C8", "vector": [8, 3, 0.4354, 0.0011, 3, 0.25, 0.6667, 969, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "pop", "arg_names": [], "import_names": [], "rhs_call_name": "pop", "annotation": ""}, "snippet": " ft_list.pop()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L402_C12", "label": "if", "type": "if", "loc": [402, 403], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L398_C8", "vector": [4, 3, 0.437, 0.0022, 3, 0.25, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if vel_list != []:\n vel_list.pop()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L403_C16", "label": "pop()", "type": "expression", "loc": [403, 403], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L402_C12", "vector": [8, 4, 0.4376, 0.0011, 4, 0.13, 0.0, 969, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "pop", "arg_names": [], "import_names": [], "rhs_call_name": "pop", "annotation": ""}, "snippet": " vel_list.pop()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L408_C4", "label": "ct2 = CartesianTajectory()", "type": "assigned_variable", "loc": [408, 408], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L382_C0", "vector": [14, 1, 0.443, 0.0011, 1, 0.39, 0.5882, 18, 3, 0, 0, 0, 610, 10, 1], "semantic": {"name": "ct2", "arg_names": [], "import_names": [], "rhs_call_name": "CartesianTajectory", "annotation": ""}, "snippet": " ct2 = CartesianTajectory()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L409_C4", "label": "ct2.time_list =", "type": "assigned_variable", "loc": [409, 409], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L382_C0", "vector": [14, 1, 0.4441, 0.0011, 1, 0.39, 0.6471, 289, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ct2.time_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ct2.time_list = time_list"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L410_C4", "label": "ct2.p_list =", "type": "assigned_variable", "loc": [410, 410], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L382_C0", "vector": [14, 1, 0.4452, 0.0011, 1, 0.39, 0.7059, 109, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ct2.p_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ct2.p_list = pts_list"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L411_C4", "label": "ct2.v_list =", "type": "assigned_variable", "loc": [411, 411], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L382_C0", "vector": [14, 1, 0.4463, 0.0011, 1, 0.39, 0.7647, 722, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ct2.v_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ct2.v_list = vel_list"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L413_C4", "label": "ft2 = ForceTrajectory()", "type": "assigned_variable", "loc": [413, 413], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L382_C0", "vector": [14, 1, 0.4484, 0.0011, 1, 0.39, 0.8235, 396, 3, 0, 0, 0, 306, 10, 1], "semantic": {"name": "ft2", "arg_names": [], "import_names": [], "rhs_call_name": "ForceTrajectory", "annotation": ""}, "snippet": " ft2 = ForceTrajectory()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L414_C4", "label": "ft2.time_list = copy()", "type": "assigned_variable", "loc": [414, 414], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L382_C0", "vector": [14, 1, 0.4495, 0.0011, 1, 0.39, 0.8824, 846, 3, 1, 0, 0, 739, 10, 1], "semantic": {"name": "ft2.time_list", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " ft2.time_list = copy.copy(time_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L415_C4", "label": "ft2.f_list =", "type": "assigned_variable", "loc": [415, 415], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L382_C0", "vector": [14, 1, 0.4506, 0.0011, 1, 0.39, 0.9412, 681, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ft2.f_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ft2.f_list = ft_list"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Return_L416_C4", "label": "return", "type": "return", "loc": [416, 416], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L382_C0", "vector": [13, 1, 0.4517, 0.0011, 1, 0.39, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ct2, ft2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "label": "if", "type": "if", "loc": [419, 914], "level": 0, "parent": null, "vector": [4, 0, 0.7237, 0.5385, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 99], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n p = optparse.OptionParser()\n p.add_option('-f', action='store', type='string', dest='fname',\n help='pkl file to use.', default='')\n p.add_option('--xy', action='store_true', dest='xy',\n help='plot the x and y coordinates of the end effector.')\n p.add_option('--yz', action='store_true', dest='yz',\n help='plot the y and z coordinates of the end effector.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L420_C4", "label": "p = OptionParser()", "type": "assigned_variable", "loc": [420, 420], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "vector": [14, 1, 0.456, 0.0011, 1, 0.18, 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_99527:Expr_L421_C4", "label": "add_option()", "type": "expression", "loc": [421, 422], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "vector": [8, 1, 0.4577, 0.0022, 1, 0.18, 0.0182, 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_99527:Expr_L423_C4", "label": "add_option()", "type": "expression", "loc": [423, 424], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "vector": [8, 1, 0.4598, 0.0022, 1, 0.18, 0.0364, 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('--xy', action='store_true', dest='xy',\n help='plot the x and y coordinates of the end effector.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L425_C4", "label": "add_option()", "type": "expression", "loc": [425, 426], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "vector": [8, 1, 0.462, 0.0022, 1, 0.18, 0.0545, 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('--yz', action='store_true', dest='yz',\n help='plot the y and z coordinates of the end effector.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L427_C4", "label": "add_option()", "type": "expression", "loc": [427, 428], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "vector": [8, 1, 0.4642, 0.0022, 1, 0.18, 0.0727, 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('--xz', action='store_true', dest='xz',\n help='plot the x and z coordinates of the end effector.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L429_C4", "label": "add_option()", "type": "expression", "loc": [429, 430], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "vector": [8, 1, 0.4663, 0.0022, 1, 0.18, 0.0909, 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('--plot_ellipses', action='store_true', dest='plot_ellipses',\n help='plot the stiffness ellipse in the x-y plane')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L431_C4", "label": "add_option()", "type": "expression", "loc": [431, 432], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "vector": [8, 1, 0.4685, 0.0022, 1, 0.18, 0.1091, 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('--pfc', action='store_true', dest='pfc',\n help='plot the radial and tangential components of the force.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L433_C4", "label": "add_option()", "type": "expression", "loc": [433, 434], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "vector": [8, 1, 0.4707, 0.0022, 1, 0.18, 0.1273, 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('--pmf', action='store_true', dest='pmf',\n help='plot things with the mechanism alinged with the axes.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L435_C4", "label": "add_option()", "type": "expression", "loc": [435, 436], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "vector": [8, 1, 0.4729, 0.0022, 1, 0.18, 0.1455, 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('--pff', action='store_true', dest='pff',\n help='plot the force field corresponding to a stiffness ellipse.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L437_C4", "label": "add_option()", "type": "expression", "loc": [437, 438], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "vector": [8, 1, 0.475, 0.0022, 1, 0.18, 0.1636, 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('--pev', action='store_true', dest='pev',\n help='plot the stiffness ellipses for different combinations of the rel stiffnesses.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L439_C4", "label": "add_option()", "type": "expression", "loc": [439, 440], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "vector": [8, 1, 0.4772, 0.0022, 1, 0.18, 0.1818, 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('--plot_forces', action='store_true', dest='plot_forces',\n help='plot the force in the x-y plane')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L441_C4", "label": "add_option()", "type": "expression", "loc": [441, 442], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "vector": [8, 1, 0.4794, 0.0022, 1, 0.18, 0.2, 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('--plot_forces_error', action='store_true', dest='plot_forces_error',\n help='plot the error between the computed and measured (ATI) forces in the x-y plane')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L443_C4", "label": "add_option()", "type": "expression", "loc": [443, 444], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "vector": [8, 1, 0.4815, 0.0022, 1, 0.18, 0.2182, 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('--xyz', action='store_true', dest='xyz',\n help='plot in 3d the coordinates of the end effector.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L445_C4", "label": "add_option()", "type": "expression", "loc": [445, 446], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "vector": [8, 1, 0.4837, 0.0022, 1, 0.18, 0.2364, 176, 3, 6, 0, 0, 0, 0, 1], "semantic": {"name": "add_option", "arg_names": [], "import_names": [], "rhs_call_name": "add_option", "annotation": ""}, "snippet": " p.add_option('-r', action='store', type='float', dest='rad',\n help='radius of the joint.', default=None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L447_C4", "label": "add_option()", "type": "expression", "loc": [447, 448], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "vector": [8, 1, 0.4859, 0.0022, 1, 0.18, 0.2545, 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('--noshow', action='store_true', dest='noshow',\n help='do not display the figure (use while saving figures to disk)')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L449_C4", "label": "add_option()", "type": "expression", "loc": [449, 450], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "vector": [8, 1, 0.4881, 0.0022, 1, 0.18, 0.2727, 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('--exptplot', action='store_true', dest='exptplot',\n help='put all the graphs of an experiment as subplots.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L451_C4", "label": "add_option()", "type": "expression", "loc": [451, 452], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "vector": [8, 1, 0.4902, 0.0022, 1, 0.18, 0.2909, 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('--sturm', action='store_true', dest='sturm',\n help='make log files to send to sturm')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L453_C4", "label": "add_option()", "type": "expression", "loc": [453, 455], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "vector": [8, 1, 0.4929, 0.0033, 1, 0.18, 0.3091, 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('--icra_presentation_plot', action='store_true',\n dest='icra_presentation_plot',\n help='plot explaining CEP update.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L457_C4", "label": "opt, args = parse_args()", "type": "assigned_variable", "loc": [457, 457], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "vector": [14, 1, 0.4962, 0.0011, 1, 0.18, 0.3273, 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_99527:Assign_L458_C4", "label": "fname =", "type": "assigned_variable", "loc": [458, 458], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "vector": [14, 1, 0.4973, 0.0011, 1, 0.18, 0.3455, 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_99527:Assign_L459_C4", "label": "xy_flag =", "type": "assigned_variable", "loc": [459, 459], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "vector": [14, 1, 0.4984, 0.0011, 1, 0.18, 0.3636, 813, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "xy_flag", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " xy_flag = opt.xy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L460_C4", "label": "yz_flag =", "type": "assigned_variable", "loc": [460, 460], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "vector": [14, 1, 0.4995, 0.0011, 1, 0.18, 0.3818, 102, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "yz_flag", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " yz_flag = opt.yz"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L461_C4", "label": "xz_flag =", "type": "assigned_variable", "loc": [461, 461], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "vector": [14, 1, 0.5005, 0.0011, 1, 0.18, 0.4, 208, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "xz_flag", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " xz_flag = opt.xz"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L462_C4", "label": "plot_forces_flag =", "type": "assigned_variable", "loc": [462, 462], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "vector": [14, 1, 0.5016, 0.0011, 1, 0.18, 0.4182, 38, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "plot_forces_flag", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " plot_forces_flag = opt.plot_forces"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L463_C4", "label": "plot_ellipses_flag =", "type": "assigned_variable", "loc": [463, 463], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "vector": [14, 1, 0.5027, 0.0011, 1, 0.18, 0.4364, 873, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "plot_ellipses_flag", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " plot_ellipses_flag = opt.plot_ellipses"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L464_C4", "label": "plot_forces_error_flag =", "type": "assigned_variable", "loc": [464, 464], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "vector": [14, 1, 0.5038, 0.0011, 1, 0.18, 0.4545, 344, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "plot_forces_error_flag", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " plot_forces_error_flag = opt.plot_forces_error"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L465_C4", "label": "plot_force_components_flag =", "type": "assigned_variable", "loc": [465, 465], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "vector": [14, 1, 0.5049, 0.0011, 1, 0.18, 0.4727, 77, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "plot_force_components_flag", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " plot_force_components_flag = opt.pfc"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L466_C4", "label": "plot_force_field_flag =", "type": "assigned_variable", "loc": [466, 466], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "vector": [14, 1, 0.506, 0.0011, 1, 0.18, 0.4909, 364, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "plot_force_field_flag", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " plot_force_field_flag = opt.pff"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L467_C4", "label": "plot_mechanism_frame =", "type": "assigned_variable", "loc": [467, 467], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "vector": [14, 1, 0.5071, 0.0011, 1, 0.18, 0.5091, 689, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "plot_mechanism_frame", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " plot_mechanism_frame = opt.pmf"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L468_C4", "label": "xyz_flag =", "type": "assigned_variable", "loc": [468, 468], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "vector": [14, 1, 0.5081, 0.0011, 1, 0.18, 0.5273, 737, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "xyz_flag", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " xyz_flag = opt.xyz"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L469_C4", "label": "rad =", "type": "assigned_variable", "loc": [469, 469], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "vector": [14, 1, 0.5092, 0.0011, 1, 0.18, 0.5455, 439, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "rad", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rad = opt.rad"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L470_C4", "label": "show_fig =", "type": "assigned_variable", "loc": [470, 470], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "vector": [14, 1, 0.5103, 0.0011, 1, 0.18, 0.5636, 616, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "show_fig", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " show_fig = not(opt.noshow)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L471_C4", "label": "plot_ellipses_vary_flag =", "type": "assigned_variable", "loc": [471, 471], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "vector": [14, 1, 0.5114, 0.0011, 1, 0.18, 0.5818, 316, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "plot_ellipses_vary_flag", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " plot_ellipses_vary_flag = opt.pev"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L472_C4", "label": "expt_plot =", "type": "assigned_variable", "loc": [472, 472], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "vector": [14, 1, 0.5125, 0.0011, 1, 0.18, 0.6, 687, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "expt_plot", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " expt_plot = opt.exptplot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L473_C4", "label": "sturm_output =", "type": "assigned_variable", "loc": [473, 473], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "vector": [14, 1, 0.5136, 0.0011, 1, 0.18, 0.6182, 219, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "sturm_output", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " sturm_output = opt.sturm"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L476_C4", "label": "if", "type": "if", "loc": [476, 513], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "vector": [4, 1, 0.5369, 0.0413, 1, 0.18, 0.6364, 0, 2, 0, 0, 0, 0, 0, 14], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if plot_ellipses_vary_flag:\n show_fig=False\n i = 0\n ratio_list1 = [0.1,0.3,0.5,0.7,0.9] # coarse search\n ratio_list2 = [0.1,0.3,0.5,0.7,0.9] # coarse search\n ratio_list3 = [0.1,0.3,0.5,0.7,0.9] # coarse search\n# ratio_list1 = [0.7,0.8,0.9,1.0]\n# ratio_list2 = [0.7,0.8,0.9,1.0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L477_C8", "label": "show_fig =", "type": "assigned_variable", "loc": [477, 477], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L476_C4", "vector": [14, 2, 0.5179, 0.0011, 2, 0.55, 0.0, 616, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "show_fig", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " show_fig=False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L478_C8", "label": "i =", "type": "assigned_variable", "loc": [478, 478], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L476_C4", "vector": [14, 2, 0.519, 0.0011, 2, 0.55, 0.0769, 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_99527:Assign_L479_C8", "label": "ratio_list1 =", "type": "assigned_variable", "loc": [479, 479], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L476_C4", "vector": [14, 2, 0.5201, 0.0011, 2, 0.55, 0.1538, 316, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "ratio_list1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ratio_list1 = [0.1,0.3,0.5,0.7,0.9] # coarse search"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L480_C8", "label": "ratio_list2 =", "type": "assigned_variable", "loc": [480, 480], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L476_C4", "vector": [14, 2, 0.5212, 0.0011, 2, 0.55, 0.2308, 320, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "ratio_list2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ratio_list2 = [0.1,0.3,0.5,0.7,0.9] # coarse search"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L481_C8", "label": "ratio_list3 =", "type": "assigned_variable", "loc": [481, 481], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L476_C4", "vector": [14, 2, 0.5223, 0.0011, 2, 0.55, 0.3077, 19, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "ratio_list3", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ratio_list3 = [0.1,0.3,0.5,0.7,0.9] # coarse search"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L489_C8", "label": "inv_mean_list, std_list =", "type": "assigned_variable", "loc": [489, 489], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L476_C4", "vector": [14, 2, 0.5309, 0.0011, 2, 0.55, 0.3846, 618, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "inv_mean_list, std_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " inv_mean_list,std_list = [],[]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L490_C8", "label": "x_l, y_l, z_l =", "type": "assigned_variable", "loc": [490, 490], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L476_C4", "vector": [14, 2, 0.532, 0.0011, 2, 0.55, 0.4615, 876, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "x_l, y_l, z_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " x_l,y_l,z_l = [],[],[]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L491_C8", "label": "s0 =", "type": "assigned_variable", "loc": [491, 491], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L476_C4", "vector": [14, 2, 0.5331, 0.0011, 2, 0.55, 0.5385, 660, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "s0", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " s0 = 0.2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L493_C8", "label": "for s1", "type": "for", "loc": [493, 505], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L476_C4", "vector": [6, 2, 0.5418, 0.0141, 2, 0.55, 0.6154, 745, 2, 0, 0, 0, 0, 0, 7], "semantic": {"name": "s1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for s1 in ratio_list1:\n for s2 in ratio_list2:\n for s3 in ratio_list3:\n i += 1\n s_list = [s0,s1,s2,s3,0.8]\n #s_list = [s1,s2,s3,s0,0.8]\n print('################## s_list:', s_list)\n m,s = plot_stiff_ellipse_map(s_list,i)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L494_C12", "label": "for s2", "type": "for", "loc": [494, 505], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L493_C8", "vector": [6, 3, 0.5423, 0.013, 3, 0.08, 0.0, 448, 2, 0, 0, 0, 0, 0, 7], "semantic": {"name": "s2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for s2 in ratio_list2:\n for s3 in ratio_list3:\n i += 1\n s_list = [s0,s1,s2,s3,0.8]\n #s_list = [s1,s2,s3,s0,0.8]\n print('################## s_list:', s_list)\n m,s = plot_stiff_ellipse_map(s_list,i)\n inv_mean_list.append(1./m)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L495_C16", "label": "for s3", "type": "for", "loc": [495, 505], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L494_C12", "vector": [6, 4, 0.5429, 0.0119, 4, 0.01, 0.0, 626, 2, 0, 0, 0, 0, 0, 7], "semantic": {"name": "s3", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for s3 in ratio_list3:\n i += 1\n s_list = [s0,s1,s2,s3,0.8]\n #s_list = [s1,s2,s3,s0,0.8]\n print('################## s_list:', s_list)\n m,s = plot_stiff_ellipse_map(s_list,i)\n inv_mean_list.append(1./m)\n std_list.append(s)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L497_C20", "label": "s_list =", "type": "assigned_variable", "loc": [497, 497], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L495_C16", "vector": [14, 5, 0.5396, 0.0011, 5, 0.13, 0.0, 363, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "s_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " s_list = [s0,s1,s2,s3,0.8]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L499_C20", "label": "print()", "type": "expression", "loc": [499, 499], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L495_C16", "vector": [8, 5, 0.5418, 0.0011, 5, 0.13, 0.1429, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('################## s_list:', s_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L500_C20", "label": "m, s = plot_stiff_ellipse_map()", "type": "assigned_variable", "loc": [500, 500], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L495_C16", "vector": [14, 5, 0.5429, 0.0011, 5, 0.13, 0.2857, 483, 3, 2, 0, 0, 503, 10, 1], "semantic": {"name": "m, s", "arg_names": [], "import_names": [], "rhs_call_name": "plot_stiff_ellipse_map", "annotation": ""}, "snippet": " m,s = plot_stiff_ellipse_map(s_list,i)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L501_C20", "label": "append()", "type": "expression", "loc": [501, 501], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L495_C16", "vector": [8, 5, 0.544, 0.0011, 5, 0.13, 0.4286, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " inv_mean_list.append(1./m)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L502_C20", "label": "append()", "type": "expression", "loc": [502, 502], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L495_C16", "vector": [8, 5, 0.5451, 0.0011, 5, 0.13, 0.5714, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " std_list.append(s)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L503_C20", "label": "append()", "type": "expression", "loc": [503, 503], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L495_C16", "vector": [8, 5, 0.5461, 0.0011, 5, 0.13, 0.7143, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " x_l.append(s1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L504_C20", "label": "append()", "type": "expression", "loc": [504, 504], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L495_C16", "vector": [8, 5, 0.5472, 0.0011, 5, 0.13, 0.8571, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " y_l.append(s2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L505_C20", "label": "append()", "type": "expression", "loc": [505, 505], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L495_C16", "vector": [8, 5, 0.5483, 0.0011, 5, 0.13, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " z_l.append(s3)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L507_C8", "label": "save_pickle()", "type": "expression", "loc": [507, 508], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L476_C4", "vector": [8, 2, 0.551, 0.0022, 2, 0.55, 0.6923, 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({'x_l':x_l,'y_l':y_l,'z_l':z_l,'inv_mean_list':inv_mean_list,'std_list':std_list},\n 'stiff_dict_'+ut.formatted_time()+'.pkl')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L509_C8", "label": "plot_points()", "type": "expression", "loc": [509, 509], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L476_C4", "vector": [8, 2, 0.5527, 0.0011, 2, 0.55, 0.7692, 111, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "plot_points", "arg_names": [], "import_names": [], "rhs_call_name": "plot_points", "annotation": ""}, "snippet": " d3m.plot_points(np.matrix([x_l,y_l,z_l]),scalar_list=inv_mean_list,mode='sphere')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L510_C8", "label": "axes()", "type": "expression", "loc": [510, 510], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L476_C4", "vector": [8, 2, 0.5537, 0.0011, 2, 0.55, 0.8462, 590, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "axes", "arg_names": [], "import_names": [], "rhs_call_name": "axes", "annotation": ""}, "snippet": " mlab.axes()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L511_C8", "label": "show()", "type": "expression", "loc": [511, 511], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L476_C4", "vector": [8, 2, 0.5548, 0.0011, 2, 0.55, 0.9231, 497, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "show", "arg_names": [], "import_names": [], "rhs_call_name": "show", "annotation": ""}, "snippet": " d3m.show()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L513_C8", "label": "exit()", "type": "expression", "loc": [513, 513], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L476_C4", "vector": [8, 2, 0.557, 0.0011, 2, 0.55, 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_99527:If_L515_C4", "label": "if", "type": "if", "loc": [515, 518], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "vector": [4, 1, 0.5608, 0.0043, 1, 0.18, 0.6545, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if fname=='':\n print('please specify a pkl file (-f option)')\n print('Exiting...')\n sys.exit()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L516_C8", "label": "print()", "type": "expression", "loc": [516, 516], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L515_C4", "vector": [8, 2, 0.5603, 0.0011, 2, 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('please specify a pkl file (-f option)')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L517_C8", "label": "print()", "type": "expression", "loc": [517, 517], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L515_C4", "vector": [8, 2, 0.5613, 0.0011, 2, 0.54, 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_99527:Expr_L518_C8", "label": "exit()", "type": "expression", "loc": [518, 518], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L515_C4", "vector": [8, 2, 0.5624, 0.0011, 2, 0.54, 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_99527:Assign_L520_C4", "label": "d = load_pickle()", "type": "assigned_variable", "loc": [520, 520], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "vector": [14, 1, 0.5646, 0.0011, 1, 0.18, 0.6727, 355, 3, 1, 0, 0, 65, 10, 1], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "load_pickle", "annotation": ""}, "snippet": " d = ut.load_pickle(fname)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L521_C4", "label": "actual_cartesian_tl = joint_to_cartesian()", "type": "assigned_variable", "loc": [521, 521], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "vector": [14, 1, 0.5657, 0.0011, 1, 0.18, 0.6909, 396, 3, 1, 0, 0, 202, 10, 1], "semantic": {"name": "actual_cartesian_tl", "arg_names": [], "import_names": [], "rhs_call_name": "joint_to_cartesian", "annotation": ""}, "snippet": " actual_cartesian_tl = joint_to_cartesian(d['actual'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L522_C4", "label": "actual_cartesian = account_segway_motion()", "type": "assigned_variable", "loc": [522, 522], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "vector": [14, 1, 0.5668, 0.0011, 1, 0.18, 0.7091, 824, 3, 2, 0, 0, 119, 10, 1], "semantic": {"name": "actual_cartesian", "arg_names": [], "import_names": [], "rhs_call_name": "account_segway_motion", "annotation": ""}, "snippet": " actual_cartesian = account_segway_motion(actual_cartesian_tl,d['segway'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L523_C4", "label": "if", "type": "if", "loc": [523, 525], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "vector": [4, 1, 0.5689, 0.0033, 1, 0.18, 0.7273, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if d.has_key('zenither_list'):\n actual_cartesian = account_zenithering(actual_cartesian,\n d['zenither_list'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L524_C8", "label": "actual_cartesian = account_zenithering()", "type": "assigned_variable", "loc": [524, 525], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L523_C4", "vector": [14, 2, 0.5695, 0.0022, 2, 0.22, 0.0, 824, 3, 2, 0, 0, 583, 10, 1], "semantic": {"name": "actual_cartesian", "arg_names": [], "import_names": [], "rhs_call_name": "account_zenithering", "annotation": ""}, "snippet": " actual_cartesian = account_zenithering(actual_cartesian,\n d['zenither_list'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L527_C4", "label": "eq_cartesian_tl = joint_to_cartesian()", "type": "assigned_variable", "loc": [527, 527], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "vector": [14, 1, 0.5722, 0.0011, 1, 0.18, 0.7455, 715, 3, 1, 0, 0, 202, 10, 1], "semantic": {"name": "eq_cartesian_tl", "arg_names": [], "import_names": [], "rhs_call_name": "joint_to_cartesian", "annotation": ""}, "snippet": " eq_cartesian_tl = joint_to_cartesian(d['eq_pt'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L528_C4", "label": "eq_cartesian = account_segway_motion()", "type": "assigned_variable", "loc": [528, 528], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "vector": [14, 1, 0.5733, 0.0011, 1, 0.18, 0.7636, 883, 3, 2, 0, 0, 119, 10, 1], "semantic": {"name": "eq_cartesian", "arg_names": [], "import_names": [], "rhs_call_name": "account_segway_motion", "annotation": ""}, "snippet": " eq_cartesian = account_segway_motion(eq_cartesian_tl, d['segway'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L529_C4", "label": "if", "type": "if", "loc": [529, 530], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "vector": [4, 1, 0.5749, 0.0022, 1, 0.18, 0.7818, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if d.has_key('zenither_list'):\n eq_cartesian = account_zenithering(eq_cartesian, d['zenither_list'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L530_C8", "label": "eq_cartesian = account_zenithering()", "type": "assigned_variable", "loc": [530, 530], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L529_C4", "vector": [14, 2, 0.5755, 0.0011, 2, 0.03, 0.0, 883, 3, 2, 0, 0, 583, 10, 1], "semantic": {"name": "eq_cartesian", "arg_names": [], "import_names": [], "rhs_call_name": "account_zenithering", "annotation": ""}, "snippet": " eq_cartesian = account_zenithering(eq_cartesian, d['zenither_list'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L532_C4", "label": "cartesian_force_clean, _ = filter_trajectory_force()", "type": "assigned_variable", "loc": [532, 533], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "vector": [14, 1, 0.5782, 0.0022, 1, 0.18, 0.8, 298, 3, 2, 0, 0, 811, 10, 1], "semantic": {"name": "cartesian_force_clean, _", "arg_names": [], "import_names": [], "rhs_call_name": "filter_trajectory_force", "annotation": ""}, "snippet": " cartesian_force_clean, _ = filter_trajectory_force(actual_cartesian,\n d['force'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L534_C4", "label": "pts_2d, reject_idx = filter_cartesian_trajectory()", "type": "assigned_variable", "loc": [534, 534], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "vector": [14, 1, 0.5798, 0.0011, 1, 0.18, 0.8182, 285, 3, 1, 0, 0, 996, 10, 1], "semantic": {"name": "pts_2d, reject_idx", "arg_names": [], "import_names": [], "rhs_call_name": "filter_cartesian_trajectory", "annotation": ""}, "snippet": " pts_2d, reject_idx = filter_cartesian_trajectory(cartesian_force_clean)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L536_C4", "label": "if", "type": "if", "loc": [536, 573], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "vector": [4, 1, 0.6021, 0.0413, 1, 0.18, 0.8364, 0, 0, 0, 0, 0, 0, 0, 22], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if rad != None:\n #rad = 0.39 # lab cabinet recessed.\n #rad = 0.42 # kitchen cabinet\n #rad = 0.80 # lab glass door\n pts_list = actual_cartesian.p_list\n eq_pts_list = eq_cartesian.p_list\n ee_start_pos = pts_list[0]\n x_guess = ee_start_pos[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L540_C8", "label": "pts_list =", "type": "assigned_variable", "loc": [540, 540], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L536_C4", "vector": [14, 2, 0.5863, 0.0011, 2, 0.01, 0.0, 713, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pts_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pts_list = actual_cartesian.p_list"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L541_C8", "label": "eq_pts_list =", "type": "assigned_variable", "loc": [541, 541], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L536_C4", "vector": [14, 2, 0.5874, 0.0011, 2, 0.01, 0.0769, 441, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "eq_pts_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " eq_pts_list = eq_cartesian.p_list"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L542_C8", "label": "ee_start_pos =", "type": "assigned_variable", "loc": [542, 542], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L536_C4", "vector": [14, 2, 0.5885, 0.0011, 2, 0.01, 0.1538, 996, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ee_start_pos", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ee_start_pos = pts_list[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L543_C8", "label": "x_guess =", "type": "assigned_variable", "loc": [543, 543], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L536_C4", "vector": [14, 2, 0.5896, 0.0011, 2, 0.01, 0.2308, 547, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "x_guess", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " x_guess = ee_start_pos[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L544_C8", "label": "y_guess =", "type": "assigned_variable", "loc": [544, 544], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L536_C4", "vector": [14, 2, 0.5907, 0.0011, 2, 0.01, 0.3077, 583, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "y_guess", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " y_guess = ee_start_pos[1] - rad"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L545_C8", "label": "print()", "type": "expression", "loc": [545, 545], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L536_C4", "vector": [8, 2, 0.5917, 0.0011, 2, 0.01, 0.3846, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('before call to fit_rotary_joint')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L546_C8", "label": "force_list =", "type": "assigned_variable", "loc": [546, 546], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L536_C4", "vector": [14, 2, 0.5928, 0.0011, 2, 0.01, 0.4615, 906, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "force_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " force_list = d['force'].f_list"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L548_C8", "label": "if", "type": "if", "loc": [548, 562], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L536_C4", "vector": [4, 2, 0.6026, 0.0163, 2, 0.01, 0.5385, 0, 2, 0, 0, 0, 0, 0, 14], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if sturm_output:\n str_parts = fname.split('.')\n sturm_file_name = str_parts[0]+'_sturm.log'\n print('Sturm file name:', sturm_file_name)\n sturm_file = open(sturm_file_name,'w')\n sturm_pts = cartesian_force_clean.p_list\n print('len(sturm_pts):', len(sturm_pts))\n print('len(pts_list):', len(pts_list))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L549_C12", "label": "str_parts = split()", "type": "assigned_variable", "loc": [549, 549], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L548_C8", "vector": [14, 3, 0.5961, 0.0011, 3, 0.4, 0.0, 705, 3, 1, 0, 0, 908, 10, 1], "semantic": {"name": "str_parts", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": " str_parts = fname.split('.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L550_C12", "label": "sturm_file_name =", "type": "assigned_variable", "loc": [550, 550], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L548_C8", "vector": [14, 3, 0.5972, 0.0011, 3, 0.4, 0.1111, 200, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "sturm_file_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " sturm_file_name = str_parts[0]+'_sturm.log'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L551_C12", "label": "print()", "type": "expression", "loc": [551, 551], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L548_C8", "vector": [8, 3, 0.5983, 0.0011, 3, 0.4, 0.2222, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Sturm file name:', sturm_file_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L552_C12", "label": "sturm_file = open()", "type": "assigned_variable", "loc": [552, 552], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L548_C8", "vector": [14, 3, 0.5993, 0.0011, 3, 0.4, 0.3333, 666, 3, 2, 0, 0, 693, 10, 1], "semantic": {"name": "sturm_file", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": " sturm_file = open(sturm_file_name,'w')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L553_C12", "label": "sturm_pts =", "type": "assigned_variable", "loc": [553, 553], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L548_C8", "vector": [14, 3, 0.6004, 0.0011, 3, 0.4, 0.4444, 526, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "sturm_pts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " sturm_pts = cartesian_force_clean.p_list"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L554_C12", "label": "print()", "type": "expression", "loc": [554, 554], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L548_C8", "vector": [8, 3, 0.6015, 0.0011, 3, 0.4, 0.5556, 535, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('len(sturm_pts):', len(sturm_pts))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L555_C12", "label": "print()", "type": "expression", "loc": [555, 555], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L548_C8", "vector": [8, 3, 0.6026, 0.0011, 3, 0.4, 0.6667, 535, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('len(pts_list):', len(pts_list))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L557_C12", "label": "for i, p", "type": "for", "loc": [557, 559], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L548_C8", "vector": [6, 3, 0.6059, 0.0033, 3, 0.4, 0.7778, 816, 3, 0, 0, 0, 0, 0, 5], "semantic": {"name": "i, p", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i,p in enumerate(sturm_pts[1:]):\n sturm_file.write(\" \".join(map(str,p)))\n sturm_file.write('\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L558_C16", "label": "write()", "type": "expression", "loc": [558, 558], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L557_C12", "vector": [8, 4, 0.6059, 0.0011, 4, 0.42, 0.0, 837, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " sturm_file.write(\" \".join(map(str,p)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L559_C16", "label": "write()", "type": "expression", "loc": [559, 559], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L557_C12", "vector": [8, 4, 0.6069, 0.0011, 4, 0.42, 1.0, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " sturm_file.write('\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L561_C12", "label": "write()", "type": "expression", "loc": [561, 561], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L548_C8", "vector": [8, 3, 0.6091, 0.0011, 3, 0.4, 0.8889, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " sturm_file.write('\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L562_C12", "label": "close()", "type": "expression", "loc": [562, 562], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L548_C8", "vector": [8, 3, 0.6102, 0.0011, 3, 0.4, 1.0, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": " sturm_file.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L564_C8", "label": "rad_guess =", "type": "assigned_variable", "loc": [564, 564], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L536_C4", "vector": [14, 2, 0.6124, 0.0011, 2, 0.01, 0.6154, 590, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "rad_guess", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rad_guess = rad"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L565_C8", "label": "rad, cx, cy = fit_circle()", "type": "assigned_variable", "loc": [565, 566], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L536_C4", "vector": [14, 2, 0.614, 0.0022, 2, 0.01, 0.6923, 693, 3, 6, 0, 0, 441, 10, 1], "semantic": {"name": "rad, cx, cy", "arg_names": [], "import_names": [], "rhs_call_name": "fit_circle", "annotation": ""}, "snippet": " rad, cx, cy = fit_circle(rad_guess,x_guess,y_guess,pts_2d,\n method='fmin_bfgs',verbose=False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L567_C8", "label": "c_ts =", "type": "assigned_variable", "loc": [567, 567], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L536_C4", "vector": [14, 2, 0.6156, 0.0011, 2, 0.01, 0.7692, 123, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "c_ts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " c_ts = np.matrix([cx, cy, 0.]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L568_C8", "label": "start_angle = angle_within_mod180()", "type": "assigned_variable", "loc": [568, 569], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L536_C4", "vector": [14, 2, 0.6173, 0.0022, 2, 0.01, 0.8462, 662, 3, 1, 0, 0, 694, 10, 2], "semantic": {"name": "start_angle", "arg_names": [], "import_names": [], "rhs_call_name": "angle_within_mod180", "annotation": ""}, "snippet": " start_angle = tr.angle_within_mod180(math.atan2(pts_2d[0,1]-cy,\n pts_2d[0,0]-cx) - math.pi/2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L570_C8", "label": "end_angle = angle_within_mod180()", "type": "assigned_variable", "loc": [570, 571], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L536_C4", "vector": [14, 2, 0.6194, 0.0022, 2, 0.01, 0.9231, 919, 3, 1, 0, 0, 694, 10, 2], "semantic": {"name": "end_angle", "arg_names": [], "import_names": [], "rhs_call_name": "angle_within_mod180", "annotation": ""}, "snippet": " end_angle = tr.angle_within_mod180(math.atan2(pts_2d[-1,1]-cy,\n pts_2d[-1,0]-cx) - math.pi/2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L572_C8", "label": "plot_circle()", "type": "expression", "loc": [572, 573], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L536_C4", "vector": [8, 2, 0.6216, 0.0022, 2, 0.01, 1.0, 365, 3, 7, 0, 0, 0, 0, 1], "semantic": {"name": "plot_circle", "arg_names": [], "import_names": [], "rhs_call_name": "plot_circle", "annotation": ""}, "snippet": " mpu.plot_circle(cx, cy, rad, start_angle, end_angle,\n label='Actual\\_opt', color='r')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "label": "if", "type": "if", "loc": [576, 736], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "vector": [4, 1, 0.7123, 0.1748, 1, 0.18, 0.8545, 0, 7, 0, 0, 0, 0, 0, 76], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if opt.icra_presentation_plot:\n mpu.set_figure_size(30,20)\n rad = 1.0\n x_guess = pts_2d[0,0]\n y_guess = pts_2d[1,0] - rad\n\n rad_guess = rad\n rad, cx, cy = fit_circle(rad_guess,x_guess,y_guess,pts_2d,"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L577_C8", "label": "set_figure_size()", "type": "expression", "loc": [577, 577], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "vector": [8, 2, 0.6265, 0.0011, 2, 0.45, 0.0, 342, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "set_figure_size", "arg_names": [], "import_names": [], "rhs_call_name": "set_figure_size", "annotation": ""}, "snippet": " mpu.set_figure_size(30,20)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L578_C8", "label": "rad =", "type": "assigned_variable", "loc": [578, 578], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "vector": [14, 2, 0.6276, 0.0011, 2, 0.45, 0.0114, 439, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "rad", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rad = 1.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L579_C8", "label": "x_guess =", "type": "assigned_variable", "loc": [579, 579], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "vector": [14, 2, 0.6287, 0.0011, 2, 0.45, 0.0227, 547, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "x_guess", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " x_guess = pts_2d[0,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L580_C8", "label": "y_guess =", "type": "assigned_variable", "loc": [580, 580], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "vector": [14, 2, 0.6298, 0.0011, 2, 0.45, 0.0341, 583, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "y_guess", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " y_guess = pts_2d[1,0] - rad"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L582_C8", "label": "rad_guess =", "type": "assigned_variable", "loc": [582, 582], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "vector": [14, 2, 0.6319, 0.0011, 2, 0.45, 0.0455, 590, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "rad_guess", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rad_guess = rad"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L583_C8", "label": "rad, cx, cy = fit_circle()", "type": "assigned_variable", "loc": [583, 584], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "vector": [14, 2, 0.6336, 0.0022, 2, 0.45, 0.0568, 693, 3, 6, 0, 0, 441, 10, 1], "semantic": {"name": "rad, cx, cy", "arg_names": [], "import_names": [], "rhs_call_name": "fit_circle", "annotation": ""}, "snippet": " rad, cx, cy = fit_circle(rad_guess,x_guess,y_guess,pts_2d,\n method='fmin_bfgs',verbose=False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L585_C8", "label": "print()", "type": "expression", "loc": [585, 585], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "vector": [8, 2, 0.6352, 0.0011, 2, 0.45, 0.0682, 535, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Estimated rad, cx, cy:', rad, cx, cy)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L587_C8", "label": "start_angle = angle_within_mod180()", "type": "assigned_variable", "loc": [587, 588], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "vector": [14, 2, 0.6379, 0.0022, 2, 0.45, 0.0795, 662, 3, 1, 0, 0, 694, 10, 2], "semantic": {"name": "start_angle", "arg_names": [], "import_names": [], "rhs_call_name": "angle_within_mod180", "annotation": ""}, "snippet": " start_angle = tr.angle_within_mod180(math.atan2(pts_2d[1,0]-cy,\n pts_2d[0,0]-cx) - math.pi/2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L589_C8", "label": "end_angle = angle_within_mod180()", "type": "assigned_variable", "loc": [589, 590], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "vector": [14, 2, 0.6401, 0.0022, 2, 0.45, 0.0909, 919, 3, 1, 0, 0, 694, 10, 2], "semantic": {"name": "end_angle", "arg_names": [], "import_names": [], "rhs_call_name": "angle_within_mod180", "annotation": ""}, "snippet": " end_angle = tr.angle_within_mod180(math.atan2(pts_2d[1,-1]-cy,\n pts_2d[0,-1]-cx) - math.pi/2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L592_C8", "label": "subsample_ratio =", "type": "assigned_variable", "loc": [592, 592], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "vector": [14, 2, 0.6428, 0.0011, 2, 0.45, 0.1023, 521, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "subsample_ratio", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " subsample_ratio = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L593_C8", "label": "pts_2d_s =", "type": "assigned_variable", "loc": [593, 593], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "vector": [14, 2, 0.6439, 0.0011, 2, 0.45, 0.1136, 476, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pts_2d_s", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pts_2d_s = pts_2d[:,::subsample_ratio]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L595_C8", "label": "cep_force_clean, force_new = filter_trajectory_force()", "type": "assigned_variable", "loc": [595, 596], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "vector": [14, 2, 0.6466, 0.0022, 2, 0.45, 0.125, 292, 3, 2, 0, 0, 811, 10, 1], "semantic": {"name": "cep_force_clean, force_new", "arg_names": [], "import_names": [], "rhs_call_name": "filter_trajectory_force", "annotation": ""}, "snippet": " cep_force_clean, force_new = filter_trajectory_force(eq_cartesian,\n d['force'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L597_C8", "label": "cep_2d =", "type": "assigned_variable", "loc": [597, 597], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "vector": [14, 2, 0.6482, 0.0011, 2, 0.45, 0.1364, 817, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "cep_2d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cep_2d = np.matrix(cep_force_clean.p_list).T[0:2,reject_idx:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L600_C8", "label": "figure()", "type": "expression", "loc": [600, 600], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "vector": [8, 2, 0.6515, 0.0011, 2, 0.45, 0.1477, 789, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "figure", "arg_names": [], "import_names": [], "rhs_call_name": "figure", "annotation": ""}, "snippet": " mpu.figure()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L601_C8", "label": "plot_yx()", "type": "expression", "loc": [601, 604], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "vector": [8, 2, 0.6542, 0.0043, 2, 0.45, 0.1591, 112, 3, 10, 0, 0, 0, 0, 1], "semantic": {"name": "plot_yx", "arg_names": [], "import_names": [], "rhs_call_name": "plot_yx", "annotation": ""}, "snippet": " mpu.plot_yx(pts_2d_s[1,:].A1, pts_2d_s[0,:].A1, color='b',\n label = 'FK', axis = 'equal', alpha = 1.0,\n scatter_size=7, linewidth=0, marker='x',\n marker_edge_width = 1.5)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L606_C8", "label": "cep_2d_s =", "type": "assigned_variable", "loc": [606, 606], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "vector": [14, 2, 0.658, 0.0011, 2, 0.45, 0.1705, 423, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "cep_2d_s", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cep_2d_s = cep_2d[:,::subsample_ratio]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L607_C8", "label": "plot_yx()", "type": "expression", "loc": [607, 610], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "vector": [8, 2, 0.6607, 0.0043, 2, 0.45, 0.1818, 112, 3, 10, 0, 0, 0, 0, 1], "semantic": {"name": "plot_yx", "arg_names": [], "import_names": [], "rhs_call_name": "plot_yx", "annotation": ""}, "snippet": " mpu.plot_yx(cep_2d_s[1,:].A1, cep_2d_s[0,:].A1, color='g',\n label = 'CEP', axis = 'equal', alpha = 1.0,\n scatter_size=10, linewidth=0, marker='+',\n marker_edge_width = 1.5)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L612_C8", "label": "plot_circle()", "type": "expression", "loc": [612, 614], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "vector": [8, 2, 0.6656, 0.0033, 2, 0.45, 0.1932, 365, 3, 8, 0, 0, 0, 0, 1], "semantic": {"name": "plot_circle", "arg_names": [], "import_names": [], "rhs_call_name": "plot_circle", "annotation": ""}, "snippet": " mpu.plot_circle(cx, cy, rad, start_angle, end_angle,\n label='Estimated Kinematics', color='r',\n alpha=0.7)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L615_C8", "label": "plot_radii()", "type": "expression", "loc": [615, 617], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "vector": [8, 2, 0.6688, 0.0033, 2, 0.45, 0.2045, 459, 3, 8, 0, 0, 0, 0, 1], "semantic": {"name": "plot_radii", "arg_names": [], "import_names": [], "rhs_call_name": "plot_radii", "annotation": ""}, "snippet": " mpu.plot_radii(cx, cy, rad, start_angle, end_angle,\n interval=end_angle-start_angle, color='r',\n alpha=0.7)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L618_C8", "label": "legend()", "type": "expression", "loc": [618, 618], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "vector": [8, 2, 0.671, 0.0011, 2, 0.45, 0.2159, 880, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "legend", "arg_names": [], "import_names": [], "rhs_call_name": "legend", "annotation": ""}, "snippet": " mpu.legend()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L619_C8", "label": "savefig()", "type": "expression", "loc": [619, 619], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "vector": [8, 2, 0.6721, 0.0011, 2, 0.45, 0.2273, 677, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "savefig", "arg_names": [], "import_names": [], "rhs_call_name": "savefig", "annotation": ""}, "snippet": " mpu.savefig('one.png')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L623_C8", "label": "zoom_location =", "type": "assigned_variable", "loc": [623, 623], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "vector": [14, 2, 0.6764, 0.0011, 2, 0.45, 0.2386, 164, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "zoom_location", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " zoom_location = 10"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L624_C8", "label": "pts_2d_zoom =", "type": "assigned_variable", "loc": [624, 624], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "vector": [14, 2, 0.6775, 0.0011, 2, 0.45, 0.25, 352, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pts_2d_zoom", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pts_2d_zoom = pts_2d[:,:zoom_location]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L625_C8", "label": "cep_2d_zoom =", "type": "assigned_variable", "loc": [625, 625], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "vector": [14, 2, 0.6786, 0.0011, 2, 0.45, 0.2614, 184, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "cep_2d_zoom", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cep_2d_zoom = cep_2d[:,:zoom_location]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L627_C8", "label": "figure()", "type": "expression", "loc": [627, 627], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "vector": [8, 2, 0.6808, 0.0011, 2, 0.45, 0.2727, 789, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "figure", "arg_names": [], "import_names": [], "rhs_call_name": "figure", "annotation": ""}, "snippet": " mpu.figure()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L628_C8", "label": "plot_yx()", "type": "expression", "loc": [628, 631], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "vector": [8, 2, 0.6835, 0.0043, 2, 0.45, 0.2841, 112, 3, 10, 0, 0, 0, 0, 1], "semantic": {"name": "plot_yx", "arg_names": [], "import_names": [], "rhs_call_name": "plot_yx", "annotation": ""}, "snippet": " mpu.plot_yx(pts_2d_zoom[1,:].A1, pts_2d_zoom[0,:].A1, color='b',\n label = 'FK', axis = 'equal', alpha = 1.0,\n scatter_size=7, linewidth=0, marker='x',\n marker_edge_width = 1.5)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L632_C8", "label": "plot_yx()", "type": "expression", "loc": [632, 635], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "vector": [8, 2, 0.6878, 0.0043, 2, 0.45, 0.2955, 112, 3, 10, 0, 0, 0, 0, 1], "semantic": {"name": "plot_yx", "arg_names": [], "import_names": [], "rhs_call_name": "plot_yx", "annotation": ""}, "snippet": " mpu.plot_yx(cep_2d_zoom[1,:].A1, cep_2d_zoom[0,:].A1, color='g',\n label = 'CEP', axis = 'equal', alpha = 1.0,\n scatter_size=10, linewidth=0, marker='+',\n marker_edge_width = 1.5)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L636_C8", "label": "xlim()", "type": "expression", "loc": [636, 636], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "vector": [8, 2, 0.6906, 0.0011, 2, 0.45, 0.3068, 907, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "xlim", "arg_names": [], "import_names": [], "rhs_call_name": "xlim", "annotation": ""}, "snippet": " mpu.pl.xlim(0.28, 0.47)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L637_C8", "label": "legend()", "type": "expression", "loc": [637, 637], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "vector": [8, 2, 0.6916, 0.0011, 2, 0.45, 0.3182, 880, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "legend", "arg_names": [], "import_names": [], "rhs_call_name": "legend", "annotation": ""}, "snippet": " mpu.legend()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L638_C8", "label": "savefig()", "type": "expression", "loc": [638, 638], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "vector": [8, 2, 0.6927, 0.0011, 2, 0.45, 0.3295, 677, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "savefig", "arg_names": [], "import_names": [], "rhs_call_name": "savefig", "annotation": ""}, "snippet": " mpu.savefig('two.png')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L640_C8", "label": "rad, cx, cy = fit_circle()", "type": "assigned_variable", "loc": [640, 641], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "vector": [14, 2, 0.6954, 0.0022, 2, 0.45, 0.3409, 693, 3, 6, 0, 0, 441, 10, 1], "semantic": {"name": "rad, cx, cy", "arg_names": [], "import_names": [], "rhs_call_name": "fit_circle", "annotation": ""}, "snippet": " rad, cx, cy = fit_circle(1.0,x_guess,y_guess,pts_2d_zoom,\n method='fmin_bfgs',verbose=False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L642_C8", "label": "print()", "type": "expression", "loc": [642, 642], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "vector": [8, 2, 0.6971, 0.0011, 2, 0.45, 0.3523, 535, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Estimated rad, cx, cy:', rad, cx, cy)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L643_C8", "label": "start_angle = angle_within_mod180()", "type": "assigned_variable", "loc": [643, 644], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "vector": [14, 2, 0.6987, 0.0022, 2, 0.45, 0.3636, 662, 3, 1, 0, 0, 694, 10, 2], "semantic": {"name": "start_angle", "arg_names": [], "import_names": [], "rhs_call_name": "angle_within_mod180", "annotation": ""}, "snippet": " start_angle = tr.angle_within_mod180(math.atan2(pts_2d[1,0]-cy,\n pts_2d[0,0]-cx) - math.pi/2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L645_C8", "label": "end_angle = angle_within_mod180()", "type": "assigned_variable", "loc": [645, 646], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "vector": [14, 2, 0.7009, 0.0022, 2, 0.45, 0.375, 919, 3, 1, 0, 0, 694, 10, 2], "semantic": {"name": "end_angle", "arg_names": [], "import_names": [], "rhs_call_name": "angle_within_mod180", "annotation": ""}, "snippet": " end_angle = tr.angle_within_mod180(math.atan2(pts_2d_zoom[1,-1]-cy,\n pts_2d_zoom[0,-1]-cx) - math.pi/2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L647_C8", "label": "plot_circle()", "type": "expression", "loc": [647, 649], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "vector": [8, 2, 0.7036, 0.0033, 2, 0.45, 0.3864, 365, 3, 8, 0, 0, 0, 0, 1], "semantic": {"name": "plot_circle", "arg_names": [], "import_names": [], "rhs_call_name": "plot_circle", "annotation": ""}, "snippet": " mpu.plot_circle(cx, cy, rad, start_angle, end_angle,\n label='Estimated Kinematics', color='r',\n alpha=0.7)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L650_C8", "label": "xlim()", "type": "expression", "loc": [650, 650], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "vector": [8, 2, 0.7058, 0.0011, 2, 0.45, 0.3977, 907, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "xlim", "arg_names": [], "import_names": [], "rhs_call_name": "xlim", "annotation": ""}, "snippet": " mpu.pl.xlim(0.28, 0.47)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L651_C8", "label": "legend()", "type": "expression", "loc": [651, 651], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "vector": [8, 2, 0.7068, 0.0011, 2, 0.45, 0.4091, 880, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "legend", "arg_names": [], "import_names": [], "rhs_call_name": "legend", "annotation": ""}, "snippet": " mpu.legend()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L652_C8", "label": "savefig()", "type": "expression", "loc": [652, 652], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "vector": [8, 2, 0.7079, 0.0011, 2, 0.45, 0.4205, 677, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "savefig", "arg_names": [], "import_names": [], "rhs_call_name": "savefig", "annotation": ""}, "snippet": " mpu.savefig('three.png')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L654_C8", "label": "current_pos =", "type": "assigned_variable", "loc": [654, 654], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "vector": [14, 2, 0.7101, 0.0011, 2, 0.45, 0.4318, 863, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "current_pos", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " current_pos = pts_2d_zoom[:,-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L655_C8", "label": "radial_vec =", "type": "assigned_variable", "loc": [655, 655], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "vector": [14, 2, 0.7112, 0.0011, 2, 0.45, 0.4432, 253, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "radial_vec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " radial_vec = current_pos - np.matrix([cx,cy]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L656_C8", "label": "radial_vec =", "type": "assigned_variable", "loc": [656, 656], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "vector": [14, 2, 0.7123, 0.0011, 2, 0.45, 0.4545, 253, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "radial_vec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " radial_vec = radial_vec / np.linalg.norm(radial_vec)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L657_C8", "label": "tangential_vec =", "type": "assigned_variable", "loc": [657, 657], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "vector": [14, 2, 0.7134, 0.0011, 2, 0.45, 0.4659, 367, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "tangential_vec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tangential_vec = np.matrix([[0,-1],[1,0]]) * radial_vec"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L658_C8", "label": "plot_quiver_yxv()", "type": "expression", "loc": [658, 660], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "vector": [8, 2, 0.7155, 0.0033, 2, 0.45, 0.4773, 776, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "plot_quiver_yxv", "arg_names": [], "import_names": [], "rhs_call_name": "plot_quiver_yxv", "annotation": ""}, "snippet": " mpu.plot_quiver_yxv([pts_2d_zoom[1,-1]],\n [pts_2d_zoom[0,-1]],\n radial_vec, scale=10., width = 0.002)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L661_C8", "label": "rad_text_loc =", "type": "assigned_variable", "loc": [661, 661], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "vector": [14, 2, 0.7177, 0.0011, 2, 0.45, 0.4886, 597, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "rad_text_loc", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rad_text_loc = pts_2d_zoom[:,-1] + np.matrix([0.001,0.01]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L662_C8", "label": "text()", "type": "expression", "loc": [662, 662], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "vector": [8, 2, 0.7188, 0.0011, 2, 0.45, 0.5, 439, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "text", "arg_names": [], "import_names": [], "rhs_call_name": "text", "annotation": ""}, "snippet": " mpu.pl.text(rad_text_loc[0,0], rad_text_loc[1,0], '\\huge{$\\hat v_{rad}$}')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L663_C8", "label": "plot_quiver_yxv()", "type": "expression", "loc": [663, 665], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "vector": [8, 2, 0.721, 0.0033, 2, 0.45, 0.5114, 776, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "plot_quiver_yxv", "arg_names": [], "import_names": [], "rhs_call_name": "plot_quiver_yxv", "annotation": ""}, "snippet": " mpu.plot_quiver_yxv([pts_2d_zoom[1,-1]],\n [pts_2d_zoom[0,-1]],\n tangential_vec, scale=10., width = 0.002)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L667_C8", "label": "tan_text_loc =", "type": "assigned_variable", "loc": [667, 667], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "vector": [14, 2, 0.7242, 0.0011, 2, 0.45, 0.5227, 444, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "tan_text_loc", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tan_text_loc = pts_2d_zoom[:,-1] + np.matrix([-0.012, -0.011]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L668_C8", "label": "text()", "type": "expression", "loc": [668, 668], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "vector": [8, 2, 0.7253, 0.0011, 2, 0.45, 0.5341, 439, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "text", "arg_names": [], "import_names": [], "rhs_call_name": "text", "annotation": ""}, "snippet": " mpu.pl.text(tan_text_loc[0,0], tan_text_loc[1,0], s = '\\huge{$\\hat v_{tan}$}')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L669_C8", "label": "xlim()", "type": "expression", "loc": [669, 669], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "vector": [8, 2, 0.7264, 0.0011, 2, 0.45, 0.5455, 907, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "xlim", "arg_names": [], "import_names": [], "rhs_call_name": "xlim", "annotation": ""}, "snippet": " mpu.pl.xlim(0.28, 0.47)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L670_C8", "label": "legend()", "type": "expression", "loc": [670, 670], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "vector": [8, 2, 0.7275, 0.0011, 2, 0.45, 0.5568, 880, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "legend", "arg_names": [], "import_names": [], "rhs_call_name": "legend", "annotation": ""}, "snippet": " mpu.legend()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L671_C8", "label": "savefig()", "type": "expression", "loc": [671, 671], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "vector": [8, 2, 0.7286, 0.0011, 2, 0.45, 0.5682, 677, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "savefig", "arg_names": [], "import_names": [], "rhs_call_name": "savefig", "annotation": ""}, "snippet": " mpu.savefig('four.png')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L673_C8", "label": "wrist_force =", "type": "assigned_variable", "loc": [673, 673], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "vector": [14, 2, 0.7307, 0.0011, 2, 0.45, 0.5795, 483, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "wrist_force", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " wrist_force = -np.matrix(force_new.f_list[zoom_location]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L674_C8", "label": "frad =", "type": "assigned_variable", "loc": [674, 674], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "vector": [14, 2, 0.7318, 0.0011, 2, 0.45, 0.5909, 209, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "frad", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " frad = (wrist_force[0:2,:].T * radial_vec)[0,0] * radial_vec"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L675_C8", "label": "plot_quiver_yxv()", "type": "expression", "loc": [675, 678], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "vector": [8, 2, 0.7345, 0.0043, 2, 0.45, 0.6023, 776, 3, 6, 0, 0, 0, 0, 1], "semantic": {"name": "plot_quiver_yxv", "arg_names": [], "import_names": [], "rhs_call_name": "plot_quiver_yxv", "annotation": ""}, "snippet": " mpu.plot_quiver_yxv([pts_2d_zoom[1,-1]],\n [pts_2d_zoom[0,-1]],\n wrist_force, scale=50., width = 0.002,\n color='y')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L679_C8", "label": "wf_text =", "type": "assigned_variable", "loc": [679, 679], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "vector": [14, 2, 0.7372, 0.0011, 2, 0.45, 0.6136, 613, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "wf_text", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " wf_text = rad_text_loc + np.matrix([-0.05,0.015]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L680_C8", "label": "text()", "type": "expression", "loc": [680, 681], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "vector": [8, 2, 0.7389, 0.0022, 2, 0.45, 0.625, 439, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "text", "arg_names": [], "import_names": [], "rhs_call_name": "text", "annotation": ""}, "snippet": " mpu.pl.text(wf_text[0,0], wf_text[1,0], color='y',\n fontsize = 15, s = 'Wrist Force')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L683_C8", "label": "plot_quiver_yxv()", "type": "expression", "loc": [683, 686], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "vector": [8, 2, 0.7432, 0.0043, 2, 0.45, 0.6364, 776, 3, 6, 0, 0, 0, 0, 1], "semantic": {"name": "plot_quiver_yxv", "arg_names": [], "import_names": [], "rhs_call_name": "plot_quiver_yxv", "annotation": ""}, "snippet": " mpu.plot_quiver_yxv([pts_2d_zoom[1,-1]],\n [pts_2d_zoom[0,-1]],\n frad, scale=50., width = 0.002,\n color='y')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L687_C8", "label": "frad_text =", "type": "assigned_variable", "loc": [687, 687], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "vector": [14, 2, 0.7459, 0.0011, 2, 0.45, 0.6477, 706, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "frad_text", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " frad_text = rad_text_loc + np.matrix([0.,0.015]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L688_C8", "label": "text()", "type": "expression", "loc": [688, 688], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "vector": [8, 2, 0.747, 0.0011, 2, 0.45, 0.6591, 439, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "text", "arg_names": [], "import_names": [], "rhs_call_name": "text", "annotation": ""}, "snippet": " mpu.pl.text(frad_text[0,0], frad_text[1,0], color='y', s = '\\huge{$\\hat F_{rad}$}')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L690_C8", "label": "xlim()", "type": "expression", "loc": [690, 690], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "vector": [8, 2, 0.7492, 0.0011, 2, 0.45, 0.6705, 907, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "xlim", "arg_names": [], "import_names": [], "rhs_call_name": "xlim", "annotation": ""}, "snippet": " mpu.pl.xlim(0.28, 0.47)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L691_C8", "label": "legend()", "type": "expression", "loc": [691, 691], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "vector": [8, 2, 0.7503, 0.0011, 2, 0.45, 0.6818, 880, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "legend", "arg_names": [], "import_names": [], "rhs_call_name": "legend", "annotation": ""}, "snippet": " mpu.legend()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L692_C8", "label": "savefig()", "type": "expression", "loc": [692, 692], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "vector": [8, 2, 0.7514, 0.0011, 2, 0.45, 0.6932, 677, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "savefig", "arg_names": [], "import_names": [], "rhs_call_name": "savefig", "annotation": ""}, "snippet": " mpu.savefig('five.png')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L694_C8", "label": "frad =", "type": "assigned_variable", "loc": [694, 694], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "vector": [14, 2, 0.7535, 0.0011, 2, 0.45, 0.7045, 209, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "frad", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " frad = (wrist_force[0:2,:].T * radial_vec)[0,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L695_C8", "label": "hook_force_motion =", "type": "assigned_variable", "loc": [695, 695], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "vector": [14, 2, 0.7546, 0.0011, 2, 0.45, 0.7159, 550, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "hook_force_motion", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " hook_force_motion = -(frad - 5) * radial_vec * 0.001"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L696_C8", "label": "tangential_motion =", "type": "assigned_variable", "loc": [696, 696], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "vector": [14, 2, 0.7557, 0.0011, 2, 0.45, 0.7273, 632, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "tangential_motion", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tangential_motion = 0.01 * tangential_vec"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L697_C8", "label": "total_cep_motion =", "type": "assigned_variable", "loc": [697, 697], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "vector": [14, 2, 0.7568, 0.0011, 2, 0.45, 0.7386, 240, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "total_cep_motion", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " total_cep_motion = hook_force_motion + tangential_motion"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L699_C8", "label": "plot_quiver_yxv()", "type": "expression", "loc": [699, 701], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "vector": [8, 2, 0.76, 0.0033, 2, 0.45, 0.75, 776, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "plot_quiver_yxv", "arg_names": [], "import_names": [], "rhs_call_name": "plot_quiver_yxv", "annotation": ""}, "snippet": " mpu.plot_quiver_yxv([cep_2d_zoom[1,-1]],\n [cep_2d_zoom[0,-1]],\n hook_force_motion, scale=0.1, width = 0.002)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L702_C8", "label": "hw_text =", "type": "assigned_variable", "loc": [702, 702], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "vector": [14, 2, 0.7622, 0.0011, 2, 0.45, 0.7614, 318, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "hw_text", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " hw_text = cep_2d_zoom[:,-1] + np.matrix([-0.002,-0.012]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L703_C8", "label": "text()", "type": "expression", "loc": [703, 704], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "vector": [8, 2, 0.7638, 0.0022, 2, 0.45, 0.7727, 439, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "text", "arg_names": [], "import_names": [], "rhs_call_name": "text", "annotation": ""}, "snippet": " mpu.pl.text(hw_text[0,0], hw_text[1,0], color='k', fontsize=14,\n s = '$h[t]$ = $0.1cm/N \\cdot (|\\hat{F}_{rad}|-5N) \\cdot \\hat{v}_{rad}$')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L705_C8", "label": "xlim()", "type": "expression", "loc": [705, 705], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "vector": [8, 2, 0.7655, 0.0011, 2, 0.45, 0.7841, 907, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "xlim", "arg_names": [], "import_names": [], "rhs_call_name": "xlim", "annotation": ""}, "snippet": " mpu.pl.xlim(0.28, 0.47)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L706_C8", "label": "legend()", "type": "expression", "loc": [706, 706], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "vector": [8, 2, 0.7666, 0.0011, 2, 0.45, 0.7955, 880, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "legend", "arg_names": [], "import_names": [], "rhs_call_name": "legend", "annotation": ""}, "snippet": " mpu.legend()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L707_C8", "label": "savefig()", "type": "expression", "loc": [707, 707], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "vector": [8, 2, 0.7676, 0.0011, 2, 0.45, 0.8068, 677, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "savefig", "arg_names": [], "import_names": [], "rhs_call_name": "savefig", "annotation": ""}, "snippet": " mpu.savefig('six.png')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L709_C8", "label": "plot_quiver_yxv()", "type": "expression", "loc": [709, 711], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "vector": [8, 2, 0.7709, 0.0033, 2, 0.45, 0.8182, 776, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "plot_quiver_yxv", "arg_names": [], "import_names": [], "rhs_call_name": "plot_quiver_yxv", "annotation": ""}, "snippet": " mpu.plot_quiver_yxv([cep_2d_zoom[1,-1]],\n [cep_2d_zoom[0,-1]],\n tangential_motion, scale=0.1, width = 0.002)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L712_C8", "label": "mw_text =", "type": "assigned_variable", "loc": [712, 712], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "vector": [14, 2, 0.7731, 0.0011, 2, 0.45, 0.8295, 189, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "mw_text", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mw_text = cep_2d_zoom[:,-1] + np.matrix([-0.038,0.001]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L713_C8", "label": "text()", "type": "expression", "loc": [713, 714], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "vector": [8, 2, 0.7747, 0.0022, 2, 0.45, 0.8409, 439, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "text", "arg_names": [], "import_names": [], "rhs_call_name": "text", "annotation": ""}, "snippet": " mpu.pl.text(mw_text[0,0], mw_text[1,0], color='k', fontsize=14,\n s = '$m[t]$ = $1cm \\cdot \\hat{v}_{tan}$')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L715_C8", "label": "xlim()", "type": "expression", "loc": [715, 715], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "vector": [8, 2, 0.7763, 0.0011, 2, 0.45, 0.8523, 907, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "xlim", "arg_names": [], "import_names": [], "rhs_call_name": "xlim", "annotation": ""}, "snippet": " mpu.pl.xlim(0.28, 0.47)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L716_C8", "label": "legend()", "type": "expression", "loc": [716, 716], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "vector": [8, 2, 0.7774, 0.0011, 2, 0.45, 0.8636, 880, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "legend", "arg_names": [], "import_names": [], "rhs_call_name": "legend", "annotation": ""}, "snippet": " mpu.legend()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L717_C8", "label": "savefig()", "type": "expression", "loc": [717, 717], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "vector": [8, 2, 0.7785, 0.0011, 2, 0.45, 0.875, 677, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "savefig", "arg_names": [], "import_names": [], "rhs_call_name": "savefig", "annotation": ""}, "snippet": " mpu.savefig('seven.png')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L719_C8", "label": "plot_quiver_yxv()", "type": "expression", "loc": [719, 721], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "vector": [8, 2, 0.7818, 0.0033, 2, 0.45, 0.8864, 776, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "plot_quiver_yxv", "arg_names": [], "import_names": [], "rhs_call_name": "plot_quiver_yxv", "annotation": ""}, "snippet": " mpu.plot_quiver_yxv([cep_2d_zoom[1,-1]],\n [cep_2d_zoom[0,-1]],\n total_cep_motion, scale=0.1, width = 0.002)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L722_C8", "label": "cep_text =", "type": "assigned_variable", "loc": [722, 722], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "vector": [14, 2, 0.7839, 0.0011, 2, 0.45, 0.8977, 424, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "cep_text", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cep_text = cep_2d_zoom[:,-1] + np.matrix([-0.058,-0.013]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L723_C8", "label": "text()", "type": "expression", "loc": [723, 724], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "vector": [8, 2, 0.7856, 0.0022, 2, 0.45, 0.9091, 439, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "text", "arg_names": [], "import_names": [], "rhs_call_name": "text", "annotation": ""}, "snippet": " mpu.pl.text(cep_text[0,0], cep_text[1,0], color='k', fontsize=14,\n s = '$x_{eq}[t]$ = &x_{eq}[t-1] + m[t] + h[t]$')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L725_C8", "label": "xlim()", "type": "expression", "loc": [725, 725], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "vector": [8, 2, 0.7872, 0.0011, 2, 0.45, 0.9205, 907, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "xlim", "arg_names": [], "import_names": [], "rhs_call_name": "xlim", "annotation": ""}, "snippet": " mpu.pl.xlim(0.28, 0.47)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L726_C8", "label": "legend()", "type": "expression", "loc": [726, 726], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "vector": [8, 2, 0.7883, 0.0011, 2, 0.45, 0.9318, 880, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "legend", "arg_names": [], "import_names": [], "rhs_call_name": "legend", "annotation": ""}, "snippet": " mpu.legend()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L727_C8", "label": "savefig()", "type": "expression", "loc": [727, 727], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "vector": [8, 2, 0.7894, 0.0011, 2, 0.45, 0.9432, 677, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "savefig", "arg_names": [], "import_names": [], "rhs_call_name": "savefig", "annotation": ""}, "snippet": " mpu.savefig('eight.png')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L729_C8", "label": "new_cep =", "type": "assigned_variable", "loc": [729, 729], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "vector": [14, 2, 0.7915, 0.0011, 2, 0.45, 0.9545, 483, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "new_cep", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " new_cep = cep_2d_zoom[:,-1] + total_cep_motion"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L730_C8", "label": "plot_yx()", "type": "expression", "loc": [730, 733], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "vector": [8, 2, 0.7942, 0.0043, 2, 0.45, 0.9659, 112, 3, 9, 0, 0, 0, 0, 1], "semantic": {"name": "plot_yx", "arg_names": [], "import_names": [], "rhs_call_name": "plot_yx", "annotation": ""}, "snippet": " mpu.plot_yx(new_cep[1,:].A1, new_cep[0,:].A1, color='g',\n axis = 'equal', alpha = 1.0,\n scatter_size=10, linewidth=0, marker='+',\n marker_edge_width = 1.5)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L734_C8", "label": "xlim()", "type": "expression", "loc": [734, 734], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "vector": [8, 2, 0.797, 0.0011, 2, 0.45, 0.9773, 907, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "xlim", "arg_names": [], "import_names": [], "rhs_call_name": "xlim", "annotation": ""}, "snippet": " mpu.pl.xlim(0.28, 0.47)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L735_C8", "label": "legend()", "type": "expression", "loc": [735, 735], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "vector": [8, 2, 0.798, 0.0011, 2, 0.45, 0.9886, 880, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "legend", "arg_names": [], "import_names": [], "rhs_call_name": "legend", "annotation": ""}, "snippet": " mpu.legend()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L736_C8", "label": "savefig()", "type": "expression", "loc": [736, 736], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "vector": [8, 2, 0.7991, 0.0011, 2, 0.45, 1.0, 677, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "savefig", "arg_names": [], "import_names": [], "rhs_call_name": "savefig", "annotation": ""}, "snippet": " mpu.savefig('nine.png')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L745_C4", "label": "if", "type": "if", "loc": [745, 802], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "vector": [4, 1, 0.8398, 0.063, 1, 0.18, 0.8727, 0, 2, 0, 0, 0, 0, 0, 36], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if plot_mechanism_frame:\n if expt_plot:\n pl.subplot(231)\n\n # transform points so that the mechanism is in a fixed position.\n start_pt = actual_cartesian.p_list[0]\n x_diff = start_pt[0] - cx\n y_diff = start_pt[1] - cy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L746_C8", "label": "if", "type": "if", "loc": [746, 747], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L745_C4", "vector": [4, 2, 0.8105, 0.0022, 2, 0.96, 0.0, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if expt_plot:\n pl.subplot(231)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L747_C12", "label": "subplot()", "type": "expression", "loc": [747, 747], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L746_C8", "vector": [8, 3, 0.8111, 0.0011, 3, 0.43, 0.0, 905, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "subplot", "arg_names": [], "import_names": [], "rhs_call_name": "subplot", "annotation": ""}, "snippet": " pl.subplot(231)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L750_C8", "label": "start_pt =", "type": "assigned_variable", "loc": [750, 750], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L745_C4", "vector": [14, 2, 0.8143, 0.0011, 2, 0.96, 0.027, 727, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "start_pt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " start_pt = actual_cartesian.p_list[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L751_C8", "label": "x_diff =", "type": "assigned_variable", "loc": [751, 751], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L745_C4", "vector": [14, 2, 0.8154, 0.0011, 2, 0.96, 0.0541, 533, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "x_diff", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " x_diff = start_pt[0] - cx"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L752_C8", "label": "y_diff =", "type": "assigned_variable", "loc": [752, 752], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L745_C4", "vector": [14, 2, 0.8165, 0.0011, 2, 0.96, 0.0811, 518, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "y_diff", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " y_diff = start_pt[1] - cy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L753_C8", "label": "angle =", "type": "assigned_variable", "loc": [753, 753], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L745_C4", "vector": [14, 2, 0.8176, 0.0011, 2, 0.96, 0.1081, 418, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "angle", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " angle = math.atan2(y_diff,x_diff) - math.radians(90)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L754_C8", "label": "rot_mat =", "type": "assigned_variable", "loc": [754, 754], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L745_C4", "vector": [14, 2, 0.8187, 0.0011, 2, 0.96, 0.1351, 968, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "rot_mat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rot_mat = tr.Rz(angle)[0:2,0:2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L755_C8", "label": "translation_mat =", "type": "assigned_variable", "loc": [755, 755], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L745_C4", "vector": [14, 2, 0.8198, 0.0011, 2, 0.96, 0.1622, 470, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "translation_mat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " translation_mat = np.matrix([cx,cy]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L757_C8", "label": "robot_width, robot_length =", "type": "assigned_variable", "loc": [757, 757], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L745_C4", "vector": [14, 2, 0.8219, 0.0011, 2, 0.96, 0.1892, 173, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "robot_width, robot_length", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " robot_width,robot_length = 0.1,0.2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L758_C8", "label": "robot_x_list =", "type": "assigned_variable", "loc": [758, 758], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L745_C4", "vector": [14, 2, 0.823, 0.0011, 2, 0.96, 0.2162, 173, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "robot_x_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " robot_x_list = [-robot_width/2,-robot_width/2,robot_width/2,robot_width/2,-robot_width/2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L759_C8", "label": "robot_y_list =", "type": "assigned_variable", "loc": [759, 759], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L745_C4", "vector": [14, 2, 0.8241, 0.0011, 2, 0.96, 0.2432, 364, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "robot_y_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " robot_y_list = [-robot_length/2,robot_length/2,robot_length/2,-robot_length/2,-robot_length/2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L760_C8", "label": "robot_mat =", "type": "assigned_variable", "loc": [760, 760], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L745_C4", "vector": [14, 2, 0.8252, 0.0011, 2, 0.96, 0.2703, 101, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "robot_mat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " robot_mat = rot_mat*(np.matrix([robot_x_list,robot_y_list]) - translation_mat)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L761_C8", "label": "plot_yx()", "type": "expression", "loc": [761, 762], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L745_C4", "vector": [8, 2, 0.8268, 0.0022, 2, 0.96, 0.2973, 112, 3, 7, 0, 0, 0, 0, 1], "semantic": {"name": "plot_yx", "arg_names": [], "import_names": [], "rhs_call_name": "plot_yx", "annotation": ""}, "snippet": " mpu.plot_yx(robot_mat[1,:].A1,robot_mat[0,:].A1,linewidth=2,scatter_size=0,\n color='k',label='torso', axis='equal')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L764_C8", "label": "pts2d_actual =", "type": "assigned_variable", "loc": [764, 764], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L745_C4", "vector": [14, 2, 0.8295, 0.0011, 2, 0.96, 0.3243, 824, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "pts2d_actual", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pts2d_actual = (np.matrix(actual_cartesian.p_list).T)[0:2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L765_C8", "label": "pts2d_actual_t =", "type": "assigned_variable", "loc": [765, 765], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L745_C4", "vector": [14, 2, 0.8306, 0.0011, 2, 0.96, 0.3514, 458, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pts2d_actual_t", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pts2d_actual_t = rot_mat *(pts2d_actual - translation_mat)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L766_C8", "label": "plot_yx()", "type": "expression", "loc": [766, 767], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L745_C4", "vector": [8, 2, 0.8322, 0.0022, 2, 0.96, 0.3784, 112, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "plot_yx", "arg_names": [], "import_names": [], "rhs_call_name": "plot_yx", "annotation": ""}, "snippet": " mpu.plot_yx(pts2d_actual_t[1,:].A1,pts2d_actual_t[0,:].A1,scatter_size=20,label='FK',\n axis = 'equal')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L769_C8", "label": "end_pt =", "type": "assigned_variable", "loc": [769, 769], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L745_C4", "vector": [14, 2, 0.835, 0.0011, 2, 0.96, 0.4054, 292, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "end_pt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " end_pt = pts2d_actual_t[:,-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L770_C8", "label": "end_angle = angle_within_mod180()", "type": "assigned_variable", "loc": [770, 770], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L745_C4", "vector": [14, 2, 0.836, 0.0011, 2, 0.96, 0.4324, 919, 3, 1, 0, 0, 694, 10, 3], "semantic": {"name": "end_angle", "arg_names": [], "import_names": [], "rhs_call_name": "angle_within_mod180", "annotation": ""}, "snippet": " end_angle = tr.angle_within_mod180(math.atan2(end_pt[1,0],end_pt[0,0])-math.radians(90))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L772_C8", "label": "plot_circle()", "type": "expression", "loc": [772, 772], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L745_C4", "vector": [8, 2, 0.8382, 0.0011, 2, 0.96, 0.4595, 365, 3, 7, 0, 0, 0, 0, 1], "semantic": {"name": "plot_circle", "arg_names": [], "import_names": [], "rhs_call_name": "plot_circle", "annotation": ""}, "snippet": " mpu.plot_circle(0,0,rad,0.,end_angle,label='Actual_opt',color='r')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L773_C8", "label": "plot_radii()", "type": "expression", "loc": [773, 773], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L745_C4", "vector": [8, 2, 0.8393, 0.0011, 2, 0.96, 0.4865, 459, 3, 7, 0, 0, 0, 0, 2], "semantic": {"name": "plot_radii", "arg_names": [], "import_names": [], "rhs_call_name": "plot_radii", "annotation": ""}, "snippet": " mpu.plot_radii(0,0,rad,0.,end_angle,interval=math.radians(15),color='r')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L774_C8", "label": "legend()", "type": "expression", "loc": [774, 774], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L745_C4", "vector": [8, 2, 0.8404, 0.0011, 2, 0.96, 0.5135, 880, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "legend", "arg_names": [], "import_names": [], "rhs_call_name": "legend", "annotation": ""}, "snippet": " pl.legend(loc='best')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L775_C8", "label": "axis()", "type": "expression", "loc": [775, 775], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L745_C4", "vector": [8, 2, 0.8415, 0.0011, 2, 0.96, 0.5405, 860, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "axis", "arg_names": [], "import_names": [], "rhs_call_name": "axis", "annotation": ""}, "snippet": " pl.axis('equal')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L777_C8", "label": "if", "type": "if", "loc": [777, 783], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L745_C4", "vector": [4, 2, 0.8469, 0.0076, 2, 0.96, 0.5676, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not(expt_plot):\n str_parts = fname.split('.')\n fig_name = str_parts[0]+'_robot_pose.png'\n pl.savefig(fig_name)\n pl.figure()\n else:\n pl.subplot(232)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L778_C12", "label": "str_parts = split()", "type": "assigned_variable", "loc": [778, 778], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L777_C8", "vector": [14, 3, 0.8447, 0.0011, 3, 0.12, 0.0, 705, 3, 1, 0, 0, 908, 10, 1], "semantic": {"name": "str_parts", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": " str_parts = fname.split('.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L779_C12", "label": "fig_name =", "type": "assigned_variable", "loc": [779, 779], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L777_C8", "vector": [14, 3, 0.8458, 0.0011, 3, 0.12, 0.25, 219, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "fig_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " fig_name = str_parts[0]+'_robot_pose.png'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L780_C12", "label": "savefig()", "type": "expression", "loc": [780, 780], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L777_C8", "vector": [8, 3, 0.8469, 0.0011, 3, 0.12, 0.5, 677, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "savefig", "arg_names": [], "import_names": [], "rhs_call_name": "savefig", "annotation": ""}, "snippet": " pl.savefig(fig_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L781_C12", "label": "figure()", "type": "expression", "loc": [781, 781], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L777_C8", "vector": [8, 3, 0.848, 0.0011, 3, 0.12, 0.75, 789, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "figure", "arg_names": [], "import_names": [], "rhs_call_name": "figure", "annotation": ""}, "snippet": " pl.figure()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L783_C12", "label": "subplot()", "type": "expression", "loc": [783, 783], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L777_C8", "vector": [8, 3, 0.8502, 0.0011, 3, 0.12, 1.0, 905, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "subplot", "arg_names": [], "import_names": [], "rhs_call_name": "subplot", "annotation": ""}, "snippet": " pl.subplot(232)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L785_C8", "label": "text()", "type": "expression", "loc": [785, 785], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L745_C4", "vector": [8, 2, 0.8523, 0.0011, 2, 0.96, 0.5946, 439, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "text", "arg_names": [], "import_names": [], "rhs_call_name": "text", "annotation": ""}, "snippet": " pl.text(0.1,0.15,d['info'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L786_C8", "label": "text()", "type": "expression", "loc": [786, 786], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L745_C4", "vector": [8, 2, 0.8534, 0.0011, 2, 0.96, 0.6216, 439, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "text", "arg_names": [], "import_names": [], "rhs_call_name": "text", "annotation": ""}, "snippet": " pl.text(0.1,0.10,'control: '+d['strategy'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L787_C8", "label": "text()", "type": "expression", "loc": [787, 787], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L745_C4", "vector": [8, 2, 0.8545, 0.0011, 2, 0.96, 0.6486, 439, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "text", "arg_names": [], "import_names": [], "rhs_call_name": "text", "annotation": ""}, "snippet": " pl.text(0.1,0.05,'robot angle: %.2f'%math.degrees(angle))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L788_C8", "label": "text()", "type": "expression", "loc": [788, 788], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L745_C4", "vector": [8, 2, 0.8556, 0.0011, 2, 0.96, 0.6757, 439, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "text", "arg_names": [], "import_names": [], "rhs_call_name": "text", "annotation": ""}, "snippet": " pl.text(0.1,0,'optimized radius: %.2f'%rad_opt)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L789_C8", "label": "text()", "type": "expression", "loc": [789, 789], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L745_C4", "vector": [8, 2, 0.8567, 0.0011, 2, 0.96, 0.7027, 439, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "text", "arg_names": [], "import_names": [], "rhs_call_name": "text", "annotation": ""}, "snippet": " pl.text(0.1,-0.05,'radius used: %.2f'%rad)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L790_C8", "label": "text()", "type": "expression", "loc": [790, 790], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L745_C4", "vector": [8, 2, 0.8578, 0.0011, 2, 0.96, 0.7297, 439, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "text", "arg_names": [], "import_names": [], "rhs_call_name": "text", "annotation": ""}, "snippet": " pl.text(0.1,-0.10,'opening angle: %.2f'%math.degrees(end_angle))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L791_C8", "label": "s_list =", "type": "assigned_variable", "loc": [791, 791], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L745_C4", "vector": [14, 2, 0.8588, 0.0011, 2, 0.96, 0.7568, 363, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "s_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " s_list = d['stiffness'].stiffness_list"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L792_C8", "label": "s_scale =", "type": "assigned_variable", "loc": [792, 792], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L745_C4", "vector": [14, 2, 0.8599, 0.0011, 2, 0.96, 0.7838, 389, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "s_scale", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " s_scale = d['stiffness'].stiffness_scale"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L793_C8", "label": "sl =", "type": "assigned_variable", "loc": [793, 793], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L745_C4", "vector": [14, 2, 0.861, 0.0011, 2, 0.96, 0.8108, 555, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "sl", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " sl = [min(s*s_scale,1.0) for s in s_list]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L794_C8", "label": "text()", "type": "expression", "loc": [794, 794], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L745_C4", "vector": [8, 2, 0.8621, 0.0011, 2, 0.96, 0.8378, 439, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "text", "arg_names": [], "import_names": [], "rhs_call_name": "text", "annotation": ""}, "snippet": " pl.text(0.1,-0.15,'stiffness list: %.2f, %.2f, %.2f, %.2f'%(sl[0],sl[1],sl[2],sl[3]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L795_C8", "label": "text()", "type": "expression", "loc": [795, 795], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L745_C4", "vector": [8, 2, 0.8632, 0.0011, 2, 0.96, 0.8649, 439, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "text", "arg_names": [], "import_names": [], "rhs_call_name": "text", "annotation": ""}, "snippet": " pl.text(0.1,-0.20,'stop condition: '+d['result'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L796_C8", "label": "time_dict =", "type": "assigned_variable", "loc": [796, 796], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L745_C4", "vector": [14, 2, 0.8643, 0.0011, 2, 0.96, 0.8919, 361, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "time_dict", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " time_dict = d['time_dict']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L797_C8", "label": "text()", "type": "expression", "loc": [797, 797], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L745_C4", "vector": [8, 2, 0.8654, 0.0011, 2, 0.96, 0.9189, 439, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "text", "arg_names": [], "import_names": [], "rhs_call_name": "text", "annotation": ""}, "snippet": " pl.text(0.1,-0.25,'time to hook: %.2f'%(time_dict['before_hook']-time_dict['before_pull']))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L798_C8", "label": "text()", "type": "expression", "loc": [798, 798], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L745_C4", "vector": [8, 2, 0.8664, 0.0011, 2, 0.96, 0.9459, 439, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "text", "arg_names": [], "import_names": [], "rhs_call_name": "text", "annotation": ""}, "snippet": " pl.text(0.1,-0.30,'time to pull: %.2f'%(time_dict['before_pull']-time_dict['after_pull']))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L800_C8", "label": "ylim()", "type": "expression", "loc": [800, 800], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L745_C4", "vector": [8, 2, 0.8686, 0.0011, 2, 0.96, 0.973, 247, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "ylim", "arg_names": [], "import_names": [], "rhs_call_name": "ylim", "annotation": ""}, "snippet": " pl.ylim(-0.45,0.25)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L801_C8", "label": "if", "type": "if", "loc": [801, 802], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L745_C4", "vector": [4, 2, 0.8702, 0.0022, 2, 0.96, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not(expt_plot):\n pl.figure()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L802_C12", "label": "figure()", "type": "expression", "loc": [802, 802], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L801_C8", "vector": [8, 3, 0.8708, 0.0011, 3, 0.99, 0.0, 789, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "figure", "arg_names": [], "import_names": [], "rhs_call_name": "figure", "annotation": ""}, "snippet": " pl.figure()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L804_C4", "label": "if", "type": "if", "loc": [804, 829], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "vector": [4, 1, 0.8865, 0.0282, 1, 0.18, 0.8909, 0, 2, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if xy_flag:\n st_pt = pts_2d[:,0]\n end_pt = pts_2d[:,-1]\n\n# if rad != None:\n# start_angle = tr.angle_within_mod180(math.atan2(st_pt[1,0]-cy,st_pt[0,0]-cx) - math.radians(90))\n# end_angle = tr.angle_within_mod180(math.atan2(end_pt[1,0]-cy,end_pt[0,0]-cx) - math.radians(90))\n# "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L805_C8", "label": "st_pt =", "type": "assigned_variable", "loc": [805, 805], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L804_C4", "vector": [14, 2, 0.874, 0.0011, 2, 0.74, 0.0, 515, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "st_pt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " st_pt = pts_2d[:,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L806_C8", "label": "end_pt =", "type": "assigned_variable", "loc": [806, 806], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L804_C4", "vector": [14, 2, 0.8751, 0.0011, 2, 0.74, 0.2, 292, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "end_pt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " end_pt = pts_2d[:,-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L815_C8", "label": "if", "type": "if", "loc": [815, 816], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L804_C4", "vector": [4, 2, 0.8855, 0.0022, 2, 0.74, 0.4, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if expt_plot:\n pl.subplot(233)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L816_C12", "label": "subplot()", "type": "expression", "loc": [816, 816], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L815_C8", "vector": [8, 3, 0.886, 0.0011, 3, 0.67, 0.0, 905, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "subplot", "arg_names": [], "import_names": [], "rhs_call_name": "subplot", "annotation": ""}, "snippet": " pl.subplot(233)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L818_C8", "label": "plot_cartesian()", "type": "expression", "loc": [818, 819], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L804_C4", "vector": [8, 2, 0.8887, 0.0022, 2, 0.74, 0.6, 991, 3, 6, 0, 0, 0, 0, 1], "semantic": {"name": "plot_cartesian", "arg_names": [], "import_names": [], "rhs_call_name": "plot_cartesian", "annotation": ""}, "snippet": " plot_cartesian(actual_cartesian, xaxis=0, yaxis=1, color='b',\n label='FK', plot_velocity=False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L820_C8", "label": "plot_cartesian()", "type": "expression", "loc": [820, 820], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L804_C4", "vector": [8, 2, 0.8903, 0.0011, 2, 0.74, 0.8, 991, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "plot_cartesian", "arg_names": [], "import_names": [], "rhs_call_name": "plot_cartesian", "annotation": ""}, "snippet": " plot_cartesian(eq_cartesian, xaxis=0,yaxis=1,color='g',label='Eq Point')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L824_C4", "label": "if", "type": "if", "loc": [824, 829], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L804_C4", "vector": [4, 2, 0.8974, 0.0065, 2, 0.74, 1.0, 0, 2, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif yz_flag:\n plot_cartesian(actual_cartesian,xaxis=1,yaxis=2,color='b',label='FK')\n plot_cartesian(eq_cartesian, xaxis=1,yaxis=2,color='g',label='Eq Point')\n elif xz_flag:\n plot_cartesian(actual_cartesian,xaxis=0,yaxis=2,color='b',label='FK')\n plot_cartesian(eq_cartesian, xaxis=0,yaxis=2,color='g',label='Eq Point')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L825_C8", "label": "plot_cartesian()", "type": "expression", "loc": [825, 825], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L824_C4", "vector": [8, 3, 0.8958, 0.0011, 3, 0.76, 0.0, 991, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "plot_cartesian", "arg_names": [], "import_names": [], "rhs_call_name": "plot_cartesian", "annotation": ""}, "snippet": " plot_cartesian(actual_cartesian,xaxis=1,yaxis=2,color='b',label='FK')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L826_C8", "label": "plot_cartesian()", "type": "expression", "loc": [826, 826], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L824_C4", "vector": [8, 3, 0.8969, 0.0011, 3, 0.76, 0.5, 991, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "plot_cartesian", "arg_names": [], "import_names": [], "rhs_call_name": "plot_cartesian", "annotation": ""}, "snippet": " plot_cartesian(eq_cartesian, xaxis=1,yaxis=2,color='g',label='Eq Point')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L827_C4", "label": "if", "type": "if", "loc": [827, 829], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L824_C4", "vector": [4, 3, 0.899, 0.0033, 3, 0.76, 1.0, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif xz_flag:\n plot_cartesian(actual_cartesian,xaxis=0,yaxis=2,color='b',label='FK')\n plot_cartesian(eq_cartesian, xaxis=0,yaxis=2,color='g',label='Eq Point')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L828_C8", "label": "plot_cartesian()", "type": "expression", "loc": [828, 828], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L827_C4", "vector": [8, 4, 0.899, 0.0011, 4, 0.68, 0.0, 991, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "plot_cartesian", "arg_names": [], "import_names": [], "rhs_call_name": "plot_cartesian", "annotation": ""}, "snippet": " plot_cartesian(actual_cartesian,xaxis=0,yaxis=2,color='b',label='FK')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L829_C8", "label": "plot_cartesian()", "type": "expression", "loc": [829, 829], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L827_C4", "vector": [8, 4, 0.9001, 0.0011, 4, 0.68, 1.0, 991, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "plot_cartesian", "arg_names": [], "import_names": [], "rhs_call_name": "plot_cartesian", "annotation": ""}, "snippet": " plot_cartesian(eq_cartesian, xaxis=0,yaxis=2,color='g',label='Eq Point')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L832_C4", "label": "if", "type": "if", "loc": [832, 884], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "vector": [4, 1, 0.9316, 0.0575, 1, 0.18, 0.9091, 0, 0, 0, 0, 0, 0, 0, 23], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if plot_forces_flag or plot_forces_error_flag or plot_ellipses_flag or plot_force_components_flag or plot_force_field_flag:\n arm_stiffness_list = d['stiffness'].stiffness_list\n scale = d['stiffness'].stiffness_scale\n asl = [min(scale*s,1.0) for s in arm_stiffness_list]\n ftraj_jinv,ftraj_stiff,ftraj_torque,k_cart_list=compute_forces(d['actual'],d['eq_pt'],\n d['torque'],asl)\n if plot_forces_flag:\n plot_forces_quiver(actual_cartesian,d['force'],color='k')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L833_C8", "label": "arm_stiffness_list =", "type": "assigned_variable", "loc": [833, 833], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L832_C4", "vector": [14, 2, 0.9045, 0.0011, 2, 0.82, 0.0, 442, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "arm_stiffness_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " arm_stiffness_list = d['stiffness'].stiffness_list"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L834_C8", "label": "scale =", "type": "assigned_variable", "loc": [834, 834], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L832_C4", "vector": [14, 2, 0.9055, 0.0011, 2, 0.82, 0.125, 18, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "scale", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " scale = d['stiffness'].stiffness_scale"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L835_C8", "label": "asl =", "type": "assigned_variable", "loc": [835, 835], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L832_C4", "vector": [14, 2, 0.9066, 0.0011, 2, 0.82, 0.25, 870, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "asl", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " asl = [min(scale*s,1.0) for s in arm_stiffness_list]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L836_C8", "label": "ftraj_jinv, ftraj_stiff, ftraj_torque, k_cart_list = compute_forces()", "type": "assigned_variable", "loc": [836, 837], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L832_C4", "vector": [14, 2, 0.9083, 0.0022, 2, 0.82, 0.375, 537, 3, 4, 0, 0, 761, 10, 1], "semantic": {"name": "ftraj_jinv, ftraj_stiff, ftraj_torque, k_cart_list", "arg_names": [], "import_names": [], "rhs_call_name": "compute_forces", "annotation": ""}, "snippet": " ftraj_jinv,ftraj_stiff,ftraj_torque,k_cart_list=compute_forces(d['actual'],d['eq_pt'],\n d['torque'],asl)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L838_C8", "label": "if", "type": "if", "loc": [838, 839], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L832_C4", "vector": [4, 2, 0.9104, 0.0022, 2, 0.82, 0.5, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if plot_forces_flag:\n plot_forces_quiver(actual_cartesian,d['force'],color='k')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L839_C12", "label": "plot_forces_quiver()", "type": "expression", "loc": [839, 839], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L838_C8", "vector": [8, 3, 0.911, 0.0011, 3, 0.12, 0.0, 539, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "plot_forces_quiver", "arg_names": [], "import_names": [], "rhs_call_name": "plot_forces_quiver", "annotation": ""}, "snippet": " plot_forces_quiver(actual_cartesian,d['force'],color='k')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L843_C8", "label": "if", "type": "if", "loc": [843, 850], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L832_C4", "vector": [4, 2, 0.9191, 0.0087, 2, 0.82, 0.625, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if plot_ellipses_flag:\n #plot_stiff_ellipses(k_cart_list,actual_cartesian)\n if expt_plot:\n subplotnum=234\n else:\n pl.figure()\n subplotnum=111\n plot_stiff_ellipses(k_cart_list,eq_cartesian,subplotnum=subplotnum)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L845_C12", "label": "if", "type": "if", "loc": [845, 849], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L843_C8", "vector": [4, 3, 0.9197, 0.0054, 3, 0.74, 0.0, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if expt_plot:\n subplotnum=234\n else:\n pl.figure()\n subplotnum=111"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L846_C16", "label": "subplotnum =", "type": "assigned_variable", "loc": [846, 846], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L845_C12", "vector": [14, 4, 0.9186, 0.0011, 4, 0.26, 0.0, 279, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "subplotnum", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " subplotnum=234"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L848_C16", "label": "figure()", "type": "expression", "loc": [848, 848], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L845_C12", "vector": [8, 4, 0.9207, 0.0011, 4, 0.26, 0.5, 789, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "figure", "arg_names": [], "import_names": [], "rhs_call_name": "figure", "annotation": ""}, "snippet": " pl.figure()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L849_C16", "label": "subplotnum =", "type": "assigned_variable", "loc": [849, 849], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L845_C12", "vector": [14, 4, 0.9218, 0.0011, 4, 0.26, 1.0, 279, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "subplotnum", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " subplotnum=111"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L850_C12", "label": "plot_stiff_ellipses()", "type": "expression", "loc": [850, 850], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L843_C8", "vector": [8, 3, 0.9229, 0.0011, 3, 0.74, 1.0, 370, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "plot_stiff_ellipses", "arg_names": [], "import_names": [], "rhs_call_name": "plot_stiff_ellipses", "annotation": ""}, "snippet": " plot_stiff_ellipses(k_cart_list,eq_cartesian,subplotnum=subplotnum)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L852_C8", "label": "if", "type": "if", "loc": [852, 853], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L832_C4", "vector": [4, 2, 0.9256, 0.0022, 2, 0.82, 0.75, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if plot_forces_error_flag:\n plot_error_forces(d['force'].f_list,ftraj_jinv.f_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L853_C12", "label": "plot_error_forces()", "type": "expression", "loc": [853, 853], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L852_C8", "vector": [8, 3, 0.9262, 0.0011, 3, 0.1, 0.0, 432, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "plot_error_forces", "arg_names": [], "import_names": [], "rhs_call_name": "plot_error_forces", "annotation": ""}, "snippet": " plot_error_forces(d['force'].f_list,ftraj_jinv.f_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L856_C8", "label": "if", "type": "if", "loc": [856, 880], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L832_C4", "vector": [4, 2, 0.9425, 0.0271, 2, 0.82, 0.875, 0, 2, 0, 0, 0, 0, 0, 15], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if plot_force_components_flag:\n p_list = actual_cartesian.p_list\n cx = 45.\n cy = -0.3\n frad_list,ftan_list = compute_radial_tangential_forces(d['force'].f_list,p_list,cx,cy)\n if expt_plot:\n pl.subplot(235)\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L857_C12", "label": "p_list =", "type": "assigned_variable", "loc": [857, 857], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L856_C8", "vector": [14, 3, 0.9305, 0.0011, 3, 0.54, 0.0, 98, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "p_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p_list = actual_cartesian.p_list"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L858_C12", "label": "cx =", "type": "assigned_variable", "loc": [858, 858], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L856_C8", "vector": [14, 3, 0.9316, 0.0011, 3, 0.54, 0.0625, 425, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "cx", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cx = 45."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L859_C12", "label": "cy =", "type": "assigned_variable", "loc": [859, 859], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L856_C8", "vector": [14, 3, 0.9327, 0.0011, 3, 0.54, 0.125, 628, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "cy", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cy = -0.3"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L860_C12", "label": "frad_list, ftan_list = compute_radial_tangential_forces()", "type": "assigned_variable", "loc": [860, 860], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L856_C8", "vector": [14, 3, 0.9338, 0.0011, 3, 0.54, 0.1875, 736, 3, 4, 0, 0, 224, 10, 1], "semantic": {"name": "frad_list, ftan_list", "arg_names": [], "import_names": [], "rhs_call_name": "compute_radial_tangential_forces", "annotation": ""}, "snippet": " frad_list,ftan_list = compute_radial_tangential_forces(d['force'].f_list,p_list,cx,cy)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L861_C12", "label": "if", "type": "if", "loc": [861, 864], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L856_C8", "vector": [4, 3, 0.9365, 0.0043, 3, 0.54, 0.25, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if expt_plot:\n pl.subplot(235)\n else:\n pl.figure()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L862_C16", "label": "subplot()", "type": "expression", "loc": [862, 862], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L861_C12", "vector": [8, 4, 0.9359, 0.0011, 4, 0.99, 0.0, 905, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "subplot", "arg_names": [], "import_names": [], "rhs_call_name": "subplot", "annotation": ""}, "snippet": " pl.subplot(235)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L864_C16", "label": "figure()", "type": "expression", "loc": [864, 864], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L861_C12", "vector": [8, 4, 0.9381, 0.0011, 4, 0.99, 1.0, 789, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "figure", "arg_names": [], "import_names": [], "rhs_call_name": "figure", "annotation": ""}, "snippet": " pl.figure()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L866_C12", "label": "time_list =", "type": "assigned_variable", "loc": [866, 866], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L856_C8", "vector": [14, 3, 0.9403, 0.0011, 3, 0.54, 0.3125, 941, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "time_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " time_list = d['force'].time_list"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L867_C12", "label": "time_list =", "type": "assigned_variable", "loc": [867, 867], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L856_C8", "vector": [14, 3, 0.9414, 0.0011, 3, 0.54, 0.375, 941, 5, 0, 0, 0, 0, 0, 0], "semantic": {"name": "time_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " time_list = [t-time_list[0] for t in time_list]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L868_C12", "label": "x_coord_list = tolist()", "type": "assigned_variable", "loc": [868, 868], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L856_C8", "vector": [14, 3, 0.9425, 0.0011, 3, 0.54, 0.4375, 243, 3, 0, 0, 0, 185, 10, 2], "semantic": {"name": "x_coord_list", "arg_names": [], "import_names": [], "rhs_call_name": "tolist", "annotation": ""}, "snippet": " x_coord_list = np.matrix(p_list)[:,0].A1.tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L869_C12", "label": "plot_yx()", "type": "expression", "loc": [869, 869], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L856_C8", "vector": [8, 3, 0.9435, 0.0011, 3, 0.54, 0.5, 112, 3, 6, 0, 0, 0, 0, 1], "semantic": {"name": "plot_yx", "arg_names": [], "import_names": [], "rhs_call_name": "plot_yx", "annotation": ""}, "snippet": " mpu.plot_yx(frad_list,x_coord_list,scatter_size=50,color=time_list,cb_label='time',axis=None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L870_C12", "label": "xlabel()", "type": "expression", "loc": [870, 870], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L856_C8", "vector": [8, 3, 0.9446, 0.0011, 3, 0.54, 0.5625, 676, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "xlabel", "arg_names": [], "import_names": [], "rhs_call_name": "xlabel", "annotation": ""}, "snippet": " pl.xlabel('x coord of end effector (m)')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L871_C12", "label": "ylabel()", "type": "expression", "loc": [871, 871], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L856_C8", "vector": [8, 3, 0.9457, 0.0011, 3, 0.54, 0.625, 584, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "ylabel", "arg_names": [], "import_names": [], "rhs_call_name": "ylabel", "annotation": ""}, "snippet": " pl.ylabel('magnitude of radial force (N)')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L872_C12", "label": "title()", "type": "expression", "loc": [872, 872], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L856_C8", "vector": [8, 3, 0.9468, 0.0011, 3, 0.54, 0.6875, 48, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "title", "arg_names": [], "import_names": [], "rhs_call_name": "title", "annotation": ""}, "snippet": " pl.title(d['info'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L873_C12", "label": "if", "type": "if", "loc": [873, 876], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L856_C8", "vector": [4, 3, 0.9495, 0.0043, 3, 0.54, 0.75, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if expt_plot:\n pl.subplot(236)\n else:\n pl.figure()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L874_C16", "label": "subplot()", "type": "expression", "loc": [874, 874], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L873_C12", "vector": [8, 4, 0.949, 0.0011, 4, 0.22, 0.0, 905, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "subplot", "arg_names": [], "import_names": [], "rhs_call_name": "subplot", "annotation": ""}, "snippet": " pl.subplot(236)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L876_C16", "label": "figure()", "type": "expression", "loc": [876, 876], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L873_C12", "vector": [8, 4, 0.9511, 0.0011, 4, 0.22, 1.0, 789, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "figure", "arg_names": [], "import_names": [], "rhs_call_name": "figure", "annotation": ""}, "snippet": " pl.figure()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L877_C12", "label": "plot_yx()", "type": "expression", "loc": [877, 877], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L856_C8", "vector": [8, 3, 0.9522, 0.0011, 3, 0.54, 0.8125, 112, 3, 6, 0, 0, 0, 0, 1], "semantic": {"name": "plot_yx", "arg_names": [], "import_names": [], "rhs_call_name": "plot_yx", "annotation": ""}, "snippet": " mpu.plot_yx(ftan_list,x_coord_list,scatter_size=50,color=time_list,cb_label='time',axis=None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L878_C12", "label": "xlabel()", "type": "expression", "loc": [878, 878], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L856_C8", "vector": [8, 3, 0.9533, 0.0011, 3, 0.54, 0.875, 676, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "xlabel", "arg_names": [], "import_names": [], "rhs_call_name": "xlabel", "annotation": ""}, "snippet": " pl.xlabel('x coord of end effector (m)')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L879_C12", "label": "ylabel()", "type": "expression", "loc": [879, 879], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L856_C8", "vector": [8, 3, 0.9544, 0.0011, 3, 0.54, 0.9375, 584, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "ylabel", "arg_names": [], "import_names": [], "rhs_call_name": "ylabel", "annotation": ""}, "snippet": " pl.ylabel('magnitude of tangential force (N)')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L880_C12", "label": "title()", "type": "expression", "loc": [880, 880], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L856_C8", "vector": [8, 3, 0.9555, 0.0011, 3, 0.54, 1.0, 48, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "title", "arg_names": [], "import_names": [], "rhs_call_name": "title", "annotation": ""}, "snippet": " pl.title(d['info'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L882_C8", "label": "if", "type": "if", "loc": [882, 884], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L832_C4", "vector": [4, 2, 0.9587, 0.0033, 2, 0.82, 1.0, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if plot_force_field_flag:\n plot_stiffness_field(k_cart_list[0],plottitle='start')\n plot_stiffness_field(k_cart_list[-1],plottitle='end')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L883_C12", "label": "plot_stiffness_field()", "type": "expression", "loc": [883, 883], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L882_C8", "vector": [8, 3, 0.9587, 0.0011, 3, 0.44, 0.0, 136, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "plot_stiffness_field", "arg_names": [], "import_names": [], "rhs_call_name": "plot_stiffness_field", "annotation": ""}, "snippet": " plot_stiffness_field(k_cart_list[0],plottitle='start')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L884_C12", "label": "plot_stiffness_field()", "type": "expression", "loc": [884, 884], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L882_C8", "vector": [8, 3, 0.9598, 0.0011, 3, 0.44, 1.0, 136, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "plot_stiffness_field", "arg_names": [], "import_names": [], "rhs_call_name": "plot_stiffness_field", "annotation": ""}, "snippet": " plot_stiffness_field(k_cart_list[-1],plottitle='end')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L887_C4", "label": "str_parts = split()", "type": "assigned_variable", "loc": [887, 887], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "vector": [14, 1, 0.9631, 0.0011, 1, 0.18, 0.9273, 705, 3, 1, 0, 0, 908, 10, 1], "semantic": {"name": "str_parts", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": " str_parts = fname.split('.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L888_C4", "label": "if", "type": "if", "loc": [888, 896], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "vector": [4, 1, 0.9685, 0.0098, 1, 0.18, 0.9455, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if d.has_key('strategy'):\n addon = ''\n if opt.xy:\n addon = '_xy'\n if opt.xz:\n addon = '_xz'\n fig_name = str_parts[0]+'_'+d['strategy']+addon+'.png'\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L889_C8", "label": "addon =", "type": "assigned_variable", "loc": [889, 889], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L888_C4", "vector": [14, 2, 0.9653, 0.0011, 2, 0.26, 0.0, 968, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "addon", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " addon = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L890_C8", "label": "if", "type": "if", "loc": [890, 891], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L888_C4", "vector": [4, 2, 0.9669, 0.0022, 2, 0.26, 0.25, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if opt.xy:\n addon = '_xy'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L891_C12", "label": "addon =", "type": "assigned_variable", "loc": [891, 891], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L890_C8", "vector": [14, 3, 0.9674, 0.0011, 3, 0.1, 0.0, 968, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "addon", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " addon = '_xy'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L892_C8", "label": "if", "type": "if", "loc": [892, 893], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L888_C4", "vector": [4, 2, 0.9691, 0.0022, 2, 0.26, 0.5, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if opt.xz:\n addon = '_xz'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L893_C12", "label": "addon =", "type": "assigned_variable", "loc": [893, 893], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L892_C8", "vector": [14, 3, 0.9696, 0.0011, 3, 0.13, 0.0, 968, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "addon", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " addon = '_xz'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L894_C8", "label": "fig_name =", "type": "assigned_variable", "loc": [894, 894], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L888_C4", "vector": [14, 2, 0.9707, 0.0011, 2, 0.26, 0.75, 219, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "fig_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " fig_name = str_parts[0]+'_'+d['strategy']+addon+'.png'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L896_C8", "label": "fig_name =", "type": "assigned_variable", "loc": [896, 896], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L888_C4", "vector": [14, 2, 0.9729, 0.0011, 2, 0.26, 1.0, 219, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "fig_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " fig_name = str_parts[0]+'_res.png'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L898_C4", "label": "if", "type": "if", "loc": [898, 902], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "vector": [4, 1, 0.9772, 0.0054, 1, 0.18, 0.9636, 0, 2, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if expt_plot:\n f = pl.gcf()\n curr_size = f.get_size_inches()\n f.set_size_inches(curr_size[0]*2,curr_size[1]*2)\n f.savefig(fig_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L899_C8", "label": "f = gcf()", "type": "assigned_variable", "loc": [899, 899], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L898_C4", "vector": [14, 2, 0.9761, 0.0011, 2, 0.98, 0.0, 899, 3, 0, 0, 0, 274, 10, 1], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "gcf", "annotation": ""}, "snippet": " f = pl.gcf()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L900_C8", "label": "curr_size = get_size_inches()", "type": "assigned_variable", "loc": [900, 900], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L898_C4", "vector": [14, 2, 0.9772, 0.0011, 2, 0.98, 0.3333, 156, 3, 0, 0, 0, 444, 10, 1], "semantic": {"name": "curr_size", "arg_names": [], "import_names": [], "rhs_call_name": "get_size_inches", "annotation": ""}, "snippet": " curr_size = f.get_size_inches()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L901_C8", "label": "set_size_inches()", "type": "expression", "loc": [901, 901], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L898_C4", "vector": [8, 2, 0.9783, 0.0011, 2, 0.98, 0.6667, 620, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "set_size_inches", "arg_names": [], "import_names": [], "rhs_call_name": "set_size_inches", "annotation": ""}, "snippet": " f.set_size_inches(curr_size[0]*2,curr_size[1]*2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L902_C8", "label": "savefig()", "type": "expression", "loc": [902, 902], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L898_C4", "vector": [8, 2, 0.9794, 0.0011, 2, 0.98, 1.0, 677, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "savefig", "arg_names": [], "import_names": [], "rhs_call_name": "savefig", "annotation": ""}, "snippet": " f.savefig(fig_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L904_C4", "label": "if", "type": "if", "loc": [904, 910], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "vector": [4, 1, 0.9848, 0.0076, 1, 0.18, 0.9818, 0, 2, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if show_fig:\n pl.show()\n else:\n print('################################')\n print('show_fig is FALSE')\n if not(expt_plot):\n pl.savefig(fig_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L905_C8", "label": "show()", "type": "expression", "loc": [905, 905], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L904_C4", "vector": [8, 2, 0.9826, 0.0011, 2, 0.69, 0.0, 497, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "show", "arg_names": [], "import_names": [], "rhs_call_name": "show", "annotation": ""}, "snippet": " pl.show()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L907_C8", "label": "print()", "type": "expression", "loc": [907, 907], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L904_C4", "vector": [8, 2, 0.9848, 0.0011, 2, 0.69, 0.3333, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('################################')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L908_C8", "label": "print()", "type": "expression", "loc": [908, 908], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L904_C4", "vector": [8, 2, 0.9859, 0.0011, 2, 0.69, 0.6667, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('show_fig is FALSE')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L909_C8", "label": "if", "type": "if", "loc": [909, 910], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L904_C4", "vector": [4, 2, 0.9875, 0.0022, 2, 0.69, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not(expt_plot):\n pl.savefig(fig_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L910_C12", "label": "savefig()", "type": "expression", "loc": [910, 910], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L909_C8", "vector": [8, 3, 0.9881, 0.0011, 3, 0.88, 0.0, 677, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "savefig", "arg_names": [], "import_names": [], "rhs_call_name": "savefig", "annotation": ""}, "snippet": " pl.savefig(fig_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L912_C4", "label": "if", "type": "if", "loc": [912, 914], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "vector": [4, 1, 0.9913, 0.0033, 1, 0.18, 1.0, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if xyz_flag:\n plot_cartesian(traj, xaxis=0,yaxis=1,zaxis=2)\n mlab.show()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L913_C8", "label": "plot_cartesian()", "type": "expression", "loc": [913, 913], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L912_C4", "vector": [8, 2, 0.9913, 0.0011, 2, 0.21, 0.0, 991, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "plot_cartesian", "arg_names": [], "import_names": [], "rhs_call_name": "plot_cartesian", "annotation": ""}, "snippet": " plot_cartesian(traj, xaxis=0,yaxis=1,zaxis=2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L914_C8", "label": "show()", "type": "expression", "loc": [914, 914], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L912_C4", "vector": [8, 2, 0.9924, 0.0011, 2, 0.21, 1.0, 497, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "show", "arg_names": [], "import_names": [], "rhs_call_name": "show", "annotation": ""}, "snippet": " mlab.show()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99527:ClassDef_L52_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L53_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:ClassDef_L52_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L56_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L57_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L58_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L59_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L60_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:ClassDef_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L65_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L65_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L66_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L65_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L67_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L65_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L68_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L65_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L69_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:ClassDef_L71_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L72_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:ClassDef_L71_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L75_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L75_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L76_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L75_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L77_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L75_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L78_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:ClassDef_L80_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L81_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:ClassDef_L80_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L84_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L84_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L85_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L84_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L86_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L92_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L93_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L92_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L94_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L92_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L95_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L92_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L96_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L97_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L98_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L99_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L101_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L101_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L102_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L101_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L103_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L101_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L104_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L101_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L105_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L92_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L107_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L92_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L108_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L92_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L109_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L92_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L110_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L92_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Return_L112_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L114_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Import_L115_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L114_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L117_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L117_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L118_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L114_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L120_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L114_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L121_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L114_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L122_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L114_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L123_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L114_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L125_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L114_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L126_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L114_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L127_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L114_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L128_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L114_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L130_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L135_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Import_L138_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L135_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L140_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L140_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L141_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L135_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L143_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L135_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L144_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L135_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L145_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L135_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L146_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L135_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L148_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L148_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L149_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L148_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L150_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L148_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L151_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L135_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L153_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L153_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L154_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L153_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L157_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L157_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L158_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L153_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L160_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L153_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:ImportFrom_L162_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L153_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:ImportFrom_L163_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L153_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L164_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L153_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L165_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L153_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L166_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L166_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L167_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L153_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L169_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L153_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L170_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L153_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L171_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L153_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L172_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L153_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L173_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L153_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L174_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L153_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L175_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L153_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L176_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L153_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L179_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L153_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L180_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L153_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L181_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L153_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L182_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L190_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L191_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L190_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L193_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L190_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L194_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L190_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L196_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L190_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L197_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L190_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L200_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L190_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L201_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L190_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L202_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L190_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L203_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L190_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L205_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L190_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L206_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L190_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L207_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L190_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L208_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L190_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L209_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L190_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L211_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L190_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L213_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L213_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L214_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L213_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L215_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L213_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L216_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L213_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L218_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L213_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L220_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L213_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L221_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L213_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L223_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L213_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L224_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L213_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L225_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L213_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L226_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L213_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L228_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L213_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L230_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L213_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L232_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L213_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L233_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L213_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L234_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L213_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L235_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L190_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Return_L237_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L245_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L246_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L245_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L247_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L247_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L248_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L247_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L249_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L247_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L250_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L247_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L251_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L247_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L252_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L247_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L253_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L247_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L254_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L247_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L255_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L245_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Return_L257_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L269_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L270_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L270_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L271_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L270_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L272_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L270_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L276_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L270_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L277_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L270_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Return_L278_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L269_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L280_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L269_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L281_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L281_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L282_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L281_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L283_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L281_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L284_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L284_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L285_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L284_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L287_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L269_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L291_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L269_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L292_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L292_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L293_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L292_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L294_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L292_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L295_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L295_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L296_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L295_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L298_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L269_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L302_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L302_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Return_L303_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L302_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Return_L305_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L314_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L315_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L314_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L316_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L316_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L317_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L316_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L318_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L316_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L319_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L316_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L320_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L316_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L321_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L316_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L326_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L326_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L327_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L326_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L328_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L326_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L329_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L314_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L331_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L314_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Return_L332_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L337_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L338_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L337_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L339_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L337_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L340_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L340_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L341_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L340_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L342_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L340_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L344_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L340_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L349_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L349_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L350_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L337_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L352_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L337_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Return_L353_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L359_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L360_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L359_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L361_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L359_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L362_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L359_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L364_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L364_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L365_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L364_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L366_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L364_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L367_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L364_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L368_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L364_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L369_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L364_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L371_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L371_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L372_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L359_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L374_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L359_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Return_L375_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L382_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L383_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L382_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L384_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L382_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L385_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L382_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L386_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L382_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L387_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L382_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L389_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L389_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L390_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L389_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L391_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L389_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L392_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L382_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L394_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L382_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L395_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L382_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L396_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L382_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:While_L397_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:While_L397_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L398_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L398_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L399_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L398_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L400_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L398_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L401_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L398_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L402_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L402_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L403_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L382_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L408_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L382_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L409_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L382_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L410_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L382_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L411_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L382_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L413_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L382_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L414_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L382_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L415_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:FunctionDef_L382_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Return_L416_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L420_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L421_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L423_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L425_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L427_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L429_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L431_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L433_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L435_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L437_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L439_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L441_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L443_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L445_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L447_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L449_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L451_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L453_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L457_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L458_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L459_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L460_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L461_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L462_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L463_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L464_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L465_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L466_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L467_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L468_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L469_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L470_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L471_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L472_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L473_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L476_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L476_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L477_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L476_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L478_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L476_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L479_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L476_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L480_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L476_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L481_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L476_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L489_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L476_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L490_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L476_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L491_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L476_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L493_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L493_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L494_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L494_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L495_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L495_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L497_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L495_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L499_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L495_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L500_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L495_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L501_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L495_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L502_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L495_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L503_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L495_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L504_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L495_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L505_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L476_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L507_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L476_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L509_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L476_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L510_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L476_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L511_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L476_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L513_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L515_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L515_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L516_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L515_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L517_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L515_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L518_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L520_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L521_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L522_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L523_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L523_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L524_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L527_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L528_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L529_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L529_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L530_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L532_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L534_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L536_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L536_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L540_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L536_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L541_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L536_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L542_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L536_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L543_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L536_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L544_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L536_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L545_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L536_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L546_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L536_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L548_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L548_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L549_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L548_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L550_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L548_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L551_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L548_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L552_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L548_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L553_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L548_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L554_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L548_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L555_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L548_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L557_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L557_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L558_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:For_L557_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L559_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L548_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L561_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L548_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L562_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L536_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L564_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L536_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L565_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L536_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L567_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L536_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L568_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L536_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L570_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L536_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L572_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L577_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L578_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L579_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L580_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L582_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L583_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L585_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L587_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L589_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L592_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L593_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L595_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L597_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L600_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L601_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L606_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L607_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L612_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L615_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L618_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L619_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L623_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L624_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L625_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L627_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L628_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L632_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L636_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L637_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L638_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L640_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L642_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L643_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L645_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L647_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L650_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L651_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L652_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L654_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L655_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L656_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L657_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L658_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L661_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L662_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L663_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L667_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L668_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L669_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L670_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L671_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L673_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L674_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L675_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L679_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L680_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L683_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L687_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L688_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L690_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L691_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L692_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L694_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L695_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L696_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L697_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L699_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L702_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L703_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L705_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L706_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L707_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L709_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L712_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L713_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L715_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L716_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L717_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L719_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L722_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L723_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L725_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L726_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L727_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L729_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L730_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L734_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L735_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L576_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L736_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L745_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L745_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L746_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L746_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L747_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L745_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L750_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L745_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L751_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L745_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L752_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L745_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L753_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L745_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L754_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L745_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L755_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L745_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L757_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L745_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L758_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L745_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L759_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L745_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L760_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L745_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L761_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L745_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L764_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L745_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L765_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L745_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L766_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L745_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L769_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L745_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L770_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L745_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L772_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L745_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L773_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L745_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L774_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L745_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L775_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L745_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L777_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L777_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L778_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L777_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L779_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L777_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L780_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L777_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L781_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L777_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L783_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L745_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L785_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L745_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L786_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L745_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L787_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L745_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L788_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L745_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L789_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L745_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L790_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L745_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L791_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L745_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L792_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L745_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L793_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L745_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L794_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L745_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L795_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L745_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L796_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L745_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L797_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L745_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L798_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L745_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L800_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L745_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L801_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L801_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L802_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L804_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L804_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L805_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L804_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L806_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L804_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L815_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L815_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L816_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L804_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L818_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L804_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L820_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L804_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L824_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L824_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L825_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L824_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L826_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L824_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L827_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L827_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L828_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L827_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L829_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L832_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L832_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L833_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L832_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L834_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L832_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L835_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L832_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L836_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L832_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L838_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L838_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L839_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L832_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L843_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L843_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L845_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L845_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L846_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L845_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L848_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L845_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L849_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L843_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L850_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L832_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L852_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L852_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L853_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L832_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L856_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L856_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L857_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L856_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L858_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L856_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L859_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L856_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L860_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L856_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L861_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L861_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L862_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L861_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L864_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L856_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L866_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L856_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L867_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L856_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L868_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L856_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L869_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L856_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L870_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L856_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L871_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L856_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L872_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L856_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L873_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L873_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L874_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L873_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L876_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L856_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L877_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L856_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L878_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L856_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L879_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L856_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L880_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L832_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L882_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L882_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L883_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L882_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L884_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L887_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L888_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L888_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L889_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L888_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L890_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L890_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L891_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L888_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L892_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L892_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L893_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L888_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L894_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L888_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L896_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L898_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L898_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L899_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L898_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Assign_L900_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L898_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L901_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L898_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L902_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L904_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L904_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L905_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L904_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L907_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L904_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L908_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L904_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L909_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L909_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L910_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L419_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L912_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L912_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L913_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99527:If_L912_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99527:Expr_L914_C8"}]
# # # Copyright (c) 2010, Georgia Tech Research Corporation # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # * Neither the name of the Georgia Tech Research Corporation nor the # names of its contributors may be used to endorse or promote products # derived from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY GEORGIA TECH RESEARCH CORPORATION ''AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL GEORGIA TECH BE LIABLE FOR ANY DIRECT, INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # \author Advait Jain (Healthcare Robotics Lab, Georgia Tech.) import sys, time, os, optparse import math, numpy as np import copy import mekabot.coord_frames as mcf import compliant_trajectories as ct import m3.toolbox as m3t import roslib; roslib.load_manifest('2010_icra_epc_pull') import hrl_lib.util as ut import hrl_lib.transforms as tr if __name__=='__main__': p = optparse.OptionParser() p.add_option('--ha', action='store', dest='ha',type='float', default=None,help='hook angle (degrees).') p.add_option('--ft', action='store', dest='ft',type='float', default=80.,help='force threshold (Newtons). [default 80.]') p.add_option('--info', action='store', type='string', dest='info_string', help='string to save in the pkl log.', default='') p.add_option('--pull_fixed', action='store_true', dest='pull_fixed', help='pull with the segway stationary') p.add_option('--lead', action='store_true', dest='lead', help='move the segway while pulling') p.add_option('--lpi', action='store_true', dest='lpi', help='use the laser pointer interface to designate hooking location') p.add_option('-p', action='store', dest='p',type='int', default=2,help='position number') p.add_option('-z', action='store', dest='z',type='float', default=1.0,help='zenither height') p.add_option('--sa', action='store', dest='sa',type='float', default=0.0,help='servo angle at which to take camera image (DEGREES)') p.add_option('--sliding_left', action='store_true', dest='sliding_left', help='defining the initial motion of the hook.') p.add_option('--use_jacobian', action='store_true', dest='use_jacobian', help='assume that kinematics estimation gives a jacobian') opt, args = p.parse_args() ha = opt.ha z = opt.z sa = opt.sa ft = opt.ft info_string = opt.info_string lead_flag = opt.lead lpi_flag = opt.lpi pull_fixed_flag = opt.pull_fixed move_segway_flag = not pull_fixed_flag pnum = opt.p arm = 'right_arm' try: if ha == None: print 'please specify hook angle (--ha)' print 'Exiting...' sys.exit() cmg = ct.CompliantMotionGenerator(move_segway = move_segway_flag, use_right_arm = True, use_left_arm = False) if lead_flag: sys.path.append(os.environ['HRLBASEPATH']+'/src/projects/lead') import lead print 'hit a key to start leading.' k=m3t.get_keystroke() cmg.firenze.power_on() if move_segway_flag: mec = cmg.segway_command_node else: import segway_omni.segway as segway mec = segway.Mecanum() zed = cmg.z import mekabot.hrl_robot as hr settings_lead = hr.MekaArmSettings(stiffness_list=[0.2,0.3,0.3,0.5,0.8]) cmg.firenze.set_arm_settings(settings_lead,None) follower = lead.Lead(cmg.firenze,'right_arm',mec,zed, max_allowable_height=zed.calib['max_height'], init_height = zed.get_position_meters()) qr = [0, 0, 0, math.pi/2, -(math.radians(ha)-ct.hook_3dprint_angle), 0, 0] follower.start_lead_thread(qr=qr) print 'hit a key to start hook and pull.' k=m3t.get_keystroke() follower.stop() cmg.firenze.set_arm_settings(cmg.settings_stiff,None) cmg.firenze.step() cmg.firenze.pose_robot('right_arm') print 'Hit ENTER to reposition the robot' k=m3t.get_keystroke() if k!='\r': print 'You did not press ENTER.' print 'Exiting ...' sys.exit() hook_location = cmg.firenze.end_effector_pos('right_arm') pull_loc = cmg.reposition_robot(hook_location) elif lpi_flag: import lpi # import point_cloud_features.pointcloud_features as ppf import hrl_tilting_hokuyo.processing_3d as p3d # pc_feat = ppf.PointcloudFeatureExtractor(ros_init_node=False) cmg.z.torque_move_position(1.0) cmg.firenze.power_on() cmg.movement_posture() if z<0.5: print 'desired zenither height of %.2f is unsafe.'%(z) print 'Exiting...' sys.exit() hook_location = None #z_list = [1.0,0.5] z_list = [opt.z] i = 0 while hook_location == None: if i == len(z_list): print 'Did not get a click. Exiting...' sys.exit() z = z_list[i] cmg.z.torque_move_position(z) hook_location = lpi.select_location(cmg.cam,cmg.thok,math.radians(sa)) i += 1 hl_thok0 = mcf.thok0Tglobal(hook_location) hl_torso = mcf.torsoTglobal(hook_location) t_begin = time.time() angle = 0. pull_loc,residual_angle = cmg.reposition_robot(hl_torso,angle,math.radians(ha), position_number=pnum) print 'pull_loc:',pull_loc.A1.tolist() starting_location = copy.copy(hl_torso) starting_angle = -angle pose_dict = {} pose_dict['loc'] = starting_location pose_dict['angle'] = angle pose_dict['residual_angle'] = residual_angle pose_dict['position_number'] = pnum if opt.sliding_left: thresh = 2. else: thresh = 5. res, jep = cmg.search_and_hook(arm, math.radians(ha), pull_loc, residual_angle, thresh) print 'result of search and hook:', res if res != 'got a hook': print 'Did not get a hook.' print 'Exiting...' sys.exit() elif pull_fixed_flag: print 'hit a key to power up the arms.' k=m3t.get_keystroke() cmg.firenze.power_on() t_begin = time.time() pull_loc = np.matrix([0.55, -0.2, -.23]).T if opt.sliding_left: thresh = 2. else: thresh = 5. res, jep = cmg.search_and_hook(arm, math.radians(ha), pull_loc, 0., thresh) print 'result of search and hook:', res if res != 'got a hook': print 'Did not get a hook.' print 'Exiting...' sys.exit() residual_angle = 0. pose_dict = {} else: raise RuntimeError('Unsupported. Advait Jan 02, 2010.') if opt.use_jacobian: kinematics_estimation = 'jacobian' else: kinematics_estimation = 'rotation_center' t_pull = time.time() cmg.pull(arm, math.radians(ha), residual_angle, ft, jep, strategy = 'control_radial_force', info_string=info_string, cep_vel = 0.10, kinematics_estimation=kinematics_estimation, pull_left = opt.sliding_left) t_end = time.time() pose_dict['t0'] = t_begin pose_dict['t1'] = t_pull pose_dict['t2'] = t_end ut.save_pickle(pose_dict,'pose_dict_'+ut.formatted_time()+'.pkl') print 'hit a key to end everything' k=m3t.get_keystroke() cmg.stop() except: # catch all exceptions, stop and re-raise them print 'Hello, Mr. Exception' cmg.stop() raise
ajibawa-2023/Python-Code-Large/train/row_99528
146
246
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Import_L32_C0", "label": "sys import sys, time, os\u2026", "type": "import", "loc": [32, 32], "level": 0, "parent": null, "vector": [1, 0, 0.1301, 0.0041, 0, 0.66, 0.0, 509, 0, 4, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys", "time", "os", "optparse"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys, time, os, optparse"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Import_L33_C0", "label": "math import math, np", "type": "import", "loc": [33, 33], "level": 0, "parent": null, "vector": [1, 0, 0.1341, 0.0041, 0, 0.66, 0.1, 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_99528:Import_L34_C0", "label": "copy import copy", "type": "import", "loc": [34, 34], "level": 0, "parent": null, "vector": [1, 0, 0.1382, 0.0041, 0, 0.66, 0.2, 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_99528:Import_L36_C0", "label": "mekabot.coord_frames import mcf", "type": "import", "loc": [36, 36], "level": 0, "parent": null, "vector": [1, 0, 0.1463, 0.0041, 0, 0.66, 0.3, 350, 0, 1, 0, 0, 350, 0, 0], "semantic": {"name": "mekabot.coord_frames", "arg_names": [], "import_names": ["mcf"], "rhs_call_name": "", "annotation": ""}, "snippet": "import mekabot.coord_frames as mcf"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Import_L37_C0", "label": "compliant_trajectories import ct", "type": "import", "loc": [37, 37], "level": 0, "parent": null, "vector": [1, 0, 0.1504, 0.0041, 0, 0.66, 0.4, 906, 0, 1, 0, 0, 906, 0, 0], "semantic": {"name": "compliant_trajectories", "arg_names": [], "import_names": ["ct"], "rhs_call_name": "", "annotation": ""}, "snippet": "import compliant_trajectories as ct"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Import_L38_C0", "label": "m3.toolbox import m3t", "type": "import", "loc": [38, 38], "level": 0, "parent": null, "vector": [1, 0, 0.1545, 0.0041, 0, 0.66, 0.5, 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_99528:Import_L40_C0", "label": "roslib import roslib", "type": "import", "loc": [40, 40], "level": 0, "parent": null, "vector": [1, 0, 0.1626, 0.0041, 0, 0.66, 0.6, 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('2010_icra_epc_pull')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Expr_L40_C15", "label": "load_manifest()", "type": "expression", "loc": [40, 40], "level": 0, "parent": null, "vector": [8, 0, 0.1626, 0.0041, 0, 0.66, 0.7, 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('2010_icra_epc_pull')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Import_L41_C0", "label": "hrl_lib.util import ut", "type": "import", "loc": [41, 41], "level": 0, "parent": null, "vector": [1, 0, 0.1667, 0.0041, 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_99528:Import_L42_C0", "label": "hrl_lib.transforms import tr", "type": "import", "loc": [42, 42], "level": 0, "parent": null, "vector": [1, 0, 0.1707, 0.0041, 0, 0.66, 0.9, 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_99528:If_L44_C0", "label": "if", "type": "if", "loc": [44, 244], "level": 0, "parent": null, "vector": [4, 0, 0.5854, 0.8171, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 90], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__=='__main__':\n p = optparse.OptionParser()\n p.add_option('--ha', action='store', dest='ha',type='float',\n default=None,help='hook angle (degrees).')\n p.add_option('--ft', action='store', dest='ft',type='float',\n default=80.,help='force threshold (Newtons). [default 80.]')\n p.add_option('--info', action='store', type='string', dest='info_string',\n help='string to save in the pkl log.', default='')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L45_C4", "label": "p = OptionParser()", "type": "assigned_variable", "loc": [45, 45], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L44_C0", "vector": [14, 1, 0.1829, 0.0041, 1, 0.61, 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_99528:Expr_L46_C4", "label": "add_option()", "type": "expression", "loc": [46, 47], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L44_C0", "vector": [8, 1, 0.189, 0.0081, 1, 0.61, 0.0417, 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('--ha', action='store', dest='ha',type='float',\n default=None,help='hook angle (degrees).')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Expr_L48_C4", "label": "add_option()", "type": "expression", "loc": [48, 49], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L44_C0", "vector": [8, 1, 0.1972, 0.0081, 1, 0.61, 0.0833, 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('--ft', action='store', dest='ft',type='float',\n default=80.,help='force threshold (Newtons). [default 80.]')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Expr_L50_C4", "label": "add_option()", "type": "expression", "loc": [50, 51], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L44_C0", "vector": [8, 1, 0.2053, 0.0081, 1, 0.61, 0.125, 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('--info', action='store', type='string', dest='info_string',\n help='string to save in the pkl log.', default='')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Expr_L52_C4", "label": "add_option()", "type": "expression", "loc": [52, 53], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L44_C0", "vector": [8, 1, 0.2134, 0.0081, 1, 0.61, 0.1667, 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('--pull_fixed', action='store_true', dest='pull_fixed',\n help='pull with the segway stationary')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Expr_L54_C4", "label": "add_option()", "type": "expression", "loc": [54, 55], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L44_C0", "vector": [8, 1, 0.2215, 0.0081, 1, 0.61, 0.2083, 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('--lead', action='store_true', dest='lead',\n help='move the segway while pulling')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Expr_L56_C4", "label": "add_option()", "type": "expression", "loc": [56, 57], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L44_C0", "vector": [8, 1, 0.2297, 0.0081, 1, 0.61, 0.25, 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('--lpi', action='store_true', dest='lpi',\n help='use the laser pointer interface to designate hooking location')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Expr_L58_C4", "label": "add_option()", "type": "expression", "loc": [58, 59], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L44_C0", "vector": [8, 1, 0.2378, 0.0081, 1, 0.61, 0.2917, 176, 3, 6, 0, 0, 0, 0, 1], "semantic": {"name": "add_option", "arg_names": [], "import_names": [], "rhs_call_name": "add_option", "annotation": ""}, "snippet": " p.add_option('-p', action='store', dest='p',type='int',\n default=2,help='position number')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Expr_L60_C4", "label": "add_option()", "type": "expression", "loc": [60, 61], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L44_C0", "vector": [8, 1, 0.2459, 0.0081, 1, 0.61, 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('-z', action='store', dest='z',type='float',\n default=1.0,help='zenither height')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Expr_L62_C4", "label": "add_option()", "type": "expression", "loc": [62, 63], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L44_C0", "vector": [8, 1, 0.2541, 0.0081, 1, 0.61, 0.375, 176, 3, 6, 0, 0, 0, 0, 1], "semantic": {"name": "add_option", "arg_names": [], "import_names": [], "rhs_call_name": "add_option", "annotation": ""}, "snippet": " p.add_option('--sa', action='store', dest='sa',type='float',\n default=0.0,help='servo angle at which to take camera image (DEGREES)')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Expr_L64_C4", "label": "add_option()", "type": "expression", "loc": [64, 66], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L44_C0", "vector": [8, 1, 0.2642, 0.0122, 1, 0.61, 0.4167, 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('--sliding_left', action='store_true',\n dest='sliding_left',\n help='defining the initial motion of the hook.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Expr_L68_C4", "label": "add_option()", "type": "expression", "loc": [68, 70], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L44_C0", "vector": [8, 1, 0.2805, 0.0122, 1, 0.61, 0.4583, 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('--use_jacobian', action='store_true',\n dest='use_jacobian',\n help='assume that kinematics estimation gives a jacobian')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L72_C4", "label": "opt, args = parse_args()", "type": "assigned_variable", "loc": [72, 72], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L44_C0", "vector": [14, 1, 0.2927, 0.0041, 1, 0.61, 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_99528:Assign_L73_C4", "label": "ha =", "type": "assigned_variable", "loc": [73, 73], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L44_C0", "vector": [14, 1, 0.2967, 0.0041, 1, 0.61, 0.5417, 499, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ha", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ha = opt.ha"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L74_C4", "label": "z =", "type": "assigned_variable", "loc": [74, 74], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L44_C0", "vector": [14, 1, 0.3008, 0.0041, 1, 0.61, 0.5833, 859, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " z = opt.z"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L75_C4", "label": "sa =", "type": "assigned_variable", "loc": [75, 75], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L44_C0", "vector": [14, 1, 0.3049, 0.0041, 1, 0.61, 0.625, 756, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "sa", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " sa = opt.sa"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L76_C4", "label": "ft =", "type": "assigned_variable", "loc": [76, 76], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L44_C0", "vector": [14, 1, 0.3089, 0.0041, 1, 0.61, 0.6667, 505, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ft", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ft = opt.ft"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L77_C4", "label": "info_string =", "type": "assigned_variable", "loc": [77, 77], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L44_C0", "vector": [14, 1, 0.313, 0.0041, 1, 0.61, 0.7083, 986, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "info_string", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " info_string = opt.info_string"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L78_C4", "label": "lead_flag =", "type": "assigned_variable", "loc": [78, 78], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L44_C0", "vector": [14, 1, 0.3171, 0.0041, 1, 0.61, 0.75, 101, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "lead_flag", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " lead_flag = opt.lead"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L79_C4", "label": "lpi_flag =", "type": "assigned_variable", "loc": [79, 79], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L44_C0", "vector": [14, 1, 0.3211, 0.0041, 1, 0.61, 0.7917, 217, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "lpi_flag", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " lpi_flag = opt.lpi"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L80_C4", "label": "pull_fixed_flag =", "type": "assigned_variable", "loc": [80, 80], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L44_C0", "vector": [14, 1, 0.3252, 0.0041, 1, 0.61, 0.8333, 112, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pull_fixed_flag", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pull_fixed_flag = opt.pull_fixed"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L81_C4", "label": "move_segway_flag =", "type": "assigned_variable", "loc": [81, 81], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L44_C0", "vector": [14, 1, 0.3293, 0.0041, 1, 0.61, 0.875, 12, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "move_segway_flag", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " move_segway_flag = not pull_fixed_flag"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L82_C4", "label": "pnum =", "type": "assigned_variable", "loc": [82, 82], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L44_C0", "vector": [14, 1, 0.3333, 0.0041, 1, 0.61, 0.9167, 112, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pnum", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pnum = opt.p"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L84_C4", "label": "arm =", "type": "assigned_variable", "loc": [84, 84], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L44_C0", "vector": [14, 1, 0.3415, 0.0041, 1, 0.61, 0.9583, 413, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "arm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " arm = 'right_arm'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Try_L86_C4", "label": "try", "type": "try", "loc": [86, 244], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L44_C0", "vector": [7, 1, 0.6707, 0.6463, 1, 0.61, 1.0, 0, 0, 1, 0, 0, 0, 0, 77], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n if ha == None:\n print('please specify hook angle (--ha)')\n print('Exiting...')\n sys.exit()\n\n cmg = ct.CompliantMotionGenerator(move_segway = move_segway_flag,\n use_right_arm = True,"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L87_C8", "label": "if", "type": "if", "loc": [87, 90], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:Try_L86_C4", "vector": [4, 2, 0.3598, 0.0163, 2, 0.76, 0.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if ha == None:\n print('please specify hook angle (--ha)')\n print('Exiting...')\n sys.exit()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Expr_L88_C12", "label": "print()", "type": "expression", "loc": [88, 88], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L87_C8", "vector": [8, 3, 0.3577, 0.0041, 3, 0.57, 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 hook angle (--ha)')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Expr_L89_C12", "label": "print()", "type": "expression", "loc": [89, 89], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L87_C8", "vector": [8, 3, 0.3618, 0.0041, 3, 0.57, 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_99528:Expr_L90_C12", "label": "exit()", "type": "expression", "loc": [90, 90], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L87_C8", "vector": [8, 3, 0.3659, 0.0041, 3, 0.57, 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_99528:Assign_L92_C8", "label": "cmg = CompliantMotionGenerator()", "type": "assigned_variable", "loc": [92, 94], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:Try_L86_C4", "vector": [14, 2, 0.378, 0.0122, 2, 0.76, 0.0769, 440, 3, 3, 0, 0, 257, 10, 1], "semantic": {"name": "cmg", "arg_names": [], "import_names": [], "rhs_call_name": "CompliantMotionGenerator", "annotation": ""}, "snippet": " cmg = ct.CompliantMotionGenerator(move_segway = move_segway_flag,\n use_right_arm = True,\n use_left_arm = False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L96_C8", "label": "if", "type": "if", "loc": [96, 217], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:Try_L86_C4", "vector": [4, 2, 0.6362, 0.4959, 2, 0.76, 0.1538, 0, 2, 0, 0, 0, 0, 0, 62], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if lead_flag:\n sys.path.append(os.environ['HRLBASEPATH']+'/src/projects/lead')\n import lead\n\n print('hit a key to start leading.')\n k=m3t.get_keystroke()\n cmg.firenze.power_on()\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Expr_L97_C12", "label": "append()", "type": "expression", "loc": [97, 97], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L96_C8", "vector": [8, 3, 0.3943, 0.0041, 3, 0.4, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " sys.path.append(os.environ['HRLBASEPATH']+'/src/projects/lead')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Import_L98_C12", "label": "lead import lead", "type": "import", "loc": [98, 98], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L96_C8", "vector": [1, 3, 0.3984, 0.0041, 3, 0.4, 0.0417, 586, 0, 1, 0, 0, 586, 0, 0], "semantic": {"name": "lead", "arg_names": [], "import_names": ["lead"], "rhs_call_name": "", "annotation": ""}, "snippet": " import lead"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Expr_L100_C12", "label": "print()", "type": "expression", "loc": [100, 100], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L96_C8", "vector": [8, 3, 0.4065, 0.0041, 3, 0.4, 0.0833, 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 start leading.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L101_C12", "label": "k = get_keystroke()", "type": "assigned_variable", "loc": [101, 101], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L96_C8", "vector": [14, 3, 0.4106, 0.0041, 3, 0.4, 0.125, 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_99528:Expr_L102_C12", "label": "power_on()", "type": "expression", "loc": [102, 102], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L96_C8", "vector": [8, 3, 0.4146, 0.0041, 3, 0.4, 0.1667, 777, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "power_on", "arg_names": [], "import_names": [], "rhs_call_name": "power_on", "annotation": ""}, "snippet": " cmg.firenze.power_on()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L104_C12", "label": "if", "type": "if", "loc": [104, 108], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L96_C8", "vector": [4, 3, 0.4309, 0.0203, 3, 0.4, 0.2083, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if move_segway_flag:\n mec = cmg.segway_command_node\n else:\n import segway_omni.segway as segway\n mec = segway.Mecanum()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L105_C16", "label": "mec =", "type": "assigned_variable", "loc": [105, 105], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L104_C12", "vector": [14, 4, 0.4268, 0.0041, 4, 0.72, 0.0, 640, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "mec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mec = cmg.segway_command_node"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Import_L107_C16", "label": "segway_omni.segway import segway", "type": "import", "loc": [107, 107], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L104_C12", "vector": [1, 4, 0.435, 0.0041, 4, 0.72, 0.5, 751, 0, 1, 0, 0, 751, 0, 0], "semantic": {"name": "segway_omni.segway", "arg_names": [], "import_names": ["segway"], "rhs_call_name": "", "annotation": ""}, "snippet": " import segway_omni.segway as segway"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L108_C16", "label": "mec = Mecanum()", "type": "assigned_variable", "loc": [108, 108], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L104_C12", "vector": [14, 4, 0.439, 0.0041, 4, 0.72, 1.0, 640, 3, 0, 0, 0, 751, 10, 1], "semantic": {"name": "mec", "arg_names": [], "import_names": [], "rhs_call_name": "Mecanum", "annotation": ""}, "snippet": " mec = segway.Mecanum()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L110_C12", "label": "zed =", "type": "assigned_variable", "loc": [110, 110], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L96_C8", "vector": [14, 3, 0.4472, 0.0041, 3, 0.4, 0.25, 246, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "zed", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " zed = cmg.z"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Import_L111_C12", "label": "mekabot.hrl_robot import hr", "type": "import", "loc": [111, 111], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L96_C8", "vector": [1, 3, 0.4512, 0.0041, 3, 0.4, 0.2917, 4, 0, 1, 0, 0, 4, 0, 0], "semantic": {"name": "mekabot.hrl_robot", "arg_names": [], "import_names": ["hr"], "rhs_call_name": "", "annotation": ""}, "snippet": " import mekabot.hrl_robot as hr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L112_C12", "label": "settings_lead = MekaArmSettings()", "type": "assigned_variable", "loc": [112, 112], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L96_C8", "vector": [14, 3, 0.4553, 0.0041, 3, 0.4, 0.3333, 544, 3, 1, 0, 0, 503, 10, 1], "semantic": {"name": "settings_lead", "arg_names": [], "import_names": [], "rhs_call_name": "MekaArmSettings", "annotation": ""}, "snippet": " settings_lead = hr.MekaArmSettings(stiffness_list=[0.2,0.3,0.3,0.5,0.8])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Expr_L113_C12", "label": "set_arm_settings()", "type": "expression", "loc": [113, 113], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L96_C8", "vector": [8, 3, 0.4593, 0.0041, 3, 0.4, 0.375, 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": " cmg.firenze.set_arm_settings(settings_lead,None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L115_C12", "label": "follower = Lead()", "type": "assigned_variable", "loc": [115, 117], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L96_C8", "vector": [14, 3, 0.4715, 0.0122, 3, 0.4, 0.4167, 382, 3, 6, 0, 0, 848, 10, 2], "semantic": {"name": "follower", "arg_names": [], "import_names": [], "rhs_call_name": "Lead", "annotation": ""}, "snippet": " follower = lead.Lead(cmg.firenze,'right_arm',mec,zed,\n max_allowable_height=zed.calib['max_height'],\n init_height = zed.get_position_meters())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L118_C12", "label": "qr =", "type": "assigned_variable", "loc": [118, 118], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L96_C8", "vector": [14, 3, 0.4797, 0.0041, 3, 0.4, 0.4583, 286, 0, 0, 0, 0, 0, 5, 1], "semantic": {"name": "qr", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " qr = [0, 0, 0, math.pi/2, -(math.radians(ha)-ct.hook_3dprint_angle), 0, 0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Expr_L119_C12", "label": "start_lead_thread()", "type": "expression", "loc": [119, 119], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L96_C8", "vector": [8, 3, 0.4837, 0.0041, 3, 0.4, 0.5, 712, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "start_lead_thread", "arg_names": [], "import_names": [], "rhs_call_name": "start_lead_thread", "annotation": ""}, "snippet": " follower.start_lead_thread(qr=qr)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Expr_L121_C12", "label": "print()", "type": "expression", "loc": [121, 121], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L96_C8", "vector": [8, 3, 0.4919, 0.0041, 3, 0.4, 0.5417, 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 start hook and pull.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L122_C12", "label": "k = get_keystroke()", "type": "assigned_variable", "loc": [122, 122], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L96_C8", "vector": [14, 3, 0.4959, 0.0041, 3, 0.4, 0.5833, 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_99528:Expr_L123_C12", "label": "stop()", "type": "expression", "loc": [123, 123], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L96_C8", "vector": [8, 3, 0.5, 0.0041, 3, 0.4, 0.625, 343, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "stop", "annotation": ""}, "snippet": " follower.stop()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Expr_L125_C12", "label": "set_arm_settings()", "type": "expression", "loc": [125, 125], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L96_C8", "vector": [8, 3, 0.5081, 0.0041, 3, 0.4, 0.6667, 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": " cmg.firenze.set_arm_settings(cmg.settings_stiff,None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Expr_L126_C12", "label": "step()", "type": "expression", "loc": [126, 126], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L96_C8", "vector": [8, 3, 0.5122, 0.0041, 3, 0.4, 0.7083, 880, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "step", "arg_names": [], "import_names": [], "rhs_call_name": "step", "annotation": ""}, "snippet": " cmg.firenze.step()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Expr_L127_C12", "label": "pose_robot()", "type": "expression", "loc": [127, 127], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L96_C8", "vector": [8, 3, 0.5163, 0.0041, 3, 0.4, 0.75, 941, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "pose_robot", "arg_names": [], "import_names": [], "rhs_call_name": "pose_robot", "annotation": ""}, "snippet": " cmg.firenze.pose_robot('right_arm')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Expr_L129_C12", "label": "print()", "type": "expression", "loc": [129, 129], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L96_C8", "vector": [8, 3, 0.5244, 0.0041, 3, 0.4, 0.7917, 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 reposition the robot')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L130_C12", "label": "k = get_keystroke()", "type": "assigned_variable", "loc": [130, 130], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L96_C8", "vector": [14, 3, 0.5285, 0.0041, 3, 0.4, 0.8333, 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_99528:If_L131_C12", "label": "if", "type": "if", "loc": [131, 134], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L96_C8", "vector": [4, 3, 0.5386, 0.0163, 3, 0.4, 0.875, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if k!='\\r':\n print('You did not press ENTER.')\n print('Exiting ...')\n sys.exit()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Expr_L132_C16", "label": "print()", "type": "expression", "loc": [132, 132], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L131_C12", "vector": [8, 4, 0.5366, 0.0041, 4, 0.96, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('You did not press ENTER.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Expr_L133_C16", "label": "print()", "type": "expression", "loc": [133, 133], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L131_C12", "vector": [8, 4, 0.5407, 0.0041, 4, 0.96, 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_99528:Expr_L134_C16", "label": "exit()", "type": "expression", "loc": [134, 134], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L131_C12", "vector": [8, 4, 0.5447, 0.0041, 4, 0.96, 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_99528:Assign_L136_C12", "label": "hook_location = end_effector_pos()", "type": "assigned_variable", "loc": [136, 136], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L96_C8", "vector": [14, 3, 0.5528, 0.0041, 3, 0.4, 0.9167, 595, 3, 1, 0, 0, 889, 10, 1], "semantic": {"name": "hook_location", "arg_names": [], "import_names": [], "rhs_call_name": "end_effector_pos", "annotation": ""}, "snippet": " hook_location = cmg.firenze.end_effector_pos('right_arm')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L137_C12", "label": "pull_loc = reposition_robot()", "type": "assigned_variable", "loc": [137, 137], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L96_C8", "vector": [14, 3, 0.5569, 0.0041, 3, 0.4, 0.9583, 640, 3, 1, 0, 0, 622, 10, 1], "semantic": {"name": "pull_loc", "arg_names": [], "import_names": [], "rhs_call_name": "reposition_robot", "annotation": ""}, "snippet": " pull_loc = cmg.reposition_robot(hook_location)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L139_C8", "label": "if", "type": "if", "loc": [139, 217], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L96_C8", "vector": [4, 3, 0.7236, 0.3211, 3, 0.4, 1.0, 0, 2, 0, 0, 0, 0, 0, 38], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif lpi_flag:\n import lpi\n# import point_cloud_features.pointcloud_features as ppf\n import hrl_tilting_hokuyo.processing_3d as p3d\n# pc_feat = ppf.PointcloudFeatureExtractor(ros_init_node=False)\n\n cmg.z.torque_move_position(1.0)\n cmg.firenze.power_on()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Import_L140_C12", "label": "lpi import lpi", "type": "import", "loc": [140, 140], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L139_C8", "vector": [1, 4, 0.5691, 0.0041, 4, 0.43, 0.0, 120, 0, 1, 0, 0, 120, 0, 0], "semantic": {"name": "lpi", "arg_names": [], "import_names": ["lpi"], "rhs_call_name": "", "annotation": ""}, "snippet": " import lpi"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Import_L142_C12", "label": "hrl_tilting_hokuyo.processing_3d import p3d", "type": "import", "loc": [142, 142], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L139_C8", "vector": [1, 4, 0.5772, 0.0041, 4, 0.43, 0.037, 307, 0, 1, 0, 0, 307, 0, 0], "semantic": {"name": "hrl_tilting_hokuyo.processing_3d", "arg_names": [], "import_names": ["p3d"], "rhs_call_name": "", "annotation": ""}, "snippet": " import hrl_tilting_hokuyo.processing_3d as p3d"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Expr_L145_C12", "label": "torque_move_position()", "type": "expression", "loc": [145, 145], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L139_C8", "vector": [8, 4, 0.5894, 0.0041, 4, 0.43, 0.0741, 351, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "torque_move_position", "arg_names": [], "import_names": [], "rhs_call_name": "torque_move_position", "annotation": ""}, "snippet": " cmg.z.torque_move_position(1.0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Expr_L146_C12", "label": "power_on()", "type": "expression", "loc": [146, 146], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L139_C8", "vector": [8, 4, 0.5935, 0.0041, 4, 0.43, 0.1111, 777, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "power_on", "arg_names": [], "import_names": [], "rhs_call_name": "power_on", "annotation": ""}, "snippet": " cmg.firenze.power_on()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Expr_L147_C12", "label": "movement_posture()", "type": "expression", "loc": [147, 147], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L139_C8", "vector": [8, 4, 0.5976, 0.0041, 4, 0.43, 0.1481, 991, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "movement_posture", "arg_names": [], "import_names": [], "rhs_call_name": "movement_posture", "annotation": ""}, "snippet": " cmg.movement_posture()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L148_C12", "label": "if", "type": "if", "loc": [148, 151], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L139_C8", "vector": [4, 4, 0.6077, 0.0163, 4, 0.43, 0.1852, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if z<0.5:\n print('desired zenither height of %.2f is unsafe.'%(z))\n print('Exiting...')\n sys.exit()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Expr_L149_C16", "label": "print()", "type": "expression", "loc": [149, 149], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L148_C12", "vector": [8, 5, 0.6057, 0.0041, 5, 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('desired zenither height of %.2f is unsafe.'%(z))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Expr_L150_C16", "label": "print()", "type": "expression", "loc": [150, 150], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L148_C12", "vector": [8, 5, 0.6098, 0.0041, 5, 0.19, 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_99528:Expr_L151_C16", "label": "exit()", "type": "expression", "loc": [151, 151], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L148_C12", "vector": [8, 5, 0.6138, 0.0041, 5, 0.19, 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_99528:Assign_L153_C12", "label": "hook_location =", "type": "assigned_variable", "loc": [153, 153], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L139_C8", "vector": [14, 4, 0.622, 0.0041, 4, 0.43, 0.2222, 595, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "hook_location", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " hook_location = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L155_C12", "label": "z_list =", "type": "assigned_variable", "loc": [155, 155], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L139_C8", "vector": [14, 4, 0.6301, 0.0041, 4, 0.43, 0.2593, 684, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "z_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " z_list = [opt.z]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L156_C12", "label": "i =", "type": "assigned_variable", "loc": [156, 156], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L139_C8", "vector": [14, 4, 0.6341, 0.0041, 4, 0.43, 0.2963, 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_99528:While_L157_C12", "label": "while", "type": "while", "loc": [157, 164], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L139_C8", "vector": [5, 4, 0.6524, 0.0325, 4, 0.43, 0.3333, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while hook_location == None:\n if i == len(z_list):\n print('Did not get a click. Exiting...')\n sys.exit()\n z = z_list[i]\n cmg.z.torque_move_position(z)\n hook_location = lpi.select_location(cmg.cam,cmg.thok,math.radians(sa))\n i += 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L158_C16", "label": "if", "type": "if", "loc": [158, 160], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:While_L157_C12", "vector": [4, 5, 0.6463, 0.0122, 5, 0.01, 0.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if i == len(z_list):\n print('Did not get a click. Exiting...')\n sys.exit()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Expr_L159_C20", "label": "print()", "type": "expression", "loc": [159, 159], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L158_C16", "vector": [8, 6, 0.6463, 0.0041, 6, 0.77, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Did not get a click. Exiting...')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Expr_L160_C20", "label": "exit()", "type": "expression", "loc": [160, 160], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L158_C16", "vector": [8, 6, 0.6504, 0.0041, 6, 0.77, 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_99528:Assign_L161_C16", "label": "z =", "type": "assigned_variable", "loc": [161, 161], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:While_L157_C12", "vector": [14, 5, 0.6545, 0.0041, 5, 0.01, 0.3333, 859, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " z = z_list[i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Expr_L162_C16", "label": "torque_move_position()", "type": "expression", "loc": [162, 162], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:While_L157_C12", "vector": [8, 5, 0.6585, 0.0041, 5, 0.01, 0.6667, 351, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "torque_move_position", "arg_names": [], "import_names": [], "rhs_call_name": "torque_move_position", "annotation": ""}, "snippet": " cmg.z.torque_move_position(z)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L163_C16", "label": "hook_location = select_location()", "type": "assigned_variable", "loc": [163, 163], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:While_L157_C12", "vector": [14, 5, 0.6626, 0.0041, 5, 0.01, 1.0, 595, 3, 3, 0, 0, 94, 10, 2], "semantic": {"name": "hook_location", "arg_names": [], "import_names": [], "rhs_call_name": "select_location", "annotation": ""}, "snippet": " hook_location = lpi.select_location(cmg.cam,cmg.thok,math.radians(sa))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L166_C12", "label": "hl_thok0 = thok0Tglobal()", "type": "assigned_variable", "loc": [166, 166], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L139_C8", "vector": [14, 4, 0.6748, 0.0041, 4, 0.43, 0.3704, 687, 3, 1, 0, 0, 419, 10, 1], "semantic": {"name": "hl_thok0", "arg_names": [], "import_names": [], "rhs_call_name": "thok0Tglobal", "annotation": ""}, "snippet": " hl_thok0 = mcf.thok0Tglobal(hook_location)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L167_C12", "label": "hl_torso = torsoTglobal()", "type": "assigned_variable", "loc": [167, 167], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L139_C8", "vector": [14, 4, 0.6789, 0.0041, 4, 0.43, 0.4074, 755, 3, 1, 0, 0, 309, 10, 1], "semantic": {"name": "hl_torso", "arg_names": [], "import_names": [], "rhs_call_name": "torsoTglobal", "annotation": ""}, "snippet": " hl_torso = mcf.torsoTglobal(hook_location)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L169_C12", "label": "t_begin = time()", "type": "assigned_variable", "loc": [169, 169], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L139_C8", "vector": [14, 4, 0.687, 0.0041, 4, 0.43, 0.4444, 23, 3, 0, 0, 0, 654, 10, 1], "semantic": {"name": "t_begin", "arg_names": [], "import_names": [], "rhs_call_name": "time", "annotation": ""}, "snippet": " t_begin = time.time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L170_C12", "label": "angle =", "type": "assigned_variable", "loc": [170, 170], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L139_C8", "vector": [14, 4, 0.6911, 0.0041, 4, 0.43, 0.4815, 418, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "angle", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " angle = 0."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L171_C12", "label": "pull_loc, residual_angle = reposition_robot()", "type": "assigned_variable", "loc": [171, 172], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L139_C8", "vector": [14, 4, 0.6972, 0.0081, 4, 0.43, 0.5185, 555, 3, 4, 0, 0, 622, 10, 2], "semantic": {"name": "pull_loc, residual_angle", "arg_names": [], "import_names": [], "rhs_call_name": "reposition_robot", "annotation": ""}, "snippet": " pull_loc,residual_angle = cmg.reposition_robot(hl_torso,angle,math.radians(ha),\n position_number=pnum)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Expr_L173_C12", "label": "print()", "type": "expression", "loc": [173, 173], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L139_C8", "vector": [8, 4, 0.7033, 0.0041, 4, 0.43, 0.5556, 535, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('pull_loc:',pull_loc.A1.tolist())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L175_C12", "label": "starting_location = copy()", "type": "assigned_variable", "loc": [175, 175], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L139_C8", "vector": [14, 4, 0.7114, 0.0041, 4, 0.43, 0.5926, 882, 3, 1, 0, 0, 739, 10, 1], "semantic": {"name": "starting_location", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " starting_location = copy.copy(hl_torso)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L176_C12", "label": "starting_angle =", "type": "assigned_variable", "loc": [176, 176], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L139_C8", "vector": [14, 4, 0.7154, 0.0041, 4, 0.43, 0.6296, 375, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "starting_angle", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " starting_angle = -angle"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L177_C12", "label": "pose_dict =", "type": "assigned_variable", "loc": [177, 177], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L139_C8", "vector": [14, 4, 0.7195, 0.0041, 4, 0.43, 0.6667, 96, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "pose_dict", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pose_dict = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L178_C12", "label": "assign", "type": "assigned_variable", "loc": [178, 178], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L139_C8", "vector": [14, 4, 0.7236, 0.0041, 4, 0.43, 0.7037, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pose_dict['loc'] = starting_location"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L179_C12", "label": "assign", "type": "assigned_variable", "loc": [179, 179], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L139_C8", "vector": [14, 4, 0.7276, 0.0041, 4, 0.43, 0.7407, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pose_dict['angle'] = angle"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L180_C12", "label": "assign", "type": "assigned_variable", "loc": [180, 180], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L139_C8", "vector": [14, 4, 0.7317, 0.0041, 4, 0.43, 0.7778, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pose_dict['residual_angle'] = residual_angle"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L181_C12", "label": "assign", "type": "assigned_variable", "loc": [181, 181], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L139_C8", "vector": [14, 4, 0.7358, 0.0041, 4, 0.43, 0.8148, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pose_dict['position_number'] = pnum"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L183_C12", "label": "if", "type": "if", "loc": [183, 186], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L139_C8", "vector": [4, 4, 0.75, 0.0163, 4, 0.43, 0.8519, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if opt.sliding_left:\n thresh = 2.\n else:\n thresh = 5."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L184_C16", "label": "thresh =", "type": "assigned_variable", "loc": [184, 184], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L183_C12", "vector": [14, 5, 0.748, 0.0041, 5, 0.34, 0.0, 844, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "thresh", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " thresh = 2."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L186_C16", "label": "thresh =", "type": "assigned_variable", "loc": [186, 186], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L183_C12", "vector": [14, 5, 0.7561, 0.0041, 5, 0.34, 1.0, 844, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "thresh", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " thresh = 5."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L187_C12", "label": "res, jep = search_and_hook()", "type": "assigned_variable", "loc": [187, 188], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L139_C8", "vector": [14, 4, 0.7622, 0.0081, 4, 0.43, 0.8889, 95, 3, 5, 0, 0, 913, 10, 2], "semantic": {"name": "res, jep", "arg_names": [], "import_names": [], "rhs_call_name": "search_and_hook", "annotation": ""}, "snippet": " res, jep = cmg.search_and_hook(arm, math.radians(ha),\n pull_loc, residual_angle, thresh)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Expr_L189_C12", "label": "print()", "type": "expression", "loc": [189, 189], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L139_C8", "vector": [8, 4, 0.7683, 0.0041, 4, 0.43, 0.9259, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('result of search and hook:', res)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L190_C12", "label": "if", "type": "if", "loc": [190, 193], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L139_C8", "vector": [4, 4, 0.7785, 0.0163, 4, 0.43, 0.963, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if res != 'got a hook':\n print('Did not get a hook.')\n print('Exiting...')\n sys.exit()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Expr_L191_C16", "label": "print()", "type": "expression", "loc": [191, 191], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L190_C12", "vector": [8, 5, 0.7764, 0.0041, 5, 0.27, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Did not get a hook.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Expr_L192_C16", "label": "print()", "type": "expression", "loc": [192, 192], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L190_C12", "vector": [8, 5, 0.7805, 0.0041, 5, 0.27, 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_99528:Expr_L193_C16", "label": "exit()", "type": "expression", "loc": [193, 193], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L190_C12", "vector": [8, 5, 0.7846, 0.0041, 5, 0.27, 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_99528:If_L195_C8", "label": "if", "type": "if", "loc": [195, 217], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L139_C8", "vector": [4, 4, 0.8374, 0.0935, 4, 0.43, 1.0, 0, 2, 0, 0, 0, 0, 0, 12], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif pull_fixed_flag:\n print('hit a key to power up the arms.')\n k=m3t.get_keystroke()\n cmg.firenze.power_on()\n\n t_begin = time.time()\n pull_loc = np.matrix([0.55, -0.2, -.23]).T\n if opt.sliding_left:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Expr_L196_C12", "label": "print()", "type": "expression", "loc": [196, 196], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L195_C8", "vector": [8, 5, 0.7967, 0.0041, 5, 0.96, 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 power up the arms.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L197_C12", "label": "k = get_keystroke()", "type": "assigned_variable", "loc": [197, 197], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L195_C8", "vector": [14, 5, 0.8008, 0.0041, 5, 0.96, 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_99528:Expr_L198_C12", "label": "power_on()", "type": "expression", "loc": [198, 198], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L195_C8", "vector": [8, 5, 0.8049, 0.0041, 5, 0.96, 0.2, 777, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "power_on", "arg_names": [], "import_names": [], "rhs_call_name": "power_on", "annotation": ""}, "snippet": " cmg.firenze.power_on()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L200_C12", "label": "t_begin = time()", "type": "assigned_variable", "loc": [200, 200], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L195_C8", "vector": [14, 5, 0.813, 0.0041, 5, 0.96, 0.3, 23, 3, 0, 0, 0, 654, 10, 1], "semantic": {"name": "t_begin", "arg_names": [], "import_names": [], "rhs_call_name": "time", "annotation": ""}, "snippet": " t_begin = time.time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L201_C12", "label": "pull_loc =", "type": "assigned_variable", "loc": [201, 201], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L195_C8", "vector": [14, 5, 0.8171, 0.0041, 5, 0.96, 0.4, 640, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "pull_loc", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pull_loc = np.matrix([0.55, -0.2, -.23]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L202_C12", "label": "if", "type": "if", "loc": [202, 205], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L195_C8", "vector": [4, 5, 0.8272, 0.0163, 5, 0.96, 0.5, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if opt.sliding_left:\n thresh = 2.\n else:\n thresh = 5."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L203_C16", "label": "thresh =", "type": "assigned_variable", "loc": [203, 203], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L202_C12", "vector": [14, 6, 0.8252, 0.0041, 6, 0.59, 0.0, 844, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "thresh", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " thresh = 2."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L205_C16", "label": "thresh =", "type": "assigned_variable", "loc": [205, 205], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L202_C12", "vector": [14, 6, 0.8333, 0.0041, 6, 0.59, 1.0, 844, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "thresh", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " thresh = 5."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L206_C12", "label": "res, jep = search_and_hook()", "type": "assigned_variable", "loc": [206, 207], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L195_C8", "vector": [14, 5, 0.8394, 0.0081, 5, 0.96, 0.6, 95, 3, 5, 0, 0, 913, 10, 2], "semantic": {"name": "res, jep", "arg_names": [], "import_names": [], "rhs_call_name": "search_and_hook", "annotation": ""}, "snippet": " res, jep = cmg.search_and_hook(arm, math.radians(ha),\n pull_loc, 0., thresh)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Expr_L208_C12", "label": "print()", "type": "expression", "loc": [208, 208], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L195_C8", "vector": [8, 5, 0.8455, 0.0041, 5, 0.96, 0.7, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('result of search and hook:', res)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L209_C12", "label": "if", "type": "if", "loc": [209, 212], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L195_C8", "vector": [4, 5, 0.8557, 0.0163, 5, 0.96, 0.8, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if res != 'got a hook':\n print('Did not get a hook.')\n print('Exiting...')\n sys.exit()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Expr_L210_C16", "label": "print()", "type": "expression", "loc": [210, 210], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L209_C12", "vector": [8, 6, 0.8537, 0.0041, 6, 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('Did not get a hook.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Expr_L211_C16", "label": "print()", "type": "expression", "loc": [211, 211], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L209_C12", "vector": [8, 6, 0.8577, 0.0041, 6, 0.75, 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_99528:Expr_L212_C16", "label": "exit()", "type": "expression", "loc": [212, 212], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L209_C12", "vector": [8, 6, 0.8618, 0.0041, 6, 0.75, 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_99528:Assign_L213_C12", "label": "residual_angle =", "type": "assigned_variable", "loc": [213, 213], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L195_C8", "vector": [14, 5, 0.8659, 0.0041, 5, 0.96, 0.9, 496, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "residual_angle", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " residual_angle = 0."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L214_C12", "label": "pose_dict =", "type": "assigned_variable", "loc": [214, 214], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L195_C8", "vector": [14, 5, 0.8699, 0.0041, 5, 0.96, 1.0, 96, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "pose_dict", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pose_dict = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L219_C8", "label": "if", "type": "if", "loc": [219, 222], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:Try_L86_C4", "vector": [4, 2, 0.8963, 0.0163, 2, 0.76, 0.2308, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if opt.use_jacobian:\n kinematics_estimation = 'jacobian'\n else:\n kinematics_estimation = 'rotation_center'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L220_C12", "label": "kinematics_estimation =", "type": "assigned_variable", "loc": [220, 220], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L219_C8", "vector": [14, 3, 0.8943, 0.0041, 3, 0.93, 0.0, 240, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "kinematics_estimation", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " kinematics_estimation = 'jacobian'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L222_C12", "label": "kinematics_estimation =", "type": "assigned_variable", "loc": [222, 222], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L219_C8", "vector": [14, 3, 0.9024, 0.0041, 3, 0.93, 1.0, 240, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "kinematics_estimation", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " kinematics_estimation = 'rotation_center'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L224_C8", "label": "t_pull = time()", "type": "assigned_variable", "loc": [224, 224], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:Try_L86_C4", "vector": [14, 2, 0.9106, 0.0041, 2, 0.76, 0.3077, 556, 3, 0, 0, 0, 654, 10, 1], "semantic": {"name": "t_pull", "arg_names": [], "import_names": [], "rhs_call_name": "time", "annotation": ""}, "snippet": " t_pull = time.time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Expr_L225_C8", "label": "pull()", "type": "expression", "loc": [225, 229], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:Try_L86_C4", "vector": [8, 2, 0.9228, 0.0203, 2, 0.76, 0.3846, 964, 3, 10, 0, 0, 0, 0, 2], "semantic": {"name": "pull", "arg_names": [], "import_names": [], "rhs_call_name": "pull", "annotation": ""}, "snippet": " cmg.pull(arm, math.radians(ha), residual_angle, ft, jep,\n strategy = 'control_radial_force',\n info_string=info_string, cep_vel = 0.10,\n kinematics_estimation=kinematics_estimation,\n pull_left = opt.sliding_left)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L230_C8", "label": "t_end = time()", "type": "assigned_variable", "loc": [230, 230], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:Try_L86_C4", "vector": [14, 2, 0.935, 0.0041, 2, 0.76, 0.4615, 945, 3, 0, 0, 0, 654, 10, 1], "semantic": {"name": "t_end", "arg_names": [], "import_names": [], "rhs_call_name": "time", "annotation": ""}, "snippet": " t_end = time.time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L232_C8", "label": "assign", "type": "assigned_variable", "loc": [232, 232], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:Try_L86_C4", "vector": [14, 2, 0.9431, 0.0041, 2, 0.76, 0.5385, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pose_dict['t0'] = t_begin"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L233_C8", "label": "assign", "type": "assigned_variable", "loc": [233, 233], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:Try_L86_C4", "vector": [14, 2, 0.9472, 0.0041, 2, 0.76, 0.6154, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pose_dict['t1'] = t_pull"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L234_C8", "label": "assign", "type": "assigned_variable", "loc": [234, 234], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:Try_L86_C4", "vector": [14, 2, 0.9512, 0.0041, 2, 0.76, 0.6923, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pose_dict['t2'] = t_end"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Expr_L235_C8", "label": "save_pickle()", "type": "expression", "loc": [235, 235], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:Try_L86_C4", "vector": [8, 2, 0.9553, 0.0041, 2, 0.76, 0.7692, 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(pose_dict,'pose_dict_'+ut.formatted_time()+'.pkl')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Expr_L237_C8", "label": "print()", "type": "expression", "loc": [237, 237], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:Try_L86_C4", "vector": [8, 2, 0.9634, 0.0041, 2, 0.76, 0.8462, 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 end everything')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L238_C8", "label": "k = get_keystroke()", "type": "assigned_variable", "loc": [238, 238], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:Try_L86_C4", "vector": [14, 2, 0.9675, 0.0041, 2, 0.76, 0.9231, 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_99528:Expr_L239_C8", "label": "stop()", "type": "expression", "loc": [239, 239], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:Try_L86_C4", "vector": [8, 2, 0.9715, 0.0041, 2, 0.76, 1.0, 343, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "stop", "annotation": ""}, "snippet": " cmg.stop()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Expr_L242_C8", "label": "print()", "type": "expression", "loc": [242, 242], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:Try_L86_C4", "vector": [8, 2, 0.9837, 0.0041, 2, 0.76, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Hello, Mr. Exception')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99528:Expr_L243_C8", "label": "stop()", "type": "expression", "loc": [243, 243], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99528:Try_L86_C4", "vector": [8, 2, 0.9878, 0.0041, 2, 0.76, 1.0, 343, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "stop", "annotation": ""}, "snippet": " cmg.stop()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L45_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Expr_L46_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Expr_L48_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Expr_L50_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Expr_L52_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Expr_L54_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Expr_L56_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Expr_L58_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Expr_L60_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Expr_L62_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Expr_L64_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Expr_L68_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L72_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L73_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L74_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L75_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L76_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L77_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L78_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L79_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L80_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L81_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L82_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L84_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Try_L86_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:Try_L86_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L87_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L87_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Expr_L88_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L87_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Expr_L89_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L87_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Expr_L90_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:Try_L86_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L92_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:Try_L86_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L96_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L96_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Expr_L97_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L96_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Import_L98_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L96_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Expr_L100_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L96_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L101_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L96_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Expr_L102_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L96_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L104_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L104_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L105_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L104_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Import_L107_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L104_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L108_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L96_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L110_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L96_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Import_L111_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L96_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L112_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L96_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Expr_L113_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L96_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L115_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L96_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L118_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L96_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Expr_L119_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L96_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Expr_L121_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L96_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L122_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L96_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Expr_L123_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L96_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Expr_L125_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L96_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Expr_L126_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L96_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Expr_L127_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L96_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Expr_L129_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L96_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L130_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L96_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L131_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L131_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Expr_L132_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L131_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Expr_L133_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L131_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Expr_L134_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L96_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L136_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L96_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L137_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L96_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L139_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L139_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Import_L140_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L139_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Import_L142_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L139_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Expr_L145_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L139_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Expr_L146_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L139_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Expr_L147_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L139_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L148_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L148_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Expr_L149_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L148_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Expr_L150_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L148_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Expr_L151_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L139_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L153_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L139_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L155_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L139_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L156_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L139_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:While_L157_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:While_L157_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L158_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L158_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Expr_L159_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L158_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Expr_L160_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:While_L157_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L161_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:While_L157_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Expr_L162_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:While_L157_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L163_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L139_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L166_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L139_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L167_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L139_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L169_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L139_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L170_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L139_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L171_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L139_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Expr_L173_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L139_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L175_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L139_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L176_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L139_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L177_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L139_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L178_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L139_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L179_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L139_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L180_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L139_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L181_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L139_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L183_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L183_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L184_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L183_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L186_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L139_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L187_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L139_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Expr_L189_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L139_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L190_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L190_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Expr_L191_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L190_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Expr_L192_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L190_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Expr_L193_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L139_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L195_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L195_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Expr_L196_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L195_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L197_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L195_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Expr_L198_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L195_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L200_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L195_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L201_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L195_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L202_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L202_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L203_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L202_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L205_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L195_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L206_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L195_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Expr_L208_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L195_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L209_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L209_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Expr_L210_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L209_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Expr_L211_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L209_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Expr_L212_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L195_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L213_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L195_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L214_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:Try_L86_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L219_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L219_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L220_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:If_L219_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L222_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:Try_L86_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L224_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:Try_L86_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Expr_L225_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:Try_L86_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L230_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:Try_L86_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L232_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:Try_L86_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L233_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:Try_L86_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L234_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:Try_L86_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Expr_L235_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:Try_L86_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Expr_L237_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:Try_L86_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Assign_L238_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:Try_L86_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Expr_L239_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:Try_L86_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Expr_L242_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99528:Try_L86_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99528:Expr_L243_C8"}]
# # # Copyright (c) 2010, Georgia Tech Research Corporation # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # * Neither the name of the Georgia Tech Research Corporation nor the # names of its contributors may be used to endorse or promote products # derived from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY GEORGIA TECH RESEARCH CORPORATION ''AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL GEORGIA TECH BE LIABLE FOR ANY DIRECT, INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # \author Advait Jain (Healthcare Robotics Lab, Georgia Tech.) import roslib roslib.load_manifest('equilibrium_point_control') import numpy as np, math import scipy.optimize as so import scipy.ndimage as ni import matplotlib_util.util as mpu import hrl_lib.util as ut import hrl_lib.transforms as tr import hrl_hokuyo.hokuyo_processing as hp import mekabot.coord_frames as mcf import util as uto from opencv.highgui import * ## # @param pts - 2xN np matrix # @return r,theta (two 1D np arrays) def cartesian_to_polar(pts): r = ut.norm(pts).A1 theta = np.arctan2(pts[1,:],pts[0,:]).A1 return r,theta ## # @param r - 1D np array # @param theta - 1D np array (RADIANS) # @return 2xN np matrix of cartesian points def polar_to_cartesian(r,theta): x = r*np.cos(theta) y = r*np.sin(theta) return np.matrix(np.row_stack((x,y))) ## # mx,my,ma - motion of the robot # cx,cy - axis of mechanism in robot frame. # start_angle,end_angle - between 0 and 2*pi def point_contained(mx,my,ma,cx,cy,rad,pts,start_angle,end_angle,buffer): if abs(mx)>0.2 or abs(my)>0.2 or abs(ma)>math.radians(40): # print 'too large a motion for point_contained' return np.array([[]]) pts_t = pts + np.matrix([mx,my]).T pts_t = tr.Rz(-ma)[0:2,0:2]*pts_t r,t = cartesian_to_polar(pts_t-np.matrix([cx,cy]).T) t = np.mod(t,math.pi*2) # I want theta to be b/w 0 and 2pi if start_angle<end_angle: f = np.row_stack((r<rad+buffer,r>rad-buffer/2.,t<end_angle,t>start_angle)) else: f = np.row_stack((r<rad+buffer,r>rad-buffer/2.,t<start_angle,t>end_angle)) idxs = np.where(np.all(f,0)) r_filt = r[idxs] t_filt = t[idxs] return polar_to_cartesian(r_filt,t_filt)+np.matrix([cx,cy]).T def optimize_position(cx,cy,rad,curr_pos,eq_pos,pts,bndry,start_angle, end_angle,buffer,tangential_force): scale_x,scale_y,scale_a = 1.,1.,1. b = min(abs(tangential_force),60.) if end_angle>start_angle: # min_alpha = math.radians(30) max_alpha = math.radians(90) else: # min_alpha = math.radians(-150) max_alpha = math.radians(-90) min_alpha = max_alpha - math.radians(60-b*0.7) dist_moved_weight = 0.4 - 0.3*b/60. alpha_weight = 0.4+1.0*b/60. bndry_weight = 1. pts_in_weight = 1. print 'OPTIMIZE_POSITION' print 'start_angle:', math.degrees(start_angle) print 'end_angle:', math.degrees(end_angle) print 'tangential_force:', tangential_force def error_function(params): mx,my,ma = params[0],params[1],params[2] mx,my,ma = mx/scale_x,my/scale_y,ma/scale_a #x,y = params[0],params[1] pts_in = point_contained(mx,my,ma,cx,cy,rad,pts, start_angle,end_angle,buffer) p = tr.Rz(ma)*curr_pos-np.matrix([mx,my,0.]).T p_eq = tr.Rz(ma)*eq_pos-np.matrix([mx,my,0.]).T dist_moved = math.sqrt(mx*mx+my*my)+abs(ma)*0.2 dist_bndry = dist_from_boundary(p_eq,bndry,pts) alpha = math.pi-(start_angle-ma) if alpha<min_alpha: alpha_cost = min_alpha-alpha elif alpha>max_alpha: alpha_cost = alpha-max_alpha else: alpha_cost = 0. alpha_cost = alpha_cost * alpha_weight move_cost = dist_moved * dist_moved_weight bndry_cost = dist_bndry * bndry_weight pts_in_cost = pts_in.shape[1]/1000. * pts_in_weight # print '---------------------------------' # print 'alpha:',math.degrees(alpha) # print 'alpha_cost:',alpha_cost # print 'mx,my:',mx,my # print 'dist_moved:',dist_moved # print 'dist_bndry:',dist_bndry # print 'pts_in.shape[1]:',pts_in.shape[1] # print 'move_cost:', move_cost # print 'bndry_cost:',bndry_cost # print 'pts_in_cost:',pts_in_cost # return -pts_in.shape[1]+dist_moved - bndry_cost err = -pts_in_cost-bndry_cost+move_cost+alpha_cost # print 'error function value:',err return err params_1 = [0.,0.,0.] res = so.fmin_bfgs(error_function,params_1,full_output=1) r,f = res[0],res[1] # r,f,d = so.fmin_l_bfgs_b(error_function,params_1,approx_grad=True, # bounds=[(-0.1*scale_x,0.1*scale_x), # (-0.1*scale_y,0.1*scale_y), # (-math.radians(15)*scale_a, # math.radians(15)*scale_a)], # m=10, factr=10000000.0, # pgtol=1.0000000000000001e-05, # epsilon=0.0001, iprint=-1, # maxfun=1000) opt_params = r # print 'optimized value:',f mx,my,ma = opt_params[0]/scale_x,opt_params[1]/scale_y,\ opt_params[2]/scale_a error_function(opt_params) return mx,my,ma #return opt_params[0],opt_params[1] ## # compute the boundary of the 2D points. Making assumptions about # the density of the points, tested with workspace_dict only. # @param pts - 2xN np matrix def compute_boundary(pts): npim1,nx,ny,br = hp.xy_map_to_np_image(pts,m_per_pixel=0.01,dilation_count=0,padding=10) npim1 = npim1/255 npim = np.zeros(npim1.shape,dtype='int') npim[:,:] = npim1[:,:] connect_structure = np.empty((3,3),dtype='int') connect_structure[:,:] = 1 erim = ni.binary_erosion(npim,connect_structure,iterations=1) bim = npim-erim tup = np.where(bim>0) bpts = np.row_stack((nx-tup[0],ny-tup[1]))*0.01 + br # cvim = uto.np2cv(bim) # cvSaveImage('boundary.png',cvim) return np.matrix(bpts) ## #return 2x1 vector from closest boundary point def vec_from_boundary(curr_pos,bndry): p = curr_pos[0:2,:] v = p-bndry min_idx = np.argmin(ut.norm(v)) return v[:,min_idx] ## #return distance from boundary. (-ve if outside the boundary) # @param curr_pos - can be 3x1 np matrix # @param bndry - boundary (2xN np matrix) # @param pts - 2xN np matrix. pts whose boundary is bndry def dist_from_boundary(curr_pos,bndry,pts): mv = vec_from_boundary(curr_pos,bndry) # spoly = sg.Polygon((bndry.T).tolist()) # spt = sg.Point(curr_pos[0,0],curr_pos[1,0]) d = np.linalg.norm(mv) p = curr_pos[0:2,:] v = p-pts min_dist = np.min(ut.norm(v)) # print 'min_dist,d:',min_dist,d # print 'min_dist >= d',min_dist >= d-0.001 if min_dist >= d-0.001: # print 'I predict outside workspace' d = -d # if spoly.contains(spt) == False: # print 'Shapely predicts outside workspace' # d = -d return d ## # @param curr_pos - current location of end effector. 3x1 np matrix # @param bndry - workspace boundary. 2xN np matrix def close_to_boundary(curr_pos,bndry,pts,dist_thresh): min_dist = dist_from_boundary(curr_pos,bndry,pts) return min_dist <= dist_thresh def visualize_boundary(): d = ut.load_pickle('../../pkls/workspace_dict_2009Sep03_010426.pkl') z = -0.23 k = d.keys() k_idx = np.argmin(np.abs(np.array(k)-z)) pts = d[k[k_idx]] bpts = compute_boundary(pts) cl_list = [] for pt in pts.T: if close_to_boundary(pt.T,bpts,dist_thresh=0.05)==True: cl_list.append(pt.A1.tolist()) clpts = np.matrix(cl_list).T print 'clpts.shape:', clpts.shape mpu.plot_yx(pts[1,:].A1,pts[0,:].A1,linewidth=0) mpu.plot_yx(clpts[1,:].A1,clpts[0,:].A1,linewidth=0,color='r') mpu.plot_yx(bpts[1,:].A1,bpts[0,:].A1,linewidth=0,color='y') mpu.show() ## transform from torso start to torso local frame. # @param pts - 3xN np matrix in ts coord frame. # @param x,y,a - motion of the segway (in the ms frame) # @return pts_tl def tlTts(pts_ts,x,y,a): pts_ms = mcf.mecanumTglobal(mcf.globalTtorso(pts_ts)) v_org_ms = np.matrix([x,y,0.]).T pts_ml = tr.Rz(a)*(pts_ms-v_org_ms) pts_tl = mcf.torsoTglobal(mcf.globalTmecanum(pts_ml)) return pts_tl ## transform from torso local to torso start frame. # @param pts - 3xN np matrix in tl coord frame. # @param x,y,a - motion of the segway (in the ms frame) # @return pts_ts def tsTtl(pts_tl,x,y,a): pts_ml = mcf.mecanumTglobal(mcf.globalTtorso(pts_tl)) v_org_ms = np.matrix([x,y,0.]).T pts_ms = tr.Rz(-a) * pts_ml + v_org_ms pts_ts = mcf.torsoTglobal(mcf.globalTmecanum(pts_ms)) return pts_ts ## rotate vector from torso local to torso start frame. # @param vecs_tl - 3xN np matrix in tl coord frame. # @param a - motion of the segway (in the ms frame) # @return vecs_ts def tsRtl(vecs_tl, a): vecs_ml = mcf.mecanumTglobal(mcf.globalTtorso(vecs_tl, True), True) vecs_ms = tr.Rz(-a) * vecs_ml vecs_ts = mcf.torsoTglobal(mcf.globalTmecanum(vecs_ms, True), True) return vecs_ts ## rotate vector from torso local to torso start frame. # @param vecs_tl - 3xN np matrix in tl coord frame. # @param a - motion of the segway (in the ms frame) # @return vecs_ts def tlRts(vecs_ts, a): vecs_ms = mcf.mecanumTglobal(mcf.globalTtorso(vecs_ts, True), True) vecs_ml = tr.Rz(a) * vecs_ms vecs_tl = mcf.torsoTglobal(mcf.globalTmecanum(vecs_ml, True), True) return vecs_tl def pts_within_dist(p,pts,min_dist,max_dist): v = p-pts d_arr = ut.norm(v).A1 idxs = np.where(np.all(np.row_stack((d_arr<max_dist,d_arr>min_dist)),axis=0)) pts_within = pts[:,idxs[0]] return pts_within ## apologies for the poor name. computes the translation of the torso # frame that move the eq pt away from closest boundary and rotate such # that local x axis is perp to mechanism returns 2x1 np matrix, angle def segway_motion_repulse(curr_pos_tl, eq_pt_tl,bndry, all_pts): bndry_dist_eq = dist_from_boundary(eq_pt_tl,bndry,all_pts) # signed bndry_dist_ee = dist_from_boundary(curr_pos_tl,bndry,all_pts) # signed if bndry_dist_ee < bndry_dist_eq: p = curr_pos_tl[0:2,:] bndry_dist = bndry_dist_ee else: p = eq_pt_tl[0:2,:] bndry_dist = bndry_dist_eq # p = eq_pt_tl[0:2,:] pts_close = pts_within_dist(p,bndry,0.002,0.07) v = p-pts_close d_arr = ut.norm(v).A1 v = v/d_arr v = v/d_arr # inverse distance weight resultant = v.sum(1) res_norm = np.linalg.norm(resultant) resultant = resultant/res_norm tvec = -resultant if bndry_dist < 0.: tvec = -tvec # eq pt was outside workspace polygon. if abs(bndry_dist)<0.01 or res_norm<0.01: # internal external test fails so falling back on # going to mean. m = all_pts.mean(1) tvec = m-p tvec = -tvec/np.linalg.norm(tvec) dist_move = 0. if bndry_dist > 0.05: dist_move = 0. else: dist_move = 1. tvec = tvec*dist_move # tvec is either a unit vec or zero vec. return tvec if __name__ == '__main__': #d = ut.load_pickle('workspace_dict_2009Sep03_221107.pkl') d = ut.load_pickle('../../pkls/workspace_dict_2009Sep05_200116.pkl') z = -0.23 k = d.keys() k_idx = np.argmin(np.abs(np.array(k)-z)) pts = d[k[k_idx]] # visualize_boundary() for kk in k: pts = d[kk] bpts = compute_boundary(pts) cx,cy = 0.7,-0.6 rad = 0.4 # pts_in = point_contained(cx,cy,0.,rad,pts, # start_angle=math.radians(140), # end_angle=math.radians(190)) mpu.figure() mpu.plot_yx(pts[1,:].A1,pts[0,:].A1,linewidth=0) mpu.plot_yx(bpts[1,:].A1,bpts[0,:].A1,linewidth=0,color='y') # mpu.plot_yx(pts_in[1,:].A1,pts_in[0,:].A1,linewidth=0,color='g') # mpu.plot_yx([cy],[cx],linewidth=0,color='r') mpu.show() ### apologies for the poor name. computes the translation and rotation ## of the torso frame that move the eq pt away from closest boundary ## and rotate such that local x axis is perp to mechanism ## returns 2x1 np matrix, angle #def segway_motion_repulse(curr_pos_tl,cx_tl,cy_tl,cy_ts,start_pos_ts, # eq_pt_tl,bndry): # vec_bndry = vec_from_boundary(eq_pt_tl,bndry) # dist_boundary = np.linalg.norm(vec_bndry) # vec_bndry = vec_bndry/dist_boundary # # radial_vec_tl = curr_pos_tl[0:2]-np.matrix([cx_tl,cy_tl]).T # radial_angle = math.atan2(radial_vec_tl[1,0],radial_vec_tl[0,0]) # if cy_ts<start_pos_ts[1,0]: # err = radial_angle-math.pi/2 # else: # err = radial_angle +math.pi/2 # # a_torso = err # dist_move = max(0.15-dist_boundary,0.) # if dist_move < 0.04: # dist_move = 0. # hook_translation_tl = -vec_bndry*dist_move # ## print 'vec_bndry:',vec_bndry.A1.tolist() ## print 'dist_boundary:',dist_boundary # # return hook_translation_tl,a_torso
ajibawa-2023/Python-Code-Large/train/row_99529
194
403
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Import_L32_C0", "label": "roslib import roslib", "type": "import", "loc": [32, 32], "level": 0, "parent": null, "vector": [1, 0, 0.0794, 0.0025, 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_99529:Expr_L33_C0", "label": "load_manifest()", "type": "expression", "loc": [33, 33], "level": 0, "parent": null, "vector": [8, 0, 0.0819, 0.0025, 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('equilibrium_point_control')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Import_L36_C0", "label": "numpy import np, math", "type": "import", "loc": [36, 36], "level": 0, "parent": null, "vector": [1, 0, 0.0893, 0.0025, 0, 0.66, 0.0741, 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_99529:Import_L37_C0", "label": "scipy.optimize import so", "type": "import", "loc": [37, 37], "level": 0, "parent": null, "vector": [1, 0, 0.0918, 0.0025, 0, 0.66, 0.1111, 359, 0, 1, 0, 0, 359, 0, 0], "semantic": {"name": "scipy.optimize", "arg_names": [], "import_names": ["so"], "rhs_call_name": "", "annotation": ""}, "snippet": "import scipy.optimize as so"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Import_L38_C0", "label": "scipy.ndimage import ni", "type": "import", "loc": [38, 38], "level": 0, "parent": null, "vector": [1, 0, 0.0943, 0.0025, 0, 0.66, 0.1481, 348, 0, 1, 0, 0, 348, 0, 0], "semantic": {"name": "scipy.ndimage", "arg_names": [], "import_names": ["ni"], "rhs_call_name": "", "annotation": ""}, "snippet": "import scipy.ndimage as ni"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Import_L39_C0", "label": "matplotlib_util.util import mpu", "type": "import", "loc": [39, 39], "level": 0, "parent": null, "vector": [1, 0, 0.0968, 0.0025, 0, 0.66, 0.1852, 781, 0, 1, 0, 0, 781, 0, 0], "semantic": {"name": "matplotlib_util.util", "arg_names": [], "import_names": ["mpu"], "rhs_call_name": "", "annotation": ""}, "snippet": "import matplotlib_util.util as mpu"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Import_L40_C0", "label": "hrl_lib.util import ut", "type": "import", "loc": [40, 40], "level": 0, "parent": null, "vector": [1, 0, 0.0993, 0.0025, 0, 0.66, 0.2222, 775, 0, 1, 0, 0, 775, 0, 0], "semantic": {"name": "hrl_lib.util", "arg_names": [], "import_names": ["ut"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.util as ut"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Import_L41_C0", "label": "hrl_lib.transforms import tr", "type": "import", "loc": [41, 41], "level": 0, "parent": null, "vector": [1, 0, 0.1017, 0.0025, 0, 0.66, 0.2593, 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_99529:Import_L42_C0", "label": "hrl_hokuyo.hokuyo_processing import hp", "type": "import", "loc": [42, 42], "level": 0, "parent": null, "vector": [1, 0, 0.1042, 0.0025, 0, 0.66, 0.2963, 513, 0, 1, 0, 0, 513, 0, 0], "semantic": {"name": "hrl_hokuyo.hokuyo_processing", "arg_names": [], "import_names": ["hp"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_hokuyo.hokuyo_processing as hp"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Import_L43_C0", "label": "mekabot.coord_frames import mcf", "type": "import", "loc": [43, 43], "level": 0, "parent": null, "vector": [1, 0, 0.1067, 0.0025, 0, 0.66, 0.3333, 350, 0, 1, 0, 0, 350, 0, 0], "semantic": {"name": "mekabot.coord_frames", "arg_names": [], "import_names": ["mcf"], "rhs_call_name": "", "annotation": ""}, "snippet": "import mekabot.coord_frames as mcf"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Import_L44_C0", "label": "util import uto", "type": "import", "loc": [44, 44], "level": 0, "parent": null, "vector": [1, 0, 0.1092, 0.0025, 0, 0.66, 0.3704, 811, 0, 1, 0, 0, 811, 0, 0], "semantic": {"name": "util", "arg_names": [], "import_names": ["uto"], "rhs_call_name": "", "annotation": ""}, "snippet": "import util as uto"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:ImportFrom_L45_C0", "label": "from opencv.highgui import *", "type": "import", "loc": [45, 45], "level": 0, "parent": null, "vector": [1, 0, 0.1117, 0.0025, 0, 0.66, 0.4074, 453, 0, 1, 0, 0, 453, 0, 0], "semantic": {"name": "opencv.highgui", "arg_names": [], "import_names": ["*"], "rhs_call_name": "", "annotation": ""}, "snippet": "from opencv.highgui import *"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L50_C0", "label": "cartesian_to_polar", "type": "function", "loc": [50, 53], "level": 0, "parent": null, "vector": [2, 0, 0.1278, 0.0099, 0, 0.66, 0.4444, 805, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "cartesian_to_polar", "arg_names": ["pts"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def cartesian_to_polar(pts):\n r = ut.norm(pts).A1\n theta = np.arctan2(pts[1,:],pts[0,:]).A1\n return r,theta"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L51_C4", "label": "r =", "type": "assigned_variable", "loc": [51, 51], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L50_C0", "vector": [14, 1, 0.1266, 0.0025, 1, 0.73, 0.0, 436, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " r = ut.norm(pts).A1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L52_C4", "label": "theta =", "type": "assigned_variable", "loc": [52, 52], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L50_C0", "vector": [14, 1, 0.129, 0.0025, 1, 0.73, 0.5, 729, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "theta", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " theta = np.arctan2(pts[1,:],pts[0,:]).A1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Return_L53_C4", "label": "return", "type": "return", "loc": [53, 53], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L50_C0", "vector": [13, 1, 0.1315, 0.0025, 1, 0.73, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return r,theta"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L59_C0", "label": "polar_to_cartesian", "type": "function", "loc": [59, 62], "level": 0, "parent": null, "vector": [2, 0, 0.1501, 0.0099, 0, 0.66, 0.4815, 985, 0, 2, 1, 0, 0, 0, 4], "semantic": {"name": "polar_to_cartesian", "arg_names": ["r", "theta"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def polar_to_cartesian(r,theta):\n x = r*np.cos(theta)\n y = r*np.sin(theta)\n return np.matrix(np.row_stack((x,y)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L60_C4", "label": "x =", "type": "assigned_variable", "loc": [60, 60], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L59_C0", "vector": [14, 1, 0.1489, 0.0025, 1, 0.53, 0.0, 190, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " x = r*np.cos(theta)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L61_C4", "label": "y =", "type": "assigned_variable", "loc": [61, 61], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L59_C0", "vector": [14, 1, 0.1514, 0.0025, 1, 0.53, 0.5, 304, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " y = r*np.sin(theta)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Return_L62_C4", "label": "return", "type": "return", "loc": [62, 62], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L59_C0", "vector": [13, 1, 0.1538, 0.0025, 1, 0.53, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return np.matrix(np.row_stack((x,y)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L68_C0", "label": "point_contained", "type": "function", "loc": [68, 84], "level": 0, "parent": null, "vector": [2, 0, 0.1886, 0.0422, 0, 0.66, 0.5185, 48, 0, 10, 1, 0, 0, 0, 16], "semantic": {"name": "point_contained", "arg_names": ["mx", "my", "ma", "cx", "cy", "rad", "pts", "start_angle", "end_angle", "buffer"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def point_contained(mx,my,ma,cx,cy,rad,pts,start_angle,end_angle,buffer):\n if abs(mx)>0.2 or abs(my)>0.2 or abs(ma)>math.radians(40):\n# print 'too large a motion for point_contained'\n return np.array([[]])\n pts_t = pts + np.matrix([mx,my]).T\n pts_t = tr.Rz(-ma)[0:2,0:2]*pts_t\n r,t = cartesian_to_polar(pts_t-np.matrix([cx,cy]).T)\n t = np.mod(t,math.pi*2) # I want theta to be b/w 0 and 2pi"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:If_L69_C4", "label": "if", "type": "if", "loc": [69, 71], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L68_C0", "vector": [4, 1, 0.1737, 0.0074, 1, 0.37, 0.0, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if abs(mx)>0.2 or abs(my)>0.2 or abs(ma)>math.radians(40):\n# print 'too large a motion for point_contained'\n return np.array([[]])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Return_L71_C8", "label": "return", "type": "return", "loc": [71, 71], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:If_L69_C4", "vector": [13, 2, 0.1762, 0.0025, 2, 0.94, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return np.array([[]])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L72_C4", "label": "pts_t =", "type": "assigned_variable", "loc": [72, 72], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L68_C0", "vector": [14, 1, 0.1787, 0.0025, 1, 0.37, 0.1111, 816, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "pts_t", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pts_t = pts + np.matrix([mx,my]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L73_C4", "label": "pts_t =", "type": "assigned_variable", "loc": [73, 73], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L68_C0", "vector": [14, 1, 0.1811, 0.0025, 1, 0.37, 0.2222, 816, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "pts_t", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pts_t = tr.Rz(-ma)[0:2,0:2]*pts_t"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L74_C4", "label": "r, t = cartesian_to_polar()", "type": "assigned_variable", "loc": [74, 74], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L68_C0", "vector": [14, 1, 0.1836, 0.0025, 1, 0.37, 0.3333, 96, 3, 1, 0, 0, 805, 10, 2], "semantic": {"name": "r, t", "arg_names": [], "import_names": [], "rhs_call_name": "cartesian_to_polar", "annotation": ""}, "snippet": " r,t = cartesian_to_polar(pts_t-np.matrix([cx,cy]).T)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L75_C4", "label": "t = mod()", "type": "assigned_variable", "loc": [75, 75], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L68_C0", "vector": [14, 1, 0.1861, 0.0025, 1, 0.37, 0.4444, 15, 3, 2, 0, 0, 25, 10, 1], "semantic": {"name": "t", "arg_names": [], "import_names": [], "rhs_call_name": "mod", "annotation": ""}, "snippet": " t = np.mod(t,math.pi*2) # I want theta to be b/w 0 and 2pi"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:If_L76_C4", "label": "if", "type": "if", "loc": [76, 79], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L68_C0", "vector": [4, 1, 0.1923, 0.0099, 1, 0.37, 0.5556, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if start_angle<end_angle:\n f = np.row_stack((r<rad+buffer,r>rad-buffer/2.,t<end_angle,t>start_angle))\n else:\n f = np.row_stack((r<rad+buffer,r>rad-buffer/2.,t<start_angle,t>end_angle))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L77_C8", "label": "f = row_stack()", "type": "assigned_variable", "loc": [77, 77], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:If_L76_C4", "vector": [14, 2, 0.1911, 0.0025, 2, 0.94, 0.0, 899, 3, 1, 0, 0, 612, 10, 1], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "row_stack", "annotation": ""}, "snippet": " f = np.row_stack((r<rad+buffer,r>rad-buffer/2.,t<end_angle,t>start_angle))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L79_C8", "label": "f = row_stack()", "type": "assigned_variable", "loc": [79, 79], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:If_L76_C4", "vector": [14, 2, 0.196, 0.0025, 2, 0.94, 1.0, 899, 3, 1, 0, 0, 612, 10, 1], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "row_stack", "annotation": ""}, "snippet": " f = np.row_stack((r<rad+buffer,r>rad-buffer/2.,t<start_angle,t>end_angle))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L80_C4", "label": "idxs = where()", "type": "assigned_variable", "loc": [80, 80], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L68_C0", "vector": [14, 1, 0.1985, 0.0025, 1, 0.37, 0.6667, 677, 3, 1, 0, 0, 169, 10, 2], "semantic": {"name": "idxs", "arg_names": [], "import_names": [], "rhs_call_name": "where", "annotation": ""}, "snippet": " idxs = np.where(np.all(f,0))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L82_C4", "label": "r_filt =", "type": "assigned_variable", "loc": [82, 82], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L68_C0", "vector": [14, 1, 0.2035, 0.0025, 1, 0.37, 0.7778, 188, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "r_filt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " r_filt = r[idxs]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L83_C4", "label": "t_filt =", "type": "assigned_variable", "loc": [83, 83], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L68_C0", "vector": [14, 1, 0.206, 0.0025, 1, 0.37, 0.8889, 522, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "t_filt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " t_filt = t[idxs]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Return_L84_C4", "label": "return", "type": "return", "loc": [84, 84], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L68_C0", "vector": [13, 1, 0.2084, 0.0025, 1, 0.37, 1.0, 0, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return polar_to_cartesian(r_filt,t_filt)+np.matrix([cx,cy]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L86_C0", "label": "optimize_position", "type": "function", "loc": [86, 167], "level": 0, "parent": null, "vector": [2, 0, 0.3139, 0.2035, 0, 0.66, 0.5556, 378, 0, 11, 1, 0, 0, 0, 21], "semantic": {"name": "optimize_position", "arg_names": ["cx", "cy", "rad", "curr_pos", "eq_pos", "pts", "bndry", "start_angle", "end_angle", "buffer", "tangential_force"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def optimize_position(cx,cy,rad,curr_pos,eq_pos,pts,bndry,start_angle,\n end_angle,buffer,tangential_force):\n scale_x,scale_y,scale_a = 1.,1.,1.\n b = min(abs(tangential_force),60.)\n if end_angle>start_angle:\n# min_alpha = math.radians(30)\n max_alpha = math.radians(90)\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L88_C4", "label": "scale_x, scale_y, scale_a =", "type": "assigned_variable", "loc": [88, 88], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L86_C0", "vector": [14, 1, 0.2184, 0.0025, 1, 0.01, 0.0, 507, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "scale_x, scale_y, scale_a", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " scale_x,scale_y,scale_a = 1.,1.,1."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L89_C4", "label": "b = min()", "type": "assigned_variable", "loc": [89, 89], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L86_C0", "vector": [14, 1, 0.2208, 0.0025, 1, 0.01, 0.0526, 756, 3, 2, 0, 0, 867, 10, 2], "semantic": {"name": "b", "arg_names": [], "import_names": [], "rhs_call_name": "min", "annotation": ""}, "snippet": " b = min(abs(tangential_force),60.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:If_L90_C4", "label": "if", "type": "if", "loc": [90, 95], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L86_C0", "vector": [4, 1, 0.2295, 0.0149, 1, 0.01, 0.1053, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if end_angle>start_angle:\n# min_alpha = math.radians(30)\n max_alpha = math.radians(90)\n else:\n# min_alpha = math.radians(-150)\n max_alpha = math.radians(-90)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L92_C8", "label": "max_alpha = radians()", "type": "assigned_variable", "loc": [92, 92], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:If_L90_C4", "vector": [14, 2, 0.2283, 0.0025, 2, 0.22, 0.0, 102, 3, 1, 0, 0, 383, 10, 1], "semantic": {"name": "max_alpha", "arg_names": [], "import_names": [], "rhs_call_name": "radians", "annotation": ""}, "snippet": " max_alpha = math.radians(90)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L95_C8", "label": "max_alpha = radians()", "type": "assigned_variable", "loc": [95, 95], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:If_L90_C4", "vector": [14, 2, 0.2357, 0.0025, 2, 0.22, 1.0, 102, 3, 1, 0, 0, 383, 10, 1], "semantic": {"name": "max_alpha", "arg_names": [], "import_names": [], "rhs_call_name": "radians", "annotation": ""}, "snippet": " max_alpha = math.radians(-90)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L96_C4", "label": "min_alpha =", "type": "assigned_variable", "loc": [96, 96], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L86_C0", "vector": [14, 1, 0.2382, 0.0025, 1, 0.01, 0.1579, 767, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "min_alpha", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " min_alpha = max_alpha - math.radians(60-b*0.7)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L98_C4", "label": "dist_moved_weight =", "type": "assigned_variable", "loc": [98, 98], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L86_C0", "vector": [14, 1, 0.2432, 0.0025, 1, 0.01, 0.2105, 783, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "dist_moved_weight", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " dist_moved_weight = 0.4 - 0.3*b/60."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L99_C4", "label": "alpha_weight =", "type": "assigned_variable", "loc": [99, 99], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L86_C0", "vector": [14, 1, 0.2457, 0.0025, 1, 0.01, 0.2632, 793, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "alpha_weight", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " alpha_weight = 0.4+1.0*b/60."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L100_C4", "label": "bndry_weight =", "type": "assigned_variable", "loc": [100, 100], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L86_C0", "vector": [14, 1, 0.2481, 0.0025, 1, 0.01, 0.3158, 968, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "bndry_weight", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " bndry_weight = 1."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L101_C4", "label": "pts_in_weight =", "type": "assigned_variable", "loc": [101, 101], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L86_C0", "vector": [14, 1, 0.2506, 0.0025, 1, 0.01, 0.3684, 798, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "pts_in_weight", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pts_in_weight = 1."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Expr_L103_C4", "label": "print()", "type": "expression", "loc": [103, 103], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L86_C0", "vector": [8, 1, 0.2556, 0.0025, 1, 0.01, 0.4211, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('OPTIMIZE_POSITION')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Expr_L104_C4", "label": "print()", "type": "expression", "loc": [104, 104], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L86_C0", "vector": [8, 1, 0.2581, 0.0025, 1, 0.01, 0.4737, 535, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('start_angle:', math.degrees(start_angle))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Expr_L105_C4", "label": "print()", "type": "expression", "loc": [105, 105], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L86_C0", "vector": [8, 1, 0.2605, 0.0025, 1, 0.01, 0.5263, 535, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('end_angle:', math.degrees(end_angle))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Expr_L106_C4", "label": "print()", "type": "expression", "loc": [106, 106], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L86_C0", "vector": [8, 1, 0.263, 0.0025, 1, 0.01, 0.5789, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('tangential_force:', tangential_force)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L108_C4", "label": "error_function", "type": "function", "loc": [108, 146], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L86_C0", "vector": [2, 1, 0.3151, 0.0968, 1, 0.01, 0.6316, 875, 0, 1, 1, 0, 0, 0, 8], "semantic": {"name": "error_function", "arg_names": ["params"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def error_function(params):\n mx,my,ma = params[0],params[1],params[2]\n mx,my,ma = mx/scale_x,my/scale_y,ma/scale_a\n #x,y = params[0],params[1]\n pts_in = point_contained(mx,my,ma,cx,cy,rad,pts,\n start_angle,end_angle,buffer)\n p = tr.Rz(ma)*curr_pos-np.matrix([mx,my,0.]).T\n p_eq = tr.Rz(ma)*eq_pos-np.matrix([mx,my,0.]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L109_C8", "label": "mx, my, ma =", "type": "assigned_variable", "loc": [109, 109], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L108_C4", "vector": [14, 2, 0.2705, 0.0025, 2, 0.37, 0.0, 874, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "mx, my, ma", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mx,my,ma = params[0],params[1],params[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L110_C8", "label": "mx, my, ma =", "type": "assigned_variable", "loc": [110, 110], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L108_C4", "vector": [14, 2, 0.273, 0.0025, 2, 0.37, 0.0714, 874, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "mx, my, ma", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mx,my,ma = mx/scale_x,my/scale_y,ma/scale_a"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L112_C8", "label": "pts_in = point_contained()", "type": "assigned_variable", "loc": [112, 113], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L108_C4", "vector": [14, 2, 0.2792, 0.005, 2, 0.37, 0.1429, 451, 3, 10, 0, 0, 48, 10, 1], "semantic": {"name": "pts_in", "arg_names": [], "import_names": [], "rhs_call_name": "point_contained", "annotation": ""}, "snippet": " pts_in = point_contained(mx,my,ma,cx,cy,rad,pts,\n start_angle,end_angle,buffer)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L114_C8", "label": "p =", "type": "assigned_variable", "loc": [114, 114], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L108_C4", "vector": [14, 2, 0.2829, 0.0025, 2, 0.37, 0.2143, 491, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p = tr.Rz(ma)*curr_pos-np.matrix([mx,my,0.]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L115_C8", "label": "p_eq =", "type": "assigned_variable", "loc": [115, 115], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L108_C4", "vector": [14, 2, 0.2854, 0.0025, 2, 0.37, 0.2857, 608, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "p_eq", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p_eq = tr.Rz(ma)*eq_pos-np.matrix([mx,my,0.]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L117_C8", "label": "dist_moved =", "type": "assigned_variable", "loc": [117, 117], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L108_C4", "vector": [14, 2, 0.2903, 0.0025, 2, 0.37, 0.3571, 696, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "dist_moved", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " dist_moved = math.sqrt(mx*mx+my*my)+abs(ma)*0.2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L118_C8", "label": "dist_bndry = dist_from_boundary()", "type": "assigned_variable", "loc": [118, 118], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L108_C4", "vector": [14, 2, 0.2928, 0.0025, 2, 0.37, 0.4286, 534, 3, 3, 0, 0, 447, 10, 1], "semantic": {"name": "dist_bndry", "arg_names": [], "import_names": [], "rhs_call_name": "dist_from_boundary", "annotation": ""}, "snippet": " dist_bndry = dist_from_boundary(p_eq,bndry,pts)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L119_C8", "label": "alpha =", "type": "assigned_variable", "loc": [119, 119], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L108_C4", "vector": [14, 2, 0.2953, 0.0025, 2, 0.37, 0.5, 993, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "alpha", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " alpha = math.pi-(start_angle-ma)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:If_L121_C8", "label": "if", "type": "if", "loc": [121, 126], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L108_C4", "vector": [4, 2, 0.3065, 0.0149, 2, 0.37, 0.5714, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if alpha<min_alpha:\n alpha_cost = min_alpha-alpha\n elif alpha>max_alpha:\n alpha_cost = alpha-max_alpha\n else:\n alpha_cost = 0."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L122_C12", "label": "alpha_cost =", "type": "assigned_variable", "loc": [122, 122], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:If_L121_C8", "vector": [14, 3, 0.3027, 0.0025, 3, 0.67, 0.0, 454, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "alpha_cost", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " alpha_cost = min_alpha-alpha"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:If_L123_C8", "label": "if", "type": "if", "loc": [123, 126], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:If_L121_C8", "vector": [4, 3, 0.3089, 0.0099, 3, 0.67, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif alpha>max_alpha:\n alpha_cost = alpha-max_alpha\n else:\n alpha_cost = 0."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L124_C12", "label": "alpha_cost =", "type": "assigned_variable", "loc": [124, 124], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:If_L123_C8", "vector": [14, 4, 0.3077, 0.0025, 4, 0.39, 0.0, 454, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "alpha_cost", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " alpha_cost = alpha-max_alpha"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L126_C12", "label": "alpha_cost =", "type": "assigned_variable", "loc": [126, 126], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:If_L123_C8", "vector": [14, 4, 0.3127, 0.0025, 4, 0.39, 1.0, 454, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "alpha_cost", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " alpha_cost = 0."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L127_C8", "label": "alpha_cost =", "type": "assigned_variable", "loc": [127, 127], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L108_C4", "vector": [14, 2, 0.3151, 0.0025, 2, 0.37, 0.6429, 454, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "alpha_cost", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " alpha_cost = alpha_cost * alpha_weight"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L128_C8", "label": "move_cost =", "type": "assigned_variable", "loc": [128, 128], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L108_C4", "vector": [14, 2, 0.3176, 0.0025, 2, 0.37, 0.7143, 590, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "move_cost", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " move_cost = dist_moved * dist_moved_weight"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L129_C8", "label": "bndry_cost =", "type": "assigned_variable", "loc": [129, 129], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L108_C4", "vector": [14, 2, 0.3201, 0.0025, 2, 0.37, 0.7857, 577, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "bndry_cost", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " bndry_cost = dist_bndry * bndry_weight"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L130_C8", "label": "pts_in_cost =", "type": "assigned_variable", "loc": [130, 130], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L108_C4", "vector": [14, 2, 0.3226, 0.0025, 2, 0.37, 0.8571, 272, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pts_in_cost", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pts_in_cost = pts_in.shape[1]/1000. * pts_in_weight"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L144_C8", "label": "err =", "type": "assigned_variable", "loc": [144, 144], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L108_C4", "vector": [14, 2, 0.3573, 0.0025, 2, 0.37, 0.9286, 541, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "err", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " err = -pts_in_cost-bndry_cost+move_cost+alpha_cost"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Return_L146_C8", "label": "return", "type": "return", "loc": [146, 146], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L108_C4", "vector": [13, 2, 0.3623, 0.0025, 2, 0.37, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return err"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L148_C4", "label": "params_1 =", "type": "assigned_variable", "loc": [148, 148], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L86_C0", "vector": [14, 1, 0.3672, 0.0025, 1, 0.01, 0.6842, 908, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "params_1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " params_1 = [0.,0.,0.]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L149_C4", "label": "res = fmin_bfgs()", "type": "assigned_variable", "loc": [149, 149], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L86_C0", "vector": [14, 1, 0.3697, 0.0025, 1, 0.01, 0.7368, 413, 3, 3, 0, 0, 613, 10, 1], "semantic": {"name": "res", "arg_names": [], "import_names": [], "rhs_call_name": "fmin_bfgs", "annotation": ""}, "snippet": " res = so.fmin_bfgs(error_function,params_1,full_output=1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L151_C4", "label": "r, f =", "type": "assigned_variable", "loc": [151, 151], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L86_C0", "vector": [14, 1, 0.3747, 0.0025, 1, 0.01, 0.7895, 467, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "r, f", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " r,f = res[0],res[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L162_C4", "label": "opt_params =", "type": "assigned_variable", "loc": [162, 162], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L86_C0", "vector": [14, 1, 0.402, 0.0025, 1, 0.01, 0.8421, 669, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "opt_params", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " opt_params = r"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L164_C4", "label": "mx, my, ma =", "type": "assigned_variable", "loc": [164, 165], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L86_C0", "vector": [14, 1, 0.4082, 0.005, 1, 0.01, 0.8947, 874, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "mx, my, ma", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mx,my,ma = opt_params[0]/scale_x,opt_params[1]/scale_y,\\\n opt_params[2]/scale_a"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Expr_L166_C4", "label": "error_function()", "type": "expression", "loc": [166, 166], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L86_C0", "vector": [8, 1, 0.4119, 0.0025, 1, 0.01, 0.9474, 875, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "error_function", "arg_names": [], "import_names": [], "rhs_call_name": "error_function", "annotation": ""}, "snippet": " error_function(opt_params)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Return_L167_C4", "label": "return", "type": "return", "loc": [167, 167], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L86_C0", "vector": [13, 1, 0.4144, 0.0025, 1, 0.01, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return mx,my,ma"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L174_C0", "label": "compute_boundary", "type": "function", "loc": [174, 188], "level": 0, "parent": null, "vector": [2, 0, 0.4491, 0.0372, 0, 0.66, 0.5926, 761, 0, 1, 1, 0, 0, 0, 7], "semantic": {"name": "compute_boundary", "arg_names": ["pts"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def compute_boundary(pts):\n npim1,nx,ny,br = hp.xy_map_to_np_image(pts,m_per_pixel=0.01,dilation_count=0,padding=10)\n npim1 = npim1/255\n npim = np.zeros(npim1.shape,dtype='int')\n npim[:,:] = npim1[:,:]\n\n connect_structure = np.empty((3,3),dtype='int')\n connect_structure[:,:] = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L175_C4", "label": "npim1, nx, ny, br = xy_map_to_np_image()", "type": "assigned_variable", "loc": [175, 175], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L174_C0", "vector": [14, 1, 0.4342, 0.0025, 1, 0.14, 0.0, 693, 3, 4, 0, 0, 376, 10, 1], "semantic": {"name": "npim1, nx, ny, br", "arg_names": [], "import_names": [], "rhs_call_name": "xy_map_to_np_image", "annotation": ""}, "snippet": " npim1,nx,ny,br = hp.xy_map_to_np_image(pts,m_per_pixel=0.01,dilation_count=0,padding=10)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L176_C4", "label": "npim1 =", "type": "assigned_variable", "loc": [176, 176], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L174_C0", "vector": [14, 1, 0.4367, 0.0025, 1, 0.14, 0.1, 574, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "npim1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " npim1 = npim1/255"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L177_C4", "label": "npim = zeros()", "type": "assigned_variable", "loc": [177, 177], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L174_C0", "vector": [14, 1, 0.4392, 0.0025, 1, 0.14, 0.2, 3, 3, 2, 0, 0, 213, 10, 1], "semantic": {"name": "npim", "arg_names": [], "import_names": [], "rhs_call_name": "zeros", "annotation": ""}, "snippet": " npim = np.zeros(npim1.shape,dtype='int')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L178_C4", "label": "assign", "type": "assigned_variable", "loc": [178, 178], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L174_C0", "vector": [14, 1, 0.4417, 0.0025, 1, 0.14, 0.3, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " npim[:,:] = npim1[:,:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L180_C4", "label": "connect_structure = empty()", "type": "assigned_variable", "loc": [180, 180], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L174_C0", "vector": [14, 1, 0.4467, 0.0025, 1, 0.14, 0.4, 297, 3, 2, 0, 0, 365, 10, 1], "semantic": {"name": "connect_structure", "arg_names": [], "import_names": [], "rhs_call_name": "empty", "annotation": ""}, "snippet": " connect_structure = np.empty((3,3),dtype='int')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L181_C4", "label": "assign", "type": "assigned_variable", "loc": [181, 181], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L174_C0", "vector": [14, 1, 0.4491, 0.0025, 1, 0.14, 0.5, 0, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " connect_structure[:,:] = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L182_C4", "label": "erim = binary_erosion()", "type": "assigned_variable", "loc": [182, 182], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L174_C0", "vector": [14, 1, 0.4516, 0.0025, 1, 0.14, 0.6, 219, 3, 3, 0, 0, 333, 10, 1], "semantic": {"name": "erim", "arg_names": [], "import_names": [], "rhs_call_name": "binary_erosion", "annotation": ""}, "snippet": " erim = ni.binary_erosion(npim,connect_structure,iterations=1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L183_C4", "label": "bim =", "type": "assigned_variable", "loc": [183, 183], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L174_C0", "vector": [14, 1, 0.4541, 0.0025, 1, 0.14, 0.7, 603, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "bim", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " bim = npim-erim"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L184_C4", "label": "tup = where()", "type": "assigned_variable", "loc": [184, 184], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L174_C0", "vector": [14, 1, 0.4566, 0.0025, 1, 0.14, 0.8, 218, 3, 1, 0, 0, 169, 10, 1], "semantic": {"name": "tup", "arg_names": [], "import_names": [], "rhs_call_name": "where", "annotation": ""}, "snippet": " tup = np.where(bim>0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L185_C4", "label": "bpts =", "type": "assigned_variable", "loc": [185, 185], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L174_C0", "vector": [14, 1, 0.4591, 0.0025, 1, 0.14, 0.9, 198, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "bpts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " bpts = np.row_stack((nx-tup[0],ny-tup[1]))*0.01 + br"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Return_L188_C4", "label": "return", "type": "return", "loc": [188, 188], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L174_C0", "vector": [13, 1, 0.4665, 0.0025, 1, 0.14, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return np.matrix(bpts)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L192_C0", "label": "vec_from_boundary", "type": "function", "loc": [192, 196], "level": 0, "parent": null, "vector": [2, 0, 0.4814, 0.0124, 0, 0.66, 0.6296, 617, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "vec_from_boundary", "arg_names": ["curr_pos", "bndry"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def vec_from_boundary(curr_pos,bndry):\n p = curr_pos[0:2,:]\n v = p-bndry\n min_idx = np.argmin(ut.norm(v))\n return v[:,min_idx]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L193_C4", "label": "p =", "type": "assigned_variable", "loc": [193, 193], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L192_C0", "vector": [14, 1, 0.4789, 0.0025, 1, 0.81, 0.0, 491, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p = curr_pos[0:2,:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L194_C4", "label": "v =", "type": "assigned_variable", "loc": [194, 194], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L192_C0", "vector": [14, 1, 0.4814, 0.0025, 1, 0.81, 0.3333, 553, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "v", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " v = p-bndry"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L195_C4", "label": "min_idx = argmin()", "type": "assigned_variable", "loc": [195, 195], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L192_C0", "vector": [14, 1, 0.4839, 0.0025, 1, 0.81, 0.6667, 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(v))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Return_L196_C4", "label": "return", "type": "return", "loc": [196, 196], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L192_C0", "vector": [13, 1, 0.4864, 0.0025, 1, 0.81, 1.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return v[:,min_idx]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L203_C0", "label": "dist_from_boundary", "type": "function", "loc": [203, 221], "level": 0, "parent": null, "vector": [2, 0, 0.5261, 0.0471, 0, 0.66, 0.6667, 447, 0, 3, 1, 0, 0, 0, 4], "semantic": {"name": "dist_from_boundary", "arg_names": ["curr_pos", "bndry", "pts"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def dist_from_boundary(curr_pos,bndry,pts):\n mv = vec_from_boundary(curr_pos,bndry)\n# spoly = sg.Polygon((bndry.T).tolist())\n# spt = sg.Point(curr_pos[0,0],curr_pos[1,0])\n d = np.linalg.norm(mv)\n\n p = curr_pos[0:2,:]\n v = p-pts"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L204_C4", "label": "mv = vec_from_boundary()", "type": "assigned_variable", "loc": [204, 204], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L203_C0", "vector": [14, 1, 0.5062, 0.0025, 1, 0.93, 0.0, 233, 3, 2, 0, 0, 617, 10, 1], "semantic": {"name": "mv", "arg_names": [], "import_names": [], "rhs_call_name": "vec_from_boundary", "annotation": ""}, "snippet": " mv = vec_from_boundary(curr_pos,bndry)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L207_C4", "label": "d = norm()", "type": "assigned_variable", "loc": [207, 207], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L203_C0", "vector": [14, 1, 0.5136, 0.0025, 1, 0.93, 0.1667, 355, 3, 1, 0, 0, 902, 10, 1], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "norm", "annotation": ""}, "snippet": " d = np.linalg.norm(mv)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L209_C4", "label": "p =", "type": "assigned_variable", "loc": [209, 209], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L203_C0", "vector": [14, 1, 0.5186, 0.0025, 1, 0.93, 0.3333, 491, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p = curr_pos[0:2,:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L210_C4", "label": "v =", "type": "assigned_variable", "loc": [210, 210], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L203_C0", "vector": [14, 1, 0.5211, 0.0025, 1, 0.93, 0.5, 553, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "v", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " v = p-pts"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L211_C4", "label": "min_dist = min()", "type": "assigned_variable", "loc": [211, 211], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L203_C0", "vector": [14, 1, 0.5236, 0.0025, 1, 0.93, 0.6667, 109, 3, 1, 0, 0, 867, 10, 2], "semantic": {"name": "min_dist", "arg_names": [], "import_names": [], "rhs_call_name": "min", "annotation": ""}, "snippet": " min_dist = np.min(ut.norm(v))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:If_L214_C4", "label": "if", "type": "if", "loc": [214, 216], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L203_C0", "vector": [4, 1, 0.5335, 0.0074, 1, 0.93, 0.8333, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if min_dist >= d-0.001:\n# print 'I predict outside workspace'\n d = -d"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L216_C8", "label": "d =", "type": "assigned_variable", "loc": [216, 216], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:If_L214_C4", "vector": [14, 2, 0.536, 0.0025, 2, 0.46, 0.0, 355, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " d = -d"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Return_L221_C4", "label": "return", "type": "return", "loc": [221, 221], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L203_C0", "vector": [13, 1, 0.5484, 0.0025, 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 d"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L226_C0", "label": "close_to_boundary", "type": "function", "loc": [226, 228], "level": 0, "parent": null, "vector": [2, 0, 0.5633, 0.0074, 0, 0.66, 0.7037, 725, 0, 4, 1, 0, 0, 0, 1], "semantic": {"name": "close_to_boundary", "arg_names": ["curr_pos", "bndry", "pts", "dist_thresh"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def close_to_boundary(curr_pos,bndry,pts,dist_thresh):\n min_dist = dist_from_boundary(curr_pos,bndry,pts)\n return min_dist <= dist_thresh"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L227_C4", "label": "min_dist = dist_from_boundary()", "type": "assigned_variable", "loc": [227, 227], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L226_C0", "vector": [14, 1, 0.5633, 0.0025, 1, 0.68, 0.0, 109, 3, 3, 0, 0, 447, 10, 1], "semantic": {"name": "min_dist", "arg_names": [], "import_names": [], "rhs_call_name": "dist_from_boundary", "annotation": ""}, "snippet": " min_dist = dist_from_boundary(curr_pos,bndry,pts)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Return_L228_C4", "label": "return", "type": "return", "loc": [228, 228], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L226_C0", "vector": [13, 1, 0.5658, 0.0025, 1, 0.68, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return min_dist <= dist_thresh"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L230_C0", "label": "visualize_boundary", "type": "function", "loc": [230, 248], "level": 0, "parent": null, "vector": [2, 0, 0.5931, 0.0471, 0, 0.66, 0.7407, 271, 0, 0, 0, 0, 0, 0, 15], "semantic": {"name": "visualize_boundary", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def visualize_boundary():\n d = ut.load_pickle('../../pkls/workspace_dict_2009Sep03_010426.pkl')\n z = -0.23\n k = d.keys()\n k_idx = np.argmin(np.abs(np.array(k)-z))\n pts = d[k[k_idx]]\n bpts = compute_boundary(pts)\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L231_C4", "label": "d = load_pickle()", "type": "assigned_variable", "loc": [231, 231], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L230_C0", "vector": [14, 1, 0.5732, 0.0025, 1, 0.93, 0.0, 355, 3, 1, 0, 0, 65, 10, 1], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "load_pickle", "annotation": ""}, "snippet": " d = ut.load_pickle('../../pkls/workspace_dict_2009Sep03_010426.pkl')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L232_C4", "label": "z =", "type": "assigned_variable", "loc": [232, 232], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L230_C0", "vector": [14, 1, 0.5757, 0.0025, 1, 0.93, 0.0769, 859, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " z = -0.23"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L233_C4", "label": "k = keys()", "type": "assigned_variable", "loc": [233, 233], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L230_C0", "vector": [14, 1, 0.5782, 0.0025, 1, 0.93, 0.1538, 954, 3, 0, 0, 0, 204, 10, 1], "semantic": {"name": "k", "arg_names": [], "import_names": [], "rhs_call_name": "keys", "annotation": ""}, "snippet": " k = d.keys()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L234_C4", "label": "k_idx = argmin()", "type": "assigned_variable", "loc": [234, 234], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L230_C0", "vector": [14, 1, 0.5806, 0.0025, 1, 0.93, 0.2308, 978, 3, 1, 0, 0, 879, 10, 3], "semantic": {"name": "k_idx", "arg_names": [], "import_names": [], "rhs_call_name": "argmin", "annotation": ""}, "snippet": " k_idx = np.argmin(np.abs(np.array(k)-z))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L235_C4", "label": "pts =", "type": "assigned_variable", "loc": [235, 235], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L230_C0", "vector": [14, 1, 0.5831, 0.0025, 1, 0.93, 0.3077, 195, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pts = d[k[k_idx]]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L236_C4", "label": "bpts = compute_boundary()", "type": "assigned_variable", "loc": [236, 236], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L230_C0", "vector": [14, 1, 0.5856, 0.0025, 1, 0.93, 0.3846, 198, 3, 1, 0, 0, 761, 10, 1], "semantic": {"name": "bpts", "arg_names": [], "import_names": [], "rhs_call_name": "compute_boundary", "annotation": ""}, "snippet": " bpts = compute_boundary(pts)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L238_C4", "label": "cl_list =", "type": "assigned_variable", "loc": [238, 238], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L230_C0", "vector": [14, 1, 0.5906, 0.0025, 1, 0.93, 0.4615, 636, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "cl_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cl_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:For_L239_C4", "label": "for pt", "type": "for", "loc": [239, 241], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L230_C0", "vector": [6, 1, 0.5955, 0.0074, 1, 0.93, 0.5385, 989, 7, 0, 0, 0, 0, 0, 3], "semantic": {"name": "pt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for pt in pts.T:\n if close_to_boundary(pt.T,bpts,dist_thresh=0.05)==True:\n cl_list.append(pt.A1.tolist())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:If_L240_C8", "label": "if", "type": "if", "loc": [240, 241], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:For_L239_C4", "vector": [4, 2, 0.5968, 0.005, 2, 0.68, 0.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if close_to_boundary(pt.T,bpts,dist_thresh=0.05)==True:\n cl_list.append(pt.A1.tolist())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Expr_L241_C12", "label": "append()", "type": "expression", "loc": [241, 241], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:If_L240_C8", "vector": [8, 3, 0.598, 0.0025, 3, 0.88, 0.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " cl_list.append(pt.A1.tolist())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L242_C4", "label": "clpts =", "type": "assigned_variable", "loc": [242, 242], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L230_C0", "vector": [14, 1, 0.6005, 0.0025, 1, 0.93, 0.6154, 937, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "clpts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " clpts = np.matrix(cl_list).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Expr_L243_C4", "label": "print()", "type": "expression", "loc": [243, 243], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L230_C0", "vector": [8, 1, 0.603, 0.0025, 1, 0.93, 0.6923, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('clpts.shape:', clpts.shape)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Expr_L245_C4", "label": "plot_yx()", "type": "expression", "loc": [245, 245], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L230_C0", "vector": [8, 1, 0.6079, 0.0025, 1, 0.93, 0.7692, 112, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "plot_yx", "arg_names": [], "import_names": [], "rhs_call_name": "plot_yx", "annotation": ""}, "snippet": " mpu.plot_yx(pts[1,:].A1,pts[0,:].A1,linewidth=0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Expr_L246_C4", "label": "plot_yx()", "type": "expression", "loc": [246, 246], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L230_C0", "vector": [8, 1, 0.6104, 0.0025, 1, 0.93, 0.8462, 112, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "plot_yx", "arg_names": [], "import_names": [], "rhs_call_name": "plot_yx", "annotation": ""}, "snippet": " mpu.plot_yx(clpts[1,:].A1,clpts[0,:].A1,linewidth=0,color='r')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Expr_L247_C4", "label": "plot_yx()", "type": "expression", "loc": [247, 247], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L230_C0", "vector": [8, 1, 0.6129, 0.0025, 1, 0.93, 0.9231, 112, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "plot_yx", "arg_names": [], "import_names": [], "rhs_call_name": "plot_yx", "annotation": ""}, "snippet": " mpu.plot_yx(bpts[1,:].A1,bpts[0,:].A1,linewidth=0,color='y')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Expr_L248_C4", "label": "show()", "type": "expression", "loc": [248, 248], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L230_C0", "vector": [8, 1, 0.6154, 0.0025, 1, 0.93, 1.0, 497, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "show", "arg_names": [], "import_names": [], "rhs_call_name": "show", "annotation": ""}, "snippet": " mpu.show()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L255_C0", "label": "tlTts", "type": "function", "loc": [255, 260], "level": 0, "parent": null, "vector": [2, 0, 0.639, 0.0149, 0, 0.66, 0.7778, 23, 0, 4, 1, 0, 0, 0, 6], "semantic": {"name": "tlTts", "arg_names": ["pts_ts", "x", "y", "a"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def tlTts(pts_ts,x,y,a):\n pts_ms = mcf.mecanumTglobal(mcf.globalTtorso(pts_ts))\n v_org_ms = np.matrix([x,y,0.]).T\n pts_ml = tr.Rz(a)*(pts_ms-v_org_ms)\n pts_tl = mcf.torsoTglobal(mcf.globalTmecanum(pts_ml))\n return pts_tl"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L256_C4", "label": "pts_ms = mecanumTglobal()", "type": "assigned_variable", "loc": [256, 256], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L255_C0", "vector": [14, 1, 0.6352, 0.0025, 1, 0.14, 0.0, 592, 3, 1, 0, 0, 406, 10, 2], "semantic": {"name": "pts_ms", "arg_names": [], "import_names": [], "rhs_call_name": "mecanumTglobal", "annotation": ""}, "snippet": " pts_ms = mcf.mecanumTglobal(mcf.globalTtorso(pts_ts))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L257_C4", "label": "v_org_ms =", "type": "assigned_variable", "loc": [257, 257], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L255_C0", "vector": [14, 1, 0.6377, 0.0025, 1, 0.14, 0.25, 712, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "v_org_ms", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " v_org_ms = np.matrix([x,y,0.]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L258_C4", "label": "pts_ml =", "type": "assigned_variable", "loc": [258, 258], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L255_C0", "vector": [14, 1, 0.6402, 0.0025, 1, 0.14, 0.5, 523, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "pts_ml", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pts_ml = tr.Rz(a)*(pts_ms-v_org_ms)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L259_C4", "label": "pts_tl = torsoTglobal()", "type": "assigned_variable", "loc": [259, 259], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L255_C0", "vector": [14, 1, 0.6427, 0.0025, 1, 0.14, 0.75, 114, 3, 1, 0, 0, 309, 10, 2], "semantic": {"name": "pts_tl", "arg_names": [], "import_names": [], "rhs_call_name": "torsoTglobal", "annotation": ""}, "snippet": " pts_tl = mcf.torsoTglobal(mcf.globalTmecanum(pts_ml))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Return_L260_C4", "label": "return", "type": "return", "loc": [260, 260], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L255_C0", "vector": [13, 1, 0.6452, 0.0025, 1, 0.14, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return pts_tl"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L266_C0", "label": "tsTtl", "type": "function", "loc": [266, 271], "level": 0, "parent": null, "vector": [2, 0, 0.6663, 0.0149, 0, 0.66, 0.8148, 370, 0, 4, 1, 0, 0, 0, 6], "semantic": {"name": "tsTtl", "arg_names": ["pts_tl", "x", "y", "a"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def tsTtl(pts_tl,x,y,a):\n pts_ml = mcf.mecanumTglobal(mcf.globalTtorso(pts_tl))\n v_org_ms = np.matrix([x,y,0.]).T\n pts_ms = tr.Rz(-a) * pts_ml + v_org_ms\n pts_ts = mcf.torsoTglobal(mcf.globalTmecanum(pts_ms))\n return pts_ts"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L267_C4", "label": "pts_ml = mecanumTglobal()", "type": "assigned_variable", "loc": [267, 267], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L266_C0", "vector": [14, 1, 0.6625, 0.0025, 1, 0.67, 0.0, 523, 3, 1, 0, 0, 406, 10, 2], "semantic": {"name": "pts_ml", "arg_names": [], "import_names": [], "rhs_call_name": "mecanumTglobal", "annotation": ""}, "snippet": " pts_ml = mcf.mecanumTglobal(mcf.globalTtorso(pts_tl))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L268_C4", "label": "v_org_ms =", "type": "assigned_variable", "loc": [268, 268], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L266_C0", "vector": [14, 1, 0.665, 0.0025, 1, 0.67, 0.25, 712, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "v_org_ms", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " v_org_ms = np.matrix([x,y,0.]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L269_C4", "label": "pts_ms =", "type": "assigned_variable", "loc": [269, 269], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L266_C0", "vector": [14, 1, 0.6675, 0.0025, 1, 0.67, 0.5, 592, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "pts_ms", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pts_ms = tr.Rz(-a) * pts_ml + v_org_ms"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L270_C4", "label": "pts_ts = torsoTglobal()", "type": "assigned_variable", "loc": [270, 270], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L266_C0", "vector": [14, 1, 0.67, 0.0025, 1, 0.67, 0.75, 837, 3, 1, 0, 0, 309, 10, 2], "semantic": {"name": "pts_ts", "arg_names": [], "import_names": [], "rhs_call_name": "torsoTglobal", "annotation": ""}, "snippet": " pts_ts = mcf.torsoTglobal(mcf.globalTmecanum(pts_ms))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Return_L271_C4", "label": "return", "type": "return", "loc": [271, 271], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L266_C0", "vector": [13, 1, 0.6725, 0.0025, 1, 0.67, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return pts_ts"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L277_C0", "label": "tsRtl", "type": "function", "loc": [277, 281], "level": 0, "parent": null, "vector": [2, 0, 0.6923, 0.0124, 0, 0.66, 0.8519, 437, 0, 2, 1, 0, 0, 0, 5], "semantic": {"name": "tsRtl", "arg_names": ["vecs_tl", "a"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def tsRtl(vecs_tl, a):\n vecs_ml = mcf.mecanumTglobal(mcf.globalTtorso(vecs_tl, True), True)\n vecs_ms = tr.Rz(-a) * vecs_ml\n vecs_ts = mcf.torsoTglobal(mcf.globalTmecanum(vecs_ms, True), True)\n return vecs_ts"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L278_C4", "label": "vecs_ml = mecanumTglobal()", "type": "assigned_variable", "loc": [278, 278], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L277_C0", "vector": [14, 1, 0.6898, 0.0025, 1, 0.52, 0.0, 231, 3, 2, 0, 0, 406, 10, 2], "semantic": {"name": "vecs_ml", "arg_names": [], "import_names": [], "rhs_call_name": "mecanumTglobal", "annotation": ""}, "snippet": " vecs_ml = mcf.mecanumTglobal(mcf.globalTtorso(vecs_tl, True), True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L279_C4", "label": "vecs_ms =", "type": "assigned_variable", "loc": [279, 279], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L277_C0", "vector": [14, 1, 0.6923, 0.0025, 1, 0.52, 0.3333, 243, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "vecs_ms", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " vecs_ms = tr.Rz(-a) * vecs_ml"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L280_C4", "label": "vecs_ts = torsoTglobal()", "type": "assigned_variable", "loc": [280, 280], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L277_C0", "vector": [14, 1, 0.6948, 0.0025, 1, 0.52, 0.6667, 808, 3, 2, 0, 0, 309, 10, 2], "semantic": {"name": "vecs_ts", "arg_names": [], "import_names": [], "rhs_call_name": "torsoTglobal", "annotation": ""}, "snippet": " vecs_ts = mcf.torsoTglobal(mcf.globalTmecanum(vecs_ms, True), True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Return_L281_C4", "label": "return", "type": "return", "loc": [281, 281], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L277_C0", "vector": [13, 1, 0.6973, 0.0025, 1, 0.52, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return vecs_ts"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L287_C0", "label": "tlRts", "type": "function", "loc": [287, 291], "level": 0, "parent": null, "vector": [2, 0, 0.7171, 0.0124, 0, 0.66, 0.8889, 348, 0, 2, 1, 0, 0, 0, 5], "semantic": {"name": "tlRts", "arg_names": ["vecs_ts", "a"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def tlRts(vecs_ts, a):\n vecs_ms = mcf.mecanumTglobal(mcf.globalTtorso(vecs_ts, True), True)\n vecs_ml = tr.Rz(a) * vecs_ms\n vecs_tl = mcf.torsoTglobal(mcf.globalTmecanum(vecs_ml, True), True)\n return vecs_tl"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L288_C4", "label": "vecs_ms = mecanumTglobal()", "type": "assigned_variable", "loc": [288, 288], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L287_C0", "vector": [14, 1, 0.7146, 0.0025, 1, 0.87, 0.0, 243, 3, 2, 0, 0, 406, 10, 2], "semantic": {"name": "vecs_ms", "arg_names": [], "import_names": [], "rhs_call_name": "mecanumTglobal", "annotation": ""}, "snippet": " vecs_ms = mcf.mecanumTglobal(mcf.globalTtorso(vecs_ts, True), True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L289_C4", "label": "vecs_ml =", "type": "assigned_variable", "loc": [289, 289], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L287_C0", "vector": [14, 1, 0.7171, 0.0025, 1, 0.87, 0.3333, 231, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "vecs_ml", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " vecs_ml = tr.Rz(a) * vecs_ms"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L290_C4", "label": "vecs_tl = torsoTglobal()", "type": "assigned_variable", "loc": [290, 290], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L287_C0", "vector": [14, 1, 0.7196, 0.0025, 1, 0.87, 0.6667, 805, 3, 2, 0, 0, 309, 10, 2], "semantic": {"name": "vecs_tl", "arg_names": [], "import_names": [], "rhs_call_name": "torsoTglobal", "annotation": ""}, "snippet": " vecs_tl = mcf.torsoTglobal(mcf.globalTmecanum(vecs_ml, True), True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Return_L291_C4", "label": "return", "type": "return", "loc": [291, 291], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L287_C0", "vector": [13, 1, 0.7221, 0.0025, 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 vecs_tl"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L294_C0", "label": "pts_within_dist", "type": "function", "loc": [294, 299], "level": 0, "parent": null, "vector": [2, 0, 0.7357, 0.0149, 0, 0.66, 0.9259, 414, 0, 4, 1, 0, 0, 0, 4], "semantic": {"name": "pts_within_dist", "arg_names": ["p", "pts", "min_dist", "max_dist"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def pts_within_dist(p,pts,min_dist,max_dist):\n v = p-pts\n d_arr = ut.norm(v).A1\n idxs = np.where(np.all(np.row_stack((d_arr<max_dist,d_arr>min_dist)),axis=0))\n pts_within = pts[:,idxs[0]]\n return pts_within"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L295_C4", "label": "v =", "type": "assigned_variable", "loc": [295, 295], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L294_C0", "vector": [14, 1, 0.732, 0.0025, 1, 0.17, 0.0, 553, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "v", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " v = p-pts"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L296_C4", "label": "d_arr =", "type": "assigned_variable", "loc": [296, 296], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L294_C0", "vector": [14, 1, 0.7345, 0.0025, 1, 0.17, 0.25, 301, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "d_arr", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " d_arr = ut.norm(v).A1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L297_C4", "label": "idxs = where()", "type": "assigned_variable", "loc": [297, 297], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L294_C0", "vector": [14, 1, 0.737, 0.0025, 1, 0.17, 0.5, 677, 3, 1, 0, 0, 169, 10, 3], "semantic": {"name": "idxs", "arg_names": [], "import_names": [], "rhs_call_name": "where", "annotation": ""}, "snippet": " idxs = np.where(np.all(np.row_stack((d_arr<max_dist,d_arr>min_dist)),axis=0))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L298_C4", "label": "pts_within =", "type": "assigned_variable", "loc": [298, 298], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L294_C0", "vector": [14, 1, 0.7395, 0.0025, 1, 0.17, 0.75, 930, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pts_within", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pts_within = pts[:,idxs[0]]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Return_L299_C4", "label": "return", "type": "return", "loc": [299, 299], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L294_C0", "vector": [13, 1, 0.7419, 0.0025, 1, 0.17, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return pts_within"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L305_C0", "label": "segway_motion_repulse", "type": "function", "loc": [305, 343], "level": 0, "parent": null, "vector": [2, 0, 0.804, 0.0968, 0, 0.66, 0.963, 681, 0, 4, 1, 0, 0, 0, 9], "semantic": {"name": "segway_motion_repulse", "arg_names": ["curr_pos_tl", "eq_pt_tl", "bndry", "all_pts"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def segway_motion_repulse(curr_pos_tl, eq_pt_tl,bndry, all_pts):\n bndry_dist_eq = dist_from_boundary(eq_pt_tl,bndry,all_pts) # signed\n bndry_dist_ee = dist_from_boundary(curr_pos_tl,bndry,all_pts) # signed\n if bndry_dist_ee < bndry_dist_eq:\n p = curr_pos_tl[0:2,:]\n bndry_dist = bndry_dist_ee\n else:\n p = eq_pt_tl[0:2,:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L306_C4", "label": "bndry_dist_eq = dist_from_boundary()", "type": "assigned_variable", "loc": [306, 306], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L305_C0", "vector": [14, 1, 0.7593, 0.0025, 1, 0.95, 0.0, 145, 3, 3, 0, 0, 447, 10, 1], "semantic": {"name": "bndry_dist_eq", "arg_names": [], "import_names": [], "rhs_call_name": "dist_from_boundary", "annotation": ""}, "snippet": " bndry_dist_eq = dist_from_boundary(eq_pt_tl,bndry,all_pts) # signed"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L307_C4", "label": "bndry_dist_ee = dist_from_boundary()", "type": "assigned_variable", "loc": [307, 307], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L305_C0", "vector": [14, 1, 0.7618, 0.0025, 1, 0.95, 0.0588, 95, 3, 3, 0, 0, 447, 10, 1], "semantic": {"name": "bndry_dist_ee", "arg_names": [], "import_names": [], "rhs_call_name": "dist_from_boundary", "annotation": ""}, "snippet": " bndry_dist_ee = dist_from_boundary(curr_pos_tl,bndry,all_pts) # signed"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:If_L308_C4", "label": "if", "type": "if", "loc": [308, 313], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L305_C0", "vector": [4, 1, 0.7705, 0.0149, 1, 0.95, 0.1176, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if bndry_dist_ee < bndry_dist_eq:\n p = curr_pos_tl[0:2,:]\n bndry_dist = bndry_dist_ee\n else:\n p = eq_pt_tl[0:2,:]\n bndry_dist = bndry_dist_eq"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L309_C8", "label": "p =", "type": "assigned_variable", "loc": [309, 309], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:If_L308_C4", "vector": [14, 2, 0.7667, 0.0025, 2, 0.6, 0.0, 491, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p = curr_pos_tl[0:2,:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L310_C8", "label": "bndry_dist =", "type": "assigned_variable", "loc": [310, 310], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:If_L308_C4", "vector": [14, 2, 0.7692, 0.0025, 2, 0.6, 0.3333, 770, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "bndry_dist", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " bndry_dist = bndry_dist_ee"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L312_C8", "label": "p =", "type": "assigned_variable", "loc": [312, 312], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:If_L308_C4", "vector": [14, 2, 0.7742, 0.0025, 2, 0.6, 0.6667, 491, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p = eq_pt_tl[0:2,:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L313_C8", "label": "bndry_dist =", "type": "assigned_variable", "loc": [313, 313], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:If_L308_C4", "vector": [14, 2, 0.7767, 0.0025, 2, 0.6, 1.0, 770, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "bndry_dist", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " bndry_dist = bndry_dist_eq"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L316_C4", "label": "pts_close = pts_within_dist()", "type": "assigned_variable", "loc": [316, 316], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L305_C0", "vector": [14, 1, 0.7841, 0.0025, 1, 0.95, 0.1765, 664, 3, 4, 0, 0, 414, 10, 1], "semantic": {"name": "pts_close", "arg_names": [], "import_names": [], "rhs_call_name": "pts_within_dist", "annotation": ""}, "snippet": " pts_close = pts_within_dist(p,bndry,0.002,0.07)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L317_C4", "label": "v =", "type": "assigned_variable", "loc": [317, 317], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L305_C0", "vector": [14, 1, 0.7866, 0.0025, 1, 0.95, 0.2353, 553, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "v", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " v = p-pts_close"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L318_C4", "label": "d_arr =", "type": "assigned_variable", "loc": [318, 318], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L305_C0", "vector": [14, 1, 0.7891, 0.0025, 1, 0.95, 0.2941, 301, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "d_arr", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " d_arr = ut.norm(v).A1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L319_C4", "label": "v =", "type": "assigned_variable", "loc": [319, 319], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L305_C0", "vector": [14, 1, 0.7916, 0.0025, 1, 0.95, 0.3529, 553, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "v", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " v = v/d_arr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L320_C4", "label": "v =", "type": "assigned_variable", "loc": [320, 320], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L305_C0", "vector": [14, 1, 0.794, 0.0025, 1, 0.95, 0.4118, 553, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "v", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " v = v/d_arr # inverse distance weight"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L321_C4", "label": "resultant = sum()", "type": "assigned_variable", "loc": [321, 321], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L305_C0", "vector": [14, 1, 0.7965, 0.0025, 1, 0.95, 0.4706, 631, 3, 1, 0, 0, 824, 10, 1], "semantic": {"name": "resultant", "arg_names": [], "import_names": [], "rhs_call_name": "sum", "annotation": ""}, "snippet": " resultant = v.sum(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L322_C4", "label": "res_norm = norm()", "type": "assigned_variable", "loc": [322, 322], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L305_C0", "vector": [14, 1, 0.799, 0.0025, 1, 0.95, 0.5294, 217, 3, 1, 0, 0, 902, 10, 1], "semantic": {"name": "res_norm", "arg_names": [], "import_names": [], "rhs_call_name": "norm", "annotation": ""}, "snippet": " res_norm = np.linalg.norm(resultant)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L323_C4", "label": "resultant =", "type": "assigned_variable", "loc": [323, 323], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L305_C0", "vector": [14, 1, 0.8015, 0.0025, 1, 0.95, 0.5882, 631, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "resultant", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " resultant = resultant/res_norm"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L324_C4", "label": "tvec =", "type": "assigned_variable", "loc": [324, 324], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L305_C0", "vector": [14, 1, 0.804, 0.0025, 1, 0.95, 0.6471, 214, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "tvec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tvec = -resultant"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:If_L326_C4", "label": "if", "type": "if", "loc": [326, 327], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L305_C0", "vector": [4, 1, 0.8102, 0.005, 1, 0.95, 0.7059, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if bndry_dist < 0.:\n tvec = -tvec # eq pt was outside workspace polygon."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L327_C8", "label": "tvec =", "type": "assigned_variable", "loc": [327, 327], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:If_L326_C4", "vector": [14, 2, 0.8114, 0.0025, 2, 0.71, 0.0, 214, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "tvec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tvec = -tvec # eq pt was outside workspace polygon."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:If_L329_C4", "label": "if", "type": "if", "loc": [329, 334], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L305_C0", "vector": [4, 1, 0.8226, 0.0149, 1, 0.95, 0.7647, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if abs(bndry_dist)<0.01 or res_norm<0.01:\n # internal external test fails so falling back on\n # going to mean.\n m = all_pts.mean(1)\n tvec = m-p\n tvec = -tvec/np.linalg.norm(tvec)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L332_C8", "label": "m = mean()", "type": "assigned_variable", "loc": [332, 332], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:If_L329_C4", "vector": [14, 2, 0.8238, 0.0025, 2, 0.06, 0.0, 711, 3, 1, 0, 0, 856, 10, 1], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "mean", "annotation": ""}, "snippet": " m = all_pts.mean(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L333_C8", "label": "tvec =", "type": "assigned_variable", "loc": [333, 333], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:If_L329_C4", "vector": [14, 2, 0.8263, 0.0025, 2, 0.06, 0.5, 214, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "tvec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tvec = m-p"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L334_C8", "label": "tvec =", "type": "assigned_variable", "loc": [334, 334], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:If_L329_C4", "vector": [14, 2, 0.8288, 0.0025, 2, 0.06, 1.0, 214, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "tvec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tvec = -tvec/np.linalg.norm(tvec)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L336_C4", "label": "dist_move =", "type": "assigned_variable", "loc": [336, 336], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L305_C0", "vector": [14, 1, 0.8337, 0.0025, 1, 0.95, 0.8235, 816, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "dist_move", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " dist_move = 0."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:If_L337_C4", "label": "if", "type": "if", "loc": [337, 340], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L305_C0", "vector": [4, 1, 0.84, 0.0099, 1, 0.95, 0.8824, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if bndry_dist > 0.05:\n dist_move = 0.\n else:\n dist_move = 1."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L338_C8", "label": "dist_move =", "type": "assigned_variable", "loc": [338, 338], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:If_L337_C4", "vector": [14, 2, 0.8387, 0.0025, 2, 0.65, 0.0, 816, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "dist_move", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " dist_move = 0."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L340_C8", "label": "dist_move =", "type": "assigned_variable", "loc": [340, 340], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:If_L337_C4", "vector": [14, 2, 0.8437, 0.0025, 2, 0.65, 1.0, 816, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "dist_move", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " dist_move = 1."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L342_C4", "label": "tvec =", "type": "assigned_variable", "loc": [342, 342], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L305_C0", "vector": [14, 1, 0.8486, 0.0025, 1, 0.95, 0.9412, 214, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "tvec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tvec = tvec*dist_move # tvec is either a unit vec or zero vec."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Return_L343_C4", "label": "return", "type": "return", "loc": [343, 343], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L305_C0", "vector": [13, 1, 0.8511, 0.0025, 1, 0.95, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return tvec"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:If_L346_C0", "label": "if", "type": "if", "loc": [346, 370], "level": 0, "parent": null, "vector": [4, 0, 0.8883, 0.062, 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\n #d = ut.load_pickle('workspace_dict_2009Sep03_221107.pkl')\n d = ut.load_pickle('../../pkls/workspace_dict_2009Sep05_200116.pkl')\n z = -0.23\n k = d.keys()\n k_idx = np.argmin(np.abs(np.array(k)-z))\n pts = d[k[k_idx]]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L349_C4", "label": "d = load_pickle()", "type": "assigned_variable", "loc": [349, 349], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:If_L346_C0", "vector": [14, 1, 0.866, 0.0025, 1, 0.5, 0.0, 355, 3, 1, 0, 0, 65, 10, 1], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "load_pickle", "annotation": ""}, "snippet": " d = ut.load_pickle('../../pkls/workspace_dict_2009Sep05_200116.pkl')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L350_C4", "label": "z =", "type": "assigned_variable", "loc": [350, 350], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:If_L346_C0", "vector": [14, 1, 0.8685, 0.0025, 1, 0.5, 0.1667, 859, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " z = -0.23"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L351_C4", "label": "k = keys()", "type": "assigned_variable", "loc": [351, 351], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:If_L346_C0", "vector": [14, 1, 0.871, 0.0025, 1, 0.5, 0.3333, 954, 3, 0, 0, 0, 204, 10, 1], "semantic": {"name": "k", "arg_names": [], "import_names": [], "rhs_call_name": "keys", "annotation": ""}, "snippet": " k = d.keys()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L352_C4", "label": "k_idx = argmin()", "type": "assigned_variable", "loc": [352, 352], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:If_L346_C0", "vector": [14, 1, 0.8734, 0.0025, 1, 0.5, 0.5, 978, 3, 1, 0, 0, 879, 10, 3], "semantic": {"name": "k_idx", "arg_names": [], "import_names": [], "rhs_call_name": "argmin", "annotation": ""}, "snippet": " k_idx = np.argmin(np.abs(np.array(k)-z))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L353_C4", "label": "pts =", "type": "assigned_variable", "loc": [353, 353], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:If_L346_C0", "vector": [14, 1, 0.8759, 0.0025, 1, 0.5, 0.6667, 195, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pts = d[k[k_idx]]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:For_L356_C4", "label": "for kk", "type": "for", "loc": [356, 367], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:If_L346_C0", "vector": [6, 1, 0.897, 0.0298, 1, 0.5, 0.8333, 616, 2, 0, 0, 0, 0, 0, 4], "semantic": {"name": "kk", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for kk in k:\n pts = d[kk]\n bpts = compute_boundary(pts)\n cx,cy = 0.7,-0.6\n rad = 0.4\n \n # pts_in = point_contained(cx,cy,0.,rad,pts,\n # start_angle=math.radians(140),"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L357_C8", "label": "pts =", "type": "assigned_variable", "loc": [357, 357], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:For_L356_C4", "vector": [14, 2, 0.8859, 0.0025, 2, 0.49, 0.0, 195, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pts = d[kk]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L358_C8", "label": "bpts = compute_boundary()", "type": "assigned_variable", "loc": [358, 358], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:For_L356_C4", "vector": [14, 2, 0.8883, 0.0025, 2, 0.49, 0.1667, 198, 3, 1, 0, 0, 761, 10, 1], "semantic": {"name": "bpts", "arg_names": [], "import_names": [], "rhs_call_name": "compute_boundary", "annotation": ""}, "snippet": " bpts = compute_boundary(pts)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L359_C8", "label": "cx, cy =", "type": "assigned_variable", "loc": [359, 359], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:For_L356_C4", "vector": [14, 2, 0.8908, 0.0025, 2, 0.49, 0.3333, 959, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "cx, cy", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cx,cy = 0.7,-0.6"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L360_C8", "label": "rad =", "type": "assigned_variable", "loc": [360, 360], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:For_L356_C4", "vector": [14, 2, 0.8933, 0.0025, 2, 0.49, 0.5, 439, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "rad", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rad = 0.4"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Expr_L365_C8", "label": "figure()", "type": "expression", "loc": [365, 365], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:For_L356_C4", "vector": [8, 2, 0.9057, 0.0025, 2, 0.49, 0.6667, 789, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "figure", "arg_names": [], "import_names": [], "rhs_call_name": "figure", "annotation": ""}, "snippet": " mpu.figure()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Expr_L366_C8", "label": "plot_yx()", "type": "expression", "loc": [366, 366], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:For_L356_C4", "vector": [8, 2, 0.9082, 0.0025, 2, 0.49, 0.8333, 112, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "plot_yx", "arg_names": [], "import_names": [], "rhs_call_name": "plot_yx", "annotation": ""}, "snippet": " mpu.plot_yx(pts[1,:].A1,pts[0,:].A1,linewidth=0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Expr_L367_C8", "label": "plot_yx()", "type": "expression", "loc": [367, 367], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:For_L356_C4", "vector": [8, 2, 0.9107, 0.0025, 2, 0.49, 1.0, 112, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "plot_yx", "arg_names": [], "import_names": [], "rhs_call_name": "plot_yx", "annotation": ""}, "snippet": " mpu.plot_yx(bpts[1,:].A1,bpts[0,:].A1,linewidth=0,color='y')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99529:Expr_L370_C4", "label": "show()", "type": "expression", "loc": [370, 370], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99529:If_L346_C0", "vector": [8, 1, 0.9181, 0.0025, 1, 0.5, 1.0, 497, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "show", "arg_names": [], "import_names": [], "rhs_call_name": "show", "annotation": ""}, "snippet": " mpu.show()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L50_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L51_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L50_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L52_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L50_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Return_L53_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L60_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L61_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Return_L62_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L68_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:If_L69_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:If_L69_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Return_L71_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L68_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L72_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L68_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L73_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L68_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L74_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L68_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L75_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L68_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:If_L76_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:If_L76_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L77_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:If_L76_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L79_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L68_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L80_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L68_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L82_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L68_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L83_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L68_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Return_L84_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L88_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L89_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:If_L90_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:If_L90_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L92_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:If_L90_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L95_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L96_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L98_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L99_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L100_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L101_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Expr_L103_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Expr_L104_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Expr_L105_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Expr_L106_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L108_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L108_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L109_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L108_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L110_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L108_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L112_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L108_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L114_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L108_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L115_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L108_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L117_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L108_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L118_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L108_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L119_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L108_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:If_L121_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:If_L121_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L122_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:If_L121_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:If_L123_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:If_L123_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L124_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:If_L123_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L126_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L108_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L127_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L108_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L128_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L108_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L129_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L108_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L130_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L108_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L144_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L108_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Return_L146_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L148_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L149_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L151_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L162_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L164_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Expr_L166_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Return_L167_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L174_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L175_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L174_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L176_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L174_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L177_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L174_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L178_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L174_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L180_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L174_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L181_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L174_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L182_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L174_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L183_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L174_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L184_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L174_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L185_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L174_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Return_L188_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L192_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L193_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L192_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L194_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L192_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L195_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L192_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Return_L196_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L203_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L204_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L203_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L207_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L203_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L209_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L203_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L210_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L203_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L211_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L203_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:If_L214_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:If_L214_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L216_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L203_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Return_L221_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L226_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L227_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L226_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Return_L228_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L230_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L231_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L230_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L232_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L230_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L233_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L230_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L234_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L230_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L235_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L230_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L236_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L230_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L238_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L230_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:For_L239_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:For_L239_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:If_L240_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:If_L240_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Expr_L241_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L230_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L242_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L230_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Expr_L243_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L230_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Expr_L245_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L230_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Expr_L246_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L230_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Expr_L247_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L230_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Expr_L248_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L255_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L256_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L255_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L257_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L255_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L258_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L255_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L259_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L255_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Return_L260_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L266_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L267_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L266_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L268_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L266_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L269_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L266_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L270_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L266_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Return_L271_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L277_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L278_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L277_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L279_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L277_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L280_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L277_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Return_L281_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L287_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L288_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L287_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L289_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L287_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L290_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L287_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Return_L291_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L294_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L295_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L294_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L296_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L294_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L297_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L294_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L298_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L294_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Return_L299_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L305_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L306_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L305_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L307_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L305_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:If_L308_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:If_L308_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L309_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:If_L308_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L310_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:If_L308_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L312_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:If_L308_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L313_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L305_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L316_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L305_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L317_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L305_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L318_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L305_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L319_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L305_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L320_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L305_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L321_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L305_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L322_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L305_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L323_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L305_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L324_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L305_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:If_L326_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:If_L326_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L327_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L305_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:If_L329_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:If_L329_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L332_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:If_L329_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L333_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:If_L329_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L334_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L305_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L336_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L305_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:If_L337_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:If_L337_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L338_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:If_L337_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L340_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L305_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L342_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:FunctionDef_L305_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Return_L343_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:If_L346_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L349_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:If_L346_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L350_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:If_L346_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L351_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:If_L346_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L352_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:If_L346_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L353_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:If_L346_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:For_L356_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:For_L356_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L357_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:For_L356_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L358_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:For_L356_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L359_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:For_L356_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Assign_L360_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:For_L356_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Expr_L365_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:For_L356_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Expr_L366_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:For_L356_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Expr_L367_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99529:If_L346_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99529:Expr_L370_C4"}]
# # # Copyright (c) 2010, Georgia Tech Research Corporation # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # * Neither the name of the Georgia Tech Research Corporation nor the # names of its contributors may be used to endorse or promote products # derived from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY GEORGIA TECH RESEARCH CORPORATION ''AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL GEORGIA TECH BE LIABLE FOR ANY DIRECT, INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # \author Advait Jain (Healthcare Robotics Lab, Georgia Tech.) import roslib; roslib.load_manifest('2010_icra_epc_pull') import rospy from 2010_icra_epc_pull.msg import MechanismKinematicsRot from geometry_msgs.msg import Point32 import arm_trajectories as at from threading import RLock import numpy as np import time ## # fit circle to the trajectory, publish the computed kinematics. # @param cartesian_pts_list - list of 3-tuples. trajectory of the mechanism # @param pbshr - publisher for the MechanismKinematics message # @param lock - to make list operations thread safe. (there is a callback too.) def circle_estimator(cartesian_pts_list, pbshr, lock): lock.acquire() n_pts = len(cartesian_pts_list) pts_2d = (np.matrix(cartesian_pts_list).T)[0:2,:] lock.release() if n_pts<2: time.sleep(0.1) #pbshr.publish(mk) # don't publish anything. return st = pts_2d[:,0] now = pts_2d[:,-1] mk = MechanismKinematicsRot() mk.cx = 0.5 mk.cy = -3.5 mk.cz = cartesian_pts_list[0][2] mk.rad = 10. dist_moved = np.linalg.norm(st-now) if dist_moved<=0.1: reject_pts_num = n_pts else: reject_pts_num = 1 if dist_moved<=0.15: time.sleep(0.1) pbshr.publish(mk) return # pts_2d = (np.matrix(cartesian_pts_list).T)[0:2,:] pts_2d = pts_2d[:,reject_pts_num:] rad = 1.0 #start_pos = np.matrix(cartesian_pts_list[0]).T start_pos = st rad,cx,cy = at.fit_circle(rad, start_pos[0,0], start_pos[1,0]-rad, pts_2d, method='fmin_bfgs', verbose=False) mk.cx = cx mk.cy = cy mk.rad = rad pbshr.publish(mk) # append the point to the trajectory def trajectory_cb(pt32, tup): cp_list, lock = tup lock.acquire() cp_list.append([pt32.x, pt32.y, pt32.z]) lock.release() if __name__ == '__main__': cartesian_points_list = [] lock = RLock() rospy.init_node('kinematics_estimator_least_sq') mech_kin_pub = rospy.Publisher('mechanism_kinematics_rot', MechanismKinematicsRot) rospy.Subscriber('mechanism_trajectory', Point32, trajectory_cb, (cartesian_points_list, lock)) print 'Begin' while not rospy.is_shutdown(): circle_estimator(cartesian_points_list, mech_kin_pub, lock) time.sleep(0.01) print 'End'
ajibawa-2023/Python-Code-Large/train/row_99530
55
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_99530:Import_L32_C0", "label": "roslib import roslib", "type": "import", "loc": [32, 32], "level": 0, "parent": null, "vector": [1, 0, 0.2735, 0.0085, 0, 0.66, 0.0, 796, 0, 1, 0, 0, 796, 0, 0], "semantic": {"name": "roslib", "arg_names": [], "import_names": ["roslib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('2010_icra_epc_pull')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99530:Expr_L32_C15", "label": "load_manifest()", "type": "expression", "loc": [32, 32], "level": 0, "parent": null, "vector": [8, 0, 0.2735, 0.0085, 0, 0.66, 0.1, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('2010_icra_epc_pull')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99530:Import_L33_C0", "label": "rospy import rospy", "type": "import", "loc": [33, 33], "level": 0, "parent": null, "vector": [1, 0, 0.2821, 0.0085, 0, 0.66, 0.2, 164, 0, 1, 0, 0, 164, 0, 0], "semantic": {"name": "rospy", "arg_names": [], "import_names": ["rospy"], "rhs_call_name": "", "annotation": ""}, "snippet": "import rospy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99530:ImportFrom_L35_C0", "label": "from geometry_msgs.msg import Point32", "type": "import", "loc": [35, 35], "level": 0, "parent": null, "vector": [1, 0, 0.2991, 0.0085, 0, 0.66, 0.3, 951, 0, 1, 0, 0, 951, 0, 0], "semantic": {"name": "geometry_msgs.msg", "arg_names": [], "import_names": ["Point32"], "rhs_call_name": "", "annotation": ""}, "snippet": "from geometry_msgs.msg import Point32"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99530:Import_L37_C0", "label": "arm_trajectories import at", "type": "import", "loc": [37, 37], "level": 0, "parent": null, "vector": [1, 0, 0.3162, 0.0085, 0, 0.66, 0.4, 34, 0, 1, 0, 0, 34, 0, 0], "semantic": {"name": "arm_trajectories", "arg_names": [], "import_names": ["at"], "rhs_call_name": "", "annotation": ""}, "snippet": "import arm_trajectories as at"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99530:ImportFrom_L39_C0", "label": "from threading import RLock", "type": "import", "loc": [39, 39], "level": 0, "parent": null, "vector": [1, 0, 0.3333, 0.0085, 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_99530:Import_L40_C0", "label": "numpy import np", "type": "import", "loc": [40, 40], "level": 0, "parent": null, "vector": [1, 0, 0.3419, 0.0085, 0, 0.66, 0.6, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np"], "rhs_call_name": "", "annotation": ""}, "snippet": "import numpy as np"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99530:Import_L41_C0", "label": "time import time", "type": "import", "loc": [41, 41], "level": 0, "parent": null, "vector": [1, 0, 0.3504, 0.0085, 0, 0.66, 0.7, 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_99530:FunctionDef_L48_C0", "label": "circle_estimator", "type": "function", "loc": [48, 91], "level": 0, "parent": null, "vector": [2, 0, 0.594, 0.3761, 0, 0.66, 0.8, 512, 0, 3, 0, 0, 0, 0, 11], "semantic": {"name": "circle_estimator", "arg_names": ["cartesian_pts_list", "pbshr", "lock"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def circle_estimator(cartesian_pts_list, pbshr, lock):\n lock.acquire()\n n_pts = len(cartesian_pts_list)\n pts_2d = (np.matrix(cartesian_pts_list).T)[0:2,:]\n lock.release()\n\n if n_pts<2:\n time.sleep(0.1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99530:Expr_L49_C4", "label": "acquire()", "type": "expression", "loc": [49, 49], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99530:FunctionDef_L48_C0", "vector": [8, 1, 0.4188, 0.0085, 1, 0.78, 0.0, 229, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "acquire", "arg_names": [], "import_names": [], "rhs_call_name": "acquire", "annotation": ""}, "snippet": " lock.acquire()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99530:Assign_L50_C4", "label": "n_pts = len()", "type": "assigned_variable", "loc": [50, 50], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99530:FunctionDef_L48_C0", "vector": [14, 1, 0.4274, 0.0085, 1, 0.78, 0.0455, 156, 3, 1, 0, 0, 890, 10, 1], "semantic": {"name": "n_pts", "arg_names": [], "import_names": [], "rhs_call_name": "len", "annotation": ""}, "snippet": " n_pts = len(cartesian_pts_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99530:Assign_L51_C4", "label": "pts_2d =", "type": "assigned_variable", "loc": [51, 51], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99530:FunctionDef_L48_C0", "vector": [14, 1, 0.4359, 0.0085, 1, 0.78, 0.0909, 945, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "pts_2d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pts_2d = (np.matrix(cartesian_pts_list).T)[0:2,:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99530:Expr_L52_C4", "label": "release()", "type": "expression", "loc": [52, 52], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99530:FunctionDef_L48_C0", "vector": [8, 1, 0.4444, 0.0085, 1, 0.78, 0.1364, 784, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "release", "arg_names": [], "import_names": [], "rhs_call_name": "release", "annotation": ""}, "snippet": " lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99530:If_L54_C4", "label": "if", "type": "if", "loc": [54, 57], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99530:FunctionDef_L48_C0", "vector": [4, 1, 0.4744, 0.0342, 1, 0.78, 0.1818, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if n_pts<2:\n time.sleep(0.1)\n #pbshr.publish(mk) # don't publish anything.\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99530:Expr_L55_C8", "label": "sleep()", "type": "expression", "loc": [55, 55], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99530:If_L54_C4", "vector": [8, 2, 0.4701, 0.0085, 2, 0.37, 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_99530:Return_L57_C8", "label": "return", "type": "return", "loc": [57, 57], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99530:If_L54_C4", "vector": [13, 2, 0.4872, 0.0085, 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_99530:Assign_L59_C4", "label": "st =", "type": "assigned_variable", "loc": [59, 59], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99530:FunctionDef_L48_C0", "vector": [14, 1, 0.5043, 0.0085, 1, 0.78, 0.2273, 93, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "st", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " st = pts_2d[:,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99530:Assign_L60_C4", "label": "now =", "type": "assigned_variable", "loc": [60, 60], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99530:FunctionDef_L48_C0", "vector": [14, 1, 0.5128, 0.0085, 1, 0.78, 0.2727, 894, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "now", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " now = pts_2d[:,-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99530:Assign_L62_C4", "label": "mk = MechanismKinematicsRot()", "type": "assigned_variable", "loc": [62, 62], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99530:FunctionDef_L48_C0", "vector": [14, 1, 0.5299, 0.0085, 1, 0.78, 0.3182, 141, 3, 0, 0, 0, 603, 10, 1], "semantic": {"name": "mk", "arg_names": [], "import_names": [], "rhs_call_name": "MechanismKinematicsRot", "annotation": ""}, "snippet": " mk = MechanismKinematicsRot()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99530:Assign_L63_C4", "label": "mk.cx =", "type": "assigned_variable", "loc": [63, 63], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99530:FunctionDef_L48_C0", "vector": [14, 1, 0.5385, 0.0085, 1, 0.78, 0.3636, 127, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "mk.cx", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mk.cx = 0.5"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99530:Assign_L64_C4", "label": "mk.cy =", "type": "assigned_variable", "loc": [64, 64], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99530:FunctionDef_L48_C0", "vector": [14, 1, 0.547, 0.0085, 1, 0.78, 0.4091, 802, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "mk.cy", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mk.cy = -3.5"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99530:Assign_L65_C4", "label": "mk.cz =", "type": "assigned_variable", "loc": [65, 65], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99530:FunctionDef_L48_C0", "vector": [14, 1, 0.5556, 0.0085, 1, 0.78, 0.4545, 779, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "mk.cz", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mk.cz = cartesian_pts_list[0][2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99530:Assign_L66_C4", "label": "mk.rad =", "type": "assigned_variable", "loc": [66, 66], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99530:FunctionDef_L48_C0", "vector": [14, 1, 0.5641, 0.0085, 1, 0.78, 0.5, 141, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "mk.rad", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mk.rad = 10."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99530:Assign_L68_C4", "label": "dist_moved = norm()", "type": "assigned_variable", "loc": [68, 68], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99530:FunctionDef_L48_C0", "vector": [14, 1, 0.5812, 0.0085, 1, 0.78, 0.5455, 696, 3, 1, 0, 0, 902, 10, 1], "semantic": {"name": "dist_moved", "arg_names": [], "import_names": [], "rhs_call_name": "norm", "annotation": ""}, "snippet": " dist_moved = np.linalg.norm(st-now)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99530:If_L70_C4", "label": "if", "type": "if", "loc": [70, 73], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99530:FunctionDef_L48_C0", "vector": [4, 1, 0.6111, 0.0342, 1, 0.78, 0.5909, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if dist_moved<=0.1:\n reject_pts_num = n_pts\n else:\n reject_pts_num = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99530:Assign_L71_C8", "label": "reject_pts_num =", "type": "assigned_variable", "loc": [71, 71], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99530:If_L70_C4", "vector": [14, 2, 0.6068, 0.0085, 2, 0.38, 0.0, 801, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "reject_pts_num", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " reject_pts_num = n_pts"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99530:Assign_L73_C8", "label": "reject_pts_num =", "type": "assigned_variable", "loc": [73, 73], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99530:If_L70_C4", "vector": [14, 2, 0.6239, 0.0085, 2, 0.38, 1.0, 801, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "reject_pts_num", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " reject_pts_num = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99530:If_L75_C4", "label": "if", "type": "if", "loc": [75, 78], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99530:FunctionDef_L48_C0", "vector": [4, 1, 0.6538, 0.0342, 1, 0.78, 0.6364, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if dist_moved<=0.15:\n time.sleep(0.1)\n pbshr.publish(mk)\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99530:Expr_L76_C8", "label": "sleep()", "type": "expression", "loc": [76, 76], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99530:If_L75_C4", "vector": [8, 2, 0.6496, 0.0085, 2, 0.41, 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_99530:Expr_L77_C8", "label": "publish()", "type": "expression", "loc": [77, 77], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99530:If_L75_C4", "vector": [8, 2, 0.6581, 0.0085, 2, 0.41, 0.5, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " pbshr.publish(mk)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99530:Return_L78_C8", "label": "return", "type": "return", "loc": [78, 78], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99530:If_L75_C4", "vector": [13, 2, 0.6667, 0.0085, 2, 0.41, 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_99530:Assign_L81_C4", "label": "pts_2d =", "type": "assigned_variable", "loc": [81, 81], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99530:FunctionDef_L48_C0", "vector": [14, 1, 0.6923, 0.0085, 1, 0.78, 0.6818, 945, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pts_2d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pts_2d = pts_2d[:,reject_pts_num:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99530:Assign_L83_C4", "label": "rad =", "type": "assigned_variable", "loc": [83, 83], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99530:FunctionDef_L48_C0", "vector": [14, 1, 0.7094, 0.0085, 1, 0.78, 0.7273, 439, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "rad", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rad = 1.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99530:Assign_L85_C4", "label": "start_pos =", "type": "assigned_variable", "loc": [85, 85], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99530:FunctionDef_L48_C0", "vector": [14, 1, 0.7265, 0.0085, 1, 0.78, 0.7727, 12, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "start_pos", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " start_pos = st"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99530:Assign_L86_C4", "label": "rad, cx, cy = fit_circle()", "type": "assigned_variable", "loc": [86, 87], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99530:FunctionDef_L48_C0", "vector": [14, 1, 0.7393, 0.0171, 1, 0.78, 0.8182, 693, 3, 6, 0, 0, 441, 10, 1], "semantic": {"name": "rad, cx, cy", "arg_names": [], "import_names": [], "rhs_call_name": "fit_circle", "annotation": ""}, "snippet": " rad,cx,cy = at.fit_circle(rad, start_pos[0,0], start_pos[1,0]-rad,\n pts_2d, method='fmin_bfgs', verbose=False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99530:Assign_L88_C4", "label": "mk.cx =", "type": "assigned_variable", "loc": [88, 88], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99530:FunctionDef_L48_C0", "vector": [14, 1, 0.7521, 0.0085, 1, 0.78, 0.8636, 127, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "mk.cx", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mk.cx = cx"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99530:Assign_L89_C4", "label": "mk.cy =", "type": "assigned_variable", "loc": [89, 89], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99530:FunctionDef_L48_C0", "vector": [14, 1, 0.7607, 0.0085, 1, 0.78, 0.9091, 802, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "mk.cy", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mk.cy = cy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99530:Assign_L90_C4", "label": "mk.rad =", "type": "assigned_variable", "loc": [90, 90], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99530:FunctionDef_L48_C0", "vector": [14, 1, 0.7692, 0.0085, 1, 0.78, 0.9545, 141, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "mk.rad", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mk.rad = rad"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99530:Expr_L91_C4", "label": "publish()", "type": "expression", "loc": [91, 91], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99530:FunctionDef_L48_C0", "vector": [8, 1, 0.7778, 0.0085, 1, 0.78, 1.0, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " pbshr.publish(mk)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99530:FunctionDef_L94_C0", "label": "trajectory_cb", "type": "function", "loc": [94, 98], "level": 0, "parent": null, "vector": [2, 0, 0.8205, 0.0427, 0, 0.66, 0.9, 232, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "trajectory_cb", "arg_names": ["pt32", "tup"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def trajectory_cb(pt32, tup):\n cp_list, lock = tup\n lock.acquire()\n cp_list.append([pt32.x, pt32.y, pt32.z])\n lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99530:Assign_L95_C4", "label": "cp_list, lock =", "type": "assigned_variable", "loc": [95, 95], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99530:FunctionDef_L94_C0", "vector": [14, 1, 0.812, 0.0085, 1, 0.35, 0.0, 223, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "cp_list, lock", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cp_list, lock = tup"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99530:Expr_L96_C4", "label": "acquire()", "type": "expression", "loc": [96, 96], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99530:FunctionDef_L94_C0", "vector": [8, 1, 0.8205, 0.0085, 1, 0.35, 0.3333, 229, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "acquire", "arg_names": [], "import_names": [], "rhs_call_name": "acquire", "annotation": ""}, "snippet": " lock.acquire()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99530:Expr_L97_C4", "label": "append()", "type": "expression", "loc": [97, 97], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99530:FunctionDef_L94_C0", "vector": [8, 1, 0.8291, 0.0085, 1, 0.35, 0.6667, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " cp_list.append([pt32.x, pt32.y, pt32.z])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99530:Expr_L98_C4", "label": "release()", "type": "expression", "loc": [98, 98], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99530:FunctionDef_L94_C0", "vector": [8, 1, 0.8376, 0.0085, 1, 0.35, 1.0, 784, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "release", "arg_names": [], "import_names": [], "rhs_call_name": "release", "annotation": ""}, "snippet": " lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99530:If_L101_C0", "label": "if", "type": "if", "loc": [101, 115], "level": 0, "parent": null, "vector": [4, 0, 0.9231, 0.1282, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 9], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n\n cartesian_points_list = []\n lock = RLock()\n rospy.init_node('kinematics_estimator_least_sq')\n mech_kin_pub = rospy.Publisher('mechanism_kinematics_rot',\n MechanismKinematicsRot)\n rospy.Subscriber('mechanism_trajectory', Point32, trajectory_cb,"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99530:Assign_L103_C4", "label": "cartesian_points_list =", "type": "assigned_variable", "loc": [103, 103], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99530:If_L101_C0", "vector": [14, 1, 0.8803, 0.0085, 1, 0.62, 0.0, 190, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "cartesian_points_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cartesian_points_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99530:Assign_L104_C4", "label": "lock = RLock()", "type": "assigned_variable", "loc": [104, 104], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99530:If_L101_C0", "vector": [14, 1, 0.8889, 0.0085, 1, 0.62, 0.1429, 104, 3, 0, 0, 0, 207, 10, 1], "semantic": {"name": "lock", "arg_names": [], "import_names": [], "rhs_call_name": "RLock", "annotation": ""}, "snippet": " lock = RLock()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99530:Expr_L105_C4", "label": "init_node()", "type": "expression", "loc": [105, 105], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99530:If_L101_C0", "vector": [8, 1, 0.8974, 0.0085, 1, 0.62, 0.2857, 463, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "init_node", "arg_names": [], "import_names": [], "rhs_call_name": "init_node", "annotation": ""}, "snippet": " rospy.init_node('kinematics_estimator_least_sq')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99530:Assign_L106_C4", "label": "mech_kin_pub = Publisher()", "type": "assigned_variable", "loc": [106, 107], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99530:If_L101_C0", "vector": [14, 1, 0.9103, 0.0171, 1, 0.62, 0.4286, 189, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "mech_kin_pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " mech_kin_pub = rospy.Publisher('mechanism_kinematics_rot',\n MechanismKinematicsRot)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99530:Expr_L108_C4", "label": "Subscriber()", "type": "expression", "loc": [108, 109], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99530:If_L101_C0", "vector": [8, 1, 0.9274, 0.0171, 1, 0.62, 0.5714, 455, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "Subscriber", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " rospy.Subscriber('mechanism_trajectory', Point32, trajectory_cb,\n (cartesian_points_list, lock))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99530:Expr_L111_C4", "label": "print()", "type": "expression", "loc": [111, 111], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99530:If_L101_C0", "vector": [8, 1, 0.9487, 0.0085, 1, 0.62, 0.7143, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Begin')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99530:While_L112_C4", "label": "while", "type": "while", "loc": [112, 114], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99530:If_L101_C0", "vector": [5, 1, 0.9658, 0.0256, 1, 0.62, 0.8571, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while not rospy.is_shutdown():\n circle_estimator(cartesian_points_list, mech_kin_pub, lock)\n time.sleep(0.01)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99530:Expr_L113_C8", "label": "circle_estimator()", "type": "expression", "loc": [113, 113], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99530:While_L112_C4", "vector": [8, 2, 0.9658, 0.0085, 2, 0.04, 0.0, 512, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "circle_estimator", "arg_names": [], "import_names": [], "rhs_call_name": "circle_estimator", "annotation": ""}, "snippet": " circle_estimator(cartesian_points_list, mech_kin_pub, lock)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99530:Expr_L114_C8", "label": "sleep()", "type": "expression", "loc": [114, 114], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99530:While_L112_C4", "vector": [8, 2, 0.9744, 0.0085, 2, 0.04, 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_99530:Expr_L115_C4", "label": "print()", "type": "expression", "loc": [115, 115], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99530:If_L101_C0", "vector": [8, 1, 0.9829, 0.0085, 1, 0.62, 1.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('End')"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99530:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99530:Expr_L49_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99530:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99530:Assign_L50_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99530:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99530:Assign_L51_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99530:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99530:Expr_L52_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99530:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99530:If_L54_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99530:If_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99530:Expr_L55_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99530:If_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99530:Return_L57_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99530:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99530:Assign_L59_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99530:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99530:Assign_L60_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99530:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99530:Assign_L62_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99530:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99530:Assign_L63_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99530:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99530:Assign_L64_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99530:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99530:Assign_L65_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99530:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99530:Assign_L66_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99530:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99530:Assign_L68_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99530:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99530:If_L70_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99530:If_L70_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99530:Assign_L71_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99530:If_L70_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99530:Assign_L73_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99530:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99530:If_L75_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99530:If_L75_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99530:Expr_L76_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99530:If_L75_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99530:Expr_L77_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99530:If_L75_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99530:Return_L78_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99530:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99530:Assign_L81_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99530:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99530:Assign_L83_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99530:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99530:Assign_L85_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99530:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99530:Assign_L86_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99530:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99530:Assign_L88_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99530:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99530:Assign_L89_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99530:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99530:Assign_L90_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99530:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99530:Expr_L91_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99530:FunctionDef_L94_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99530:Assign_L95_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99530:FunctionDef_L94_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99530:Expr_L96_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99530:FunctionDef_L94_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99530:Expr_L97_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99530:FunctionDef_L94_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99530:Expr_L98_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99530:If_L101_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99530:Assign_L103_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99530:If_L101_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99530:Assign_L104_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99530:If_L101_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99530:Expr_L105_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99530:If_L101_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99530:Assign_L106_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99530:If_L101_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99530:Expr_L108_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99530:If_L101_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99530:Expr_L111_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99530:If_L101_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99530:While_L112_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99530:While_L112_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99530:Expr_L113_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99530:While_L112_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99530:Expr_L114_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99530:If_L101_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99530:Expr_L115_C4"}]
# # # Copyright (c) 2010, Georgia Tech Research Corporation # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # * Neither the name of the Georgia Tech Research Corporation nor the # names of its contributors may be used to endorse or promote products # derived from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY GEORGIA TECH RESEARCH CORPORATION ''AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL GEORGIA TECH BE LIABLE FOR ANY DIRECT, INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # \author Advait Jain (Healthcare Robotics Lab, Georgia Tech.) import sys,os sys.path.append(os.environ['HRLBASEPATH']+'/usr/advait/LPI') import cam_utm_lpi as cul import hrl_lib.util as ut import hrl_lib.transforms as tr import mekabot.coord_frames as mcf import math, numpy as np import util as uto import tilting_hokuyo.processing_3d as p3d import camera_config as cc ## returns selected location in global coord frame. # @param angle - angle at which to take image, and about which to take # a 3D scan. def select_location(c,thok,angle): thok.servo.move_angle(angle) cvim = c.get_frame() cvim = c.get_frame() cvim = c.get_frame() im_angle = thok.servo.read_angle() tilt_angles = (math.radians(-20)+angle,math.radians(30)+angle) pos_list,scan_list = thok.scan(tilt_angles,speed=math.radians(10)) m = p3d.generate_pointcloud(pos_list,scan_list,math.radians(-60), math.radians(60), 0.0,-0.055) pts = mcf.utmcam0Tglobal(mcf.globalTthok0(m),im_angle) cam_params = cc.camera_parameters['mekabotUTM'] fx = cam_params['focal_length_x_in_pixels'] fy = cam_params['focal_length_y_in_pixels'] cx,cy = cam_params['optical_center_x_in_pixels'],cam_params['optical_center_y_in_pixels'] cam_proj_mat = np.matrix([[fx, 0, cx], [0, fy, cy], [0, 0, 1]]) cvim,pts2d = cul.project_points_in_image(cvim,pts,cam_proj_mat) cp = cul.get_click_location(cvim) print 'Clicked location:', cp if cp == None: return None idx = cul.get_index(pts2d.T,cp) pt3d = pts[:,idx] pt_interest = mcf.globalTutmcam0(pt3d,im_angle) hl_thok0 = mcf.thok0Tglobal(pt_interest) l1,l2 = 0.0,-0.055 d = {} d['pt'] = hl_thok0 d['pos_list'],d['scan_list'] = pos_list,scan_list d['l1'],d['l2'] = l1,l2 d['img'] = uto.cv2np(cvim) ut.save_pickle(d,'hook_plane_scan_'+ut.formatted_time()+'.pkl') return pt_interest if __name__ == '__main__': import camera import hokuyo.hokuyo_scan as hs import tilting_hokuyo.tilt_hokuyo_servo as ths hok = hs.Hokuyo('utm',0,flip=True,ros_init_node=True) thok = ths.tilt_hokuyo('/dev/robot/servo0',5,hok,l1=0.,l2=-0.055) cam = camera.Camera('mekabotUTM') for i in range(10): cam.get_frame() pt = select_location(cam,thok) print 'Selected location in global coordinates:', pt.A1.tolist()
ajibawa-2023/Python-Code-Large/train/row_99531
53
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_99531:Import_L31_C0", "label": "sys import sys, os", "type": "import", "loc": [31, 31], "level": 0, "parent": null, "vector": [1, 0, 0.301, 0.0097, 0, 0.66, 0.0, 509, 0, 2, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys", "os"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys,os"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99531:Expr_L32_C0", "label": "append()", "type": "expression", "loc": [32, 32], "level": 0, "parent": null, "vector": [8, 0, 0.3107, 0.0097, 0, 0.66, 0.0909, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": "sys.path.append(os.environ['HRLBASEPATH']+'/usr/advait/LPI')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99531:Import_L33_C0", "label": "cam_utm_lpi import cul", "type": "import", "loc": [33, 33], "level": 0, "parent": null, "vector": [1, 0, 0.3204, 0.0097, 0, 0.66, 0.1818, 84, 0, 1, 0, 0, 84, 0, 0], "semantic": {"name": "cam_utm_lpi", "arg_names": [], "import_names": ["cul"], "rhs_call_name": "", "annotation": ""}, "snippet": "import cam_utm_lpi as cul"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99531:Import_L35_C0", "label": "hrl_lib.util import ut", "type": "import", "loc": [35, 35], "level": 0, "parent": null, "vector": [1, 0, 0.3398, 0.0097, 0, 0.66, 0.2727, 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_99531:Import_L36_C0", "label": "hrl_lib.transforms import tr", "type": "import", "loc": [36, 36], "level": 0, "parent": null, "vector": [1, 0, 0.3495, 0.0097, 0, 0.66, 0.3636, 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_99531:Import_L37_C0", "label": "mekabot.coord_frames import mcf", "type": "import", "loc": [37, 37], "level": 0, "parent": null, "vector": [1, 0, 0.3592, 0.0097, 0, 0.66, 0.4545, 350, 0, 1, 0, 0, 350, 0, 0], "semantic": {"name": "mekabot.coord_frames", "arg_names": [], "import_names": ["mcf"], "rhs_call_name": "", "annotation": ""}, "snippet": "import mekabot.coord_frames as mcf"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99531:Import_L38_C0", "label": "math import math, np", "type": "import", "loc": [38, 38], "level": 0, "parent": null, "vector": [1, 0, 0.3689, 0.0097, 0, 0.66, 0.5455, 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_99531:Import_L39_C0", "label": "util import uto", "type": "import", "loc": [39, 39], "level": 0, "parent": null, "vector": [1, 0, 0.3786, 0.0097, 0, 0.66, 0.6364, 811, 0, 1, 0, 0, 811, 0, 0], "semantic": {"name": "util", "arg_names": [], "import_names": ["uto"], "rhs_call_name": "", "annotation": ""}, "snippet": "import util as uto"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99531:Import_L41_C0", "label": "tilting_hokuyo.processing_3d import p3d", "type": "import", "loc": [41, 41], "level": 0, "parent": null, "vector": [1, 0, 0.3981, 0.0097, 0, 0.66, 0.7273, 474, 0, 1, 0, 0, 474, 0, 0], "semantic": {"name": "tilting_hokuyo.processing_3d", "arg_names": [], "import_names": ["p3d"], "rhs_call_name": "", "annotation": ""}, "snippet": "import tilting_hokuyo.processing_3d as p3d"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99531:Import_L42_C0", "label": "camera_config import cc", "type": "import", "loc": [42, 42], "level": 0, "parent": null, "vector": [1, 0, 0.4078, 0.0097, 0, 0.66, 0.8182, 94, 0, 1, 0, 0, 94, 0, 0], "semantic": {"name": "camera_config", "arg_names": [], "import_names": ["cc"], "rhs_call_name": "", "annotation": ""}, "snippet": "import camera_config as cc"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99531:FunctionDef_L47_C0", "label": "select_location", "type": "function", "loc": [47, 86], "level": 0, "parent": null, "vector": [2, 0, 0.6456, 0.3883, 0, 0.66, 0.9091, 94, 0, 3, 1, 0, 0, 0, 24], "semantic": {"name": "select_location", "arg_names": ["c", "thok", "angle"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def select_location(c,thok,angle):\n thok.servo.move_angle(angle)\n cvim = c.get_frame()\n cvim = c.get_frame()\n cvim = c.get_frame()\n im_angle = thok.servo.read_angle()\n\n tilt_angles = (math.radians(-20)+angle,math.radians(30)+angle)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99531:Expr_L48_C4", "label": "move_angle()", "type": "expression", "loc": [48, 48], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99531:FunctionDef_L47_C0", "vector": [8, 1, 0.466, 0.0097, 1, 0.53, 0.0, 293, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "move_angle", "arg_names": [], "import_names": [], "rhs_call_name": "move_angle", "annotation": ""}, "snippet": " thok.servo.move_angle(angle)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99531:Assign_L49_C4", "label": "cvim = get_frame()", "type": "assigned_variable", "loc": [49, 49], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99531:FunctionDef_L47_C0", "vector": [14, 1, 0.4757, 0.0097, 1, 0.53, 0.0345, 758, 3, 0, 0, 0, 489, 10, 1], "semantic": {"name": "cvim", "arg_names": [], "import_names": [], "rhs_call_name": "get_frame", "annotation": ""}, "snippet": " cvim = c.get_frame()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99531:Assign_L50_C4", "label": "cvim = get_frame()", "type": "assigned_variable", "loc": [50, 50], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99531:FunctionDef_L47_C0", "vector": [14, 1, 0.4854, 0.0097, 1, 0.53, 0.069, 758, 3, 0, 0, 0, 489, 10, 1], "semantic": {"name": "cvim", "arg_names": [], "import_names": [], "rhs_call_name": "get_frame", "annotation": ""}, "snippet": " cvim = c.get_frame()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99531:Assign_L51_C4", "label": "cvim = get_frame()", "type": "assigned_variable", "loc": [51, 51], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99531:FunctionDef_L47_C0", "vector": [14, 1, 0.4951, 0.0097, 1, 0.53, 0.1034, 758, 3, 0, 0, 0, 489, 10, 1], "semantic": {"name": "cvim", "arg_names": [], "import_names": [], "rhs_call_name": "get_frame", "annotation": ""}, "snippet": " cvim = c.get_frame()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99531:Assign_L52_C4", "label": "im_angle = read_angle()", "type": "assigned_variable", "loc": [52, 52], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99531:FunctionDef_L47_C0", "vector": [14, 1, 0.5049, 0.0097, 1, 0.53, 0.1379, 834, 3, 0, 0, 0, 27, 10, 1], "semantic": {"name": "im_angle", "arg_names": [], "import_names": [], "rhs_call_name": "read_angle", "annotation": ""}, "snippet": " im_angle = thok.servo.read_angle()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99531:Assign_L54_C4", "label": "tilt_angles =", "type": "assigned_variable", "loc": [54, 54], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99531:FunctionDef_L47_C0", "vector": [14, 1, 0.5243, 0.0097, 1, 0.53, 0.1724, 609, 0, 0, 0, 0, 0, 8, 2], "semantic": {"name": "tilt_angles", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tilt_angles = (math.radians(-20)+angle,math.radians(30)+angle)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99531:Assign_L55_C4", "label": "pos_list, scan_list = scan()", "type": "assigned_variable", "loc": [55, 55], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99531:FunctionDef_L47_C0", "vector": [14, 1, 0.534, 0.0097, 1, 0.53, 0.2069, 818, 3, 2, 0, 0, 202, 10, 2], "semantic": {"name": "pos_list, scan_list", "arg_names": [], "import_names": [], "rhs_call_name": "scan", "annotation": ""}, "snippet": " pos_list,scan_list = thok.scan(tilt_angles,speed=math.radians(10))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99531:Assign_L56_C4", "label": "m = generate_pointcloud()", "type": "assigned_variable", "loc": [56, 57], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99531:FunctionDef_L47_C0", "vector": [14, 1, 0.5485, 0.0194, 1, 0.53, 0.2414, 711, 3, 6, 0, 0, 989, 10, 3], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "generate_pointcloud", "annotation": ""}, "snippet": " m = p3d.generate_pointcloud(pos_list,scan_list,math.radians(-60), math.radians(60),\n 0.0,-0.055)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99531:Assign_L58_C4", "label": "pts = utmcam0Tglobal()", "type": "assigned_variable", "loc": [58, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99531:FunctionDef_L47_C0", "vector": [14, 1, 0.5631, 0.0097, 1, 0.53, 0.2759, 195, 3, 2, 0, 0, 894, 10, 2], "semantic": {"name": "pts", "arg_names": [], "import_names": [], "rhs_call_name": "utmcam0Tglobal", "annotation": ""}, "snippet": " pts = mcf.utmcam0Tglobal(mcf.globalTthok0(m),im_angle)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99531:Assign_L60_C4", "label": "cam_params =", "type": "assigned_variable", "loc": [60, 60], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99531:FunctionDef_L47_C0", "vector": [14, 1, 0.5825, 0.0097, 1, 0.53, 0.3103, 887, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "cam_params", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cam_params = cc.camera_parameters['mekabotUTM']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99531:Assign_L61_C4", "label": "fx =", "type": "assigned_variable", "loc": [61, 61], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99531:FunctionDef_L47_C0", "vector": [14, 1, 0.5922, 0.0097, 1, 0.53, 0.3448, 322, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "fx", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " fx = cam_params['focal_length_x_in_pixels']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99531:Assign_L62_C4", "label": "fy =", "type": "assigned_variable", "loc": [62, 62], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99531:FunctionDef_L47_C0", "vector": [14, 1, 0.6019, 0.0097, 1, 0.53, 0.3793, 8, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "fy", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " fy = cam_params['focal_length_y_in_pixels']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99531:Assign_L63_C4", "label": "cx, cy =", "type": "assigned_variable", "loc": [63, 63], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99531:FunctionDef_L47_C0", "vector": [14, 1, 0.6117, 0.0097, 1, 0.53, 0.4138, 959, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "cx, cy", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cx,cy = cam_params['optical_center_x_in_pixels'],cam_params['optical_center_y_in_pixels']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99531:Assign_L64_C4", "label": "cam_proj_mat = matrix()", "type": "assigned_variable", "loc": [64, 66], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99531:FunctionDef_L47_C0", "vector": [14, 1, 0.6311, 0.0291, 1, 0.53, 0.4483, 613, 3, 1, 0, 0, 162, 10, 1], "semantic": {"name": "cam_proj_mat", "arg_names": [], "import_names": [], "rhs_call_name": "matrix", "annotation": ""}, "snippet": " cam_proj_mat = np.matrix([[fx, 0, cx],\n [0, fy, cy],\n [0, 0, 1]])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99531:Assign_L68_C4", "label": "cvim, pts2d = project_points_in_image()", "type": "assigned_variable", "loc": [68, 68], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99531:FunctionDef_L47_C0", "vector": [14, 1, 0.6602, 0.0097, 1, 0.53, 0.4828, 36, 3, 3, 0, 0, 542, 10, 1], "semantic": {"name": "cvim, pts2d", "arg_names": [], "import_names": [], "rhs_call_name": "project_points_in_image", "annotation": ""}, "snippet": " cvim,pts2d = cul.project_points_in_image(cvim,pts,cam_proj_mat)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99531:Assign_L69_C4", "label": "cp = get_click_location()", "type": "assigned_variable", "loc": [69, 69], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99531:FunctionDef_L47_C0", "vector": [14, 1, 0.6699, 0.0097, 1, 0.53, 0.5172, 70, 3, 1, 0, 0, 863, 10, 1], "semantic": {"name": "cp", "arg_names": [], "import_names": [], "rhs_call_name": "get_click_location", "annotation": ""}, "snippet": " cp = cul.get_click_location(cvim)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99531:Expr_L70_C4", "label": "print()", "type": "expression", "loc": [70, 70], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99531:FunctionDef_L47_C0", "vector": [8, 1, 0.6796, 0.0097, 1, 0.53, 0.5517, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Clicked location:', cp)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99531:If_L71_C4", "label": "if", "type": "if", "loc": [71, 72], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99531:FunctionDef_L47_C0", "vector": [4, 1, 0.6942, 0.0194, 1, 0.53, 0.5862, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if cp == None:\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99531:Return_L72_C8", "label": "return", "type": "return", "loc": [72, 72], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99531:If_L71_C4", "vector": [13, 2, 0.699, 0.0097, 2, 0.98, 0.0, 0, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99531:Assign_L73_C4", "label": "idx = get_index()", "type": "assigned_variable", "loc": [73, 73], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99531:FunctionDef_L47_C0", "vector": [14, 1, 0.7087, 0.0097, 1, 0.53, 0.6207, 187, 3, 2, 0, 0, 790, 10, 1], "semantic": {"name": "idx", "arg_names": [], "import_names": [], "rhs_call_name": "get_index", "annotation": ""}, "snippet": " idx = cul.get_index(pts2d.T,cp)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99531:Assign_L74_C4", "label": "pt3d =", "type": "assigned_variable", "loc": [74, 74], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99531:FunctionDef_L47_C0", "vector": [14, 1, 0.7184, 0.0097, 1, 0.53, 0.6552, 178, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pt3d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pt3d = pts[:,idx]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99531:Assign_L75_C4", "label": "pt_interest = globalTutmcam0()", "type": "assigned_variable", "loc": [75, 75], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99531:FunctionDef_L47_C0", "vector": [14, 1, 0.7282, 0.0097, 1, 0.53, 0.6897, 954, 3, 2, 0, 0, 741, 10, 1], "semantic": {"name": "pt_interest", "arg_names": [], "import_names": [], "rhs_call_name": "globalTutmcam0", "annotation": ""}, "snippet": " pt_interest = mcf.globalTutmcam0(pt3d,im_angle)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99531:Assign_L77_C4", "label": "hl_thok0 = thok0Tglobal()", "type": "assigned_variable", "loc": [77, 77], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99531:FunctionDef_L47_C0", "vector": [14, 1, 0.7476, 0.0097, 1, 0.53, 0.7241, 687, 3, 1, 0, 0, 419, 10, 1], "semantic": {"name": "hl_thok0", "arg_names": [], "import_names": [], "rhs_call_name": "thok0Tglobal", "annotation": ""}, "snippet": " hl_thok0 = mcf.thok0Tglobal(pt_interest)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99531:Assign_L78_C4", "label": "l1, l2 =", "type": "assigned_variable", "loc": [78, 78], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99531:FunctionDef_L47_C0", "vector": [14, 1, 0.7573, 0.0097, 1, 0.53, 0.7586, 209, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "l1, l2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " l1,l2 = 0.0,-0.055"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99531:Assign_L79_C4", "label": "d =", "type": "assigned_variable", "loc": [79, 79], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99531:FunctionDef_L47_C0", "vector": [14, 1, 0.767, 0.0097, 1, 0.53, 0.7931, 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_99531:Assign_L80_C4", "label": "assign", "type": "assigned_variable", "loc": [80, 80], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99531:FunctionDef_L47_C0", "vector": [14, 1, 0.7767, 0.0097, 1, 0.53, 0.8276, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " d['pt'] = hl_thok0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99531:Assign_L81_C4", "label": "assign", "type": "assigned_variable", "loc": [81, 81], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99531:FunctionDef_L47_C0", "vector": [14, 1, 0.7864, 0.0097, 1, 0.53, 0.8621, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " d['pos_list'],d['scan_list'] = pos_list,scan_list"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99531:Assign_L82_C4", "label": "assign", "type": "assigned_variable", "loc": [82, 82], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99531:FunctionDef_L47_C0", "vector": [14, 1, 0.7961, 0.0097, 1, 0.53, 0.8966, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " d['l1'],d['l2'] = l1,l2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99531:Assign_L83_C4", "label": " = cv2np()", "type": "assigned_variable", "loc": [83, 83], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99531:FunctionDef_L47_C0", "vector": [14, 1, 0.8058, 0.0097, 1, 0.53, 0.931, 0, 3, 1, 0, 0, 366, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "cv2np", "annotation": ""}, "snippet": " d['img'] = uto.cv2np(cvim)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99531:Expr_L84_C4", "label": "save_pickle()", "type": "expression", "loc": [84, 84], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99531:FunctionDef_L47_C0", "vector": [8, 1, 0.8155, 0.0097, 1, 0.53, 0.9655, 390, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "save_pickle", "arg_names": [], "import_names": [], "rhs_call_name": "save_pickle", "annotation": ""}, "snippet": " ut.save_pickle(d,'hook_plane_scan_'+ut.formatted_time()+'.pkl')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99531:Return_L86_C4", "label": "return", "type": "return", "loc": [86, 86], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99531:FunctionDef_L47_C0", "vector": [13, 1, 0.835, 0.0097, 1, 0.53, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return pt_interest"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99531:If_L89_C0", "label": "if", "type": "if", "loc": [89, 101], "level": 0, "parent": null, "vector": [4, 0, 0.9223, 0.1262, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 8], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n import camera\n import hokuyo.hokuyo_scan as hs\n import tilting_hokuyo.tilt_hokuyo_servo as ths\n\n hok = hs.Hokuyo('utm',0,flip=True,ros_init_node=True)\n thok = ths.tilt_hokuyo('/dev/robot/servo0',5,hok,l1=0.,l2=-0.055)\n cam = camera.Camera('mekabotUTM')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99531:Import_L90_C4", "label": "camera import camera", "type": "import", "loc": [90, 90], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99531:If_L89_C0", "vector": [1, 1, 0.8738, 0.0097, 1, 0.82, 0.0, 848, 0, 1, 0, 0, 848, 0, 0], "semantic": {"name": "camera", "arg_names": [], "import_names": ["camera"], "rhs_call_name": "", "annotation": ""}, "snippet": " import camera"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99531:Import_L91_C4", "label": "hokuyo.hokuyo_scan import hs", "type": "import", "loc": [91, 91], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99531:If_L89_C0", "vector": [1, 1, 0.8835, 0.0097, 1, 0.82, 0.125, 464, 0, 1, 0, 0, 464, 0, 0], "semantic": {"name": "hokuyo.hokuyo_scan", "arg_names": [], "import_names": ["hs"], "rhs_call_name": "", "annotation": ""}, "snippet": " import hokuyo.hokuyo_scan as hs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99531:Import_L92_C4", "label": "tilting_hokuyo.tilt_hokuyo_servo import ths", "type": "import", "loc": [92, 92], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99531:If_L89_C0", "vector": [1, 1, 0.8932, 0.0097, 1, 0.82, 0.25, 212, 0, 1, 0, 0, 212, 0, 0], "semantic": {"name": "tilting_hokuyo.tilt_hokuyo_servo", "arg_names": [], "import_names": ["ths"], "rhs_call_name": "", "annotation": ""}, "snippet": " import tilting_hokuyo.tilt_hokuyo_servo as ths"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99531:Assign_L94_C4", "label": "hok = Hokuyo()", "type": "assigned_variable", "loc": [94, 94], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99531:If_L89_C0", "vector": [14, 1, 0.9126, 0.0097, 1, 0.82, 0.375, 886, 3, 4, 0, 0, 66, 10, 1], "semantic": {"name": "hok", "arg_names": [], "import_names": [], "rhs_call_name": "Hokuyo", "annotation": ""}, "snippet": " hok = hs.Hokuyo('utm',0,flip=True,ros_init_node=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99531:Assign_L95_C4", "label": "thok = tilt_hokuyo()", "type": "assigned_variable", "loc": [95, 95], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99531:If_L89_C0", "vector": [14, 1, 0.9223, 0.0097, 1, 0.82, 0.5, 171, 3, 5, 0, 0, 577, 10, 1], "semantic": {"name": "thok", "arg_names": [], "import_names": [], "rhs_call_name": "tilt_hokuyo", "annotation": ""}, "snippet": " thok = ths.tilt_hokuyo('/dev/robot/servo0',5,hok,l1=0.,l2=-0.055)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99531:Assign_L96_C4", "label": "cam = Camera()", "type": "assigned_variable", "loc": [96, 96], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99531:If_L89_C0", "vector": [14, 1, 0.932, 0.0097, 1, 0.82, 0.625, 155, 3, 1, 0, 0, 468, 10, 1], "semantic": {"name": "cam", "arg_names": [], "import_names": [], "rhs_call_name": "Camera", "annotation": ""}, "snippet": " cam = camera.Camera('mekabotUTM')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99531:For_L97_C4", "label": "for i", "type": "for", "loc": [97, 98], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99531:If_L89_C0", "vector": [6, 1, 0.9466, 0.0194, 1, 0.82, 0.75, 826, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(10):\n cam.get_frame()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99531:Expr_L98_C8", "label": "get_frame()", "type": "expression", "loc": [98, 98], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99531:For_L97_C4", "vector": [8, 2, 0.9515, 0.0097, 2, 0.96, 0.0, 489, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "get_frame", "arg_names": [], "import_names": [], "rhs_call_name": "get_frame", "annotation": ""}, "snippet": " cam.get_frame()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99531:Assign_L100_C4", "label": "pt = select_location()", "type": "assigned_variable", "loc": [100, 100], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99531:If_L89_C0", "vector": [14, 1, 0.9709, 0.0097, 1, 0.82, 0.875, 989, 3, 2, 0, 0, 94, 10, 1], "semantic": {"name": "pt", "arg_names": [], "import_names": [], "rhs_call_name": "select_location", "annotation": ""}, "snippet": " pt = select_location(cam,thok)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99531:Expr_L101_C4", "label": "print()", "type": "expression", "loc": [101, 101], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99531:If_L89_C0", "vector": [8, 1, 0.9806, 0.0097, 1, 0.82, 1.0, 535, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Selected location in global coordinates:', pt.A1.tolist())"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99531:FunctionDef_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99531:Expr_L48_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99531:FunctionDef_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99531:Assign_L49_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99531:FunctionDef_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99531:Assign_L50_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99531:FunctionDef_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99531:Assign_L51_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99531:FunctionDef_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99531:Assign_L52_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99531:FunctionDef_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99531:Assign_L54_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99531:FunctionDef_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99531:Assign_L55_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99531:FunctionDef_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99531:Assign_L56_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99531:FunctionDef_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99531:Assign_L58_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99531:FunctionDef_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99531:Assign_L60_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99531:FunctionDef_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99531:Assign_L61_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99531:FunctionDef_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99531:Assign_L62_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99531:FunctionDef_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99531:Assign_L63_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99531:FunctionDef_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99531:Assign_L64_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99531:FunctionDef_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99531:Assign_L68_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99531:FunctionDef_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99531:Assign_L69_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99531:FunctionDef_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99531:Expr_L70_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99531:FunctionDef_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99531:If_L71_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99531:If_L71_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99531:Return_L72_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99531:FunctionDef_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99531:Assign_L73_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99531:FunctionDef_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99531:Assign_L74_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99531:FunctionDef_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99531:Assign_L75_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99531:FunctionDef_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99531:Assign_L77_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99531:FunctionDef_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99531:Assign_L78_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99531:FunctionDef_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99531:Assign_L79_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99531:FunctionDef_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99531:Assign_L80_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99531:FunctionDef_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99531:Assign_L81_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99531:FunctionDef_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99531:Assign_L82_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99531:FunctionDef_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99531:Assign_L83_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99531:FunctionDef_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99531:Expr_L84_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99531:FunctionDef_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99531:Return_L86_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99531:If_L89_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99531:Import_L90_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99531:If_L89_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99531:Import_L91_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99531:If_L89_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99531:Import_L92_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99531:If_L89_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99531:Assign_L94_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99531:If_L89_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99531:Assign_L95_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99531:If_L89_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99531:Assign_L96_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99531:If_L89_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99531:For_L97_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99531:For_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99531:Expr_L98_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99531:If_L89_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99531:Assign_L100_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99531:If_L89_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99531:Expr_L101_C4"}]
#!/usr/bin/python import sys, os sys.path.append(os.environ['HRLBASEPATH']+'/src/libraries/') import cameras.dragonfly as dr import roslib; roslib.load_manifest('modeling_forces') import rospy import cv from collections import deque import time import math, numpy as np import glob import hrl_lib.util as ut import hrl_camera.ros_camera as rc def got_pose_cb(data, got_pose_dict): if len(data.objects) != 2: got_pose_dict['pose_fail'] = True else: got_pose_dict['pose_fail'] = False got_pose_dict['flag'] = True if __name__ == '__main__': import optparse p = optparse.OptionParser() p.add_option('-l', '--log', action='store_true', dest='log', help='log FT data') p.add_option('-p', '--pub', action='store_true', dest='pub', help='publish over ROS') p.add_option('-c', '--conv', action='store_true', dest='avi_to_pngs', help='convert avi to pngs') p.add_option('-b', '--bad', action='store_true', dest='bad', help='find the images on which checker tracking failed.') p.add_option('-d', '--dir', action='store', default='', type='string', dest='dir', help='directory with images') p.add_option('-i', '--images_only', action='store_true', dest='images_only', help='work with images (no pkl)') p.add_option('-s', '--single_im', action='store', default='', type='string', dest='single_fname', help='work with one image') opt, args = p.parse_args() camera_name = 'remote_head' if opt.pub: import cv from cv_bridge.cv_bridge import CvBridge, CvBridgeError from std_msgs.msg import String from std_msgs.msg import Empty from sensor_msgs.msg import Image from sensor_msgs.msg import CameraInfo from checkerboard_detector.msg import ObjectDetection rospy.init_node('publish_log_images', anonymous=True) if opt.single_fname != '': im_name_list = [opt.single_fname for i in range(10)] time_list = [time.time() for i in range(10)] elif opt.images_only: im_name_list = glob.glob(opt.dir+'/*.png') #im_name_list = glob.glob(opt.dir+'/*.jpg') im_name_list.sort() time_list = [1 for i in range(len(im_name_list))] else: l = glob.glob(opt.dir+'/handheld_pull_log*.pkl') if l == []: raise RuntimeError('%s does not have a handheld_pull_log'%opt.dir) pkl_name = l[0] d = ut.load_pickle(pkl_name) im_name_list = glob.glob(opt.dir+'/0*.png') im_name_list.sort() time_list = d['time_list'] import camera_config as cc cp = cc.camera_parameters[camera_name] m = np.array([ [ cp['focal_length_x_in_pixels'], 0., cp['optical_center_x_in_pixels'], 0. ], [ 0., cp['focal_length_y_in_pixels'], cp['optical_center_y_in_pixels'], 0. ], [ 0., 0., 1., 0.] ]) intrinsic_list = [m[0,0], m[0,1], m[0,2], 0.0, m[1,0], m[1,1], m[1,2], 0.0, m[2,0], m[2,1], m[2,2], 0.0] topic_name = 'cvcamera_' + camera_name image_pub = rospy.Publisher(topic_name, Image) config_pub = rospy.Publisher(topic_name+'_info', CameraInfo) ch_pub = rospy.Publisher('/checker_to_poses/trigger', Empty) time.sleep(0.5) bridge = CvBridge() got_pose_dict = {'flag': False, 'pose_fail': False} topic_name_cb = '/checkerdetector/ObjectDetection' rospy.Subscriber(topic_name_cb, ObjectDetection, got_pose_cb, got_pose_dict) failed_im_list = [] # list of filenames on which checkboard detection failed. n_images = len(im_name_list) for i in range(n_images): name = im_name_list[i] cv_im = cv.LoadImage(name) rosimage = bridge.cv_to_imgmsg(cv_im, "bgr8") rosimage.header.stamp = rospy.Time.from_sec(time_list[i]) image_pub.publish(rosimage) config_pub.publish(CameraInfo(P=intrinsic_list)) t_st = time.time() while got_pose_dict['flag'] == False: time.sleep(0.5) if (time.time()-t_st) > 10.: break if got_pose_dict['pose_fail'] == True: failed_im_list.append(name) time.sleep(0.5) got_pose_dict['flag'] = False got_pose_dict['pose_fail'] = False if rospy.is_shutdown(): break print 'Number of images:', n_images ch_pub.publish() # send trigger to the ft logger. ut.save_pickle(failed_im_list, 'checker_fail_list.pkl') if opt.log: from opencv.cv import * from opencv.highgui import * from std_msgs.msg import Empty rospy.init_node('image logger', anonymous=True) ft_pub = rospy.Publisher('/ftlogger/trigger', Empty) cam = dr.dragonfly2(camera_name) cam.set_frame_rate(30) cam.set_brightness(0, 651, 0, 65) for i in range(10): im = cam.get_frame_debayered() # undistorting slows down frame rate im_list = deque() time_list = [] cvNamedWindow('Image Logging', CV_WINDOW_AUTOSIZE) print 'Started the loop.' print 'Hit a to start logging, ESC to exit and save pkl' log_images = False while not rospy.is_shutdown(): kp = cvWaitKey(1) if (type(kp) == str and kp == '\x1b') or (type(kp) != str and kp & 255 == 27): # ESC then exit. t1 = time.time() ft_pub.publish() # send trigger to the ft logger. break if (type(kp) == str and kp == 'a') or (type(kp) != str and kp & 255 == 97): # a to start logging. log_images = True t0 = time.time() ft_pub.publish() # send trigger to the ft logger. print 'started logging' im = cam.get_frame_debayered() # undistorting slows down frame rate if log_images: time_list.append(time.time()) im_list.append(cvCloneImage(im)) print 'frame rate:', len(time_list)/(t1-t0) print 'before saving the pkl' d = {} t_string = ut.formatted_time() video_name = 'mechanism_video_'+t_string+'.avi' vwr = cvCreateVideoWriter(video_name, CV_FOURCC('I','4','2','0'), 30, cvGetSize(im_list[0]), True) t0 = time.time() im_name_list = [] time_stamp = ut.formatted_time() for im in im_list: cvWriteFrame(vwr, im) time.sleep(.01) #Important to keep force torque server #from restarting t1 = time.time() print 'disk writing rate:', len(time_list)/(t1-t0) d['time_list'] = time_list d['video_name'] = video_name fname = 'handheld_pull_log_' + t_string + '.pkl' ut.save_pickle(d, fname) print 'Done saving the pkl' if opt.avi_to_pngs: from opencv.cv import * from opencv.highgui import * import util import camera_config as cc cp = cc.camera_parameters[camera_name] size = (int(cp['calibration_image_width']), int(cp['calibration_image_height'])) color = cp['color'] intrinsic_cvmat = cvCreateMat(3,3,cv.CV_32FC1) distortion_cvmat = cvCreateMat(1,4,cv.CV_32FC1) imat_np = np.array([[cp['focal_length_x_in_pixels'],0, cp['optical_center_x_in_pixels']], [0,cp['focal_length_y_in_pixels'], cp['optical_center_y_in_pixels']], [0,0,1]]) intrinsic_cvmat = util.numpymat2cvmat(imat_np) dmat_np = np.array([[cp['lens_distortion_radial_1'], cp['lens_distortion_radial_2'], cp['lens_distortion_tangential_1'], cp['lens_distortion_tangential_2']]]) distortion_cvmat = util.numpymat2cvmat(dmat_np) undistort_mapx = cvCreateImage(size, IPL_DEPTH_32F, 1) undistort_mapy = cvCreateImage(size, IPL_DEPTH_32F, 1) cvInitUndistortMap(intrinsic_cvmat, distortion_cvmat, undistort_mapx, undistort_mapy) if color == True: undistort_image = cvCreateImage(size, IPL_DEPTH_8U, 3) else: undistort_image = cvCreateImage(size, IPL_DEPTH_8U, 1) #pkl_name = glob.glob(opt.dir+'/handheld_pull_log*.pkl')[0] #d = ut.load_pickle(pkl_name) #video_name = opt.dir+'/'+d['video_name'] #time_list = d['time_list'] video_name = glob.glob(opt.dir + 'mechanism_video*.avi')[0] cap = cvCreateFileCapture(video_name) #for i in range(len(time_list)): i = 0 while True: cvim = cvQueryFrame(cap) if cvim == None: break cvFlip(cvim, cvim) # undistort the image cvRemap(cvim, undistort_image, undistort_mapx, undistort_mapy, CV_INTER_LINEAR, cvScalarAll(0)) nm = opt.dir+'/%05d.png'%i print 'Saving', nm cvSaveImage(nm, undistort_image) i += 1 if opt.bad: import cv l = ut.load_pickle(opt.dir+'/checker_fail_list.pkl') display = False if display: wnd = 'Checker Fail Images' cv.NamedWindow(wnd, cv.CV_WINDOW_AUTOSIZE) else: save_dir = opt.dir+'/checker_fail/' os.system('mkdir %s'%save_dir) for nm in l: name = opt.dir+'/'+nm cv_im = cv.LoadImage(name) if display: cv.ShowImage(wnd, cv_im) cv.WaitKey(0) else: save_dir = os.path.normpath(save_dir) # print 'save_dir:', save_dir file_name = '_'.join(save_dir.split('/')) + '_%s'%os.path.normpath(nm) print 'file_name:', file_name cv.SaveImage(save_dir + '/' + file_name, cv_im)
ajibawa-2023/Python-Code-Large/train/row_99533
188
291
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Import_L3_C0", "label": "sys import sys, os", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0103, 0.0034, 0, 0.66, 0.0, 509, 0, 2, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys", "os"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys, os"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Expr_L4_C0", "label": "append()", "type": "expression", "loc": [4, 4], "level": 0, "parent": null, "vector": [8, 0, 0.0137, 0.0034, 0, 0.66, 0.0714, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": "sys.path.append(os.environ['HRLBASEPATH']+'/src/libraries/')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Import_L5_C0", "label": "cameras.dragonfly import dr", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0172, 0.0034, 0, 0.66, 0.1429, 372, 0, 1, 0, 0, 372, 0, 0], "semantic": {"name": "cameras.dragonfly", "arg_names": [], "import_names": ["dr"], "rhs_call_name": "", "annotation": ""}, "snippet": "import cameras.dragonfly as dr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Import_L6_C0", "label": "roslib import roslib", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0206, 0.0034, 0, 0.66, 0.2143, 796, 0, 1, 0, 0, 796, 0, 0], "semantic": {"name": "roslib", "arg_names": [], "import_names": ["roslib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('modeling_forces')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Expr_L6_C15", "label": "load_manifest()", "type": "expression", "loc": [6, 6], "level": 0, "parent": null, "vector": [8, 0, 0.0206, 0.0034, 0, 0.66, 0.2857, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('modeling_forces')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Import_L7_C0", "label": "rospy import rospy", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.0241, 0.0034, 0, 0.66, 0.3571, 164, 0, 1, 0, 0, 164, 0, 0], "semantic": {"name": "rospy", "arg_names": [], "import_names": ["rospy"], "rhs_call_name": "", "annotation": ""}, "snippet": "import rospy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Import_L8_C0", "label": "cv import cv", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.0275, 0.0034, 0, 0.66, 0.4286, 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_99533:ImportFrom_L10_C0", "label": "from collections import deque", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.0344, 0.0034, 0, 0.66, 0.5, 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_99533:Import_L11_C0", "label": "time import time", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.0378, 0.0034, 0, 0.66, 0.5714, 654, 0, 1, 0, 0, 654, 0, 0], "semantic": {"name": "time", "arg_names": [], "import_names": ["time"], "rhs_call_name": "", "annotation": ""}, "snippet": "import time"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Import_L12_C0", "label": "math import math, np", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.0412, 0.0034, 0, 0.66, 0.6429, 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_99533:Import_L13_C0", "label": "glob import glob", "type": "import", "loc": [13, 13], "level": 0, "parent": null, "vector": [1, 0, 0.0447, 0.0034, 0, 0.66, 0.7143, 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_99533:Import_L15_C0", "label": "hrl_lib.util import ut", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.0515, 0.0034, 0, 0.66, 0.7857, 775, 0, 1, 0, 0, 775, 0, 0], "semantic": {"name": "hrl_lib.util", "arg_names": [], "import_names": ["ut"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.util as ut"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Import_L16_C0", "label": "hrl_camera.ros_camera import rc", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.055, 0.0034, 0, 0.66, 0.8571, 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_99533:FunctionDef_L18_C0", "label": "got_pose_cb", "type": "function", "loc": [18, 24], "level": 0, "parent": null, "vector": [2, 0, 0.0722, 0.0241, 0, 0.66, 0.9286, 383, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "got_pose_cb", "arg_names": ["data", "got_pose_dict"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def got_pose_cb(data, got_pose_dict):\n if len(data.objects) != 2:\n got_pose_dict['pose_fail'] = True\n else:\n got_pose_dict['pose_fail'] = False\n\n got_pose_dict['flag'] = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L19_C4", "label": "if", "type": "if", "loc": [19, 22], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:FunctionDef_L18_C0", "vector": [4, 1, 0.0704, 0.0137, 1, 0.34, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(data.objects) != 2:\n got_pose_dict['pose_fail'] = True\n else:\n got_pose_dict['pose_fail'] = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L20_C8", "label": "assign", "type": "assigned_variable", "loc": [20, 20], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L19_C4", "vector": [14, 2, 0.0687, 0.0034, 2, 0.94, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " got_pose_dict['pose_fail'] = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L22_C8", "label": "assign", "type": "assigned_variable", "loc": [22, 22], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L19_C4", "vector": [14, 2, 0.0756, 0.0034, 2, 0.94, 1.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " got_pose_dict['pose_fail'] = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L24_C4", "label": "assign", "type": "assigned_variable", "loc": [24, 24], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:FunctionDef_L18_C0", "vector": [14, 1, 0.0825, 0.0034, 1, 0.34, 1.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " got_pose_dict['flag'] = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L27_C0", "label": "if", "type": "if", "loc": [27, 287], "level": 0, "parent": null, "vector": [4, 0, 0.5395, 0.8969, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 99], "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('-l', '--log', action='store_true', dest='log', help='log FT data')\n p.add_option('-p', '--pub', action='store_true', dest='pub',\n help='publish over ROS')\n p.add_option('-c', '--conv', action='store_true', dest='avi_to_pngs',\n help='convert avi to pngs')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Import_L28_C4", "label": "optparse import optparse", "type": "import", "loc": [28, 28], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L27_C0", "vector": [1, 1, 0.0962, 0.0034, 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_99533:Assign_L29_C4", "label": "p = OptionParser()", "type": "assigned_variable", "loc": [29, 29], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L27_C0", "vector": [14, 1, 0.0997, 0.0034, 1, 0.69, 0.0714, 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_99533:Expr_L30_C4", "label": "add_option()", "type": "expression", "loc": [30, 30], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L27_C0", "vector": [8, 1, 0.1031, 0.0034, 1, 0.69, 0.1429, 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('-l', '--log', action='store_true', dest='log', help='log FT data')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Expr_L31_C4", "label": "add_option()", "type": "expression", "loc": [31, 32], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L27_C0", "vector": [8, 1, 0.1082, 0.0069, 1, 0.69, 0.2143, 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('-p', '--pub', action='store_true', dest='pub',\n help='publish over ROS')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Expr_L33_C4", "label": "add_option()", "type": "expression", "loc": [33, 34], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L27_C0", "vector": [8, 1, 0.1151, 0.0069, 1, 0.69, 0.2857, 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', '--conv', action='store_true', dest='avi_to_pngs',\n help='convert avi to pngs')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Expr_L35_C4", "label": "add_option()", "type": "expression", "loc": [35, 36], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L27_C0", "vector": [8, 1, 0.122, 0.0069, 1, 0.69, 0.3571, 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('-b', '--bad', action='store_true', dest='bad',\n help='find the images on which checker tracking failed.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Expr_L37_C4", "label": "add_option()", "type": "expression", "loc": [37, 38], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L27_C0", "vector": [8, 1, 0.1289, 0.0069, 1, 0.69, 0.4286, 176, 3, 7, 0, 0, 0, 0, 1], "semantic": {"name": "add_option", "arg_names": [], "import_names": [], "rhs_call_name": "add_option", "annotation": ""}, "snippet": " p.add_option('-d', '--dir', action='store', default='',\n type='string', dest='dir', help='directory with images')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Expr_L39_C4", "label": "add_option()", "type": "expression", "loc": [39, 40], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L27_C0", "vector": [8, 1, 0.1357, 0.0069, 1, 0.69, 0.5, 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('-i', '--images_only', action='store_true',\n dest='images_only', help='work with images (no pkl)')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Expr_L41_C4", "label": "add_option()", "type": "expression", "loc": [41, 42], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L27_C0", "vector": [8, 1, 0.1426, 0.0069, 1, 0.69, 0.5714, 176, 3, 7, 0, 0, 0, 0, 1], "semantic": {"name": "add_option", "arg_names": [], "import_names": [], "rhs_call_name": "add_option", "annotation": ""}, "snippet": " p.add_option('-s', '--single_im', action='store', default='',\n type='string', dest='single_fname', help='work with one image')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L44_C4", "label": "opt, args = parse_args()", "type": "assigned_variable", "loc": [44, 44], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L27_C0", "vector": [14, 1, 0.1512, 0.0034, 1, 0.69, 0.6429, 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_99533:Assign_L46_C4", "label": "camera_name =", "type": "assigned_variable", "loc": [46, 46], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L27_C0", "vector": [14, 1, 0.1581, 0.0034, 1, 0.69, 0.7143, 879, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "camera_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " camera_name = 'remote_head'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L48_C4", "label": "if", "type": "if", "loc": [48, 134], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L27_C0", "vector": [4, 1, 0.3127, 0.299, 1, 0.69, 0.7857, 0, 7, 0, 0, 0, 0, 0, 37], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if opt.pub:\n import cv\n from cv_bridge.cv_bridge import CvBridge, CvBridgeError\n from std_msgs.msg import String\n from std_msgs.msg import Empty\n from sensor_msgs.msg import Image\n from sensor_msgs.msg import CameraInfo\n from checkerboard_detector.msg import ObjectDetection"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Import_L49_C8", "label": "cv import cv", "type": "import", "loc": [49, 49], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L48_C4", "vector": [1, 2, 0.1684, 0.0034, 2, 0.24, 0.0, 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_99533:ImportFrom_L50_C8", "label": "from cv_bridge.cv_bridge import CvBridge, CvBridgeError", "type": "import", "loc": [50, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L48_C4", "vector": [1, 2, 0.1718, 0.0034, 2, 0.24, 0.037, 356, 0, 2, 0, 0, 356, 0, 0], "semantic": {"name": "cv_bridge.cv_bridge", "arg_names": [], "import_names": ["CvBridge", "CvBridgeError"], "rhs_call_name": "", "annotation": ""}, "snippet": " from cv_bridge.cv_bridge import CvBridge, CvBridgeError"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:ImportFrom_L51_C8", "label": "from std_msgs.msg import String", "type": "import", "loc": [51, 51], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L48_C4", "vector": [1, 2, 0.1753, 0.0034, 2, 0.24, 0.0741, 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_99533:ImportFrom_L52_C8", "label": "from std_msgs.msg import Empty", "type": "import", "loc": [52, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L48_C4", "vector": [1, 2, 0.1787, 0.0034, 2, 0.24, 0.1111, 366, 0, 1, 0, 0, 366, 0, 0], "semantic": {"name": "std_msgs.msg", "arg_names": [], "import_names": ["Empty"], "rhs_call_name": "", "annotation": ""}, "snippet": " from std_msgs.msg import Empty"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:ImportFrom_L53_C8", "label": "from sensor_msgs.msg import Image", "type": "import", "loc": [53, 53], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L48_C4", "vector": [1, 2, 0.1821, 0.0034, 2, 0.24, 0.1481, 531, 0, 1, 0, 0, 531, 0, 0], "semantic": {"name": "sensor_msgs.msg", "arg_names": [], "import_names": ["Image"], "rhs_call_name": "", "annotation": ""}, "snippet": " from sensor_msgs.msg import Image"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:ImportFrom_L54_C8", "label": "from sensor_msgs.msg import CameraInfo", "type": "import", "loc": [54, 54], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L48_C4", "vector": [1, 2, 0.1856, 0.0034, 2, 0.24, 0.1852, 531, 0, 1, 0, 0, 531, 0, 0], "semantic": {"name": "sensor_msgs.msg", "arg_names": [], "import_names": ["CameraInfo"], "rhs_call_name": "", "annotation": ""}, "snippet": " from sensor_msgs.msg import CameraInfo"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:ImportFrom_L55_C8", "label": "from checkerboard_detector.msg import ObjectDetection", "type": "import", "loc": [55, 55], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L48_C4", "vector": [1, 2, 0.189, 0.0034, 2, 0.24, 0.2222, 857, 0, 1, 0, 0, 857, 0, 0], "semantic": {"name": "checkerboard_detector.msg", "arg_names": [], "import_names": ["ObjectDetection"], "rhs_call_name": "", "annotation": ""}, "snippet": " from checkerboard_detector.msg import ObjectDetection"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Expr_L57_C8", "label": "init_node()", "type": "expression", "loc": [57, 57], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L48_C4", "vector": [8, 2, 0.1959, 0.0034, 2, 0.24, 0.2593, 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('publish_log_images', anonymous=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L59_C8", "label": "if", "type": "if", "loc": [59, 76], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L48_C4", "vector": [4, 2, 0.232, 0.0619, 2, 0.24, 0.2963, 0, 0, 0, 0, 0, 0, 0, 12], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if opt.single_fname != '':\n im_name_list = [opt.single_fname for i in range(10)]\n time_list = [time.time() for i in range(10)]\n elif opt.images_only:\n im_name_list = glob.glob(opt.dir+'/*.png')\n #im_name_list = glob.glob(opt.dir+'/*.jpg')\n im_name_list.sort()\n time_list = [1 for i in range(len(im_name_list))]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L60_C12", "label": "im_name_list =", "type": "assigned_variable", "loc": [60, 60], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L59_C8", "vector": [14, 3, 0.2062, 0.0034, 3, 0.12, 0.0, 356, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "im_name_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " im_name_list = [opt.single_fname for i in range(10)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L61_C12", "label": "time_list =", "type": "assigned_variable", "loc": [61, 61], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L59_C8", "vector": [14, 3, 0.2096, 0.0034, 3, 0.12, 0.5, 941, 5, 0, 0, 0, 0, 0, 2], "semantic": {"name": "time_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " time_list = [time.time() for i in range(10)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L62_C8", "label": "if", "type": "if", "loc": [62, 76], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L59_C8", "vector": [4, 3, 0.2371, 0.0515, 3, 0.12, 1.0, 0, 7, 0, 0, 0, 0, 0, 9], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif opt.images_only:\n im_name_list = glob.glob(opt.dir+'/*.png')\n #im_name_list = glob.glob(opt.dir+'/*.jpg')\n im_name_list.sort()\n time_list = [1 for i in range(len(im_name_list))]\n else:\n l = glob.glob(opt.dir+'/handheld_pull_log*.pkl')\n if l == []:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L63_C12", "label": "im_name_list = glob()", "type": "assigned_variable", "loc": [63, 63], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L62_C8", "vector": [14, 4, 0.2165, 0.0034, 4, 0.53, 0.0, 356, 3, 1, 0, 0, 958, 10, 1], "semantic": {"name": "im_name_list", "arg_names": [], "import_names": [], "rhs_call_name": "glob", "annotation": ""}, "snippet": " im_name_list = glob.glob(opt.dir+'/*.png')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Expr_L65_C12", "label": "sort()", "type": "expression", "loc": [65, 65], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L62_C8", "vector": [8, 4, 0.2234, 0.0034, 4, 0.53, 0.1111, 489, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "sort", "arg_names": [], "import_names": [], "rhs_call_name": "sort", "annotation": ""}, "snippet": " im_name_list.sort()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L66_C12", "label": "time_list =", "type": "assigned_variable", "loc": [66, 66], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L62_C8", "vector": [14, 4, 0.2268, 0.0034, 4, 0.53, 0.2222, 941, 5, 0, 0, 0, 0, 0, 2], "semantic": {"name": "time_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " time_list = [1 for i in range(len(im_name_list))]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L68_C12", "label": "l = glob()", "type": "assigned_variable", "loc": [68, 68], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L62_C8", "vector": [14, 4, 0.2337, 0.0034, 4, 0.53, 0.3333, 810, 3, 1, 0, 0, 958, 10, 1], "semantic": {"name": "l", "arg_names": [], "import_names": [], "rhs_call_name": "glob", "annotation": ""}, "snippet": " l = glob.glob(opt.dir+'/handheld_pull_log*.pkl')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L69_C12", "label": "if", "type": "if", "loc": [69, 70], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L62_C8", "vector": [4, 4, 0.2388, 0.0069, 4, 0.53, 0.4444, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if l == []:\n raise RuntimeError('%s does not have a handheld_pull_log'%opt.dir)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L72_C12", "label": "pkl_name =", "type": "assigned_variable", "loc": [72, 72], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L62_C8", "vector": [14, 4, 0.2474, 0.0034, 4, 0.53, 0.5556, 780, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pkl_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pkl_name = l[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L73_C12", "label": "d = load_pickle()", "type": "assigned_variable", "loc": [73, 73], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L62_C8", "vector": [14, 4, 0.2509, 0.0034, 4, 0.53, 0.6667, 355, 3, 1, 0, 0, 65, 10, 1], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "load_pickle", "annotation": ""}, "snippet": " d = ut.load_pickle(pkl_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L74_C12", "label": "im_name_list = glob()", "type": "assigned_variable", "loc": [74, 74], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L62_C8", "vector": [14, 4, 0.2543, 0.0034, 4, 0.53, 0.7778, 356, 3, 1, 0, 0, 958, 10, 1], "semantic": {"name": "im_name_list", "arg_names": [], "import_names": [], "rhs_call_name": "glob", "annotation": ""}, "snippet": " im_name_list = glob.glob(opt.dir+'/0*.png')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Expr_L75_C12", "label": "sort()", "type": "expression", "loc": [75, 75], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L62_C8", "vector": [8, 4, 0.2577, 0.0034, 4, 0.53, 0.8889, 489, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "sort", "arg_names": [], "import_names": [], "rhs_call_name": "sort", "annotation": ""}, "snippet": " im_name_list.sort()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L76_C12", "label": "time_list =", "type": "assigned_variable", "loc": [76, 76], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L62_C8", "vector": [14, 4, 0.2612, 0.0034, 4, 0.53, 1.0, 941, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "time_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " time_list = d['time_list']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Import_L79_C8", "label": "camera_config import cc", "type": "import", "loc": [79, 79], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L48_C4", "vector": [1, 2, 0.2715, 0.0034, 2, 0.24, 0.3333, 94, 0, 1, 0, 0, 94, 0, 0], "semantic": {"name": "camera_config", "arg_names": [], "import_names": ["cc"], "rhs_call_name": "", "annotation": ""}, "snippet": " import camera_config as cc"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L80_C8", "label": "cp =", "type": "assigned_variable", "loc": [80, 80], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L48_C4", "vector": [14, 2, 0.2749, 0.0034, 2, 0.24, 0.3704, 70, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "cp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cp = cc.camera_parameters[camera_name]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L81_C8", "label": "m = array()", "type": "assigned_variable", "loc": [81, 85], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L48_C4", "vector": [14, 2, 0.2852, 0.0172, 2, 0.24, 0.4074, 711, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " m = np.array([ [ cp['focal_length_x_in_pixels'], 0.,\n cp['optical_center_x_in_pixels'], 0. ],\n [ 0., cp['focal_length_y_in_pixels'],\n cp['optical_center_y_in_pixels'], 0. ],\n [ 0., 0., 1., 0.] ])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L87_C8", "label": "intrinsic_list =", "type": "assigned_variable", "loc": [87, 89], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L48_C4", "vector": [14, 2, 0.3024, 0.0103, 2, 0.24, 0.4444, 585, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "intrinsic_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " intrinsic_list = [m[0,0], m[0,1], m[0,2], 0.0,\n m[1,0], m[1,1], m[1,2], 0.0,\n m[2,0], m[2,1], m[2,2], 0.0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L91_C8", "label": "topic_name =", "type": "assigned_variable", "loc": [91, 91], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L48_C4", "vector": [14, 2, 0.3127, 0.0034, 2, 0.24, 0.4815, 854, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "topic_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " topic_name = 'cvcamera_' + camera_name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L92_C8", "label": "image_pub = Publisher()", "type": "assigned_variable", "loc": [92, 92], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L48_C4", "vector": [14, 2, 0.3162, 0.0034, 2, 0.24, 0.5185, 395, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "image_pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " image_pub = rospy.Publisher(topic_name, Image)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L93_C8", "label": "config_pub = Publisher()", "type": "assigned_variable", "loc": [93, 93], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L48_C4", "vector": [14, 2, 0.3196, 0.0034, 2, 0.24, 0.5556, 970, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "config_pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " config_pub = rospy.Publisher(topic_name+'_info', CameraInfo)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L94_C8", "label": "ch_pub = Publisher()", "type": "assigned_variable", "loc": [94, 94], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L48_C4", "vector": [14, 2, 0.323, 0.0034, 2, 0.24, 0.5926, 458, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "ch_pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " ch_pub = rospy.Publisher('/checker_to_poses/trigger', Empty)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Expr_L96_C8", "label": "sleep()", "type": "expression", "loc": [96, 96], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L48_C4", "vector": [8, 2, 0.3299, 0.0034, 2, 0.24, 0.6296, 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_99533:Assign_L97_C8", "label": "bridge = CvBridge()", "type": "assigned_variable", "loc": [97, 97], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L48_C4", "vector": [14, 2, 0.3333, 0.0034, 2, 0.24, 0.6667, 658, 3, 0, 0, 0, 439, 10, 1], "semantic": {"name": "bridge", "arg_names": [], "import_names": [], "rhs_call_name": "CvBridge", "annotation": ""}, "snippet": " bridge = CvBridge()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L99_C8", "label": "got_pose_dict =", "type": "assigned_variable", "loc": [99, 99], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L48_C4", "vector": [14, 2, 0.3402, 0.0034, 2, 0.24, 0.7037, 252, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "got_pose_dict", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " got_pose_dict = {'flag': False, 'pose_fail': False}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L100_C8", "label": "topic_name_cb =", "type": "assigned_variable", "loc": [100, 100], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L48_C4", "vector": [14, 2, 0.3436, 0.0034, 2, 0.24, 0.7407, 728, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "topic_name_cb", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " topic_name_cb = '/checkerdetector/ObjectDetection'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Expr_L101_C8", "label": "Subscriber()", "type": "expression", "loc": [101, 102], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L48_C4", "vector": [8, 2, 0.3488, 0.0069, 2, 0.24, 0.7778, 455, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "Subscriber", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " rospy.Subscriber(topic_name_cb, ObjectDetection, got_pose_cb,\n got_pose_dict)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L104_C8", "label": "failed_im_list =", "type": "assigned_variable", "loc": [104, 104], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L48_C4", "vector": [14, 2, 0.3574, 0.0034, 2, 0.24, 0.8148, 85, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "failed_im_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " failed_im_list = [] # list of filenames on which checkboard detection failed."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L105_C8", "label": "n_images = len()", "type": "assigned_variable", "loc": [105, 105], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L48_C4", "vector": [14, 2, 0.3608, 0.0034, 2, 0.24, 0.8519, 892, 3, 1, 0, 0, 890, 10, 1], "semantic": {"name": "n_images", "arg_names": [], "import_names": [], "rhs_call_name": "len", "annotation": ""}, "snippet": " n_images = len(im_name_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:For_L106_C8", "label": "for i", "type": "for", "loc": [106, 130], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L48_C4", "vector": [6, 2, 0.4055, 0.0859, 2, 0.24, 0.8889, 826, 3, 0, 0, 0, 0, 0, 13], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(n_images):\n name = im_name_list[i]\n cv_im = cv.LoadImage(name)\n\n rosimage = bridge.cv_to_imgmsg(cv_im, \"bgr8\")\n rosimage.header.stamp = rospy.Time.from_sec(time_list[i])\n\n image_pub.publish(rosimage)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L107_C12", "label": "name =", "type": "assigned_variable", "loc": [107, 107], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:For_L106_C8", "vector": [14, 3, 0.3677, 0.0034, 3, 0.02, 0.0, 57, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " name = im_name_list[i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L108_C12", "label": "cv_im = LoadImage()", "type": "assigned_variable", "loc": [108, 108], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:For_L106_C8", "vector": [14, 3, 0.3711, 0.0034, 3, 0.02, 0.0833, 782, 3, 1, 0, 0, 512, 10, 1], "semantic": {"name": "cv_im", "arg_names": [], "import_names": [], "rhs_call_name": "LoadImage", "annotation": ""}, "snippet": " cv_im = cv.LoadImage(name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L110_C12", "label": "rosimage = cv_to_imgmsg()", "type": "assigned_variable", "loc": [110, 110], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:For_L106_C8", "vector": [14, 3, 0.378, 0.0034, 3, 0.02, 0.1667, 295, 3, 2, 0, 0, 630, 10, 1], "semantic": {"name": "rosimage", "arg_names": [], "import_names": [], "rhs_call_name": "cv_to_imgmsg", "annotation": ""}, "snippet": " rosimage = bridge.cv_to_imgmsg(cv_im, \"bgr8\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L111_C12", "label": "rosimage.header.stamp = from_sec()", "type": "assigned_variable", "loc": [111, 111], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:For_L106_C8", "vector": [14, 3, 0.3814, 0.0034, 3, 0.02, 0.25, 448, 3, 1, 0, 0, 334, 10, 1], "semantic": {"name": "rosimage.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "from_sec", "annotation": ""}, "snippet": " rosimage.header.stamp = rospy.Time.from_sec(time_list[i])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Expr_L113_C12", "label": "publish()", "type": "expression", "loc": [113, 113], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:For_L106_C8", "vector": [8, 3, 0.3883, 0.0034, 3, 0.02, 0.3333, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " image_pub.publish(rosimage)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Expr_L114_C12", "label": "publish()", "type": "expression", "loc": [114, 114], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:For_L106_C8", "vector": [8, 3, 0.3918, 0.0034, 3, 0.02, 0.4167, 102, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " config_pub.publish(CameraInfo(P=intrinsic_list))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L116_C12", "label": "t_st = time()", "type": "assigned_variable", "loc": [116, 116], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:For_L106_C8", "vector": [14, 3, 0.3986, 0.0034, 3, 0.02, 0.5, 588, 3, 0, 0, 0, 654, 10, 1], "semantic": {"name": "t_st", "arg_names": [], "import_names": [], "rhs_call_name": "time", "annotation": ""}, "snippet": " t_st = time.time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:While_L117_C12", "label": "while", "type": "while", "loc": [117, 120], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:For_L106_C8", "vector": [5, 3, 0.4072, 0.0137, 3, 0.02, 0.5833, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while got_pose_dict['flag'] == False:\n time.sleep(0.5)\n if (time.time()-t_st) > 10.:\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Expr_L118_C16", "label": "sleep()", "type": "expression", "loc": [118, 118], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:While_L117_C12", "vector": [8, 4, 0.4055, 0.0034, 4, 0.6, 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.5)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L119_C16", "label": "if", "type": "if", "loc": [119, 120], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:While_L117_C12", "vector": [4, 4, 0.4107, 0.0069, 4, 0.6, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (time.time()-t_st) > 10.:\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L122_C12", "label": "if", "type": "if", "loc": [122, 123], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:For_L106_C8", "vector": [4, 3, 0.421, 0.0069, 3, 0.02, 0.6667, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if got_pose_dict['pose_fail'] == True:\n failed_im_list.append(name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Expr_L123_C16", "label": "append()", "type": "expression", "loc": [123, 123], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L122_C12", "vector": [8, 4, 0.4227, 0.0034, 4, 0.56, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " failed_im_list.append(name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Expr_L125_C12", "label": "sleep()", "type": "expression", "loc": [125, 125], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:For_L106_C8", "vector": [8, 3, 0.4296, 0.0034, 3, 0.02, 0.75, 476, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " time.sleep(0.5)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L126_C12", "label": "assign", "type": "assigned_variable", "loc": [126, 126], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:For_L106_C8", "vector": [14, 3, 0.433, 0.0034, 3, 0.02, 0.8333, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " got_pose_dict['flag'] = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L127_C12", "label": "assign", "type": "assigned_variable", "loc": [127, 127], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:For_L106_C8", "vector": [14, 3, 0.4364, 0.0034, 3, 0.02, 0.9167, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " got_pose_dict['pose_fail'] = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L129_C12", "label": "if", "type": "if", "loc": [129, 130], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:For_L106_C8", "vector": [4, 3, 0.445, 0.0069, 3, 0.02, 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 break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Expr_L132_C8", "label": "print()", "type": "expression", "loc": [132, 132], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L48_C4", "vector": [8, 2, 0.4536, 0.0034, 2, 0.24, 0.9259, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Number of images:', n_images)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Expr_L133_C8", "label": "publish()", "type": "expression", "loc": [133, 133], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L48_C4", "vector": [8, 2, 0.457, 0.0034, 2, 0.24, 0.963, 102, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " ch_pub.publish() # send trigger to the ft logger."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Expr_L134_C8", "label": "save_pickle()", "type": "expression", "loc": [134, 134], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L48_C4", "vector": [8, 2, 0.4605, 0.0034, 2, 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": " ut.save_pickle(failed_im_list, 'checker_fail_list.pkl')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L136_C4", "label": "if", "type": "if", "loc": [136, 203], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L27_C0", "vector": [4, 1, 0.5825, 0.2337, 1, 0.69, 0.8571, 0, 7, 0, 0, 0, 0, 0, 43], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if opt.log:\n from opencv.cv import *\n from opencv.highgui import *\n\n from std_msgs.msg import Empty\n rospy.init_node('image logger', anonymous=True)\n ft_pub = rospy.Publisher('/ftlogger/trigger', Empty)\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:ImportFrom_L137_C8", "label": "from opencv.cv import *", "type": "import", "loc": [137, 137], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L136_C4", "vector": [1, 2, 0.4708, 0.0034, 2, 0.77, 0.0, 718, 0, 1, 0, 0, 718, 0, 0], "semantic": {"name": "opencv.cv", "arg_names": [], "import_names": ["*"], "rhs_call_name": "", "annotation": ""}, "snippet": " from opencv.cv import *"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:ImportFrom_L138_C8", "label": "from opencv.highgui import *", "type": "import", "loc": [138, 138], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L136_C4", "vector": [1, 2, 0.4742, 0.0034, 2, 0.77, 0.0312, 453, 0, 1, 0, 0, 453, 0, 0], "semantic": {"name": "opencv.highgui", "arg_names": [], "import_names": ["*"], "rhs_call_name": "", "annotation": ""}, "snippet": " from opencv.highgui import *"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:ImportFrom_L140_C8", "label": "from std_msgs.msg import Empty", "type": "import", "loc": [140, 140], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L136_C4", "vector": [1, 2, 0.4811, 0.0034, 2, 0.77, 0.0625, 366, 0, 1, 0, 0, 366, 0, 0], "semantic": {"name": "std_msgs.msg", "arg_names": [], "import_names": ["Empty"], "rhs_call_name": "", "annotation": ""}, "snippet": " from std_msgs.msg import Empty"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Expr_L141_C8", "label": "init_node()", "type": "expression", "loc": [141, 141], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L136_C4", "vector": [8, 2, 0.4845, 0.0034, 2, 0.77, 0.0938, 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('image logger', anonymous=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L142_C8", "label": "ft_pub = Publisher()", "type": "assigned_variable", "loc": [142, 142], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L136_C4", "vector": [14, 2, 0.488, 0.0034, 2, 0.77, 0.125, 660, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "ft_pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " ft_pub = rospy.Publisher('/ftlogger/trigger', Empty)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L145_C8", "label": "cam = dragonfly2()", "type": "assigned_variable", "loc": [145, 145], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L136_C4", "vector": [14, 2, 0.4983, 0.0034, 2, 0.77, 0.1562, 155, 3, 1, 0, 0, 407, 10, 1], "semantic": {"name": "cam", "arg_names": [], "import_names": [], "rhs_call_name": "dragonfly2", "annotation": ""}, "snippet": " cam = dr.dragonfly2(camera_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Expr_L146_C8", "label": "set_frame_rate()", "type": "expression", "loc": [146, 146], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L136_C4", "vector": [8, 2, 0.5017, 0.0034, 2, 0.77, 0.1875, 975, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_frame_rate", "arg_names": [], "import_names": [], "rhs_call_name": "set_frame_rate", "annotation": ""}, "snippet": " cam.set_frame_rate(30)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Expr_L147_C8", "label": "set_brightness()", "type": "expression", "loc": [147, 147], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L136_C4", "vector": [8, 2, 0.5052, 0.0034, 2, 0.77, 0.2188, 252, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "set_brightness", "arg_names": [], "import_names": [], "rhs_call_name": "set_brightness", "annotation": ""}, "snippet": " cam.set_brightness(0, 651, 0, 65)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:For_L148_C8", "label": "for i", "type": "for", "loc": [148, 149], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L136_C4", "vector": [6, 2, 0.5103, 0.0069, 2, 0.77, 0.25, 826, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(10):\n im = cam.get_frame_debayered() # undistorting slows down frame rate"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L149_C12", "label": "im = get_frame_debayered()", "type": "assigned_variable", "loc": [149, 149], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:For_L148_C8", "vector": [14, 3, 0.512, 0.0034, 3, 0.84, 0.0, 940, 3, 0, 0, 0, 255, 10, 1], "semantic": {"name": "im", "arg_names": [], "import_names": [], "rhs_call_name": "get_frame_debayered", "annotation": ""}, "snippet": " im = cam.get_frame_debayered() # undistorting slows down frame rate"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L151_C8", "label": "im_list = deque()", "type": "assigned_variable", "loc": [151, 151], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L136_C4", "vector": [14, 2, 0.5189, 0.0034, 2, 0.77, 0.2812, 638, 3, 0, 0, 0, 650, 10, 1], "semantic": {"name": "im_list", "arg_names": [], "import_names": [], "rhs_call_name": "deque", "annotation": ""}, "snippet": " im_list = deque()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L152_C8", "label": "time_list =", "type": "assigned_variable", "loc": [152, 152], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L136_C4", "vector": [14, 2, 0.5223, 0.0034, 2, 0.77, 0.3125, 941, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "time_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " time_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Expr_L154_C8", "label": "cvNamedWindow()", "type": "expression", "loc": [154, 154], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L136_C4", "vector": [8, 2, 0.5292, 0.0034, 2, 0.77, 0.3438, 431, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "cvNamedWindow", "arg_names": [], "import_names": [], "rhs_call_name": "cvNamedWindow", "annotation": ""}, "snippet": " cvNamedWindow('Image Logging', CV_WINDOW_AUTOSIZE)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Expr_L156_C8", "label": "print()", "type": "expression", "loc": [156, 156], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L136_C4", "vector": [8, 2, 0.5361, 0.0034, 2, 0.77, 0.375, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Started the loop.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Expr_L157_C8", "label": "print()", "type": "expression", "loc": [157, 157], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L136_C4", "vector": [8, 2, 0.5395, 0.0034, 2, 0.77, 0.4062, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Hit a to start logging, ESC to exit and save pkl')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L158_C8", "label": "log_images =", "type": "assigned_variable", "loc": [158, 158], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L136_C4", "vector": [14, 2, 0.543, 0.0034, 2, 0.77, 0.4375, 177, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "log_images", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " log_images = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:While_L160_C8", "label": "while", "type": "while", "loc": [160, 175], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L136_C4", "vector": [5, 2, 0.5756, 0.055, 2, 0.77, 0.4688, 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 kp = cvWaitKey(1)\n if (type(kp) == str and kp == '\\x1b') or (type(kp) != str and kp & 255 == 27): # ESC then exit.\n t1 = time.time()\n ft_pub.publish() # send trigger to the ft logger.\n break\n if (type(kp) == str and kp == 'a') or (type(kp) != str and kp & 255 == 97): # a to start logging.\n log_images = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L161_C12", "label": "kp = cvWaitKey()", "type": "assigned_variable", "loc": [161, 161], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:While_L160_C8", "vector": [14, 3, 0.5533, 0.0034, 3, 0.16, 0.0, 93, 3, 1, 0, 0, 885, 10, 1], "semantic": {"name": "kp", "arg_names": [], "import_names": [], "rhs_call_name": "cvWaitKey", "annotation": ""}, "snippet": " kp = cvWaitKey(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L162_C12", "label": "if", "type": "if", "loc": [162, 165], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:While_L160_C8", "vector": [4, 3, 0.5619, 0.0137, 3, 0.16, 0.25, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (type(kp) == str and kp == '\\x1b') or (type(kp) != str and kp & 255 == 27): # ESC then exit.\n t1 = time.time()\n ft_pub.publish() # send trigger to the ft logger.\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L163_C16", "label": "t1 = time()", "type": "assigned_variable", "loc": [163, 163], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L162_C12", "vector": [14, 4, 0.5601, 0.0034, 4, 0.72, 0.0, 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_99533:Expr_L164_C16", "label": "publish()", "type": "expression", "loc": [164, 164], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L162_C12", "vector": [8, 4, 0.5636, 0.0034, 4, 0.72, 1.0, 102, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " ft_pub.publish() # send trigger to the ft logger."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L166_C12", "label": "if", "type": "if", "loc": [166, 170], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:While_L160_C8", "vector": [4, 3, 0.5773, 0.0172, 3, 0.16, 0.5, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (type(kp) == str and kp == 'a') or (type(kp) != str and kp & 255 == 97): # a to start logging.\n log_images = True\n t0 = time.time()\n ft_pub.publish() # send trigger to the ft logger.\n print('started logging')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L167_C16", "label": "log_images =", "type": "assigned_variable", "loc": [167, 167], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L166_C12", "vector": [14, 4, 0.5739, 0.0034, 4, 0.4, 0.0, 177, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "log_images", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " log_images = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L168_C16", "label": "t0 = time()", "type": "assigned_variable", "loc": [168, 168], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L166_C12", "vector": [14, 4, 0.5773, 0.0034, 4, 0.4, 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_99533:Expr_L169_C16", "label": "publish()", "type": "expression", "loc": [169, 169], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L166_C12", "vector": [8, 4, 0.5808, 0.0034, 4, 0.4, 0.6667, 102, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " ft_pub.publish() # send trigger to the ft logger."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Expr_L170_C16", "label": "print()", "type": "expression", "loc": [170, 170], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L166_C12", "vector": [8, 4, 0.5842, 0.0034, 4, 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('started logging')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L172_C12", "label": "im = get_frame_debayered()", "type": "assigned_variable", "loc": [172, 172], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:While_L160_C8", "vector": [14, 3, 0.5911, 0.0034, 3, 0.16, 0.75, 940, 3, 0, 0, 0, 255, 10, 1], "semantic": {"name": "im", "arg_names": [], "import_names": [], "rhs_call_name": "get_frame_debayered", "annotation": ""}, "snippet": " im = cam.get_frame_debayered() # undistorting slows down frame rate"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L173_C12", "label": "if", "type": "if", "loc": [173, 175], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:While_L160_C8", "vector": [4, 3, 0.5979, 0.0103, 3, 0.16, 1.0, 0, 2, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if log_images:\n time_list.append(time.time())\n im_list.append(cvCloneImage(im))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Expr_L174_C16", "label": "append()", "type": "expression", "loc": [174, 174], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L173_C12", "vector": [8, 4, 0.5979, 0.0034, 4, 0.21, 0.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " time_list.append(time.time())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Expr_L175_C16", "label": "append()", "type": "expression", "loc": [175, 175], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L173_C12", "vector": [8, 4, 0.6014, 0.0034, 4, 0.21, 1.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " im_list.append(cvCloneImage(im))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Expr_L177_C8", "label": "print()", "type": "expression", "loc": [177, 177], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L136_C4", "vector": [8, 2, 0.6082, 0.0034, 2, 0.77, 0.5, 535, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('frame rate:', len(time_list)/(t1-t0))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Expr_L179_C8", "label": "print()", "type": "expression", "loc": [179, 179], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L136_C4", "vector": [8, 2, 0.6151, 0.0034, 2, 0.77, 0.5312, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('before saving the pkl')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L180_C8", "label": "d =", "type": "assigned_variable", "loc": [180, 180], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L136_C4", "vector": [14, 2, 0.6186, 0.0034, 2, 0.77, 0.5625, 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_99533:Assign_L182_C8", "label": "t_string = formatted_time()", "type": "assigned_variable", "loc": [182, 182], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L136_C4", "vector": [14, 2, 0.6254, 0.0034, 2, 0.77, 0.5938, 778, 3, 0, 0, 0, 353, 10, 1], "semantic": {"name": "t_string", "arg_names": [], "import_names": [], "rhs_call_name": "formatted_time", "annotation": ""}, "snippet": " t_string = ut.formatted_time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L183_C8", "label": "video_name =", "type": "assigned_variable", "loc": [183, 183], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L136_C4", "vector": [14, 2, 0.6289, 0.0034, 2, 0.77, 0.625, 707, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "video_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " video_name = 'mechanism_video_'+t_string+'.avi'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L184_C8", "label": "vwr = cvCreateVideoWriter()", "type": "assigned_variable", "loc": [184, 185], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L136_C4", "vector": [14, 2, 0.634, 0.0069, 2, 0.77, 0.6562, 675, 3, 5, 0, 0, 982, 10, 3], "semantic": {"name": "vwr", "arg_names": [], "import_names": [], "rhs_call_name": "cvCreateVideoWriter", "annotation": ""}, "snippet": " vwr = cvCreateVideoWriter(video_name, CV_FOURCC('I','4','2','0'),\n 30, cvGetSize(im_list[0]), True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L187_C8", "label": "t0 = time()", "type": "assigned_variable", "loc": [187, 187], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L136_C4", "vector": [14, 2, 0.6426, 0.0034, 2, 0.77, 0.6875, 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_99533:Assign_L188_C8", "label": "im_name_list =", "type": "assigned_variable", "loc": [188, 188], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L136_C4", "vector": [14, 2, 0.646, 0.0034, 2, 0.77, 0.7188, 356, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "im_name_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " im_name_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L189_C8", "label": "time_stamp = formatted_time()", "type": "assigned_variable", "loc": [189, 189], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L136_C4", "vector": [14, 2, 0.6495, 0.0034, 2, 0.77, 0.75, 156, 3, 0, 0, 0, 353, 10, 1], "semantic": {"name": "time_stamp", "arg_names": [], "import_names": [], "rhs_call_name": "formatted_time", "annotation": ""}, "snippet": " time_stamp = ut.formatted_time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:For_L190_C8", "label": "for im", "type": "for", "loc": [190, 192], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L136_C4", "vector": [6, 2, 0.6564, 0.0103, 2, 0.77, 0.7812, 940, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "im", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for im in im_list:\n cvWriteFrame(vwr, im)\n time.sleep(.01) #Important to keep force torque server"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Expr_L191_C12", "label": "cvWriteFrame()", "type": "expression", "loc": [191, 191], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:For_L190_C8", "vector": [8, 3, 0.6564, 0.0034, 3, 0.57, 0.0, 167, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "cvWriteFrame", "arg_names": [], "import_names": [], "rhs_call_name": "cvWriteFrame", "annotation": ""}, "snippet": " cvWriteFrame(vwr, im)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Expr_L192_C12", "label": "sleep()", "type": "expression", "loc": [192, 192], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:For_L190_C8", "vector": [8, 3, 0.6598, 0.0034, 3, 0.57, 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(.01) #Important to keep force torque server"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L194_C8", "label": "t1 = time()", "type": "assigned_variable", "loc": [194, 194], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L136_C4", "vector": [14, 2, 0.6667, 0.0034, 2, 0.77, 0.8125, 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_99533:Expr_L195_C8", "label": "print()", "type": "expression", "loc": [195, 195], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L136_C4", "vector": [8, 2, 0.6701, 0.0034, 2, 0.77, 0.8438, 535, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('disk writing rate:', len(time_list)/(t1-t0))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L197_C8", "label": "assign", "type": "assigned_variable", "loc": [197, 197], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L136_C4", "vector": [14, 2, 0.677, 0.0034, 2, 0.77, 0.875, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " d['time_list'] = time_list"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L198_C8", "label": "assign", "type": "assigned_variable", "loc": [198, 198], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L136_C4", "vector": [14, 2, 0.6804, 0.0034, 2, 0.77, 0.9062, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " d['video_name'] = video_name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L200_C8", "label": "fname =", "type": "assigned_variable", "loc": [200, 200], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L136_C4", "vector": [14, 2, 0.6873, 0.0034, 2, 0.77, 0.9375, 190, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "fname", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " fname = 'handheld_pull_log_' + t_string + '.pkl'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Expr_L201_C8", "label": "save_pickle()", "type": "expression", "loc": [201, 201], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L136_C4", "vector": [8, 2, 0.6907, 0.0034, 2, 0.77, 0.9688, 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(d, fname)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Expr_L203_C8", "label": "print()", "type": "expression", "loc": [203, 203], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L136_C4", "vector": [8, 2, 0.6976, 0.0034, 2, 0.77, 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 saving the pkl')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L205_C4", "label": "if", "type": "if", "loc": [205, 262], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L27_C0", "vector": [4, 1, 0.8024, 0.1993, 1, 0.69, 0.9286, 0, 7, 0, 0, 0, 0, 0, 21], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if opt.avi_to_pngs:\n from opencv.cv import *\n from opencv.highgui import *\n import util\n\n import camera_config as cc\n cp = cc.camera_parameters[camera_name]\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:ImportFrom_L206_C8", "label": "from opencv.cv import *", "type": "import", "loc": [206, 206], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L205_C4", "vector": [1, 2, 0.7079, 0.0034, 2, 0.77, 0.0, 718, 0, 1, 0, 0, 718, 0, 0], "semantic": {"name": "opencv.cv", "arg_names": [], "import_names": ["*"], "rhs_call_name": "", "annotation": ""}, "snippet": " from opencv.cv import *"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:ImportFrom_L207_C8", "label": "from opencv.highgui import *", "type": "import", "loc": [207, 207], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L205_C4", "vector": [1, 2, 0.7113, 0.0034, 2, 0.77, 0.05, 453, 0, 1, 0, 0, 453, 0, 0], "semantic": {"name": "opencv.highgui", "arg_names": [], "import_names": ["*"], "rhs_call_name": "", "annotation": ""}, "snippet": " from opencv.highgui import *"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Import_L208_C8", "label": "util import util", "type": "import", "loc": [208, 208], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L205_C4", "vector": [1, 2, 0.7148, 0.0034, 2, 0.77, 0.1, 811, 0, 1, 0, 0, 811, 0, 0], "semantic": {"name": "util", "arg_names": [], "import_names": ["util"], "rhs_call_name": "", "annotation": ""}, "snippet": " import util"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Import_L210_C8", "label": "camera_config import cc", "type": "import", "loc": [210, 210], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L205_C4", "vector": [1, 2, 0.7216, 0.0034, 2, 0.77, 0.15, 94, 0, 1, 0, 0, 94, 0, 0], "semantic": {"name": "camera_config", "arg_names": [], "import_names": ["cc"], "rhs_call_name": "", "annotation": ""}, "snippet": " import camera_config as cc"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L211_C8", "label": "cp =", "type": "assigned_variable", "loc": [211, 211], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L205_C4", "vector": [14, 2, 0.7251, 0.0034, 2, 0.77, 0.2, 70, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "cp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cp = cc.camera_parameters[camera_name]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L213_C8", "label": "size =", "type": "assigned_variable", "loc": [213, 213], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L205_C4", "vector": [14, 2, 0.732, 0.0034, 2, 0.77, 0.25, 714, 0, 0, 0, 0, 0, 8, 2], "semantic": {"name": "size", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " size = (int(cp['calibration_image_width']), int(cp['calibration_image_height']))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L214_C8", "label": "color =", "type": "assigned_variable", "loc": [214, 214], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L205_C4", "vector": [14, 2, 0.7354, 0.0034, 2, 0.77, 0.3, 776, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "color", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " color = cp['color']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L215_C8", "label": "intrinsic_cvmat = cvCreateMat()", "type": "assigned_variable", "loc": [215, 215], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L205_C4", "vector": [14, 2, 0.7388, 0.0034, 2, 0.77, 0.35, 670, 3, 3, 0, 0, 223, 10, 1], "semantic": {"name": "intrinsic_cvmat", "arg_names": [], "import_names": [], "rhs_call_name": "cvCreateMat", "annotation": ""}, "snippet": " intrinsic_cvmat = cvCreateMat(3,3,cv.CV_32FC1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L216_C8", "label": "distortion_cvmat = cvCreateMat()", "type": "assigned_variable", "loc": [216, 216], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L205_C4", "vector": [14, 2, 0.7423, 0.0034, 2, 0.77, 0.4, 961, 3, 3, 0, 0, 223, 10, 1], "semantic": {"name": "distortion_cvmat", "arg_names": [], "import_names": [], "rhs_call_name": "cvCreateMat", "annotation": ""}, "snippet": " distortion_cvmat = cvCreateMat(1,4,cv.CV_32FC1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L218_C8", "label": "imat_np = array()", "type": "assigned_variable", "loc": [218, 222], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L205_C4", "vector": [14, 2, 0.756, 0.0172, 2, 0.77, 0.45, 29, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "imat_np", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " imat_np = np.array([[cp['focal_length_x_in_pixels'],0,\n cp['optical_center_x_in_pixels']],\n [0,cp['focal_length_y_in_pixels'],\n cp['optical_center_y_in_pixels']],\n [0,0,1]])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L223_C8", "label": "intrinsic_cvmat = numpymat2cvmat()", "type": "assigned_variable", "loc": [223, 223], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L205_C4", "vector": [14, 2, 0.7663, 0.0034, 2, 0.77, 0.5, 670, 3, 1, 0, 0, 275, 10, 1], "semantic": {"name": "intrinsic_cvmat", "arg_names": [], "import_names": [], "rhs_call_name": "numpymat2cvmat", "annotation": ""}, "snippet": " intrinsic_cvmat = util.numpymat2cvmat(imat_np)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L225_C8", "label": "dmat_np = array()", "type": "assigned_variable", "loc": [225, 228], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L205_C4", "vector": [14, 2, 0.7784, 0.0137, 2, 0.77, 0.55, 87, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "dmat_np", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " dmat_np = np.array([[cp['lens_distortion_radial_1'],\n cp['lens_distortion_radial_2'],\n cp['lens_distortion_tangential_1'],\n cp['lens_distortion_tangential_2']]])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L230_C8", "label": "distortion_cvmat = numpymat2cvmat()", "type": "assigned_variable", "loc": [230, 230], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L205_C4", "vector": [14, 2, 0.7904, 0.0034, 2, 0.77, 0.6, 961, 3, 1, 0, 0, 275, 10, 1], "semantic": {"name": "distortion_cvmat", "arg_names": [], "import_names": [], "rhs_call_name": "numpymat2cvmat", "annotation": ""}, "snippet": " distortion_cvmat = util.numpymat2cvmat(dmat_np)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L231_C8", "label": "undistort_mapx = cvCreateImage()", "type": "assigned_variable", "loc": [231, 231], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L205_C4", "vector": [14, 2, 0.7938, 0.0034, 2, 0.77, 0.65, 967, 3, 3, 0, 0, 953, 10, 1], "semantic": {"name": "undistort_mapx", "arg_names": [], "import_names": [], "rhs_call_name": "cvCreateImage", "annotation": ""}, "snippet": " undistort_mapx = cvCreateImage(size, IPL_DEPTH_32F, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L232_C8", "label": "undistort_mapy = cvCreateImage()", "type": "assigned_variable", "loc": [232, 232], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L205_C4", "vector": [14, 2, 0.7973, 0.0034, 2, 0.77, 0.7, 425, 3, 3, 0, 0, 953, 10, 1], "semantic": {"name": "undistort_mapy", "arg_names": [], "import_names": [], "rhs_call_name": "cvCreateImage", "annotation": ""}, "snippet": " undistort_mapy = cvCreateImage(size, IPL_DEPTH_32F, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Expr_L233_C8", "label": "cvInitUndistortMap()", "type": "expression", "loc": [233, 234], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L205_C4", "vector": [8, 2, 0.8024, 0.0069, 2, 0.77, 0.75, 592, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "cvInitUndistortMap", "arg_names": [], "import_names": [], "rhs_call_name": "cvInitUndistortMap", "annotation": ""}, "snippet": " cvInitUndistortMap(intrinsic_cvmat, distortion_cvmat,\n undistort_mapx, undistort_mapy)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L236_C8", "label": "if", "type": "if", "loc": [236, 239], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L205_C4", "vector": [4, 2, 0.8162, 0.0137, 2, 0.77, 0.8, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if color == True:\n undistort_image = cvCreateImage(size, IPL_DEPTH_8U, 3)\n else:\n undistort_image = cvCreateImage(size, IPL_DEPTH_8U, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L237_C12", "label": "undistort_image = cvCreateImage()", "type": "assigned_variable", "loc": [237, 237], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L236_C8", "vector": [14, 3, 0.8144, 0.0034, 3, 0.03, 0.0, 406, 3, 3, 0, 0, 953, 10, 1], "semantic": {"name": "undistort_image", "arg_names": [], "import_names": [], "rhs_call_name": "cvCreateImage", "annotation": ""}, "snippet": " undistort_image = cvCreateImage(size, IPL_DEPTH_8U, 3)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L239_C12", "label": "undistort_image = cvCreateImage()", "type": "assigned_variable", "loc": [239, 239], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L236_C8", "vector": [14, 3, 0.8213, 0.0034, 3, 0.03, 1.0, 406, 3, 3, 0, 0, 953, 10, 1], "semantic": {"name": "undistort_image", "arg_names": [], "import_names": [], "rhs_call_name": "cvCreateImage", "annotation": ""}, "snippet": " undistort_image = cvCreateImage(size, IPL_DEPTH_8U, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L246_C8", "label": "video_name =", "type": "assigned_variable", "loc": [246, 246], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L205_C4", "vector": [14, 2, 0.8454, 0.0034, 2, 0.77, 0.85, 707, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "video_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " video_name = glob.glob(opt.dir + 'mechanism_video*.avi')[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L247_C8", "label": "cap = cvCreateFileCapture()", "type": "assigned_variable", "loc": [247, 247], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L205_C4", "vector": [14, 2, 0.8488, 0.0034, 2, 0.77, 0.9, 786, 3, 1, 0, 0, 642, 10, 1], "semantic": {"name": "cap", "arg_names": [], "import_names": [], "rhs_call_name": "cvCreateFileCapture", "annotation": ""}, "snippet": " cap = cvCreateFileCapture(video_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L250_C8", "label": "i =", "type": "assigned_variable", "loc": [250, 250], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L205_C4", "vector": [14, 2, 0.8591, 0.0034, 2, 0.77, 0.95, 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_99533:While_L251_C8", "label": "while", "type": "while", "loc": [251, 262], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L205_C4", "vector": [5, 2, 0.8814, 0.0412, 2, 0.77, 1.0, 0, 1, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while True:\n cvim = cvQueryFrame(cap)\n if cvim == None:\n break\n cvFlip(cvim, cvim)\n # undistort the image\n cvRemap(cvim, undistort_image, undistort_mapx, undistort_mapy,\n CV_INTER_LINEAR, cvScalarAll(0)) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L252_C12", "label": "cvim = cvQueryFrame()", "type": "assigned_variable", "loc": [252, 252], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:While_L251_C8", "vector": [14, 3, 0.866, 0.0034, 3, 0.77, 0.0, 758, 3, 1, 0, 0, 793, 10, 1], "semantic": {"name": "cvim", "arg_names": [], "import_names": [], "rhs_call_name": "cvQueryFrame", "annotation": ""}, "snippet": " cvim = cvQueryFrame(cap)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L253_C12", "label": "if", "type": "if", "loc": [253, 254], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:While_L251_C8", "vector": [4, 3, 0.8711, 0.0069, 3, 0.77, 0.1667, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if cvim == None:\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Expr_L255_C12", "label": "cvFlip()", "type": "expression", "loc": [255, 255], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:While_L251_C8", "vector": [8, 3, 0.8763, 0.0034, 3, 0.77, 0.3333, 853, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "cvFlip", "arg_names": [], "import_names": [], "rhs_call_name": "cvFlip", "annotation": ""}, "snippet": " cvFlip(cvim, cvim)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Expr_L257_C12", "label": "cvRemap()", "type": "expression", "loc": [257, 258], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:While_L251_C8", "vector": [8, 3, 0.8849, 0.0069, 3, 0.77, 0.5, 541, 3, 6, 0, 0, 0, 0, 2], "semantic": {"name": "cvRemap", "arg_names": [], "import_names": [], "rhs_call_name": "cvRemap", "annotation": ""}, "snippet": " cvRemap(cvim, undistort_image, undistort_mapx, undistort_mapy,\n CV_INTER_LINEAR, cvScalarAll(0)) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L259_C12", "label": "nm =", "type": "assigned_variable", "loc": [259, 259], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:While_L251_C8", "vector": [14, 3, 0.89, 0.0034, 3, 0.77, 0.6667, 931, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "nm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " nm = opt.dir+'/%05d.png'%i"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Expr_L260_C12", "label": "print()", "type": "expression", "loc": [260, 260], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:While_L251_C8", "vector": [8, 3, 0.8935, 0.0034, 3, 0.77, 0.8333, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Saving', nm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Expr_L261_C12", "label": "cvSaveImage()", "type": "expression", "loc": [261, 261], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:While_L251_C8", "vector": [8, 3, 0.8969, 0.0034, 3, 0.77, 1.0, 100, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "cvSaveImage", "arg_names": [], "import_names": [], "rhs_call_name": "cvSaveImage", "annotation": ""}, "snippet": " cvSaveImage(nm, undistort_image)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L264_C4", "label": "if", "type": "if", "loc": [264, 287], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L27_C0", "vector": [4, 1, 0.9467, 0.0825, 1, 0.69, 1.0, 0, 7, 0, 0, 0, 0, 0, 12], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if opt.bad:\n import cv\n\n l = ut.load_pickle(opt.dir+'/checker_fail_list.pkl')\n display = False\n\n if display:\n wnd = 'Checker Fail Images'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Import_L265_C8", "label": "cv import cv", "type": "import", "loc": [265, 265], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L264_C4", "vector": [1, 2, 0.9107, 0.0034, 2, 0.47, 0.0, 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_99533:Assign_L267_C8", "label": "l = load_pickle()", "type": "assigned_variable", "loc": [267, 267], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L264_C4", "vector": [14, 2, 0.9175, 0.0034, 2, 0.47, 0.25, 810, 3, 1, 0, 0, 65, 10, 1], "semantic": {"name": "l", "arg_names": [], "import_names": [], "rhs_call_name": "load_pickle", "annotation": ""}, "snippet": " l = ut.load_pickle(opt.dir+'/checker_fail_list.pkl')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L268_C8", "label": "display =", "type": "assigned_variable", "loc": [268, 268], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L264_C4", "vector": [14, 2, 0.921, 0.0034, 2, 0.47, 0.5, 669, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "display", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " display = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L270_C8", "label": "if", "type": "if", "loc": [270, 275], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L264_C4", "vector": [4, 2, 0.9364, 0.0206, 2, 0.47, 0.75, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if display:\n wnd = 'Checker Fail Images'\n cv.NamedWindow(wnd, cv.CV_WINDOW_AUTOSIZE)\n else:\n save_dir = opt.dir+'/checker_fail/'\n os.system('mkdir %s'%save_dir)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L271_C12", "label": "wnd =", "type": "assigned_variable", "loc": [271, 271], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L270_C8", "vector": [14, 3, 0.9313, 0.0034, 3, 0.17, 0.0, 890, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "wnd", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " wnd = 'Checker Fail Images'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Expr_L272_C12", "label": "NamedWindow()", "type": "expression", "loc": [272, 272], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L270_C8", "vector": [8, 3, 0.9347, 0.0034, 3, 0.17, 0.3333, 60, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "NamedWindow", "arg_names": [], "import_names": [], "rhs_call_name": "NamedWindow", "annotation": ""}, "snippet": " cv.NamedWindow(wnd, cv.CV_WINDOW_AUTOSIZE)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L274_C12", "label": "save_dir =", "type": "assigned_variable", "loc": [274, 274], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L270_C8", "vector": [14, 3, 0.9416, 0.0034, 3, 0.17, 0.6667, 201, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "save_dir", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " save_dir = opt.dir+'/checker_fail/'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Expr_L275_C12", "label": "system()", "type": "expression", "loc": [275, 275], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L270_C8", "vector": [8, 3, 0.945, 0.0034, 3, 0.17, 1.0, 856, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "system", "arg_names": [], "import_names": [], "rhs_call_name": "system", "annotation": ""}, "snippet": " os.system('mkdir %s'%save_dir)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:For_L276_C8", "label": "for nm", "type": "for", "loc": [276, 287], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L264_C4", "vector": [6, 2, 0.9674, 0.0412, 2, 0.47, 1.0, 931, 2, 0, 0, 0, 0, 0, 9], "semantic": {"name": "nm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for nm in l:\n name = opt.dir+'/'+nm\n cv_im = cv.LoadImage(name)\n if display:\n cv.ShowImage(wnd, cv_im)\n cv.WaitKey(0)\n else:\n save_dir = os.path.normpath(save_dir)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L277_C12", "label": "name =", "type": "assigned_variable", "loc": [277, 277], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:For_L276_C8", "vector": [14, 3, 0.9519, 0.0034, 3, 0.83, 0.0, 57, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " name = opt.dir+'/'+nm"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L278_C12", "label": "cv_im = LoadImage()", "type": "assigned_variable", "loc": [278, 278], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:For_L276_C8", "vector": [14, 3, 0.9553, 0.0034, 3, 0.83, 0.5, 782, 3, 1, 0, 0, 512, 10, 1], "semantic": {"name": "cv_im", "arg_names": [], "import_names": [], "rhs_call_name": "LoadImage", "annotation": ""}, "snippet": " cv_im = cv.LoadImage(name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L279_C12", "label": "if", "type": "if", "loc": [279, 287], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:For_L276_C8", "vector": [4, 3, 0.9725, 0.0309, 3, 0.83, 1.0, 0, 2, 0, 0, 0, 0, 0, 8], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if display:\n cv.ShowImage(wnd, cv_im)\n cv.WaitKey(0)\n else:\n save_dir = os.path.normpath(save_dir)\n# print 'save_dir:', save_dir\n file_name = '_'.join(save_dir.split('/')) + '_%s'%os.path.normpath(nm)\n print('file_name:', file_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Expr_L280_C16", "label": "ShowImage()", "type": "expression", "loc": [280, 280], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L279_C12", "vector": [8, 4, 0.9622, 0.0034, 4, 0.17, 0.0, 896, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "ShowImage", "arg_names": [], "import_names": [], "rhs_call_name": "ShowImage", "annotation": ""}, "snippet": " cv.ShowImage(wnd, cv_im)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Expr_L281_C16", "label": "WaitKey()", "type": "expression", "loc": [281, 281], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L279_C12", "vector": [8, 4, 0.9656, 0.0034, 4, 0.17, 0.2, 885, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "WaitKey", "arg_names": [], "import_names": [], "rhs_call_name": "WaitKey", "annotation": ""}, "snippet": " cv.WaitKey(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L283_C16", "label": "save_dir = normpath()", "type": "assigned_variable", "loc": [283, 283], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L279_C12", "vector": [14, 4, 0.9725, 0.0034, 4, 0.17, 0.4, 201, 3, 1, 0, 0, 638, 10, 1], "semantic": {"name": "save_dir", "arg_names": [], "import_names": [], "rhs_call_name": "normpath", "annotation": ""}, "snippet": " save_dir = os.path.normpath(save_dir)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L285_C16", "label": "file_name =", "type": "assigned_variable", "loc": [285, 285], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L279_C12", "vector": [14, 4, 0.9794, 0.0034, 4, 0.17, 0.6, 991, 4, 0, 0, 0, 0, 0, 3], "semantic": {"name": "file_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " file_name = '_'.join(save_dir.split('/')) + '_%s'%os.path.normpath(nm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Expr_L286_C16", "label": "print()", "type": "expression", "loc": [286, 286], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L279_C12", "vector": [8, 4, 0.9828, 0.0034, 4, 0.17, 0.8, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('file_name:', file_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99533:Expr_L287_C16", "label": "SaveImage()", "type": "expression", "loc": [287, 287], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L279_C12", "vector": [8, 4, 0.9863, 0.0034, 4, 0.17, 1.0, 91, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "SaveImage", "arg_names": [], "import_names": [], "rhs_call_name": "SaveImage", "annotation": ""}, "snippet": " cv.SaveImage(save_dir + '/' + file_name, cv_im)"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99533:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L20_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L22_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Import_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Expr_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Expr_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Expr_L33_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Expr_L35_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Expr_L37_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Expr_L39_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Expr_L41_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L44_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L46_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L48_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Import_L49_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:ImportFrom_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:ImportFrom_L51_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:ImportFrom_L52_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:ImportFrom_L53_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:ImportFrom_L54_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:ImportFrom_L55_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Expr_L57_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L59_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L59_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L60_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L59_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L61_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L59_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L62_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L62_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L63_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L62_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Expr_L65_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L62_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L66_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L62_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L68_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L62_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L69_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L62_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L72_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L62_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L73_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L62_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L74_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L62_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Expr_L75_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L62_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L76_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Import_L79_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L80_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L81_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L87_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L91_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L92_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L93_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L94_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Expr_L96_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L97_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L99_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L100_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Expr_L101_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L104_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L105_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:For_L106_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:For_L106_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L107_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:For_L106_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L108_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:For_L106_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L110_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:For_L106_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L111_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:For_L106_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Expr_L113_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:For_L106_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Expr_L114_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:For_L106_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L116_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:For_L106_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:While_L117_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:While_L117_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Expr_L118_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:While_L117_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L119_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:For_L106_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L122_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L122_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Expr_L123_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:For_L106_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Expr_L125_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:For_L106_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L126_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:For_L106_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L127_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:For_L106_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L129_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Expr_L132_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Expr_L133_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Expr_L134_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L136_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L136_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:ImportFrom_L137_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L136_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:ImportFrom_L138_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L136_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:ImportFrom_L140_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L136_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Expr_L141_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L136_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L142_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L136_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L145_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L136_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Expr_L146_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L136_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Expr_L147_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L136_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:For_L148_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:For_L148_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L149_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L136_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L151_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L136_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L152_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L136_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Expr_L154_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L136_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Expr_L156_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L136_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Expr_L157_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L136_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L158_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L136_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:While_L160_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:While_L160_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L161_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:While_L160_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L162_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L162_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L163_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L162_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Expr_L164_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:While_L160_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L166_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L166_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L167_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L166_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L168_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L166_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Expr_L169_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L166_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Expr_L170_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:While_L160_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L172_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:While_L160_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L173_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L173_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Expr_L174_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L173_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Expr_L175_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L136_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Expr_L177_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L136_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Expr_L179_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L136_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L180_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L136_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L182_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L136_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L183_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L136_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L184_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L136_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L187_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L136_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L188_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L136_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L189_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L136_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:For_L190_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:For_L190_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Expr_L191_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:For_L190_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Expr_L192_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L136_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L194_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L136_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Expr_L195_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L136_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L197_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L136_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L198_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L136_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L200_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L136_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Expr_L201_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L136_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Expr_L203_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L205_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L205_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:ImportFrom_L206_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L205_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:ImportFrom_L207_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L205_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Import_L208_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L205_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Import_L210_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L205_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L211_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L205_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L213_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L205_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L214_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L205_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L215_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L205_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L216_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L205_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L218_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L205_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L223_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L205_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L225_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L205_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L230_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L205_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L231_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L205_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L232_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L205_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Expr_L233_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L205_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L236_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L236_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L237_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L236_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L239_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L205_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L246_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L205_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L247_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L205_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L250_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L205_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:While_L251_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:While_L251_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L252_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:While_L251_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L253_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:While_L251_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Expr_L255_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:While_L251_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Expr_L257_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:While_L251_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L259_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:While_L251_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Expr_L260_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:While_L251_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Expr_L261_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L264_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L264_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Import_L265_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L264_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L267_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L264_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L268_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L264_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L270_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L270_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L271_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L270_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Expr_L272_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L270_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L274_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L270_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Expr_L275_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L264_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:For_L276_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:For_L276_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L277_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:For_L276_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L278_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:For_L276_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L279_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L279_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Expr_L280_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L279_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Expr_L281_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L279_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L283_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L279_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Assign_L285_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L279_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Expr_L286_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99533:If_L279_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99533:Expr_L287_C16"}]
# # Assumes that all the logs are in one folder with the file names # giving the different mechanisms, trial number, open or close etc. # import commands import os import os.path as pt import glob import math, numpy as np import scipy.signal as ss import scipy.cluster as clus import roslib; roslib.load_manifest('modeling_forces') import modeling_forces.mf_common as mfc import matplotlib_util.util as mpu import hrl_lib.util as ut import scipy.stats as st import pylab as pb #import mdp class pca_plot_gui(): def __init__(self, legend_list, mech_vec_list, proj_mat, dir_list, mn): self.legend_list = legend_list self.mech_vec_list = mech_vec_list self.proj_mat = proj_mat self.dir_list = dir_list self.mn = mn def pick_cb(self, event): if 'shift' != event.key: return selected = np.matrix([event.xdata, event.ydata]).T # print 'selected', selected.A1 min_list = [] for i, v in enumerate(self.mech_vec_list): p = self.proj_mat[:, 0:2].T * (v-self.mn) min_list.append(np.min(ut.norm(p-selected))) mech_idx = np.argmin(min_list) print 'Selected mechanism was:', self.legend_list[mech_idx] plot_tangential_force(self.dir_list[mech_idx], all_trials = True, open = True) # mpu.figure() # n_dim = 7 # reconstruction = self.proj_mat[:, 0:n_dim] * (self.proj_mat[:, 0:n_dim].T * (self.mech_vec_list[mech_idx] - self.mn)) + self.mn # di = extract_pkls(self.dir_list[mech_idx]) # nm = get_mech_name(self.dir_list[mech_idx]) # for i in range(reconstruction.shape[1]): # mpu.plot_yx(reconstruction[:,i].A1, color=mpu.random_color(), # plot_title=nm+': %d components'%n_dim) # mpu.legend() # mpu.figure() # plot_velocity(self.dir_list[mech_idx]) mpu.show() ## # list all the mechanisms in dir_list and allow user to type the # numbers of the desired mechanisms. # @return list of paths to the selected mechanisms. def input_mechanism_list(dir_list): mech_list = [] for i, m in enumerate(dir_list): t = m.split('/') mech = t[-1] if mech == '': mech = t[-2] mech_list.append(mech) print '%d. %s'%(i, mech) print '' print 'Enter mechanism numbers that you want to plot' s = raw_input() num_list = map(int, s.split(' ')) chosen_list = [] for n in num_list: chosen_list.append(dir_list[n]) return chosen_list ## # remove pkls in which the forces are unreasonable large or small def clean_data_forces(dir): l = commands.getoutput('find %s/ -name "*mechanism_trajectories*.pkl"'%dir).splitlines() for pkl in l: cmd1 = 'rm -f %s'%pkl cmd2 = 'svn rm %s'%pkl d = ut.load_pickle(pkl) radial_mech = d['force_rad_list'] tangential_mech = d['force_tan_list'] if len(radial_mech) == 0 or len(tangential_mech) == 0: os.system(cmd1) os.system(cmd2) continue max_force = max(np.max(np.abs(radial_mech)), np.max(np.abs(tangential_mech))) if max_force > 120.: os.system(cmd1) os.system(cmd2) n_points = len(radial_mech) if n_points < 50: os.system(cmd1) os.system(cmd2) if d.has_key('radius'): r = d['radius'] if r != -1: ang = np.degrees(d['mechanism_x']) if np.max(ang) < 20.: os.system(cmd1) os.system(cmd2) if d.has_key('time_list'): t_l = d['time_list'] time_diff_l = np.array(t_l[1:]) - np.array(t_l[0:-1]) if len(time_diff_l) == 0: os.system(cmd1) os.system(cmd2) continue max_time_diff = np.max(time_diff_l) if max_time_diff > 0.3: print 'max time difference between consec readings:', max_time_diff os.system(cmd1) os.system(cmd2) ## # @param dir_name - directory containing the pkls. # @param all_trials - plot force for all the trials. # @param open - Boolean (open or close trial) # @param filter_speed - mech vel above this will be ignored. for # ROTARY joints only, radians/sec def plot_tangential_force(dir_name, all_trials, open = True, filter_speed=math.radians(100)): mpu.set_figure_size(4.,4.) fig1 = mpu.figure() # fig2 = mpu.figure() # fig3 = mpu.figure() if open: trial = 'open' else: trial = 'close' d = extract_pkls(dir_name, open) mech_name = get_mech_name(dir_name) traj_vel_list = [] for i,ftan_l in enumerate(d['ftan_l_l']): mech_x = d['mechx_l_l'][i] if d['typ'] == 'rotary': max_angle = math.radians(30) type = 'rotary' else: max_angle = 0.3 type = 'prismatic' traj_vel = compute_average_velocity(mech_x, d['time_l_l'][i], max_angle, type) print 'traj_vel:', traj_vel if traj_vel == -1: continue traj_vel_list.append(traj_vel) #vel_color_list = ['r', 'g', 'b', 'y', 'k'] #vel_color_list = ['#000000', '#A0A0A0', '#D0D0D0', '#E0E0E0', '#F0F0F0'] #vel_color_list = ['#000000', '#00A0A0', '#00D0D0', '#00E0E0', '#00F0F0'] #vel_color_list = [ '#%02X%02X%02X'%(r,g,b) for (r,g,b) in [(95, 132, 53), (81, 193, 79), (28, 240, 100), (196, 251, 100)]] vel_color_list = [ '#%02X%02X%02X'%(r,g,b) for (r,g,b) in [(95, 132, 53), (28, 240, 100), (196, 251, 100)]] traj_vel_sorted = np.sort(traj_vel_list).tolist() sorted_color_list = [] sorted_scatter_list = [] i = 0 v_prev = traj_vel_sorted[0] legend_list = [] if d['typ'] == 'rotary': l = '%.1f'%math.degrees(v_prev) thresh = math.radians(5) else: l = '%.02f'%(v_prev) thresh = 0.05 t_v = v_prev v_threshold = 1000. for j,v in enumerate(traj_vel_sorted): if (v - v_prev) > thresh: if d['typ'] == 'rotary': l = l + ' to %.1f deg/sec'%math.degrees(t_v) else: l = l + ' to %.1f m/s'%t_v legend_list.append(l) if d['typ'] == 'rotary': l = '%.1f'%math.degrees(v) else: l = '%.02f'%(v) i += 1 if i >= 2: v_threshold = min(v_threshold, v) if d['typ'] == 'rotary': print 'v_threshold:', math.degrees(v_threshold) else: print 'v_threshold:', v_threshold if i == len(vel_color_list): i -= 1 v_prev = v else: legend_list.append('__nolegend__') t_v = v sorted_color_list.append(vel_color_list[i]) if d['typ'] == 'rotary': l = l + ' to %.1f deg/sec'%math.degrees(t_v) else: l = l + ' to %.1f m/s'%t_v legend_list.append(l) legend_list = legend_list[1:] giant_list = [] mpu.set_figure_size(3.,3.) for i,ftan_l in enumerate(d['ftan_l_l']): mech_x = d['mechx_l_l'][i] trial_num = str(d['trial_num_l'][i]) color = None scatter_size = None traj_vel = compute_average_velocity(mech_x, d['time_l_l'][i], max_angle, d['typ']) if traj_vel == -1: continue if traj_vel >= v_threshold: continue color = sorted_color_list[traj_vel_sorted.index(traj_vel)] legend = legend_list[traj_vel_sorted.index(traj_vel)] if d['typ'] == 'rotary': #traj_vel = compute_trajectory_velocity(mech_x,d['time_l_l'][i],1) #if traj_vel >= filter_speed: # continue mech_x_degrees = np.degrees(mech_x) xlabel = 'angle (degrees)' ylabel = '$f_{tan}$ (N)' else: mech_x_degrees = mech_x xlabel = 'distance (meters)' ylabel = 'Opening force (N)' # n_skip = 65 # print '>>>>>>>>>>>>> WARNING BEGIN <<<<<<<<<<<<<<<<<' # print 'not plotting the last ', n_skip, 'data points for drawers' # print '>>>>>>>>>>>>> WARNING END <<<<<<<<<<<<<<<<<' n_skip = 1 mech_x_degrees = mech_x_degrees[:-n_skip] ftan_l = ftan_l[:-n_skip] mpu.figure(fig1.number) #color, scatter_size = None, None scatter_size = None if color == None: color = mpu.random_color() if scatter_size == None: scatter_size = 1 giant_list.append((traj_vel, ftan_l, mech_x_degrees, color, legend, xlabel, ylabel, trial_num)) giant_list_sorted = reversed(sorted(giant_list)) for traj_vel, ftan_l, mech_x_degrees, color, legend, xlabel, ylabel, trial_num in giant_list_sorted: mpu.plot_yx(ftan_l, mech_x_degrees, axis=None, plot_title= '\huge{%s: %s}'%(mech_name, trial), xlabel=xlabel, ylabel = ylabel, color = color, #scatter_size = 5, linewidth = 1, label=trial_num) scatter_size = scatter_size, linewidth = 1, label=legend) print '>>>>>>>>>> number of trials <<<<<<<<<<<', len(giant_list) mpu.figure(fig1.number) # mpu.legend(display_mode='less_space') def radial_tangential_ratio(dir_name): d = extract_pkls(dir_name, open=True) nm = get_mech_name(dir_name) frad_ll = d['frad_l_l'] mechx_ll = d['mechx_l_l'] mpu.figure() for i,ftan_l in enumerate(d['ftan_l_l']): frad_l = frad_ll[i] rad_arr = np.array(np.abs(frad_l)) tan_arr = np.array(np.abs(ftan_l)) idxs = np.where(np.logical_and(rad_arr > 0.1, tan_arr > 0.1)) ratio = np.divide(rad_arr[idxs], tan_arr[idxs]) mpu.plot_yx(ratio, np.degrees(np.array(mechx_ll[i])[idxs]), color = mpu.random_color(), plot_title=nm, ylabel='radial/tangential', xlabel='Angle (degrees)') ## # get mechanism name from the directory name. def get_mech_name(d): t = d.split('/') mech_name = t[-1] if mech_name == '': mech_name = t[-2] return mech_name ## # get all the information from all the pkls in one directory. # ASSUMES - all pkls are of the same mechanism (same radius, type ...) # @param open - extract info for opening trials def extract_pkls(d, open=True, quiet = False, ignore_moment_list=False): if open: trial = 'open' else: trial = 'close' l = glob.glob(d+'/*'+trial+'*mechanism_trajectories*.pkl') l.sort() ftan_l_l, frad_l_l, mechx_l_l = [], [], [] time_l_l, trial_num_l = [], [] moment_l_l = [] typ, rad = None, None for p in l: d = ut.load_pickle(p) if d.has_key('radius'): rad = d['radius'] else: rad = -1 # if quiet == False: # print p, 'does not have radius' # return None if rad != -1: #moment_l_l.append((np.array(ftan_l_l[-1]) * rad).tolist()) if d.has_key('moment_list'): moment_l_l.append(d['moment_list']) else: # if quiet == False: # print p, 'does not have moment_list' # continue moment_l_l.append([0 for i in range(len(d['force_rad_list']))]) trial_num = p.split('_')[-5] trial_num_l.append(int(trial_num)) frad_l_l.append(d['force_rad_list']) ftan_l_l.append(d['force_tan_list']) if d.has_key('mech_type'): typ = d['mech_type'] else: if quiet == False: print p, 'does not have mech_typ' return None mechx_l_l.append(d['mechanism_x']) if d.has_key('time_list'): t_l = d['time_list'] else: t_l = [0.03*i for i in range(len(ftan_l_l))] #if quiet == False: # print p, 'does not have time_list' #return None time_l_l.append((np.array(t_l)-t_l[0]).tolist()) r = {} r['ftan_l_l'] = ftan_l_l r['frad_l_l'] = frad_l_l r['mechx_l_l'] = mechx_l_l r['typ'] = typ r['rad'] = rad r['time_l_l'] = time_l_l r['trial_num_l'] = trial_num_l r['moment_l_l'] = moment_l_l return r ## # take max force magnitude within a bin size # @param bin_size - depends on the units of poses_list # @param fn - function to apply to the binned force values (e.g. max, min) # @param ignore_empty - if True then empty bins are ignored. Else the # value of an empty bin is set to None. # @param max_pose - maximum value of pose to use if None then derived # from poses_list # @param empty_value - what to fill in an empty bin (None, np.nan etc.) def bin(poses_list, ftan_list, bin_size, fn, ignore_empty, max_pose=None, empty_value = None): if max_pose == None: max_dist = max(poses_list) else: max_dist = max_pose poses_array = np.array(poses_list) binned_poses_array = np.arange(0., max_dist, bin_size) binned_force_list = [] binned_poses_list = [] ftan_array = np.array(ftan_list) for i in range(binned_poses_array.shape[0]-1): idxs = np.where(np.logical_and(poses_array>=binned_poses_array[i], poses_array<binned_poses_array[i+1])) if idxs[0].shape[0] != 0: binned_poses_list.append(binned_poses_array[i]) binned_force_list.append(fn(ftan_array[idxs])) elif ignore_empty == False: binned_poses_list.append(binned_poses_array[i]) binned_force_list.append(empty_value) return binned_poses_list, binned_force_list ## # makes a scatter plot with the radius along the x axis and the max # force along the y-axis. different color for each mechanism # @param dir_name - directory containing the pkls. def max_force_radius_scatter(dir_name_list, open=True): mpu.figure() if open: trial = 'Opening' else: trial = 'Closing' for d in dir_name_list: nm = get_mech_name(d) print '>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>' print 'MECHANISM:', nm print '>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>' ftan_l_l, frad_l_l, mechx_l_l, typ, rad = extract_pkls(d, open) fl, rl = [], [] for n in range(len(ftan_l_l)): fmax = np.max(np.abs(ftan_l_l[n])) print 'fmax:', fmax fl.append(fmax) rl.append(rad) print 'Aloha' print 'len(fl)', len(fl) print 'len(rl)', len(rl) #mpu.plot_yx(fl, rl) plot_title = 'Scatter plot for %s trials'%trial mpu.plot_yx(fl, rl, color=mpu.random_color(), label=nm, axis=None, linewidth=0, xlabel='Radius (m)', ylabel='Maximum Force (N)', plot_title=plot_title) mpu.legend() # use all the values of all the bins for all the trials. # @param plot_type - 'tangential', 'magnitude', 'radial' def errorbar_one_mechanism(dir_name, open=True, new_figure=True, filter_speed = math.radians(100), plot_type='tangential', color=None, label = None): if new_figure: mpu.figure() nm = get_mech_name(dir_name) d = extract_pkls(dir_name, open) ftan_l_l = d['ftan_l_l'] frad_l_l = d['frad_l_l'] mechx_l_l = d['mechx_l_l'] time_l_l = d['time_l_l'] typ = d['typ'] rad = d['rad'] fn = list binned_mechx_l = [] binned_ftan_ll = [] use_trials_list = [] if plot_type == 'radial': force_l_l = frad_l_l if plot_type == 'tangential': force_l_l = ftan_l_l if plot_type == 'magnitude': force_l_l = [] for ta, ra in zip(ftan_l_l, frad_l_l): force_l_l.append(ut.norm(np.matrix([ta, ra])).A1.tolist()) n_trials = len(force_l_l) for i in range(n_trials): if typ == 'rotary': traj_vel = compute_trajectory_velocity(mechx_l_l[i], time_l_l[i], 1) if traj_vel >= filter_speed: continue t, f = bin(mechx_l_l[i], force_l_l[i], math.radians(1.), fn, ignore_empty=False, max_pose=math.radians(60)) if typ == 'prismatic': t, f = bin(mechx_l_l[i], force_l_l[i], 0.01, fn, ignore_empty=False, max_pose=0.5) if len(t) > len(binned_mechx_l): binned_mechx_l = t binned_ftan_ll.append(f) use_trials_list.append(i) n_trials = len(binned_ftan_ll) n_bins = len(binned_mechx_l) force_list_combined = [[] for i in binned_mechx_l] for i in range(n_trials): force_l = binned_ftan_ll[i] for j,p in enumerate(binned_mechx_l): if force_l[j] != None: if open: if j < 5: force_list_combined[j].append(max(force_l[j])) continue else: if (n_trials-j) < 5: force_list_combined[j].append(min(force_l[j])) continue force_list_combined[j] += force_l[j] plot_mechx_l = [] mean_l, std_l = [], [] for i,p in enumerate(binned_mechx_l): f_l = force_list_combined[i] if len(f_l) == 0: continue plot_mechx_l.append(p) mean_l.append(np.mean(f_l)) std_l.append(np.std(f_l)) if open: trial = 'Open' else: trial = 'Close' n_sigma = 1 if typ == 'rotary': x_l = np.degrees(plot_mechx_l) xlabel='\huge{Angle (degrees)}' else: x_l = plot_mechx_l xlabel='Distance (m)' std_arr = np.array(std_l) * n_sigma if color == None: color = mpu.random_color() if label == None: label= nm+' '+plot_type mpu.plot_errorbar_yx(mean_l, std_arr, x_l, linewidth=1, color=color, plot_title='\huge{Mean \& %d$\sigma$}'%(n_sigma), xlabel=xlabel, label=label, ylabel='\huge{Force (N)}') mpu.legend() # take the max of each bin. def errorbar_one_mechanism_max(dir_name, open=True, filter_speed=math.radians(100.)): # mpu.figure() nm = get_mech_name(dir_name) d = extract_pkls(dir_name, open) ftan_l_l = d['ftan_l_l'] frad_l_l = d['frad_l_l'] mechx_l_l = d['mechx_l_l'] time_l_l = d['time_l_l'] typ = d['typ'] rad = d['rad'] fn = max if open == False: fn = min binned_mechx_l = [] binned_ftan_ll = [] use_trials_list = [] n_trials = len(ftan_l_l) for i in range(n_trials): if typ == 'rotary': traj_vel = compute_trajectory_velocity(mechx_l_l[i], time_l_l[i], 1) if traj_vel >= filter_speed: continue t, f = bin(mechx_l_l[i], ftan_l_l[i], math.radians(1.), fn, ignore_empty=False, max_pose=math.radians(60)) if typ == 'prismatic': t, f = bin(mechx_l_l[i], ftan_l_l[i], 0.01, fn, ignore_empty=False, max_pose=0.5) if len(t) > len(binned_mechx_l): binned_mechx_l = t binned_ftan_ll.append(f) use_trials_list.append(i) binned_ftan_arr = np.array(binned_ftan_ll) plot_mechx_l = [] mean_l, std_l = [], [] for i,p in enumerate(binned_mechx_l): f_l = [] for j in range(len(use_trials_list)): if binned_ftan_arr[j,i] != None: f_l.append(binned_ftan_arr[j,i]) if len(f_l) == 0: continue plot_mechx_l.append(p) mean_l.append(np.mean(f_l)) std_l.append(np.std(f_l)) xlabel = 'Angle (degrees)' if open: trial = 'Open' else: trial = 'Close' n_sigma = 1 std_arr = np.array(std_l) * n_sigma mpu.plot_errorbar_yx(mean_l, std_arr, np.degrees(plot_mechx_l), linewidth=1, plot_title=nm+': '+trial, xlabel='Angle (degrees)', label='Mean \& %d$\sigma$'%(n_sigma), ylabel='Tangential Force (N)', color='y') mpu.legend() def plot_opening_distances_drawers(dir_name_list): mpu.figure() for d in dir_name_list: nm = get_mech_name(d) ftan_l_l, frad_l_l, mechx_l_l, typ, rad = extract_pkls(d) if rad != -1: # ignoring the cabinet doors. continue # print 'Aloha' # import pdb; pdb.set_trace() dist_opened_list = [] for x_l in mechx_l_l: dist_opened_list.append(x_l[-1] - x_l[0]) plot_title = 'Opening distance for drawers' mpu.plot_yx(dist_opened_list, color=mpu.random_color(), label=nm, axis=None, linewidth=0, xlabel='Nothing', ylabel='Distance opened', plot_title=plot_title) mpu.legend() def handle_height_histogram(dir_name_list, plot_title=''): mean_height_list = [] for d in dir_name_list: nm = get_mech_name(d) pkl = glob.glob(d+'/mechanism_calc_dict.pkl') if pkl == []: print 'Mechanism "%s" does not have a mechanism_calc_dict'%nm continue pkl = pkl[0] mech_calc_dict = ut.load_pickle(pkl) hb = mech_calc_dict['handle_bottom'] ht = mech_calc_dict['handle_top'] mean_height_list.append((hb+ht)/2.) #max_height = np.max(mean_height_list) max_height = 2.0 bin_width = 0.1 bins = np.arange(0.-bin_width/2., max_height+2*bin_width, bin_width) hist, bin_edges = np.histogram(np.array(mean_height_list), bins) mpu.plot_histogram(bin_edges[:-1]+bin_width/2., hist, width=bin_width*0.8, plot_title=plot_title, xlabel='Height (meters)', ylabel='\# of mechanisms') def plot_handle_height(dir_name_list, plot_title): mpu.figure() for d in dir_name_list: nm = get_mech_name(d) pkl = glob.glob(d+'/mechanism_calc_dict.pkl') if pkl == []: print 'Mechanism "%s" does not have a mechanism_calc_dict'%nm continue pkl = pkl[0] mech_calc_dict = ut.load_pickle(pkl) hb = mech_calc_dict['handle_bottom'] ht = mech_calc_dict['handle_top'] di = extract_pkls(d, open=True) ftan_l_l = di['ftan_l_l'] frad_l_l = di['frad_l_l'] mechx_l_l = di['mechx_l_l'] time_l_l = di['time_l_l'] typ = di['typ'] rad = di['rad'] # ftan_l_l, frad_l_l, mechx_l_l, typ, rad = extract_pkls(d, # open=True) fl, hl = [], [] for n in range(len(ftan_l_l)): fmax = np.max(np.abs(ftan_l_l[n][0:-50])) fl.append(fmax) fl.append(fmax) hl.append(ht) hl.append(hb) mpu.plot_yx(hl, fl, color=mpu.random_color(), label=nm, axis=None, linewidth=0, xlabel='Max opening force', ylabel='Handle Height (m)', plot_title=plot_title) mpu.legend() def distance_of_handle_from_edges(): pass def plot_handle_height_no_office(): opt = commands.getoutput('cd aggregated_pkls_Feb11; ls --ignore=*HSI* --ignore=*HRL* --ignore=a.py') d_list = opt.splitlines() dir_list = [] for d in d_list: dir_list.append('aggregated_pkls_Feb11/'+d) plot_title = 'Only homes. Excluding Offices' plot_handle_height(dir_list[0:], plot_title) def plot_handle_height_no_fridge_no_freezer(): opt = commands.getoutput('cd aggregated_pkls_Feb11; ls --ignore=*refrigerator* --ignore=*freezer* --ignore=a.py') d_list = opt.splitlines() dir_list = [] for d in d_list: dir_list.append('aggregated_pkls_Feb11/'+d) plot_title = 'Excluding Refrigerators and Freezers' plot_handle_height(dir_list[0:], plot_title) ## # returns the median of the velocity. def compute_velocity(mech_x, time_list, smooth_window): x = np.array(mech_x) t = np.array(time_list) kin_info = {'disp_mech_coord_arr': np.array(mech_x), 'mech_time_arr': np.array(time_list)} vel_arr = mfc.velocity(kin_info, smooth_window) return vel_arr ## # mech_x must be in RADIANS. def compute_trajectory_velocity(mech_x, time_list, smooth_window): vel_arr = compute_velocity(mech_x, time_list, smooth_window) filt_vel_arr = vel_arr[np.where(vel_arr>math.radians(2.))] median_vel = np.median(filt_vel_arr) return median_vel ## # compute the average velocity = total angle / total time. def compute_average_velocity(mech_x, time_list, max_angle, type): reject_num = 20 if len(mech_x) < reject_num: return -1 mech_x = mech_x[reject_num:] time_list = time_list[reject_num:] if mech_x[-1] < max_angle: return -1 if type == 'rotary': start_angle = math.radians(1) elif type == 'prismatic': start_angle = 0.01 mech_x = np.array(mech_x) start_idx = np.where(mech_x > start_angle)[0][0] end_idx = np.where(mech_x > max_angle)[0][0] start_x = mech_x[start_idx] end_x = mech_x[end_idx] start_time = time_list[start_idx] end_time = time_list[end_idx] avg_vel = (end_x - start_x) / (end_time - start_time) return avg_vel def plot_velocity(dir_name): d = extract_pkls(dir_name, True) vel_fig = mpu.figure() acc_fig = mpu.figure() for i,time_list in enumerate(d['time_l_l']): mechx_l = d['mechx_l_l'][i] mechx_l, vel, acc, time_list = mfc.kinematic_params(mechx_l, time_list, 10) vel_arr = np.array(vel) acc_arr = np.array(acc) trial_num = d['trial_num_l'][i] xarr = np.array(mechx_l) idxs = np.where(np.logical_and(xarr < math.radians(20.), xarr > math.radians(1.))) color=mpu.random_color() mpu.figure(vel_fig.number) mpu.plot_yx(np.degrees(vel_arr[idxs]), np.degrees(xarr[idxs]), color=color, label='%d velocity'%trial_num, scatter_size=0) mpu.legend() mpu.figure(acc_fig.number) mpu.plot_yx(np.degrees(acc_arr[idxs]), np.degrees(xarr[idxs]), color=color, label='%d acc'%trial_num, scatter_size=0) mpu.legend() ## # l list of trials with which to correlate c1 # trial is a list of forces (each element is the max force or some # other representative value for a given angle) # lab_list - list of labels def correlate_trials(c1, l, lab_list): mpu.figure() x = 0 corr_list = [] x_l = [] for i,c2 in enumerate(l): res = ss.correlate(np.array(c1), np.array(c2), 'valid')[0] r1 = ss.correlate(np.array(c1), np.array(c1), 'valid')[0] r2 = ss.correlate(np.array(c2), np.array(c2), 'valid')[0] res = res/math.sqrt(r1*r2) # cross correlation coefficient http://www.staff.ncl.ac.uk/oliver.hinton/eee305/Chapter6.pdf if i == 0 or lab_list[i] == lab_list[i-1]: corr_list.append(res) x_l.append(x) else: mpu.plot_yx(corr_list, x_l, color=mpu.random_color(), label=lab_list[i-1], xlabel='Nothing', ylabel='Cross-Correlation Coefficient') corr_list = [] x_l = [] x += 1 mpu.plot_yx(corr_list, x_l, color=mpu.random_color(), label=lab_list[i-1]) mpu.legend() ## # plot errorbars showing 1 sigma for tangential component of the force # and the total magnitude of the force. (Trying to verify that what we # are capturing using our setup is consistent across people) def compare_tangential_total_magnitude(dir): mpu.figure() errorbar_one_mechanism(dir, open = True, filter_speed = math.radians(30), plot_type = 'magnitude', new_figure = False, color='y', label = '\huge{$\hat F_{normal}$}') errorbar_one_mechanism(dir, open = True, filter_speed = math.radians(30), plot_type = 'tangential', color='b', new_figure = False, label = '\huge{$||\hat F_{normal} + \hat F_{plane}||$}') def max_force_vs_velocity(dir): di = extract_pkls(dir, open) ftan_l_l = di['ftan_l_l'] frad_l_l = di['frad_l_l'] mechx_l_l = di['mechx_l_l'] time_l_l = di['time_l_l'] typ = di['typ'] rad = di['rad'] nm = get_mech_name(dir) # mpu.figure() color = mpu.random_color() mfl = [] tvl = [] for i in range(len(ftan_l_l)): xarr = np.array(mechx_l_l[i]) idxs = np.where(np.logical_and(xarr < math.radians(20.), xarr > math.radians(1.))) max_force = np.max(np.array(ftan_l_l[i])[idxs]) mechx_short = np.array(mechx_l_l[i])[idxs] time_short = np.array(time_l_l[i])[idxs] vel_arr = compute_velocity(mechx_l_l[i], time_l_l[i], 5) #vel_arr = compute_velocity(mechx_short[i], time_l_l[i], 5) vel_short = vel_arr[idxs] traj_vel = np.max(vel_short) #acc_arr = compute_velocity(vel_arr, time_l_l[i], 1) #traj_vel = np.max(acc_arr) #traj_vel = compute_trajectory_velocity(mechx_short, time_short, 1) mfl.append(max_force) tvl.append(traj_vel) mpu.plot_yx(mfl, tvl, color = color, xlabel = 'Trajectory vel', label = nm, ylabel = 'Max tangential force', linewidth=0) mpu.legend() def mechanism_radius_histogram(dir_list, color='b'): rad_list = [] for d in dir_list: nm = get_mech_name(d) pkl = glob.glob(d+'/mechanism_info.pkl') if pkl == []: print 'Mechanism "%s" does not have a mechanism_info_dict'%nm continue pkl = pkl[0] md = ut.load_pickle(pkl) if md['radius'] != -1: rad_list.append(md['radius']) max_radius = np.max(rad_list) print 'Rad list:', rad_list bin_width = 0.05 bins = np.arange(0.-bin_width/2., max_radius+2*bin_width, bin_width) hist, bin_edges = np.histogram(np.array(rad_list), bins) print 'Bin Edges:', bin_edges print 'Hist:', hist h = mpu.plot_histogram(bin_edges[:-1]+bin_width/2., hist, width=0.8*bin_width, xlabel='Radius(meters)', ylabel='\# of mechanisms', plot_title='Histogram of radii of rotary mechanisms', color=color) return h def make_vector(mechx, ftan_l, lim, bin_size): t, f = bin(mechx, ftan_l, bin_size, max, ignore_empty=False, max_pose=lim, empty_value = np.nan) f = np.array(f) t = np.array(t) clean_idx = np.where(np.logical_not(np.isnan(f))) miss_idx = np.where(np.isnan(f)) if len(miss_idx[0]) > 0: fclean = f[clean_idx] mechx_clean = t[clean_idx] mechx_miss = t[miss_idx] f_inter = mfc.interpolate_1d(mechx_clean, fclean, mechx_miss) f[np.where(np.isnan(f))] = f_inter #import pdb #pdb.set_trace() return np.matrix(f).T # this makes the vector unit norm before returning it. Currently, this # function is only used for PCA. def make_vector_mechanism(dir, use_moment = False): print '>>>>>>>>>>>>>>>>>>>>>>' print 'dir:', dir di = extract_pkls(dir) ftan_l_l = di['ftan_l_l'] frad_l_l = di['frad_l_l'] mechx_l_l = di['mechx_l_l'] time_l_l = di['time_l_l'] moment_l_l = di['moment_l_l'] typ = di['typ'] rad = di['rad'] n_trials = len(ftan_l_l) vec_list = [] tup_list = [] for i in range(n_trials): if typ == 'rotary': if use_moment: torque_l = moment_l_l[i] else: torque_l = ftan_l_l[i] if len(mechx_l_l[i]) < 30: continue v = make_vector(mechx_l_l[i], torque_l, lim = math.radians(50.), bin_size = math.radians(1)) max_angle = math.radians(30) if typ == 'prismatic': v = make_vector(mechx_l_l[i], ftan_l_l[i], lim = 0.25, bin_size = 0.01) traj_vel = compute_average_velocity(mechx_l_l[i], time_l_l[i], max_angle, typ) if traj_vel == -1: continue #v = v / np.linalg.norm(v) vec_list.append(v) tup_list.append((traj_vel,v)) if len(vec_list) <= 1: return None tup_list.sort() [vel_list, vec_list] = zip(*tup_list) v_prev = vel_list[0] t_v = v_prev thresh = math.radians(5) i = 0 ret_list = [] for j,v in enumerate(vel_list): if (v - v_prev) > thresh: i += 1 if i >= 2: break v_prev = v ret_list.append(vec_list[j]) print 'Number of trials:', len(ret_list) # selecting only the slowest three trials. # tup_list.sort() # if len(tup_list) > 3: # [acc_list, v_list] = zip(*tup_list) # return np.column_stack(v_list[0:3]) return np.column_stack(ret_list) ## # one of the figures for the paper. # showing that different classes have different clusters. def different_classes_rotary(dir_list): mech_vec_list = [] legend_list = [] for d in dir_list: di = extract_pkls(d) if di == None: continue if di.has_key('typ'): typ = di['typ'] if typ != 'rotary': #if typ != 'prismatic': continue else: continue v = make_vector_mechanism(d) if v == None: continue mech_vec_list.append(v) legend_list.append(get_mech_name(d)) all_vecs = np.column_stack(mech_vec_list) print '>>>>>>>>> all_vecs.shape <<<<<<<<<<<<<', all_vecs.shape U, s, _ = np.linalg.svd(np.cov(all_vecs)) mn = np.mean(all_vecs, 1).A1 mpu.set_figure_size(3.,3.) mpu.figure() proj_mat = U[:, 0:2] legend_made_list = [False, False, False] for i, v in enumerate(mech_vec_list): p = proj_mat.T * (v - np.matrix(mn).T) if np.any(p[0,:].A1<0): print 'First principal component < 0 for some trial of:', legend_list[i] color = mpu.random_color() if 'ree' in legend_list[i]: #color = 'g' color = '#66FF33' if legend_made_list[0] == False: label = 'Freezers' legend_made_list[0] = True else: label = '__nolegend__' print 'SHAPE:', p.shape print 'p:', p elif 'ge' in legend_list[i]: color = '#FF6633' #color = 'y' if legend_made_list[1] == False: label = 'Refrigerators' legend_made_list[1] = True else: label = '__nolegend__' else: #color = 'b' color = '#3366FF' if legend_made_list[2] == False: #label = '\\flushleft Cabinets, Spring \\\\*[-2pt] Loaded Doors' label = 'Cabinets' legend_made_list[2] = True else: label = '__nolegend__' mpu.pl.scatter(p[0,:].A1, p[1,:].A1, color = color, s = 15, label = label) mpu.pl.xlabel('First Principle Component') mpu.pl.ylabel('Second Principle Component') mpu.pl.axis('equal') mpu.pl.axhline(y=0., color = 'k', ls='--') mpu.pl.axvline(x=0., color = 'k', ls='--') #mpu.legend(loc='upper center', display_mode = 'less_space', draw_frame = True) mpu.legend(loc='center left', display_mode = 'less_space', draw_frame = True) mpu.figure() mn = np.mean(all_vecs, 1).A1 mn = mn/np.linalg.norm(mn) mpu.plot_yx(mn, color = '#FF3300', label = 'mean (normalized)', scatter_size=7) c_list = ['#00CCFF', '#643DFF'] for i in range(2): mpu.plot_yx(U[:,i].flatten(), color = c_list[i], label = 'Eigenvector %d'%(i+1), scatter_size=7) mpu.pl.axhline(y=0., color = 'k', ls='--') mpu.legend(display_mode = 'less_space', draw_frame=False) mpu.show() ## # makes a scatter plot with the radius along the x axis and the max # force along the y-axis. different color for each mechanism # @param dir_name - directory containing the pkls. def max_force_hist(dir_name_list, open=True, type=''): if open: trial = 'Opening' else: trial = 'Closing' fls, freezer_list, fridge_list, springloaded_list = [],[],[],[] broiler_list = [] num_mech = 0 lens = [] max_angle = math.radians(15.) max_dist = 0.1 for d in dir_name_list: nm = get_mech_name(d) ep = extract_pkls(d, open, ignore_moment_list=True) if ep == None: continue ftan_l_l = ep['ftan_l_l'] frad_l_l = ep['frad_l_l'] mechx_l_l = ep['mechx_l_l'] typ = ep['typ'] rad = ep['rad'] fl, rl = [], [] for n in range(len(ftan_l_l)): ftan_l = ftan_l_l[n] mechx_a = np.array(mechx_l_l[n]) if type == 'prismatic': indices = np.where(mechx_a < max_dist)[0] else: indices = np.where(mechx_a < max_angle)[0] if len(indices) > 0: ftan_l = np.array(ftan_l)[indices].tolist() fmax = np.max(np.abs(ftan_l)) fl.append(fmax) rl.append(rad) #fmax_max = np.max(fl) fmax_max = np.min(fl) if type == 'rotary': if 'ree' in nm: freezer_list.append(fmax_max) elif 'naveen_microwave' in nm: # putting microwave in freezers freezer_list.append(fmax_max) if fmax_max < 5.: print 'nm:', nm elif 'ge' in nm: fridge_list.append(fmax_max) elif fmax > 60.: springloaded_list.append(fmax_max) else: if 'ven' in nm: broiler_list.append(fmax_max) if fmax_max > 10.: print 'nm:', nm, 'fmax:', fmax_max fls.append(fmax_max) num_mech += 1 lens.append(len(fl)) if len(fls) > 0: max_force = np.max(fls) bin_width = 2.5 bins = np.arange(0.-bin_width/2., max_force+2*bin_width, bin_width) if type == 'rotary': mpu.set_figure_size(3.,4.) mpu.figure() hist, bin_edges = np.histogram(fls, bins) h = mpu.plot_histogram(bin_edges[:-1]+bin_width/2., hist, width=0.8*bin_width, xlabel='Force (Newtons)', ylabel='\# of mechanisms', color='b', label='Cabinets') max_freq = np.max(hist) hist, bin_edges = np.histogram(freezer_list + fridge_list, bins) h = mpu.plot_histogram(bin_edges[:-1]+bin_width/2., hist, width=0.8*bin_width, xlabel='Force (Newtons)', ylabel='\# of mechanisms', color='y', label='Appliances') hist, bin_edges = np.histogram(springloaded_list, bins) h = mpu.plot_histogram(bin_edges[:-1]+bin_width/2., hist, width=0.8*bin_width, xlabel='Force (Newtons)', ylabel='\# of mechanisms', color='g', label='Spring Loaded Doors') mpu.pl.xticks(np.arange(0.,max_force+2*bin_width, 10.)) mpu.legend(display_mode='less_space', handlelength=1.) pb.xlim(-bin_width, max_force+bin_width) pb.ylim(0, max_freq+0.5) else: mpu.set_figure_size(3.,4.) mpu.figure() hist, bin_edges = np.histogram(fls, bins) h = mpu.plot_histogram(bin_edges[:-1]+bin_width/2., hist, width=0.8*bin_width, xlabel='Force (Newtons)', ylabel='\# of mechanisms', color='b', label='Drawers') max_freq = np.max(hist) hist, bin_edges = np.histogram(broiler_list, bins) h = mpu.plot_histogram(bin_edges[:-1]+bin_width/2., hist, width=0.8*bin_width, xlabel='Force (Newtons)', ylabel='\# of mechanisms', color='y', label='Broilers') mpu.figure() bin_width = 2.5 bins = np.arange(0.-bin_width/2., max_force+2*bin_width, bin_width) hist, bin_edges = np.histogram(fls, bins) h = mpu.plot_histogram(bin_edges[:-1]+bin_width/2., hist, width=0.8*bin_width, xlabel='Force (Newtons)', ylabel='\# of mechanisms', color='b', label='All') mpu.legend() pb.xlim(-bin_width, max_force+bin_width) pb.ylim(0, np.max(hist)+1) mpu.pl.xticks(np.arange(0.,max_force+2*bin_width, 5.)) mpu.pl.yticks(np.arange(0.,np.max(hist)+0.5, 1.)) else: print "OH NO! FLS <= 0" def dimen_reduction_mechanisms(dir_list, dimen = 2): mech_vec_list = [] legend_list = [] dir_list = filter_dir_list(dir_list) dir_list_new = [] for d in dir_list: v = make_vector_mechanism(d) if v == None: continue print 'v.shape:', v.shape mech_vec_list.append(v) legend_list.append(get_mech_name(d)) dir_list_new.append(d) all_vecs = np.column_stack(mech_vec_list) #U, s, _ = np.linalg.svd(np.cov(all_vecs)) normalized_all_vecs = all_vecs print '>>>>>>>>>>>> all_vecs.shape <<<<<<<<<<<<<<<', all_vecs.shape #normalized_all_vecs = (all_vecs - all_vecs.mean(1)) #Rule this out as it places equal value on the entire trajectory but we want #to focus modeling efforts on the beginning of the trajectory #normalized_all_vecs = normalized_all_vecs / np.std(normalized_all_vecs, 1) #Removes the effect of force scaling... not sure if we want this #normalized_all_vecs = normalized_all_vecs / ut.norm(normalized_all_vecs) U, s, _ = np.linalg.svd(np.cov((normalized_all_vecs))) perc_account = np.cumsum(s) / np.sum(s) mpu.plot_yx([0]+list(perc_account)) mpu.set_figure_size(5.,5.) mpu.figure() mn = np.mean(all_vecs, 1).A1 mpu.plot_yx(mn/np.linalg.norm(mn), color = '#FF3300', label = 'mean (normalized)', scatter_size=5) c_list = ['#%02x%02x%02x'%(r,g,b) for (r,g,b) in [(152, 32, 176), (23,94,16)]] c_list = ['#00CCFF', '#643DFF'] for i in range(2): mpu.plot_yx(U[:,i].flatten(), color = c_list[i], label = 'Eigenvector %d'%(i+1), scatter_size=5) mpu.pl.axhline(y=0., color = 'k') mpu.legend(display_mode='less_space') if dimen == 2: fig = mpu.figure() proj_mat = U[:, 0:2] for i, v in enumerate(mech_vec_list[:]): p = proj_mat.T * (v - np.matrix(mn).T) color = mpu.random_color() label = legend_list[i] mpu.plot_yx(p[1,:].A1, p[0,:].A1, color = color, linewidth = 0, label = label, xlabel='\huge{First Principle Component}', ylabel='\huge{Second Principle Component}', axis = 'equal', picker=0.5) mpu.pl.axhline(y=0., color = 'k', ls='--') mpu.pl.axvline(x=0., color = 'k', ls='--') mpu.legend() ppg = pca_plot_gui(legend_list, mech_vec_list, U, dir_list_new, np.matrix(mn).T) fig.canvas.mpl_connect('button_press_event', ppg.pick_cb) mpu.show() def filter_dir_list(dir_list, typ = 'rotary', name = None): filt_list = [] for d in dir_list: nm = get_mech_name(d) if name != None: if name not in nm: continue # trial = 'open' # l = glob.glob(d+'/*'+trial+'*mechanism_trajectories*.pkl') # di = ut.load_pickle(l[0]) # m_typ = di['typ'] # if m_typ != typ: # continue # filt_list.append(d) di = extract_pkls(d, quiet=True) if di == None: continue if di.has_key('typ'): m_typ = di['typ'] if m_typ != typ: continue filt_list.append(d) else: continue return filt_list if __name__ == '__main__': import optparse p = optparse.OptionParser() p.add_option('-d', '--dir', action='store', default='', type='string', dest='dir', help='directory with logged data') p.add_option('--check_data', action='store_true', dest='check_data', help='count the number of trajectories for each mechanism') p.add_option('--rearrange', action='store_true', dest='rearrange', help='rearrange aggregated pkls into separate folders for each mechanism') p.add_option('--clean', action='store_true', dest='clean', help='remove pkls with corrupted data') p.add_option('--max_force_hist', action='store_true', dest='max_force_hist', help='histogram of max forces') p.add_option('--max_force_radius_scatter', action='store_true', dest='max_force_radius_scatter', help='scatter plot of max force vs radius') p.add_option('--opening_distances_drawers', action='store_true', dest='opening_distances_drawers', help='opening distances for drawers') p.add_option('--plot_handle_height', action='store_true', dest='plot_handle_height', help='handle height above the ground') p.add_option('--plot_radius', action='store_true', dest='plot_radius', help='histogram of radii of the mechanisms') p.add_option('--correlate', action='store_true', dest='correlate', help='correlation across different trials') p.add_option('--consistent_across_people', action='store_true', dest='consistent_across_people', help='plot mean and std for tangential and total magnitude of the force') p.add_option('--dimen_reduc', action='store_true', dest='dimen_reduc', help='try dimen reduction') p.add_option('--independence', action='store_true', dest='independence', help='test for conditional independence') p.add_option('--mech_models', action='store_true', dest='mech_models', help='fit mechanical models to data') p.add_option('--different_classes_rotary', action='store_true', dest='different_classes_rotary', help='scatter plot showing the differnt mechanism classes') opt, args = p.parse_args() dir_list = commands.getoutput('ls -d %s/*/'%(opt.dir)).splitlines() # drawers = 0 # cabinets = 0 # for d in dir_list: # nm = get_mech_name(d) # di = extract_pkls(d) # if di == None: # print 'di was None for:', nm # continue # if di['rad'] == -1: # drawers += 1 # else: # cabinets += 1 # # print 'drawers:', drawers # print 'cabinets:', cabinets # import sys; sys.exit() if opt.clean: clean_data_forces(opt.dir) elif opt.rearrange: # listing all the different mechanisms pkl_list = commands.getoutput('ls %s/*.pkl'%(opt.dir)).splitlines() mech_name_list = [] for p in pkl_list: nm = '_'.join(p.split('/')[-1].split('_')[:-5]) print 'p:', p print 'nm:', nm mech_name_list.append(nm) mech_name_list = list(set(mech_name_list)) print 'List of unique mechanisms:', mech_name_list for mech_name in mech_name_list: nm = '%s/%s'%(opt.dir, mech_name) os.system('mkdir %s'%nm) os.system('mv %s/*%s*.pkl %s'%(opt.dir, mech_name, nm)) elif opt.check_data: mech_list = [] for i, m in enumerate(dir_list): t = m.split('/') mech = t[-1] if mech == '': mech = t[-2] mech_list.append(mech) print '%d. %s'%(i, mech) for i,d in enumerate(dir_list): mech_nm = mech_list[i] print '------------------------------------' print 'Mechanism name:', mech_nm for trial in ['open', 'close']: l = glob.glob(d+'/*'+trial+'*mechanism_trajectories*.pkl') l.sort() print 'Number of %s trials: %d'%(trial, len(l)) elif opt.max_force_radius_scatter: max_force_radius_scatter(dir_list[0:], open=True) max_force_radius_scatter(dir_list[0:], open=False) mpu.show() elif opt.max_force_hist: print 'Found %d mechanisms' % len(dir_list[0:]) max_force_hist(filter_dir_list(dir_list[0:], typ='rotary'), open=True, type='rotary') max_force_hist(filter_dir_list(dir_list[0:], typ='prismatic'), open=True, type='prismatic') mpu.show() elif opt.opening_distances_drawers: plot_opening_distances_drawers(dir_list[0:]) mpu.show() elif opt.plot_radius: l1 = filter_dir_list(dir_list, name='ree') l2 = filter_dir_list(dir_list, name='ge') print 'LEN:', len(filter_dir_list(dir_list, name=None)) bar1 = mechanism_radius_histogram(filter_dir_list(dir_list, name=None)) bar2 = mechanism_radius_histogram(l1+l2, color='y') labels = ['Other', 'Freezers and Refrigerators'] mpu.pl.legend([bar1[0],bar2[0]], labels, loc='best') mpu.show() elif opt.plot_handle_height: #plot_title = 'Opening force at different heights' #plot_handle_height(dir_list[:], plot_title) #plot_handle_height_no_fridge_no_freezer() # plot_handle_height_no_office() #handle_height_histogram(dir_list, plot_title='Homes excluding \n refrigerators and freezers') #handle_height_histogram(filter_dir_list(dir_list, name='ge'), # plot_title = 'Refrigerators') handle_height_histogram(filter_dir_list(dir_list, name='ree'), plot_title = 'Freezers') mpu.show() elif opt.correlate: cl = [] lab_list = [] ch_list = input_mechanism_list(dir_list) for i, d in enumerate(ch_list): nm = get_mech_name(d) di = extract_pkls(d, open) ftan_l_l = di['ftan_l_l'] frad_l_l = di['frad_l_l'] mechx_l_l = di['mechx_l_l'] time_l_l = di['time_l_l'] typ = di['typ'] rad = di['rad'] #ftan_l_l, frad_l_l, mechx_l_l, typ, rad = extract_pkls(d, open) for j in range(len(ftan_l_l)): if typ == 'rotary': traj_vel = compute_trajectory_velocity(mechx_l_l[j],time_l_l[j],1) if traj_vel > math.radians(30): continue t, f = bin(mechx_l_l[j], ftan_l_l[j], math.radians(1.), max, ignore_empty=True, max_pose=math.radians(60)) if typ == 'prismatic': t, f = bin(mechx_l_l[j], ftan_l_l[j], 0.01, max, ignore_empty=True, max_pose=0.3) cl.append(f) lab_list.append(nm) correlate_trials(cl[0], cl[:], lab_list) mpu.show() elif opt.consistent_across_people: ch_list = input_mechanism_list(dir_list) for dir in ch_list: compare_tangential_total_magnitude(dir) mpu.show() elif opt.different_classes_rotary: different_classes_rotary(dir_list) elif opt.independence: test_independence_mechanism(dir_list) elif opt.dimen_reduc: #ch_list = input_mechanism_list(dir_list) #dimen_reduction_mechanisms(ch_list) #dimen_reduction_mechanisms(filter_dir_list(dir_list, name='HSI_Suite_210_brown_cabinet_right')) dimen_reduction_mechanisms(dir_list) elif opt.mech_models: dir = filter_dir_list(dir_list, name='patient_room_door')[0] d = extract_pkls(dir, True) trial_num_list = d['trial_num_l'] states_l = [] xarr_l = [] varr_l = [] aarr_l = [] forces_l = [] for i, n in enumerate(trial_num_list): print 'i:', i # if i != 5: # continue #trial_idx = trial_num_list.index() mechx_l = d['mechx_l_l'][i] time_list = d['time_l_l'][i] forces = np.matrix(d['ftan_l_l'][i]) radius = d['rad'] window_len = 15 mechx_l, vel, acc, time_list = mfc.kinematic_params(mechx_l, time_list, window_len) xarr = np.array(mechx_l) idxs = np.where(np.logical_and(xarr > math.radians(1), xarr < math.radians(15))) # smooth x forces = forces[0, window_len-1:-window_len+1] #compute vel forces = forces[0, 1:-1] # smooth vel forces = forces[0, window_len-1:-window_len+1] # compute acc forces = forces[0, 1:-1] # smooth acc forces = forces[0, window_len-1:-window_len+1] forces = forces[0, idxs[0]] xarr = np.matrix(xarr[idxs]) varr = np.matrix(np.array(vel)[idxs]) aarr = np.matrix(np.array(acc)[idxs]) xarr_l.append(xarr) varr_l.append(varr) aarr_l.append(aarr) forces_l.append(forces) #import pdb #pdb.set_trace() #door_smd = mfd.DoorSpringMassDamper(radius, k=0., mass=0, damp=0., const=0, noise_cov=0.) door_smd = mfd.DoorMassDamper(radius) ones = np.ones(xarr.shape[1]) states_l.append(np.matrix(np.row_stack((xarr, varr, aarr, ones)))) states = np.column_stack(states_l) forces = np.column_stack(forces_l) acc_arr = states[2,:].A1 farr = forces.A1 # import pdb; pdb.set_trace() print 'farr:', farr print 'acc_arr:', acc_arr mass = np.mean(np.divide(farr, acc_arr)) print 'mass:', mass #door_smd = door_smd.fit(states, forces.T) door_smd = door_smd.fit(states[[1,2],:], forces.T) print 'fitted model', door_smd for i in range(len(xarr_l)): forces = forces_l[i] xarr = xarr_l[i] varr = varr_l[i] aarr = aarr_l[i] predicted_forces = door_smd.predict(states_l[i][[1,2],:]) predicted_forces_mass = mass * states_l[i][2,:].A1 mpu.figure() mpu.plot_yx(forces.A1, np.degrees(xarr.A1), label='actual', color='g') mpu.plot_yx(predicted_forces.A1, np.degrees(xarr.A1), label='predicted SMD', color='b') mpu.plot_yx(predicted_forces_mass, np.degrees(xarr.A1), label='predicted (mass only)', color='r') mpu.plot_yx(np.degrees(varr.A1), np.degrees(xarr.A1), label='vel', color=mpu.random_color()) mpu.plot_yx(np.degrees(aarr.A1), np.degrees(xarr.A1), label='acel', color=mpu.random_color()) mpu.legend() #mpu.show() #plot_velocity(dir) mpu.show() else: # filt_list = filter_dir_list(dir_list) # for dir in filt_list: # max_force_vs_velocity(dir) # mpu.show() d_list = input_mechanism_list(dir_list) # d_list = filter_dir_list(dir_list, typ='prismatic') # mpu.figure() traj_vel_l = [] for dir in d_list: #make_vector_mechanism(dir) # vel_l = [] # nm = get_mech_name(dir) # print '>>>>>>>>>> nm:', nm # d = extract_pkls(dir, ignore_moment_list=True) # for i, mech_x in enumerate(d['mechx_l_l']): # time_list = d['time_l_l'][i] # #v = compute_average_velocity(mech_x, time_list, max_angle=math.radians(30), type='rotary') # v = compute_average_velocity(mech_x, time_list, max_angle=0.2, type='prismatic') # print 'v:', v # if v == -1: # continue # vel_l.append(v) # sorted_vel_l = sorted(vel_l) # if len(sorted_vel_l) > 6: # vel_l = sorted_vel_l[0:6] # else: # vel_l = sorted_vel_l # traj_vel_l += vel_l # # #print 'mean angular velocity:', math.degrees(np.mean(traj_vel_l)) # #print 'std angular velocity:', math.degrees(np.std(traj_vel_l)) # # print 'mean angular velocity:', np.mean(traj_vel_l) # print 'std angular velocity:', np.std(traj_vel_l) #plot_tangential_force(dir, all_trials = True, open = True, # filter_speed = math.radians(30)) plot_tangential_force(dir, all_trials = True, open = True) # nm = get_mech_name(dir) # mpu.savefig(nm+'_grayscale.png') # print 'Aloha ', nm #radial_tangential_ratio(dir) mpu.show()
ajibawa-2023/Python-Code-Large/train/row_99534
1,027
1,641
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Import_L6_C0", "label": "commands import commands", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0037, 0.0006, 0, 0.66, 0.0, 760, 0, 1, 0, 0, 760, 0, 0], "semantic": {"name": "commands", "arg_names": [], "import_names": ["commands"], "rhs_call_name": "", "annotation": ""}, "snippet": "import commands"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Import_L7_C0", "label": "os import os", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.0043, 0.0006, 0, 0.66, 0.0222, 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_99534:Import_L8_C0", "label": "os.path import pt", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.0049, 0.0006, 0, 0.66, 0.0444, 79, 0, 1, 0, 0, 79, 0, 0], "semantic": {"name": "os.path", "arg_names": [], "import_names": ["pt"], "rhs_call_name": "", "annotation": ""}, "snippet": "import os.path as pt"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Import_L9_C0", "label": "glob import glob", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.0055, 0.0006, 0, 0.66, 0.0667, 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_99534:Import_L10_C0", "label": "math import math, np", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.0061, 0.0006, 0, 0.66, 0.0889, 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_99534:Import_L11_C0", "label": "scipy.signal import ss", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.0067, 0.0006, 0, 0.66, 0.1111, 261, 0, 1, 0, 0, 261, 0, 0], "semantic": {"name": "scipy.signal", "arg_names": [], "import_names": ["ss"], "rhs_call_name": "", "annotation": ""}, "snippet": "import scipy.signal as ss"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Import_L12_C0", "label": "scipy.cluster import clus", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.0073, 0.0006, 0, 0.66, 0.1333, 556, 0, 1, 0, 0, 556, 0, 0], "semantic": {"name": "scipy.cluster", "arg_names": [], "import_names": ["clus"], "rhs_call_name": "", "annotation": ""}, "snippet": "import scipy.cluster as clus"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Import_L14_C0", "label": "roslib import roslib", "type": "import", "loc": [14, 14], "level": 0, "parent": null, "vector": [1, 0, 0.0085, 0.0006, 0, 0.66, 0.1556, 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('modeling_forces')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L14_C15", "label": "load_manifest()", "type": "expression", "loc": [14, 14], "level": 0, "parent": null, "vector": [8, 0, 0.0085, 0.0006, 0, 0.66, 0.1778, 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('modeling_forces')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Import_L15_C0", "label": "modeling_forces.mf_common import mfc", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.0091, 0.0006, 0, 0.66, 0.2, 107, 0, 1, 0, 0, 107, 0, 0], "semantic": {"name": "modeling_forces.mf_common", "arg_names": [], "import_names": ["mfc"], "rhs_call_name": "", "annotation": ""}, "snippet": "import modeling_forces.mf_common as mfc"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Import_L17_C0", "label": "matplotlib_util.util import mpu", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.0104, 0.0006, 0, 0.66, 0.2222, 781, 0, 1, 0, 0, 781, 0, 0], "semantic": {"name": "matplotlib_util.util", "arg_names": [], "import_names": ["mpu"], "rhs_call_name": "", "annotation": ""}, "snippet": "import matplotlib_util.util as mpu"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Import_L18_C0", "label": "hrl_lib.util import ut", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.011, 0.0006, 0, 0.66, 0.2444, 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_99534:Import_L19_C0", "label": "scipy.stats import st", "type": "import", "loc": [19, 19], "level": 0, "parent": null, "vector": [1, 0, 0.0116, 0.0006, 0, 0.66, 0.2667, 413, 0, 1, 0, 0, 413, 0, 0], "semantic": {"name": "scipy.stats", "arg_names": [], "import_names": ["st"], "rhs_call_name": "", "annotation": ""}, "snippet": "import scipy.stats as st"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Import_L20_C0", "label": "pylab import pb", "type": "import", "loc": [20, 20], "level": 0, "parent": null, "vector": [1, 0, 0.0122, 0.0006, 0, 0.66, 0.2889, 735, 0, 1, 0, 0, 735, 0, 0], "semantic": {"name": "pylab", "arg_names": [], "import_names": ["pb"], "rhs_call_name": "", "annotation": ""}, "snippet": "import pylab as pb"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:ClassDef_L25_C0", "label": "pca_plot_gui", "type": "class", "loc": [25, 58], "level": 0, "parent": null, "vector": [3, 0, 0.0253, 0.0207, 0, 0.66, 0.3111, 428, 0, 2, 0, 0, 0, 0, 9], "semantic": {"name": "pca_plot_gui", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class pca_plot_gui():\n def __init__(self, legend_list, mech_vec_list, proj_mat, dir_list, mn):\n self.legend_list = legend_list\n self.mech_vec_list = mech_vec_list\n self.proj_mat = proj_mat\n self.dir_list = dir_list\n self.mn = mn\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L26_C4", "label": "__init__", "type": "function", "loc": [26, 31], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:ClassDef_L25_C0", "vector": [2, 1, 0.0174, 0.0037, 1, 0.25, 0.0, 555, 0, 6, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "legend_list", "mech_vec_list", "proj_mat", "dir_list", "mn"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, legend_list, mech_vec_list, proj_mat, dir_list, mn):\n self.legend_list = legend_list\n self.mech_vec_list = mech_vec_list\n self.proj_mat = proj_mat\n self.dir_list = dir_list\n self.mn = mn"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L27_C8", "label": "self.legend_list =", "type": "assigned_variable", "loc": [27, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L26_C4", "vector": [14, 2, 0.0165, 0.0006, 2, 0.68, 0.0, 978, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.legend_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.legend_list = legend_list"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L28_C8", "label": "self.mech_vec_list =", "type": "assigned_variable", "loc": [28, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L26_C4", "vector": [14, 2, 0.0171, 0.0006, 2, 0.68, 0.25, 828, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.mech_vec_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.mech_vec_list = mech_vec_list"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L29_C8", "label": "self.proj_mat =", "type": "assigned_variable", "loc": [29, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L26_C4", "vector": [14, 2, 0.0177, 0.0006, 2, 0.68, 0.5, 837, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.proj_mat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.proj_mat = proj_mat"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L30_C8", "label": "self.dir_list =", "type": "assigned_variable", "loc": [30, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L26_C4", "vector": [14, 2, 0.0183, 0.0006, 2, 0.68, 0.75, 840, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.dir_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.dir_list = dir_list"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L31_C8", "label": "self.mn =", "type": "assigned_variable", "loc": [31, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L26_C4", "vector": [14, 2, 0.0189, 0.0006, 2, 0.68, 1.0, 777, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.mn", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.mn = mn"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L33_C4", "label": "pick_cb", "type": "function", "loc": [33, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:ClassDef_L25_C0", "vector": [2, 1, 0.0277, 0.0158, 1, 0.25, 1.0, 796, 0, 2, 0, 0, 0, 0, 9], "semantic": {"name": "pick_cb", "arg_names": ["self", "event"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def pick_cb(self, event):\n if 'shift' != event.key:\n return\n selected = np.matrix([event.xdata, event.ydata]).T\n# print 'selected', selected.A1\n min_list = []\n for i, v in enumerate(self.mech_vec_list):\n p = self.proj_mat[:, 0:2].T * (v-self.mn)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L34_C8", "label": "if", "type": "if", "loc": [34, 35], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L33_C4", "vector": [4, 2, 0.021, 0.0012, 2, 0.81, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if 'shift' != event.key:\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Return_L35_C12", "label": "return", "type": "return", "loc": [35, 35], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L34_C8", "vector": [13, 3, 0.0213, 0.0006, 3, 0.44, 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_99534:Assign_L36_C8", "label": "selected =", "type": "assigned_variable", "loc": [36, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L33_C4", "vector": [14, 2, 0.0219, 0.0006, 2, 0.81, 0.1429, 73, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "selected", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " selected = np.matrix([event.xdata, event.ydata]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L38_C8", "label": "min_list =", "type": "assigned_variable", "loc": [38, 38], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L33_C4", "vector": [14, 2, 0.0232, 0.0006, 2, 0.81, 0.2857, 216, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "min_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " min_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L39_C8", "label": "for i, v", "type": "for", "loc": [39, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L33_C4", "vector": [6, 2, 0.0244, 0.0018, 2, 0.81, 0.4286, 843, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "i, v", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i, v in enumerate(self.mech_vec_list):\n p = self.proj_mat[:, 0:2].T * (v-self.mn)\n min_list.append(np.min(ut.norm(p-selected)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L40_C12", "label": "p =", "type": "assigned_variable", "loc": [40, 40], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L39_C8", "vector": [14, 3, 0.0244, 0.0006, 3, 0.69, 0.0, 491, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p = self.proj_mat[:, 0:2].T * (v-self.mn)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L41_C12", "label": "append()", "type": "expression", "loc": [41, 41], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L39_C8", "vector": [8, 3, 0.025, 0.0006, 3, 0.69, 1.0, 243, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " min_list.append(np.min(ut.norm(p-selected)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L43_C8", "label": "mech_idx = argmin()", "type": "assigned_variable", "loc": [43, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L33_C4", "vector": [14, 2, 0.0262, 0.0006, 2, 0.81, 0.5714, 744, 3, 1, 0, 0, 879, 10, 1], "semantic": {"name": "mech_idx", "arg_names": [], "import_names": [], "rhs_call_name": "argmin", "annotation": ""}, "snippet": " mech_idx = np.argmin(min_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L44_C8", "label": "print()", "type": "expression", "loc": [44, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L33_C4", "vector": [8, 2, 0.0268, 0.0006, 2, 0.81, 0.7143, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Selected mechanism was:', self.legend_list[mech_idx])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L46_C8", "label": "plot_tangential_force()", "type": "expression", "loc": [46, 46], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L33_C4", "vector": [8, 2, 0.028, 0.0006, 2, 0.81, 0.8571, 803, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "plot_tangential_force", "arg_names": [], "import_names": [], "rhs_call_name": "plot_tangential_force", "annotation": ""}, "snippet": " plot_tangential_force(self.dir_list[mech_idx], all_trials = True, open = True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L58_C8", "label": "show()", "type": "expression", "loc": [58, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L33_C4", "vector": [8, 2, 0.0353, 0.0006, 2, 0.81, 1.0, 497, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "show", "arg_names": [], "import_names": [], "rhs_call_name": "show", "annotation": ""}, "snippet": " mpu.show()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L67_C0", "label": "input_mechanism_list", "type": "function", "loc": [67, 84], "level": 0, "parent": null, "vector": [2, 0, 0.046, 0.011, 0, 0.66, 0.3333, 660, 0, 1, 1, 0, 0, 0, 10], "semantic": {"name": "input_mechanism_list", "arg_names": ["dir_list"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def input_mechanism_list(dir_list):\n mech_list = []\n for i, m in enumerate(dir_list):\n t = m.split('/')\n mech = t[-1]\n if mech == '':\n mech = t[-2]\n mech_list.append(mech)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L68_C4", "label": "mech_list =", "type": "assigned_variable", "loc": [68, 68], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L67_C0", "vector": [14, 1, 0.0414, 0.0006, 1, 0.76, 0.0, 478, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "mech_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mech_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L69_C4", "label": "for i, m", "type": "for", "loc": [69, 75], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L67_C0", "vector": [6, 1, 0.0439, 0.0043, 1, 0.76, 0.125, 489, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "i, m", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i, m in enumerate(dir_list):\n t = m.split('/')\n mech = t[-1]\n if mech == '':\n mech = t[-2]\n mech_list.append(mech)\n print('%d. %s'%(i, mech))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L70_C8", "label": "t = split()", "type": "assigned_variable", "loc": [70, 70], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L69_C4", "vector": [14, 2, 0.0427, 0.0006, 2, 0.68, 0.0, 15, 3, 1, 0, 0, 908, 10, 1], "semantic": {"name": "t", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": " t = m.split('/')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L71_C8", "label": "mech =", "type": "assigned_variable", "loc": [71, 71], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L69_C4", "vector": [14, 2, 0.0433, 0.0006, 2, 0.68, 0.25, 184, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "mech", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mech = t[-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L72_C8", "label": "if", "type": "if", "loc": [72, 73], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L69_C4", "vector": [4, 2, 0.0442, 0.0012, 2, 0.68, 0.5, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if mech == '':\n mech = t[-2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L73_C12", "label": "mech =", "type": "assigned_variable", "loc": [73, 73], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L72_C8", "vector": [14, 3, 0.0445, 0.0006, 3, 0.15, 0.0, 184, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "mech", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mech = t[-2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L74_C8", "label": "append()", "type": "expression", "loc": [74, 74], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L69_C4", "vector": [8, 2, 0.0451, 0.0006, 2, 0.68, 0.75, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " mech_list.append(mech)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L75_C8", "label": "print()", "type": "expression", "loc": [75, 75], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L69_C4", "vector": [8, 2, 0.0457, 0.0006, 2, 0.68, 1.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('%d. %s'%(i, mech))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L77_C4", "label": "print()", "type": "expression", "loc": [77, 77], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L67_C0", "vector": [8, 1, 0.0469, 0.0006, 1, 0.76, 0.25, 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_99534:Expr_L78_C4", "label": "print()", "type": "expression", "loc": [78, 78], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L67_C0", "vector": [8, 1, 0.0475, 0.0006, 1, 0.76, 0.375, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Enter mechanism numbers that you want to plot')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L79_C4", "label": "s = raw_input()", "type": "assigned_variable", "loc": [79, 79], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L67_C0", "vector": [14, 1, 0.0481, 0.0006, 1, 0.76, 0.5, 553, 3, 0, 0, 0, 821, 10, 1], "semantic": {"name": "s", "arg_names": [], "import_names": [], "rhs_call_name": "raw_input", "annotation": ""}, "snippet": " s = raw_input()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L80_C4", "label": "num_list = map()", "type": "assigned_variable", "loc": [80, 80], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L67_C0", "vector": [14, 1, 0.0488, 0.0006, 1, 0.76, 0.625, 549, 3, 2, 0, 0, 53, 10, 2], "semantic": {"name": "num_list", "arg_names": [], "import_names": [], "rhs_call_name": "map", "annotation": ""}, "snippet": " num_list = map(int, s.split(' '))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L81_C4", "label": "chosen_list =", "type": "assigned_variable", "loc": [81, 81], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L67_C0", "vector": [14, 1, 0.0494, 0.0006, 1, 0.76, 0.75, 556, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "chosen_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " chosen_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L82_C4", "label": "for n", "type": "for", "loc": [82, 83], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L67_C0", "vector": [6, 1, 0.0503, 0.0012, 1, 0.76, 0.875, 773, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "n", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for n in num_list:\n chosen_list.append(dir_list[n])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L83_C8", "label": "append()", "type": "expression", "loc": [83, 83], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L82_C4", "vector": [8, 2, 0.0506, 0.0006, 2, 0.68, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " chosen_list.append(dir_list[n])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Return_L84_C4", "label": "return", "type": "return", "loc": [84, 84], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L67_C0", "vector": [13, 1, 0.0512, 0.0006, 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 chosen_list"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L88_C0", "label": "clean_data_forces", "type": "function", "loc": [88, 134], "level": 0, "parent": null, "vector": [2, 0, 0.0676, 0.0286, 0, 0.66, 0.3556, 507, 0, 1, 0, 0, 0, 0, 32], "semantic": {"name": "clean_data_forces", "arg_names": ["dir"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def clean_data_forces(dir):\n l = commands.getoutput('find %s/ -name \"*mechanism_trajectories*.pkl\"'%dir).splitlines()\n for pkl in l:\n cmd1 = 'rm -f %s'%pkl\n cmd2 = 'svn rm %s'%pkl\n d = ut.load_pickle(pkl)\n radial_mech = d['force_rad_list']\n tangential_mech = d['force_tan_list']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L89_C4", "label": "l = splitlines()", "type": "assigned_variable", "loc": [89, 89], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L88_C0", "vector": [14, 1, 0.0542, 0.0006, 1, 0.46, 0.0, 810, 3, 0, 0, 0, 296, 10, 2], "semantic": {"name": "l", "arg_names": [], "import_names": [], "rhs_call_name": "splitlines", "annotation": ""}, "snippet": " l = commands.getoutput('find %s/ -name \"*mechanism_trajectories*.pkl\"'%dir).splitlines()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L90_C4", "label": "for pkl", "type": "for", "loc": [90, 134], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L88_C0", "vector": [6, 1, 0.0683, 0.0274, 1, 0.46, 1.0, 419, 2, 0, 0, 0, 0, 0, 30], "semantic": {"name": "pkl", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for pkl in l:\n cmd1 = 'rm -f %s'%pkl\n cmd2 = 'svn rm %s'%pkl\n d = ut.load_pickle(pkl)\n radial_mech = d['force_rad_list']\n tangential_mech = d['force_tan_list']\n\n if len(radial_mech) == 0 or len(tangential_mech) == 0:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L91_C8", "label": "cmd1 =", "type": "assigned_variable", "loc": [91, 91], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L90_C4", "vector": [14, 2, 0.0555, 0.0006, 2, 0.85, 0.0, 255, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "cmd1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cmd1 = 'rm -f %s'%pkl"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L92_C8", "label": "cmd2 =", "type": "assigned_variable", "loc": [92, 92], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L90_C4", "vector": [14, 2, 0.0561, 0.0006, 2, 0.85, 0.0909, 319, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "cmd2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cmd2 = 'svn rm %s'%pkl"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L93_C8", "label": "d = load_pickle()", "type": "assigned_variable", "loc": [93, 93], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L90_C4", "vector": [14, 2, 0.0567, 0.0006, 2, 0.85, 0.1818, 355, 3, 1, 0, 0, 65, 10, 1], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "load_pickle", "annotation": ""}, "snippet": " d = ut.load_pickle(pkl)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L94_C8", "label": "radial_mech =", "type": "assigned_variable", "loc": [94, 94], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L90_C4", "vector": [14, 2, 0.0573, 0.0006, 2, 0.85, 0.2727, 852, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "radial_mech", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " radial_mech = d['force_rad_list']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L95_C8", "label": "tangential_mech =", "type": "assigned_variable", "loc": [95, 95], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L90_C4", "vector": [14, 2, 0.0579, 0.0006, 2, 0.85, 0.3636, 528, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "tangential_mech", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tangential_mech = d['force_tan_list']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L97_C8", "label": "if", "type": "if", "loc": [97, 100], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L90_C4", "vector": [4, 2, 0.06, 0.0024, 2, 0.85, 0.4545, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(radial_mech) == 0 or len(tangential_mech) == 0:\n os.system(cmd1)\n os.system(cmd2)\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L98_C12", "label": "system()", "type": "expression", "loc": [98, 98], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L97_C8", "vector": [8, 3, 0.0597, 0.0006, 3, 0.61, 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(cmd1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L99_C12", "label": "system()", "type": "expression", "loc": [99, 99], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L97_C8", "vector": [8, 3, 0.0603, 0.0006, 3, 0.61, 1.0, 856, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "system", "arg_names": [], "import_names": [], "rhs_call_name": "system", "annotation": ""}, "snippet": " os.system(cmd2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L102_C8", "label": "max_force = max()", "type": "assigned_variable", "loc": [102, 103], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L90_C4", "vector": [14, 2, 0.0625, 0.0012, 2, 0.85, 0.5455, 874, 3, 2, 0, 0, 442, 10, 5], "semantic": {"name": "max_force", "arg_names": [], "import_names": [], "rhs_call_name": "max", "annotation": ""}, "snippet": " max_force = max(np.max(np.abs(radial_mech)),\n np.max(np.abs(tangential_mech)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L104_C8", "label": "if", "type": "if", "loc": [104, 106], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L90_C4", "vector": [4, 2, 0.064, 0.0018, 2, 0.85, 0.6364, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if max_force > 120.:\n os.system(cmd1)\n os.system(cmd2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L105_C12", "label": "system()", "type": "expression", "loc": [105, 105], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L104_C8", "vector": [8, 3, 0.064, 0.0006, 3, 0.88, 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(cmd1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L106_C12", "label": "system()", "type": "expression", "loc": [106, 106], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L104_C8", "vector": [8, 3, 0.0646, 0.0006, 3, 0.88, 1.0, 856, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "system", "arg_names": [], "import_names": [], "rhs_call_name": "system", "annotation": ""}, "snippet": " os.system(cmd2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L108_C8", "label": "n_points = len()", "type": "assigned_variable", "loc": [108, 108], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L90_C4", "vector": [14, 2, 0.0658, 0.0006, 2, 0.85, 0.7273, 202, 3, 1, 0, 0, 890, 10, 1], "semantic": {"name": "n_points", "arg_names": [], "import_names": [], "rhs_call_name": "len", "annotation": ""}, "snippet": " n_points = len(radial_mech)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L109_C8", "label": "if", "type": "if", "loc": [109, 111], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L90_C4", "vector": [4, 2, 0.067, 0.0018, 2, 0.85, 0.8182, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if n_points < 50:\n os.system(cmd1)\n os.system(cmd2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L110_C12", "label": "system()", "type": "expression", "loc": [110, 110], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L109_C8", "vector": [8, 3, 0.067, 0.0006, 3, 0.58, 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(cmd1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L111_C12", "label": "system()", "type": "expression", "loc": [111, 111], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L109_C8", "vector": [8, 3, 0.0676, 0.0006, 3, 0.58, 1.0, 856, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "system", "arg_names": [], "import_names": [], "rhs_call_name": "system", "annotation": ""}, "snippet": " os.system(cmd2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L113_C8", "label": "if", "type": "if", "loc": [113, 119], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L90_C4", "vector": [4, 2, 0.0707, 0.0043, 2, 0.85, 0.9091, 0, 3, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if d.has_key('radius'):\n r = d['radius']\n if r != -1:\n ang = np.degrees(d['mechanism_x'])\n if np.max(ang) < 20.:\n os.system(cmd1)\n os.system(cmd2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L114_C12", "label": "r =", "type": "assigned_variable", "loc": [114, 114], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L113_C8", "vector": [14, 3, 0.0695, 0.0006, 3, 0.71, 0.0, 436, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " r = d['radius']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L115_C12", "label": "if", "type": "if", "loc": [115, 119], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L113_C8", "vector": [4, 3, 0.0713, 0.003, 3, 0.71, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if r != -1:\n ang = np.degrees(d['mechanism_x'])\n if np.max(ang) < 20.:\n os.system(cmd1)\n os.system(cmd2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L116_C16", "label": "ang = degrees()", "type": "assigned_variable", "loc": [116, 116], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L115_C12", "vector": [14, 4, 0.0707, 0.0006, 4, 0.12, 0.0, 762, 3, 1, 0, 0, 633, 10, 1], "semantic": {"name": "ang", "arg_names": [], "import_names": [], "rhs_call_name": "degrees", "annotation": ""}, "snippet": " ang = np.degrees(d['mechanism_x'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L117_C16", "label": "if", "type": "if", "loc": [117, 119], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L115_C12", "vector": [4, 4, 0.0719, 0.0018, 4, 0.12, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if np.max(ang) < 20.:\n os.system(cmd1)\n os.system(cmd2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L118_C20", "label": "system()", "type": "expression", "loc": [118, 118], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L117_C16", "vector": [8, 5, 0.0719, 0.0006, 5, 0.71, 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(cmd1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L119_C20", "label": "system()", "type": "expression", "loc": [119, 119], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L117_C16", "vector": [8, 5, 0.0725, 0.0006, 5, 0.71, 1.0, 856, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "system", "arg_names": [], "import_names": [], "rhs_call_name": "system", "annotation": ""}, "snippet": " os.system(cmd2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L122_C8", "label": "if", "type": "if", "loc": [122, 134], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L90_C4", "vector": [4, 2, 0.078, 0.0079, 2, 0.85, 1.0, 0, 3, 0, 0, 0, 0, 0, 10], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if d.has_key('time_list'):\n t_l = d['time_list']\n time_diff_l = np.array(t_l[1:]) - np.array(t_l[0:-1])\n if len(time_diff_l) == 0:\n os.system(cmd1)\n os.system(cmd2)\n continue\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L123_C12", "label": "t_l =", "type": "assigned_variable", "loc": [123, 123], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L122_C8", "vector": [14, 3, 0.075, 0.0006, 3, 0.76, 0.0, 693, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "t_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " t_l = d['time_list']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L124_C12", "label": "time_diff_l =", "type": "assigned_variable", "loc": [124, 124], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L122_C8", "vector": [14, 3, 0.0756, 0.0006, 3, 0.76, 0.25, 441, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "time_diff_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " time_diff_l = np.array(t_l[1:]) - np.array(t_l[0:-1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L125_C12", "label": "if", "type": "if", "loc": [125, 128], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L122_C8", "vector": [4, 3, 0.0771, 0.0024, 3, 0.76, 0.5, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(time_diff_l) == 0:\n os.system(cmd1)\n os.system(cmd2)\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L126_C16", "label": "system()", "type": "expression", "loc": [126, 126], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L125_C12", "vector": [8, 4, 0.0768, 0.0006, 4, 0.9, 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(cmd1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L127_C16", "label": "system()", "type": "expression", "loc": [127, 127], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L125_C12", "vector": [8, 4, 0.0774, 0.0006, 4, 0.9, 1.0, 856, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "system", "arg_names": [], "import_names": [], "rhs_call_name": "system", "annotation": ""}, "snippet": " os.system(cmd2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L130_C12", "label": "max_time_diff = max()", "type": "assigned_variable", "loc": [130, 130], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L122_C8", "vector": [14, 3, 0.0792, 0.0006, 3, 0.76, 0.75, 762, 3, 1, 0, 0, 442, 10, 1], "semantic": {"name": "max_time_diff", "arg_names": [], "import_names": [], "rhs_call_name": "max", "annotation": ""}, "snippet": " max_time_diff = np.max(time_diff_l)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L131_C12", "label": "if", "type": "if", "loc": [131, 134], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L122_C8", "vector": [4, 3, 0.0807, 0.0024, 3, 0.76, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if max_time_diff > 0.3:\n print('max time difference between consec readings:', max_time_diff)\n os.system(cmd1)\n os.system(cmd2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L132_C16", "label": "print()", "type": "expression", "loc": [132, 132], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L131_C12", "vector": [8, 4, 0.0804, 0.0006, 4, 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('max time difference between consec readings:', max_time_diff)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L133_C16", "label": "system()", "type": "expression", "loc": [133, 133], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L131_C12", "vector": [8, 4, 0.081, 0.0006, 4, 0.08, 0.5, 856, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "system", "arg_names": [], "import_names": [], "rhs_call_name": "system", "annotation": ""}, "snippet": " os.system(cmd1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L134_C16", "label": "system()", "type": "expression", "loc": [134, 134], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L131_C12", "vector": [8, 4, 0.0817, 0.0006, 4, 0.08, 1.0, 856, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "system", "arg_names": [], "import_names": [], "rhs_call_name": "system", "annotation": ""}, "snippet": " os.system(cmd2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L143_C0", "label": "plot_tangential_force", "type": "function", "loc": [143, 285], "level": 0, "parent": null, "vector": [2, 0, 0.1304, 0.0871, 0, 0.66, 0.3778, 803, 0, 4, 0, 0, 0, 0, 43], "semantic": {"name": "plot_tangential_force", "arg_names": ["dir_name", "all_trials", "open", "filter_speed"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def plot_tangential_force(dir_name, all_trials, open = True,\n filter_speed=math.radians(100)):\n mpu.set_figure_size(4.,4.)\n fig1 = mpu.figure()\n# fig2 = mpu.figure()\n# fig3 = mpu.figure()\n if open:\n trial = 'open'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L145_C4", "label": "set_figure_size()", "type": "expression", "loc": [145, 145], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L143_C0", "vector": [8, 1, 0.0884, 0.0006, 1, 0.52, 0.0, 342, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "set_figure_size", "arg_names": [], "import_names": [], "rhs_call_name": "set_figure_size", "annotation": ""}, "snippet": " mpu.set_figure_size(4.,4.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L146_C4", "label": "fig1 = figure()", "type": "assigned_variable", "loc": [146, 146], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L143_C0", "vector": [14, 1, 0.089, 0.0006, 1, 0.52, 0.037, 605, 3, 0, 0, 0, 789, 10, 1], "semantic": {"name": "fig1", "arg_names": [], "import_names": [], "rhs_call_name": "figure", "annotation": ""}, "snippet": " fig1 = mpu.figure()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L149_C4", "label": "if", "type": "if", "loc": [149, 152], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L143_C0", "vector": [4, 1, 0.0917, 0.0024, 1, 0.52, 0.0741, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if open:\n trial = 'open'\n else:\n trial = 'close'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L150_C8", "label": "trial =", "type": "assigned_variable", "loc": [150, 150], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L149_C4", "vector": [14, 2, 0.0914, 0.0006, 2, 0.02, 0.0, 437, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "trial", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " trial = 'open'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L152_C8", "label": "trial =", "type": "assigned_variable", "loc": [152, 152], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L149_C4", "vector": [14, 2, 0.0926, 0.0006, 2, 0.02, 1.0, 437, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "trial", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " trial = 'close'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L154_C4", "label": "d = extract_pkls()", "type": "assigned_variable", "loc": [154, 154], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L143_C0", "vector": [14, 1, 0.0938, 0.0006, 1, 0.52, 0.1111, 355, 3, 2, 0, 0, 780, 10, 1], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "extract_pkls", "annotation": ""}, "snippet": " d = extract_pkls(dir_name, open)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L155_C4", "label": "mech_name = get_mech_name()", "type": "assigned_variable", "loc": [155, 155], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L143_C0", "vector": [14, 1, 0.0945, 0.0006, 1, 0.52, 0.1481, 884, 3, 1, 0, 0, 59, 10, 1], "semantic": {"name": "mech_name", "arg_names": [], "import_names": [], "rhs_call_name": "get_mech_name", "annotation": ""}, "snippet": " mech_name = get_mech_name(dir_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L158_C4", "label": "traj_vel_list =", "type": "assigned_variable", "loc": [158, 158], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L143_C0", "vector": [14, 1, 0.0963, 0.0006, 1, 0.52, 0.1852, 550, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "traj_vel_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " traj_vel_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L159_C4", "label": "for i, ftan_l", "type": "for", "loc": [159, 172], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L143_C0", "vector": [6, 1, 0.1009, 0.0085, 1, 0.52, 0.2222, 658, 3, 0, 0, 0, 0, 0, 5], "semantic": {"name": "i, ftan_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i,ftan_l in enumerate(d['ftan_l_l']):\n mech_x = d['mechx_l_l'][i]\n if d['typ'] == 'rotary':\n max_angle = math.radians(30)\n type = 'rotary'\n else:\n max_angle = 0.3\n type = 'prismatic'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L160_C8", "label": "mech_x =", "type": "assigned_variable", "loc": [160, 160], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L159_C4", "vector": [14, 2, 0.0975, 0.0006, 2, 0.83, 0.0, 712, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "mech_x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mech_x = d['mechx_l_l'][i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L161_C8", "label": "if", "type": "if", "loc": [161, 166], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L159_C4", "vector": [4, 2, 0.0996, 0.0037, 2, 0.83, 0.2, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if d['typ'] == 'rotary':\n max_angle = math.radians(30)\n type = 'rotary'\n else:\n max_angle = 0.3\n type = 'prismatic'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L162_C12", "label": "max_angle = radians()", "type": "assigned_variable", "loc": [162, 162], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L161_C8", "vector": [14, 3, 0.0987, 0.0006, 3, 0.75, 0.0, 451, 3, 1, 0, 0, 383, 10, 1], "semantic": {"name": "max_angle", "arg_names": [], "import_names": [], "rhs_call_name": "radians", "annotation": ""}, "snippet": " max_angle = math.radians(30)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L163_C12", "label": "type =", "type": "assigned_variable", "loc": [163, 163], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L161_C8", "vector": [14, 3, 0.0993, 0.0006, 3, 0.75, 0.3333, 801, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " type = 'rotary'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L165_C12", "label": "max_angle =", "type": "assigned_variable", "loc": [165, 165], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L161_C8", "vector": [14, 3, 0.1005, 0.0006, 3, 0.75, 0.6667, 451, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "max_angle", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " max_angle = 0.3"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L166_C12", "label": "type =", "type": "assigned_variable", "loc": [166, 166], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L161_C8", "vector": [14, 3, 0.1012, 0.0006, 3, 0.75, 1.0, 801, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " type = 'prismatic'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L168_C8", "label": "traj_vel = compute_average_velocity()", "type": "assigned_variable", "loc": [168, 168], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L159_C4", "vector": [14, 2, 0.1024, 0.0006, 2, 0.83, 0.4, 279, 3, 4, 0, 0, 59, 10, 1], "semantic": {"name": "traj_vel", "arg_names": [], "import_names": [], "rhs_call_name": "compute_average_velocity", "annotation": ""}, "snippet": " traj_vel = compute_average_velocity(mech_x, d['time_l_l'][i], max_angle, type)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L169_C8", "label": "print()", "type": "expression", "loc": [169, 169], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L159_C4", "vector": [8, 2, 0.103, 0.0006, 2, 0.83, 0.6, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('traj_vel:', traj_vel)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L170_C8", "label": "if", "type": "if", "loc": [170, 171], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L159_C4", "vector": [4, 2, 0.1039, 0.0012, 2, 0.83, 0.8, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if traj_vel == -1:\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L172_C8", "label": "append()", "type": "expression", "loc": [172, 172], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L159_C4", "vector": [8, 2, 0.1048, 0.0006, 2, 0.83, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " traj_vel_list.append(traj_vel)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L178_C4", "label": "vel_color_list =", "type": "assigned_variable", "loc": [178, 178], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L143_C0", "vector": [14, 1, 0.1085, 0.0006, 1, 0.52, 0.2593, 208, 5, 0, 0, 0, 0, 0, 0], "semantic": {"name": "vel_color_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " vel_color_list = [ '#%02X%02X%02X'%(r,g,b) for (r,g,b) in [(95, 132, 53), (28, 240, 100), (196, 251, 100)]]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L179_C4", "label": "traj_vel_sorted = tolist()", "type": "assigned_variable", "loc": [179, 179], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L143_C0", "vector": [14, 1, 0.1091, 0.0006, 1, 0.52, 0.2963, 996, 3, 0, 0, 0, 185, 10, 2], "semantic": {"name": "traj_vel_sorted", "arg_names": [], "import_names": [], "rhs_call_name": "tolist", "annotation": ""}, "snippet": " traj_vel_sorted = np.sort(traj_vel_list).tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L180_C4", "label": "sorted_color_list =", "type": "assigned_variable", "loc": [180, 180], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L143_C0", "vector": [14, 1, 0.1097, 0.0006, 1, 0.52, 0.3333, 324, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "sorted_color_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " sorted_color_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L181_C4", "label": "sorted_scatter_list =", "type": "assigned_variable", "loc": [181, 181], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L143_C0", "vector": [14, 1, 0.1103, 0.0006, 1, 0.52, 0.3704, 291, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "sorted_scatter_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " sorted_scatter_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L182_C4", "label": "i =", "type": "assigned_variable", "loc": [182, 182], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L143_C0", "vector": [14, 1, 0.1109, 0.0006, 1, 0.52, 0.4074, 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_99534:Assign_L183_C4", "label": "v_prev =", "type": "assigned_variable", "loc": [183, 183], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L143_C0", "vector": [14, 1, 0.1115, 0.0006, 1, 0.52, 0.4444, 738, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "v_prev", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " v_prev = traj_vel_sorted[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L184_C4", "label": "legend_list =", "type": "assigned_variable", "loc": [184, 184], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L143_C0", "vector": [14, 1, 0.1121, 0.0006, 1, 0.52, 0.4815, 41, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "legend_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " legend_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L185_C4", "label": "if", "type": "if", "loc": [185, 190], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L143_C0", "vector": [4, 1, 0.1143, 0.0037, 1, 0.52, 0.5185, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if d['typ'] == 'rotary':\n l = '%.1f'%math.degrees(v_prev)\n thresh = math.radians(5)\n else:\n l = '%.02f'%(v_prev)\n thresh = 0.05"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L186_C8", "label": "l =", "type": "assigned_variable", "loc": [186, 186], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L185_C4", "vector": [14, 2, 0.1133, 0.0006, 2, 0.29, 0.0, 810, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " l = '%.1f'%math.degrees(v_prev)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L187_C8", "label": "thresh = radians()", "type": "assigned_variable", "loc": [187, 187], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L185_C4", "vector": [14, 2, 0.114, 0.0006, 2, 0.29, 0.3333, 844, 3, 1, 0, 0, 383, 10, 1], "semantic": {"name": "thresh", "arg_names": [], "import_names": [], "rhs_call_name": "radians", "annotation": ""}, "snippet": " thresh = math.radians(5)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L189_C8", "label": "l =", "type": "assigned_variable", "loc": [189, 189], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L185_C4", "vector": [14, 2, 0.1152, 0.0006, 2, 0.29, 0.6667, 810, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " l = '%.02f'%(v_prev)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L190_C8", "label": "thresh =", "type": "assigned_variable", "loc": [190, 190], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L185_C4", "vector": [14, 2, 0.1158, 0.0006, 2, 0.29, 1.0, 844, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "thresh", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " thresh = 0.05"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L192_C4", "label": "t_v =", "type": "assigned_variable", "loc": [192, 192], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L143_C0", "vector": [14, 1, 0.117, 0.0006, 1, 0.52, 0.5556, 314, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "t_v", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " t_v = v_prev"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L193_C4", "label": "v_threshold =", "type": "assigned_variable", "loc": [193, 193], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L143_C0", "vector": [14, 1, 0.1176, 0.0006, 1, 0.52, 0.5926, 531, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "v_threshold", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " v_threshold = 1000."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L194_C4", "label": "for j, v", "type": "for", "loc": [194, 219], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L143_C0", "vector": [6, 1, 0.1258, 0.0158, 1, 0.52, 0.6296, 655, 3, 0, 0, 0, 0, 0, 11], "semantic": {"name": "j, v", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for j,v in enumerate(traj_vel_sorted):\n if (v - v_prev) > thresh:\n if d['typ'] == 'rotary':\n l = l + ' to %.1f deg/sec'%math.degrees(t_v)\n else:\n l = l + ' to %.1f m/s'%t_v\n legend_list.append(l)\n if d['typ'] == 'rotary':"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L195_C8", "label": "if", "type": "if", "loc": [195, 217], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L194_C4", "vector": [4, 2, 0.1255, 0.014, 2, 0.52, 0.0, 0, 0, 0, 0, 0, 0, 0, 9], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (v - v_prev) > thresh:\n if d['typ'] == 'rotary':\n l = l + ' to %.1f deg/sec'%math.degrees(t_v)\n else:\n l = l + ' to %.1f m/s'%t_v\n legend_list.append(l)\n if d['typ'] == 'rotary':\n l = '%.1f'%math.degrees(v)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L196_C12", "label": "if", "type": "if", "loc": [196, 199], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L195_C8", "vector": [4, 3, 0.1204, 0.0024, 3, 0.43, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if d['typ'] == 'rotary':\n l = l + ' to %.1f deg/sec'%math.degrees(t_v)\n else:\n l = l + ' to %.1f m/s'%t_v"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L197_C16", "label": "l =", "type": "assigned_variable", "loc": [197, 197], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L196_C12", "vector": [14, 4, 0.12, 0.0006, 4, 0.95, 0.0, 810, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " l = l + ' to %.1f deg/sec'%math.degrees(t_v)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L199_C16", "label": "l =", "type": "assigned_variable", "loc": [199, 199], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L196_C12", "vector": [14, 4, 0.1213, 0.0006, 4, 0.95, 1.0, 810, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " l = l + ' to %.1f m/s'%t_v"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L200_C12", "label": "append()", "type": "expression", "loc": [200, 200], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L195_C8", "vector": [8, 3, 0.1219, 0.0006, 3, 0.43, 0.1667, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " legend_list.append(l)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L201_C12", "label": "if", "type": "if", "loc": [201, 204], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L195_C8", "vector": [4, 3, 0.1234, 0.0024, 3, 0.43, 0.3333, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if d['typ'] == 'rotary':\n l = '%.1f'%math.degrees(v)\n else:\n l = '%.02f'%(v)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L202_C16", "label": "l =", "type": "assigned_variable", "loc": [202, 202], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L201_C12", "vector": [14, 4, 0.1231, 0.0006, 4, 0.1, 0.0, 810, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " l = '%.1f'%math.degrees(v)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L204_C16", "label": "l =", "type": "assigned_variable", "loc": [204, 204], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L201_C12", "vector": [14, 4, 0.1243, 0.0006, 4, 0.1, 1.0, 810, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " l = '%.02f'%(v)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L206_C12", "label": "if", "type": "if", "loc": [206, 211], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L195_C8", "vector": [4, 3, 0.1271, 0.0037, 3, 0.43, 0.5, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if i >= 2:\n v_threshold = min(v_threshold, v)\n if d['typ'] == 'rotary':\n print('v_threshold:', math.degrees(v_threshold))\n else:\n print('v_threshold:', v_threshold)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L207_C16", "label": "v_threshold = min()", "type": "assigned_variable", "loc": [207, 207], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L206_C12", "vector": [14, 4, 0.1261, 0.0006, 4, 0.26, 0.0, 531, 3, 2, 0, 0, 867, 10, 1], "semantic": {"name": "v_threshold", "arg_names": [], "import_names": [], "rhs_call_name": "min", "annotation": ""}, "snippet": " v_threshold = min(v_threshold, v)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L208_C16", "label": "if", "type": "if", "loc": [208, 211], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L206_C12", "vector": [4, 4, 0.1277, 0.0024, 4, 0.26, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if d['typ'] == 'rotary':\n print('v_threshold:', math.degrees(v_threshold))\n else:\n print('v_threshold:', v_threshold)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L209_C20", "label": "print()", "type": "expression", "loc": [209, 209], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L208_C16", "vector": [8, 5, 0.1274, 0.0006, 5, 0.08, 0.0, 535, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('v_threshold:', math.degrees(v_threshold))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L211_C20", "label": "print()", "type": "expression", "loc": [211, 211], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L208_C16", "vector": [8, 5, 0.1286, 0.0006, 5, 0.08, 1.0, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('v_threshold:', v_threshold)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L213_C12", "label": "if", "type": "if", "loc": [213, 214], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L195_C8", "vector": [4, 3, 0.1301, 0.0012, 3, 0.43, 0.6667, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if i == len(vel_color_list):\n i -= 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L215_C12", "label": "v_prev =", "type": "assigned_variable", "loc": [215, 215], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L195_C8", "vector": [14, 3, 0.131, 0.0006, 3, 0.43, 0.8333, 738, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "v_prev", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " v_prev = v"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L217_C12", "label": "append()", "type": "expression", "loc": [217, 217], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L195_C8", "vector": [8, 3, 0.1322, 0.0006, 3, 0.43, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " legend_list.append('__nolegend__')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L218_C8", "label": "t_v =", "type": "assigned_variable", "loc": [218, 218], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L194_C4", "vector": [14, 2, 0.1328, 0.0006, 2, 0.52, 0.5, 314, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "t_v", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " t_v = v"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L219_C8", "label": "append()", "type": "expression", "loc": [219, 219], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L194_C4", "vector": [8, 2, 0.1335, 0.0006, 2, 0.52, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " sorted_color_list.append(vel_color_list[i])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L221_C4", "label": "if", "type": "if", "loc": [221, 224], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L143_C0", "vector": [4, 1, 0.1356, 0.0024, 1, 0.52, 0.6667, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if d['typ'] == 'rotary':\n l = l + ' to %.1f deg/sec'%math.degrees(t_v)\n else:\n l = l + ' to %.1f m/s'%t_v"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L222_C8", "label": "l =", "type": "assigned_variable", "loc": [222, 222], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L221_C4", "vector": [14, 2, 0.1353, 0.0006, 2, 0.8, 0.0, 810, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " l = l + ' to %.1f deg/sec'%math.degrees(t_v)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L224_C8", "label": "l =", "type": "assigned_variable", "loc": [224, 224], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L221_C4", "vector": [14, 2, 0.1365, 0.0006, 2, 0.8, 1.0, 810, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " l = l + ' to %.1f m/s'%t_v"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L226_C4", "label": "append()", "type": "expression", "loc": [226, 226], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L143_C0", "vector": [8, 1, 0.1377, 0.0006, 1, 0.52, 0.7037, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " legend_list.append(l)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L227_C4", "label": "legend_list =", "type": "assigned_variable", "loc": [227, 227], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L143_C0", "vector": [14, 1, 0.1383, 0.0006, 1, 0.52, 0.7407, 41, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "legend_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " legend_list = legend_list[1:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L228_C4", "label": "giant_list =", "type": "assigned_variable", "loc": [228, 228], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L143_C0", "vector": [14, 1, 0.1389, 0.0006, 1, 0.52, 0.7778, 993, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "giant_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " giant_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L230_C4", "label": "set_figure_size()", "type": "expression", "loc": [230, 230], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L143_C0", "vector": [8, 1, 0.1402, 0.0006, 1, 0.52, 0.8148, 342, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "set_figure_size", "arg_names": [], "import_names": [], "rhs_call_name": "set_figure_size", "annotation": ""}, "snippet": " mpu.set_figure_size(3.,3.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L232_C4", "label": "for i, ftan_l", "type": "for", "loc": [232, 274], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L143_C0", "vector": [6, 1, 0.1542, 0.0262, 1, 0.52, 0.8519, 658, 3, 0, 0, 0, 0, 0, 9], "semantic": {"name": "i, ftan_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i,ftan_l in enumerate(d['ftan_l_l']):\n mech_x = d['mechx_l_l'][i]\n trial_num = str(d['trial_num_l'][i])\n color = None\n scatter_size = None\n\n traj_vel = compute_average_velocity(mech_x, d['time_l_l'][i],\n max_angle, d['typ'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L233_C8", "label": "mech_x =", "type": "assigned_variable", "loc": [233, 233], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L232_C4", "vector": [14, 2, 0.142, 0.0006, 2, 0.76, 0.0, 712, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "mech_x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mech_x = d['mechx_l_l'][i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L234_C8", "label": "trial_num = str()", "type": "assigned_variable", "loc": [234, 234], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L232_C4", "vector": [14, 2, 0.1426, 0.0006, 2, 0.76, 0.0714, 298, 3, 1, 0, 0, 52, 10, 1], "semantic": {"name": "trial_num", "arg_names": [], "import_names": [], "rhs_call_name": "str", "annotation": ""}, "snippet": " trial_num = str(d['trial_num_l'][i])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L235_C8", "label": "color =", "type": "assigned_variable", "loc": [235, 235], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L232_C4", "vector": [14, 2, 0.1432, 0.0006, 2, 0.76, 0.1429, 776, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "color", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " color = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L236_C8", "label": "scatter_size =", "type": "assigned_variable", "loc": [236, 236], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L232_C4", "vector": [14, 2, 0.1438, 0.0006, 2, 0.76, 0.2143, 891, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "scatter_size", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " scatter_size = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L238_C8", "label": "traj_vel = compute_average_velocity()", "type": "assigned_variable", "loc": [238, 239], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L232_C4", "vector": [14, 2, 0.1453, 0.0012, 2, 0.76, 0.2857, 279, 3, 4, 0, 0, 59, 10, 1], "semantic": {"name": "traj_vel", "arg_names": [], "import_names": [], "rhs_call_name": "compute_average_velocity", "annotation": ""}, "snippet": " traj_vel = compute_average_velocity(mech_x, d['time_l_l'][i],\n max_angle, d['typ'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L240_C8", "label": "if", "type": "if", "loc": [240, 241], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L232_C4", "vector": [4, 2, 0.1466, 0.0012, 2, 0.76, 0.3571, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if traj_vel == -1:\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L242_C8", "label": "if", "type": "if", "loc": [242, 243], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L232_C4", "vector": [4, 2, 0.1478, 0.0012, 2, 0.76, 0.4286, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if traj_vel >= v_threshold:\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L245_C8", "label": "color =", "type": "assigned_variable", "loc": [245, 245], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L232_C4", "vector": [14, 2, 0.1493, 0.0006, 2, 0.76, 0.5, 776, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "color", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " color = sorted_color_list[traj_vel_sorted.index(traj_vel)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L246_C8", "label": "legend =", "type": "assigned_variable", "loc": [246, 246], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L232_C4", "vector": [14, 2, 0.1499, 0.0006, 2, 0.76, 0.5714, 880, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "legend", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " legend = legend_list[traj_vel_sorted.index(traj_vel)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L247_C8", "label": "if", "type": "if", "loc": [247, 264], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L232_C4", "vector": [4, 2, 0.1557, 0.011, 2, 0.76, 0.6429, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if d['typ'] == 'rotary':\n #traj_vel = compute_trajectory_velocity(mech_x,d['time_l_l'][i],1)\n #if traj_vel >= filter_speed:\n # continue\n mech_x_degrees = np.degrees(mech_x)\n xlabel = 'angle (degrees)'\n ylabel = '$f_{tan}$ (N)'\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L251_C12", "label": "mech_x_degrees = degrees()", "type": "assigned_variable", "loc": [251, 251], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L247_C8", "vector": [14, 3, 0.153, 0.0006, 3, 0.93, 0.0, 378, 3, 1, 0, 0, 633, 10, 1], "semantic": {"name": "mech_x_degrees", "arg_names": [], "import_names": [], "rhs_call_name": "degrees", "annotation": ""}, "snippet": " mech_x_degrees = np.degrees(mech_x)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L252_C12", "label": "xlabel =", "type": "assigned_variable", "loc": [252, 252], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L247_C8", "vector": [14, 3, 0.1536, 0.0006, 3, 0.93, 0.125, 676, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "xlabel", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " xlabel = 'angle (degrees)'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L253_C12", "label": "ylabel =", "type": "assigned_variable", "loc": [253, 253], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L247_C8", "vector": [14, 3, 0.1542, 0.0006, 3, 0.93, 0.25, 584, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "ylabel", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ylabel = '$f_{tan}$ (N)'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L255_C12", "label": "mech_x_degrees =", "type": "assigned_variable", "loc": [255, 255], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L247_C8", "vector": [14, 3, 0.1554, 0.0006, 3, 0.93, 0.375, 378, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "mech_x_degrees", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mech_x_degrees = mech_x"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L256_C12", "label": "xlabel =", "type": "assigned_variable", "loc": [256, 256], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L247_C8", "vector": [14, 3, 0.156, 0.0006, 3, 0.93, 0.5, 676, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "xlabel", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " xlabel = 'distance (meters)'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L257_C12", "label": "ylabel =", "type": "assigned_variable", "loc": [257, 257], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L247_C8", "vector": [14, 3, 0.1566, 0.0006, 3, 0.93, 0.625, 584, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "ylabel", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ylabel = 'Opening force (N)'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L262_C12", "label": "n_skip =", "type": "assigned_variable", "loc": [262, 262], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L247_C8", "vector": [14, 3, 0.1597, 0.0006, 3, 0.93, 0.75, 768, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "n_skip", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " n_skip = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L263_C12", "label": "mech_x_degrees =", "type": "assigned_variable", "loc": [263, 263], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L247_C8", "vector": [14, 3, 0.1603, 0.0006, 3, 0.93, 0.875, 378, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "mech_x_degrees", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mech_x_degrees = mech_x_degrees[:-n_skip]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L264_C12", "label": "ftan_l =", "type": "assigned_variable", "loc": [264, 264], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L247_C8", "vector": [14, 3, 0.1609, 0.0006, 3, 0.93, 1.0, 989, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ftan_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ftan_l = ftan_l[:-n_skip]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L266_C8", "label": "figure()", "type": "expression", "loc": [266, 266], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L232_C4", "vector": [8, 2, 0.1621, 0.0006, 2, 0.76, 0.7143, 789, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "figure", "arg_names": [], "import_names": [], "rhs_call_name": "figure", "annotation": ""}, "snippet": " mpu.figure(fig1.number)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L268_C8", "label": "scatter_size =", "type": "assigned_variable", "loc": [268, 268], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L232_C4", "vector": [14, 2, 0.1633, 0.0006, 2, 0.76, 0.7857, 891, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "scatter_size", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " scatter_size = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L269_C8", "label": "if", "type": "if", "loc": [269, 270], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L232_C4", "vector": [4, 2, 0.1642, 0.0012, 2, 0.76, 0.8571, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if color == None:\n color = mpu.random_color()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L270_C12", "label": "color = random_color()", "type": "assigned_variable", "loc": [270, 270], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L269_C8", "vector": [14, 3, 0.1645, 0.0006, 3, 0.69, 0.0, 776, 3, 0, 0, 0, 895, 10, 1], "semantic": {"name": "color", "arg_names": [], "import_names": [], "rhs_call_name": "random_color", "annotation": ""}, "snippet": " color = mpu.random_color()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L271_C8", "label": "if", "type": "if", "loc": [271, 272], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L232_C4", "vector": [4, 2, 0.1654, 0.0012, 2, 0.76, 0.9286, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if scatter_size == None:\n scatter_size = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L272_C12", "label": "scatter_size =", "type": "assigned_variable", "loc": [272, 272], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L271_C8", "vector": [14, 3, 0.1658, 0.0006, 3, 0.67, 0.0, 891, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "scatter_size", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " scatter_size = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L274_C8", "label": "append()", "type": "expression", "loc": [274, 274], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L232_C4", "vector": [8, 2, 0.167, 0.0006, 2, 0.76, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " giant_list.append((traj_vel, ftan_l, mech_x_degrees, color, legend, xlabel, ylabel, trial_num))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L276_C4", "label": "giant_list_sorted = reversed()", "type": "assigned_variable", "loc": [276, 276], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L143_C0", "vector": [14, 1, 0.1682, 0.0006, 1, 0.52, 0.8889, 480, 3, 1, 0, 0, 339, 10, 2], "semantic": {"name": "giant_list_sorted", "arg_names": [], "import_names": [], "rhs_call_name": "reversed", "annotation": ""}, "snippet": " giant_list_sorted = reversed(sorted(giant_list))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L277_C4", "label": "for traj_vel, ftan_l, mech_x_degrees, color, legend, xlabel, ylabel, trial_num", "type": "for", "loc": [277, 282], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L143_C0", "vector": [6, 1, 0.1703, 0.0037, 1, 0.52, 0.9259, 772, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "traj_vel, ftan_l, mech_x_degrees, color, legend, xlabel, ylabel, trial_num", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for traj_vel, ftan_l, mech_x_degrees, color, legend, xlabel, ylabel, trial_num in giant_list_sorted:\n mpu.plot_yx(ftan_l, mech_x_degrees, axis=None,\n plot_title= '\\huge{%s: %s}'%(mech_name, trial), xlabel=xlabel,\n ylabel = ylabel, color = color,\n #scatter_size = 5, linewidth = 1, label=trial_num)\n scatter_size = scatter_size, linewidth = 1, label=legend)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L278_C8", "label": "plot_yx()", "type": "expression", "loc": [278, 282], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L277_C4", "vector": [8, 2, 0.1706, 0.003, 2, 0.07, 0.0, 112, 3, 10, 0, 0, 0, 0, 1], "semantic": {"name": "plot_yx", "arg_names": [], "import_names": [], "rhs_call_name": "plot_yx", "annotation": ""}, "snippet": " mpu.plot_yx(ftan_l, mech_x_degrees, axis=None,\n plot_title= '\\huge{%s: %s}'%(mech_name, trial), xlabel=xlabel,\n ylabel = ylabel, color = color,\n #scatter_size = 5, linewidth = 1, label=trial_num)\n scatter_size = scatter_size, linewidth = 1, label=legend)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L283_C4", "label": "print()", "type": "expression", "loc": [283, 283], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L143_C0", "vector": [8, 1, 0.1725, 0.0006, 1, 0.52, 0.963, 535, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('>>>>>>>>>> number of trials <<<<<<<<<<<', len(giant_list))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L285_C4", "label": "figure()", "type": "expression", "loc": [285, 285], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L143_C0", "vector": [8, 1, 0.1737, 0.0006, 1, 0.52, 1.0, 789, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "figure", "arg_names": [], "import_names": [], "rhs_call_name": "figure", "annotation": ""}, "snippet": " mpu.figure(fig1.number)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L289_C0", "label": "radial_tangential_ratio", "type": "function", "loc": [289, 303], "level": 0, "parent": null, "vector": [2, 0, 0.1804, 0.0091, 0, 0.66, 0.4, 951, 0, 1, 0, 0, 0, 0, 15], "semantic": {"name": "radial_tangential_ratio", "arg_names": ["dir_name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def radial_tangential_ratio(dir_name):\n d = extract_pkls(dir_name, open=True)\n nm = get_mech_name(dir_name)\n frad_ll = d['frad_l_l']\n mechx_ll = d['mechx_l_l']\n mpu.figure()\n for i,ftan_l in enumerate(d['ftan_l_l']):\n frad_l = frad_ll[i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L290_C4", "label": "d = extract_pkls()", "type": "assigned_variable", "loc": [290, 290], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L289_C0", "vector": [14, 1, 0.1767, 0.0006, 1, 0.57, 0.0, 355, 3, 2, 0, 0, 780, 10, 1], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "extract_pkls", "annotation": ""}, "snippet": " d = extract_pkls(dir_name, open=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L291_C4", "label": "nm = get_mech_name()", "type": "assigned_variable", "loc": [291, 291], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L289_C0", "vector": [14, 1, 0.1773, 0.0006, 1, 0.57, 0.2, 931, 3, 1, 0, 0, 59, 10, 1], "semantic": {"name": "nm", "arg_names": [], "import_names": [], "rhs_call_name": "get_mech_name", "annotation": ""}, "snippet": " nm = get_mech_name(dir_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L292_C4", "label": "frad_ll =", "type": "assigned_variable", "loc": [292, 292], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L289_C0", "vector": [14, 1, 0.1779, 0.0006, 1, 0.57, 0.4, 120, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "frad_ll", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " frad_ll = d['frad_l_l']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L293_C4", "label": "mechx_ll =", "type": "assigned_variable", "loc": [293, 293], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L289_C0", "vector": [14, 1, 0.1785, 0.0006, 1, 0.57, 0.6, 266, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "mechx_ll", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mechx_ll = d['mechx_l_l']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L294_C4", "label": "figure()", "type": "expression", "loc": [294, 294], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L289_C0", "vector": [8, 1, 0.1792, 0.0006, 1, 0.57, 0.8, 789, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "figure", "arg_names": [], "import_names": [], "rhs_call_name": "figure", "annotation": ""}, "snippet": " mpu.figure()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L295_C4", "label": "for i, ftan_l", "type": "for", "loc": [295, 303], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L289_C0", "vector": [6, 1, 0.1822, 0.0055, 1, 0.57, 1.0, 658, 3, 0, 0, 0, 0, 0, 12], "semantic": {"name": "i, ftan_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i,ftan_l in enumerate(d['ftan_l_l']):\n frad_l = frad_ll[i]\n rad_arr = np.array(np.abs(frad_l))\n tan_arr = np.array(np.abs(ftan_l))\n idxs = np.where(np.logical_and(rad_arr > 0.1, tan_arr > 0.1))\n ratio = np.divide(rad_arr[idxs], tan_arr[idxs])\n mpu.plot_yx(ratio, np.degrees(np.array(mechx_ll[i])[idxs]),\n color = mpu.random_color(), plot_title=nm,"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L296_C8", "label": "frad_l =", "type": "assigned_variable", "loc": [296, 296], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L295_C4", "vector": [14, 2, 0.1804, 0.0006, 2, 0.42, 0.0, 863, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "frad_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " frad_l = frad_ll[i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L297_C8", "label": "rad_arr = array()", "type": "assigned_variable", "loc": [297, 297], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L295_C4", "vector": [14, 2, 0.181, 0.0006, 2, 0.42, 0.2, 839, 3, 1, 0, 0, 80, 10, 2], "semantic": {"name": "rad_arr", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " rad_arr = np.array(np.abs(frad_l))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L298_C8", "label": "tan_arr = array()", "type": "assigned_variable", "loc": [298, 298], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L295_C4", "vector": [14, 2, 0.1816, 0.0006, 2, 0.42, 0.4, 770, 3, 1, 0, 0, 80, 10, 2], "semantic": {"name": "tan_arr", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " tan_arr = np.array(np.abs(ftan_l))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L299_C8", "label": "idxs = where()", "type": "assigned_variable", "loc": [299, 299], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L295_C4", "vector": [14, 2, 0.1822, 0.0006, 2, 0.42, 0.6, 677, 3, 1, 0, 0, 169, 10, 2], "semantic": {"name": "idxs", "arg_names": [], "import_names": [], "rhs_call_name": "where", "annotation": ""}, "snippet": " idxs = np.where(np.logical_and(rad_arr > 0.1, tan_arr > 0.1))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L300_C8", "label": "ratio = divide()", "type": "assigned_variable", "loc": [300, 300], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L295_C4", "vector": [14, 2, 0.1828, 0.0006, 2, 0.42, 0.8, 188, 3, 2, 0, 0, 982, 10, 1], "semantic": {"name": "ratio", "arg_names": [], "import_names": [], "rhs_call_name": "divide", "annotation": ""}, "snippet": " ratio = np.divide(rad_arr[idxs], tan_arr[idxs])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L301_C8", "label": "plot_yx()", "type": "expression", "loc": [301, 303], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L295_C4", "vector": [8, 2, 0.184, 0.0018, 2, 0.42, 1.0, 112, 3, 6, 0, 0, 0, 0, 4], "semantic": {"name": "plot_yx", "arg_names": [], "import_names": [], "rhs_call_name": "plot_yx", "annotation": ""}, "snippet": " mpu.plot_yx(ratio, np.degrees(np.array(mechx_ll[i])[idxs]),\n color = mpu.random_color(), plot_title=nm,\n ylabel='radial/tangential', xlabel='Angle (degrees)')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L308_C0", "label": "get_mech_name", "type": "function", "loc": [308, 313], "level": 0, "parent": null, "vector": [2, 0, 0.1892, 0.0037, 0, 0.66, 0.4222, 59, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "get_mech_name", "arg_names": ["d"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def get_mech_name(d):\n t = d.split('/')\n mech_name = t[-1]\n if mech_name == '':\n mech_name = t[-2]\n return mech_name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L309_C4", "label": "t = split()", "type": "assigned_variable", "loc": [309, 309], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L308_C0", "vector": [14, 1, 0.1883, 0.0006, 1, 0.68, 0.0, 15, 3, 1, 0, 0, 908, 10, 1], "semantic": {"name": "t", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": " t = d.split('/')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L310_C4", "label": "mech_name =", "type": "assigned_variable", "loc": [310, 310], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L308_C0", "vector": [14, 1, 0.1889, 0.0006, 1, 0.68, 0.3333, 884, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "mech_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mech_name = t[-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L311_C4", "label": "if", "type": "if", "loc": [311, 312], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L308_C0", "vector": [4, 1, 0.1898, 0.0012, 1, 0.68, 0.6667, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if mech_name == '':\n mech_name = t[-2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L312_C8", "label": "mech_name =", "type": "assigned_variable", "loc": [312, 312], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L311_C4", "vector": [14, 2, 0.1901, 0.0006, 2, 0.24, 0.0, 884, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "mech_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mech_name = t[-2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Return_L313_C4", "label": "return", "type": "return", "loc": [313, 313], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L308_C0", "vector": [13, 1, 0.1907, 0.0006, 1, 0.68, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return mech_name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L319_C0", "label": "extract_pkls", "type": "function", "loc": [319, 384], "level": 0, "parent": null, "vector": [2, 0, 0.2142, 0.0402, 0, 0.66, 0.4444, 780, 0, 4, 1, 0, 0, 0, 23], "semantic": {"name": "extract_pkls", "arg_names": ["d", "open", "quiet", "ignore_moment_list"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def extract_pkls(d, open=True, quiet = False, ignore_moment_list=False):\n if open:\n trial = 'open'\n else:\n trial = 'close'\n l = glob.glob(d+'/*'+trial+'*mechanism_trajectories*.pkl')\n l.sort()\n ftan_l_l, frad_l_l, mechx_l_l = [], [], []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L320_C4", "label": "if", "type": "if", "loc": [320, 323], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L319_C0", "vector": [4, 1, 0.1959, 0.0024, 1, 0.81, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if open:\n trial = 'open'\n else:\n trial = 'close'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L321_C8", "label": "trial =", "type": "assigned_variable", "loc": [321, 321], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L320_C4", "vector": [14, 2, 0.1956, 0.0006, 2, 0.08, 0.0, 437, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "trial", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " trial = 'open'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L323_C8", "label": "trial =", "type": "assigned_variable", "loc": [323, 323], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L320_C4", "vector": [14, 2, 0.1968, 0.0006, 2, 0.08, 1.0, 437, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "trial", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " trial = 'close'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L324_C4", "label": "l = glob()", "type": "assigned_variable", "loc": [324, 324], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L319_C0", "vector": [14, 1, 0.1974, 0.0006, 1, 0.81, 0.0588, 810, 3, 1, 0, 0, 958, 10, 1], "semantic": {"name": "l", "arg_names": [], "import_names": [], "rhs_call_name": "glob", "annotation": ""}, "snippet": " l = glob.glob(d+'/*'+trial+'*mechanism_trajectories*.pkl')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L325_C4", "label": "sort()", "type": "expression", "loc": [325, 325], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L319_C0", "vector": [8, 1, 0.198, 0.0006, 1, 0.81, 0.1176, 489, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "sort", "arg_names": [], "import_names": [], "rhs_call_name": "sort", "annotation": ""}, "snippet": " l.sort()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L326_C4", "label": "ftan_l_l, frad_l_l, mechx_l_l =", "type": "assigned_variable", "loc": [326, 326], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L319_C0", "vector": [14, 1, 0.1987, 0.0006, 1, 0.81, 0.1765, 958, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "ftan_l_l, frad_l_l, mechx_l_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ftan_l_l, frad_l_l, mechx_l_l = [], [], []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L327_C4", "label": "time_l_l, trial_num_l =", "type": "assigned_variable", "loc": [327, 327], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L319_C0", "vector": [14, 1, 0.1993, 0.0006, 1, 0.81, 0.2353, 179, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "time_l_l, trial_num_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " time_l_l, trial_num_l = [], []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L328_C4", "label": "moment_l_l =", "type": "assigned_variable", "loc": [328, 328], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L319_C0", "vector": [14, 1, 0.1999, 0.0006, 1, 0.81, 0.2941, 498, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "moment_l_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " moment_l_l = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L329_C4", "label": "typ, rad =", "type": "assigned_variable", "loc": [329, 329], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L319_C0", "vector": [14, 1, 0.2005, 0.0006, 1, 0.81, 0.3529, 585, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "typ, rad", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " typ, rad = None, None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L330_C4", "label": "for p", "type": "for", "loc": [330, 372], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L319_C0", "vector": [6, 1, 0.2139, 0.0262, 1, 0.81, 0.4118, 491, 2, 0, 0, 0, 0, 0, 21], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for p in l:\n d = ut.load_pickle(p)\n\n if d.has_key('radius'):\n rad = d['radius']\n else:\n rad = -1\n# if quiet == False:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L331_C8", "label": "d = load_pickle()", "type": "assigned_variable", "loc": [331, 331], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L330_C4", "vector": [14, 2, 0.2017, 0.0006, 2, 0.38, 0.0, 355, 3, 1, 0, 0, 65, 10, 1], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "load_pickle", "annotation": ""}, "snippet": " d = ut.load_pickle(p)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L333_C8", "label": "if", "type": "if", "loc": [333, 336], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L330_C4", "vector": [4, 2, 0.2038, 0.0024, 2, 0.38, 0.1, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if d.has_key('radius'):\n rad = d['radius']\n else:\n rad = -1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L334_C12", "label": "rad =", "type": "assigned_variable", "loc": [334, 334], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L333_C8", "vector": [14, 3, 0.2035, 0.0006, 3, 0.16, 0.0, 439, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "rad", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rad = d['radius']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L336_C12", "label": "rad =", "type": "assigned_variable", "loc": [336, 336], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L333_C8", "vector": [14, 3, 0.2048, 0.0006, 3, 0.16, 1.0, 439, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "rad", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rad = -1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L341_C8", "label": "if", "type": "if", "loc": [341, 349], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L330_C4", "vector": [4, 2, 0.2102, 0.0055, 2, 0.38, 0.2, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if rad != -1:\n #moment_l_l.append((np.array(ftan_l_l[-1]) * rad).tolist())\n if d.has_key('moment_list'):\n moment_l_l.append(d['moment_list'])\n else:\n# if quiet == False:\n# print p, 'does not have moment_list'\n# continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L343_C12", "label": "if", "type": "if", "loc": [343, 349], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L341_C8", "vector": [4, 3, 0.2108, 0.0043, 3, 0.64, 0.0, 0, 3, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if d.has_key('moment_list'):\n moment_l_l.append(d['moment_list'])\n else:\n# if quiet == False:\n# print p, 'does not have moment_list'\n# continue\n moment_l_l.append([0 for i in range(len(d['force_rad_list']))])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L344_C16", "label": "append()", "type": "expression", "loc": [344, 344], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L343_C12", "vector": [8, 4, 0.2096, 0.0006, 4, 0.91, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " moment_l_l.append(d['moment_list'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L349_C16", "label": "append()", "type": "expression", "loc": [349, 349], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L343_C12", "vector": [8, 4, 0.2127, 0.0006, 4, 0.91, 1.0, 243, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " moment_l_l.append([0 for i in range(len(d['force_rad_list']))])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L351_C8", "label": "trial_num =", "type": "assigned_variable", "loc": [351, 351], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L330_C4", "vector": [14, 2, 0.2139, 0.0006, 2, 0.38, 0.3, 298, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "trial_num", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " trial_num = p.split('_')[-5]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L352_C8", "label": "append()", "type": "expression", "loc": [352, 352], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L330_C4", "vector": [8, 2, 0.2145, 0.0006, 2, 0.38, 0.4, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " trial_num_l.append(int(trial_num))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L353_C8", "label": "append()", "type": "expression", "loc": [353, 353], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L330_C4", "vector": [8, 2, 0.2151, 0.0006, 2, 0.38, 0.5, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " frad_l_l.append(d['force_rad_list'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L354_C8", "label": "append()", "type": "expression", "loc": [354, 354], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L330_C4", "vector": [8, 2, 0.2157, 0.0006, 2, 0.38, 0.6, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " ftan_l_l.append(d['force_tan_list'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L356_C8", "label": "if", "type": "if", "loc": [356, 361], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L330_C4", "vector": [4, 2, 0.2185, 0.0037, 2, 0.38, 0.7, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if d.has_key('mech_type'):\n typ = d['mech_type']\n else:\n if quiet == False:\n print(p, 'does not have mech_typ')\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L357_C12", "label": "typ =", "type": "assigned_variable", "loc": [357, 357], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L356_C8", "vector": [14, 3, 0.2176, 0.0006, 3, 0.55, 0.0, 722, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "typ", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " typ = d['mech_type']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L359_C12", "label": "if", "type": "if", "loc": [359, 360], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L356_C8", "vector": [4, 3, 0.2191, 0.0012, 3, 0.55, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if quiet == False:\n print(p, 'does not have mech_typ')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L360_C16", "label": "print()", "type": "expression", "loc": [360, 360], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L359_C12", "vector": [8, 4, 0.2194, 0.0006, 4, 0.96, 0.0, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(p, 'does not have mech_typ')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Return_L361_C12", "label": "return", "type": "return", "loc": [361, 361], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L356_C8", "vector": [13, 3, 0.22, 0.0006, 3, 0.55, 1.0, 0, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L363_C8", "label": "append()", "type": "expression", "loc": [363, 363], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L330_C4", "vector": [8, 2, 0.2212, 0.0006, 2, 0.38, 0.8, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " mechx_l_l.append(d['mechanism_x'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L365_C8", "label": "if", "type": "if", "loc": [365, 368], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L330_C4", "vector": [4, 2, 0.2233, 0.0024, 2, 0.38, 0.9, 0, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if d.has_key('time_list'):\n t_l = d['time_list']\n else:\n t_l = [0.03*i for i in range(len(ftan_l_l))]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L366_C12", "label": "t_l =", "type": "assigned_variable", "loc": [366, 366], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L365_C8", "vector": [14, 3, 0.223, 0.0006, 3, 0.49, 0.0, 693, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "t_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " t_l = d['time_list']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L368_C12", "label": "t_l =", "type": "assigned_variable", "loc": [368, 368], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L365_C8", "vector": [14, 3, 0.2243, 0.0006, 3, 0.49, 1.0, 693, 5, 0, 0, 0, 0, 0, 2], "semantic": {"name": "t_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " t_l = [0.03*i for i in range(len(ftan_l_l))]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L372_C8", "label": "append()", "type": "expression", "loc": [372, 372], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L330_C4", "vector": [8, 2, 0.2267, 0.0006, 2, 0.38, 1.0, 243, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " time_l_l.append((np.array(t_l)-t_l[0]).tolist())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L374_C4", "label": "r =", "type": "assigned_variable", "loc": [374, 374], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L319_C0", "vector": [14, 1, 0.2279, 0.0006, 1, 0.81, 0.4706, 436, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " r = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L375_C4", "label": "assign", "type": "assigned_variable", "loc": [375, 375], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L319_C0", "vector": [14, 1, 0.2285, 0.0006, 1, 0.81, 0.5294, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " r['ftan_l_l'] = ftan_l_l"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L376_C4", "label": "assign", "type": "assigned_variable", "loc": [376, 376], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L319_C0", "vector": [14, 1, 0.2291, 0.0006, 1, 0.81, 0.5882, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " r['frad_l_l'] = frad_l_l"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L377_C4", "label": "assign", "type": "assigned_variable", "loc": [377, 377], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L319_C0", "vector": [14, 1, 0.2297, 0.0006, 1, 0.81, 0.6471, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " r['mechx_l_l'] = mechx_l_l"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L378_C4", "label": "assign", "type": "assigned_variable", "loc": [378, 378], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L319_C0", "vector": [14, 1, 0.2303, 0.0006, 1, 0.81, 0.7059, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " r['typ'] = typ"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L379_C4", "label": "assign", "type": "assigned_variable", "loc": [379, 379], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L319_C0", "vector": [14, 1, 0.231, 0.0006, 1, 0.81, 0.7647, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " r['rad'] = rad"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L380_C4", "label": "assign", "type": "assigned_variable", "loc": [380, 380], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L319_C0", "vector": [14, 1, 0.2316, 0.0006, 1, 0.81, 0.8235, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " r['time_l_l'] = time_l_l"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L381_C4", "label": "assign", "type": "assigned_variable", "loc": [381, 381], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L319_C0", "vector": [14, 1, 0.2322, 0.0006, 1, 0.81, 0.8824, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " r['trial_num_l'] = trial_num_l"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L382_C4", "label": "assign", "type": "assigned_variable", "loc": [382, 382], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L319_C0", "vector": [14, 1, 0.2328, 0.0006, 1, 0.81, 0.9412, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " r['moment_l_l'] = moment_l_l"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Return_L384_C4", "label": "return", "type": "return", "loc": [384, 384], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L319_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 r"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L395_C0", "label": "bin", "type": "function", "loc": [395, 419], "level": 0, "parent": null, "vector": [2, 0, 0.248, 0.0152, 0, 0.66, 0.4667, 167, 0, 7, 1, 0, 0, 0, 12], "semantic": {"name": "bin", "arg_names": ["poses_list", "ftan_list", "bin_size", "fn", "ignore_empty", "max_pose", "empty_value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def bin(poses_list, ftan_list, bin_size, fn, ignore_empty,\n max_pose=None, empty_value = None):\n if max_pose == None:\n max_dist = max(poses_list)\n else:\n max_dist = max_pose\n\n poses_array = np.array(poses_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L397_C4", "label": "if", "type": "if", "loc": [397, 400], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L395_C0", "vector": [4, 1, 0.2428, 0.0024, 1, 0.41, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if max_pose == None:\n max_dist = max(poses_list)\n else:\n max_dist = max_pose"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L398_C8", "label": "max_dist = max()", "type": "assigned_variable", "loc": [398, 398], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L397_C4", "vector": [14, 2, 0.2425, 0.0006, 2, 0.84, 0.0, 822, 3, 1, 0, 0, 442, 10, 1], "semantic": {"name": "max_dist", "arg_names": [], "import_names": [], "rhs_call_name": "max", "annotation": ""}, "snippet": " max_dist = max(poses_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L400_C8", "label": "max_dist =", "type": "assigned_variable", "loc": [400, 400], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L397_C4", "vector": [14, 2, 0.2438, 0.0006, 2, 0.84, 1.0, 822, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "max_dist", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " max_dist = max_pose"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L402_C4", "label": "poses_array = array()", "type": "assigned_variable", "loc": [402, 402], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L395_C0", "vector": [14, 1, 0.245, 0.0006, 1, 0.41, 0.1429, 105, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "poses_array", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " poses_array = np.array(poses_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L403_C4", "label": "binned_poses_array = arange()", "type": "assigned_variable", "loc": [403, 403], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L395_C0", "vector": [14, 1, 0.2456, 0.0006, 1, 0.41, 0.2857, 857, 3, 3, 0, 0, 489, 10, 1], "semantic": {"name": "binned_poses_array", "arg_names": [], "import_names": [], "rhs_call_name": "arange", "annotation": ""}, "snippet": " binned_poses_array = np.arange(0., max_dist, bin_size)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L405_C4", "label": "binned_force_list =", "type": "assigned_variable", "loc": [405, 405], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L395_C0", "vector": [14, 1, 0.2468, 0.0006, 1, 0.41, 0.4286, 962, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "binned_force_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " binned_force_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L406_C4", "label": "binned_poses_list =", "type": "assigned_variable", "loc": [406, 406], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L395_C0", "vector": [14, 1, 0.2474, 0.0006, 1, 0.41, 0.5714, 838, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "binned_poses_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " binned_poses_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L407_C4", "label": "ftan_array = array()", "type": "assigned_variable", "loc": [407, 407], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L395_C0", "vector": [14, 1, 0.248, 0.0006, 1, 0.41, 0.7143, 128, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "ftan_array", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " ftan_array = np.array(ftan_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L409_C4", "label": "for i", "type": "for", "loc": [409, 417], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L395_C0", "vector": [6, 1, 0.2517, 0.0055, 1, 0.41, 0.8571, 826, 3, 0, 0, 0, 0, 0, 8], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(binned_poses_array.shape[0]-1):\n idxs = np.where(np.logical_and(poses_array>=binned_poses_array[i],\n poses_array<binned_poses_array[i+1]))\n if idxs[0].shape[0] != 0:\n binned_poses_list.append(binned_poses_array[i])\n binned_force_list.append(fn(ftan_array[idxs]))\n elif ignore_empty == False:\n binned_poses_list.append(binned_poses_array[i])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L410_C8", "label": "idxs = where()", "type": "assigned_variable", "loc": [410, 411], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L409_C4", "vector": [14, 2, 0.2502, 0.0012, 2, 0.06, 0.0, 677, 3, 1, 0, 0, 169, 10, 2], "semantic": {"name": "idxs", "arg_names": [], "import_names": [], "rhs_call_name": "where", "annotation": ""}, "snippet": " idxs = np.where(np.logical_and(poses_array>=binned_poses_array[i],\n poses_array<binned_poses_array[i+1]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L412_C8", "label": "if", "type": "if", "loc": [412, 417], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L409_C4", "vector": [4, 2, 0.2526, 0.0037, 2, 0.06, 1.0, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if idxs[0].shape[0] != 0:\n binned_poses_list.append(binned_poses_array[i])\n binned_force_list.append(fn(ftan_array[idxs]))\n elif ignore_empty == False:\n binned_poses_list.append(binned_poses_array[i])\n binned_force_list.append(empty_value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L413_C12", "label": "append()", "type": "expression", "loc": [413, 413], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L412_C8", "vector": [8, 3, 0.2517, 0.0006, 3, 0.27, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " binned_poses_list.append(binned_poses_array[i])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L414_C12", "label": "append()", "type": "expression", "loc": [414, 414], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L412_C8", "vector": [8, 3, 0.2523, 0.0006, 3, 0.27, 0.5, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " binned_force_list.append(fn(ftan_array[idxs]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L415_C8", "label": "if", "type": "if", "loc": [415, 417], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L412_C8", "vector": [4, 3, 0.2535, 0.0018, 3, 0.27, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif ignore_empty == False:\n binned_poses_list.append(binned_poses_array[i])\n binned_force_list.append(empty_value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L416_C12", "label": "append()", "type": "expression", "loc": [416, 416], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L415_C8", "vector": [8, 4, 0.2535, 0.0006, 4, 0.08, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " binned_poses_list.append(binned_poses_array[i])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L417_C12", "label": "append()", "type": "expression", "loc": [417, 417], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L415_C8", "vector": [8, 4, 0.2541, 0.0006, 4, 0.08, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " binned_force_list.append(empty_value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Return_L419_C4", "label": "return", "type": "return", "loc": [419, 419], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L395_C0", "vector": [13, 1, 0.2553, 0.0006, 1, 0.41, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return binned_poses_list, binned_force_list"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L425_C0", "label": "max_force_radius_scatter", "type": "function", "loc": [425, 452], "level": 0, "parent": null, "vector": [2, 0, 0.2672, 0.0171, 0, 0.66, 0.4889, 698, 0, 2, 0, 0, 0, 0, 21], "semantic": {"name": "max_force_radius_scatter", "arg_names": ["dir_name_list", "open"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def max_force_radius_scatter(dir_name_list, open=True):\n mpu.figure()\n if open:\n trial = 'Opening'\n else:\n trial = 'Closing'\n\n for d in dir_name_list:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L426_C4", "label": "figure()", "type": "expression", "loc": [426, 426], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L425_C0", "vector": [8, 1, 0.2596, 0.0006, 1, 0.5, 0.0, 789, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "figure", "arg_names": [], "import_names": [], "rhs_call_name": "figure", "annotation": ""}, "snippet": " mpu.figure()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L427_C4", "label": "if", "type": "if", "loc": [427, 430], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L425_C0", "vector": [4, 1, 0.2611, 0.0024, 1, 0.5, 0.3333, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if open:\n trial = 'Opening'\n else:\n trial = 'Closing'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L428_C8", "label": "trial =", "type": "assigned_variable", "loc": [428, 428], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L427_C4", "vector": [14, 2, 0.2608, 0.0006, 2, 0.89, 0.0, 437, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "trial", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " trial = 'Opening'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L430_C8", "label": "trial =", "type": "assigned_variable", "loc": [430, 430], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L427_C4", "vector": [14, 2, 0.262, 0.0006, 2, 0.89, 1.0, 437, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "trial", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " trial = 'Closing'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L432_C4", "label": "for d", "type": "for", "loc": [432, 451], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L425_C0", "vector": [6, 1, 0.269, 0.0122, 1, 0.5, 0.6667, 355, 2, 0, 0, 0, 0, 0, 19], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for d in dir_name_list:\n nm = get_mech_name(d)\n print('>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>')\n print('MECHANISM:', nm)\n print('>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>')\n ftan_l_l, frad_l_l, mechx_l_l, typ, rad = extract_pkls(d, open)\n fl, rl = [], []\n for n in range(len(ftan_l_l)):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L433_C8", "label": "nm = get_mech_name()", "type": "assigned_variable", "loc": [433, 433], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L432_C4", "vector": [14, 2, 0.2639, 0.0006, 2, 0.84, 0.0, 931, 3, 1, 0, 0, 59, 10, 1], "semantic": {"name": "nm", "arg_names": [], "import_names": [], "rhs_call_name": "get_mech_name", "annotation": ""}, "snippet": " nm = get_mech_name(d)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L434_C8", "label": "print()", "type": "expression", "loc": [434, 434], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L432_C4", "vector": [8, 2, 0.2645, 0.0006, 2, 0.84, 0.0909, 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_99534:Expr_L435_C8", "label": "print()", "type": "expression", "loc": [435, 435], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L432_C4", "vector": [8, 2, 0.2651, 0.0006, 2, 0.84, 0.1818, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('MECHANISM:', nm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L436_C8", "label": "print()", "type": "expression", "loc": [436, 436], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L432_C4", "vector": [8, 2, 0.2657, 0.0006, 2, 0.84, 0.2727, 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_99534:Assign_L437_C8", "label": "ftan_l_l, frad_l_l, mechx_l_l, typ, rad = extract_pkls()", "type": "assigned_variable", "loc": [437, 437], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L432_C4", "vector": [14, 2, 0.2663, 0.0006, 2, 0.84, 0.3636, 300, 3, 2, 0, 0, 780, 10, 1], "semantic": {"name": "ftan_l_l, frad_l_l, mechx_l_l, typ, rad", "arg_names": [], "import_names": [], "rhs_call_name": "extract_pkls", "annotation": ""}, "snippet": " ftan_l_l, frad_l_l, mechx_l_l, typ, rad = extract_pkls(d, open)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L438_C8", "label": "fl, rl =", "type": "assigned_variable", "loc": [438, 438], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L432_C4", "vector": [14, 2, 0.2669, 0.0006, 2, 0.84, 0.4545, 420, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "fl, rl", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " fl, rl = [], []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L439_C8", "label": "for n", "type": "for", "loc": [439, 443], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L432_C4", "vector": [6, 2, 0.2687, 0.003, 2, 0.84, 0.5455, 773, 3, 0, 0, 0, 0, 0, 7], "semantic": {"name": "n", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for n in range(len(ftan_l_l)):\n fmax = np.max(np.abs(ftan_l_l[n]))\n print('fmax:', fmax)\n fl.append(fmax)\n rl.append(rad)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L440_C12", "label": "fmax = max()", "type": "assigned_variable", "loc": [440, 440], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L439_C8", "vector": [14, 3, 0.2681, 0.0006, 3, 0.26, 0.0, 916, 3, 1, 0, 0, 442, 10, 2], "semantic": {"name": "fmax", "arg_names": [], "import_names": [], "rhs_call_name": "max", "annotation": ""}, "snippet": " fmax = np.max(np.abs(ftan_l_l[n]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L441_C12", "label": "print()", "type": "expression", "loc": [441, 441], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L439_C8", "vector": [8, 3, 0.2687, 0.0006, 3, 0.26, 0.3333, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('fmax:', fmax)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L442_C12", "label": "append()", "type": "expression", "loc": [442, 442], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L439_C8", "vector": [8, 3, 0.2693, 0.0006, 3, 0.26, 0.6667, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " fl.append(fmax)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L443_C12", "label": "append()", "type": "expression", "loc": [443, 443], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L439_C8", "vector": [8, 3, 0.27, 0.0006, 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": " rl.append(rad)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L444_C8", "label": "print()", "type": "expression", "loc": [444, 444], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L432_C4", "vector": [8, 2, 0.2706, 0.0006, 2, 0.84, 0.6364, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Aloha')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L445_C8", "label": "print()", "type": "expression", "loc": [445, 445], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L432_C4", "vector": [8, 2, 0.2712, 0.0006, 2, 0.84, 0.7273, 535, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('len(fl)', len(fl))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L446_C8", "label": "print()", "type": "expression", "loc": [446, 446], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L432_C4", "vector": [8, 2, 0.2718, 0.0006, 2, 0.84, 0.8182, 535, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('len(rl)', len(rl))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L448_C8", "label": "plot_title =", "type": "assigned_variable", "loc": [448, 448], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L432_C4", "vector": [14, 2, 0.273, 0.0006, 2, 0.84, 0.9091, 779, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "plot_title", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " plot_title = 'Scatter plot for %s trials'%trial"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L449_C8", "label": "plot_yx()", "type": "expression", "loc": [449, 451], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L432_C4", "vector": [8, 2, 0.2742, 0.0018, 2, 0.84, 1.0, 112, 3, 9, 0, 0, 0, 0, 2], "semantic": {"name": "plot_yx", "arg_names": [], "import_names": [], "rhs_call_name": "plot_yx", "annotation": ""}, "snippet": " mpu.plot_yx(fl, rl, color=mpu.random_color(), label=nm,\n axis=None, linewidth=0, xlabel='Radius (m)',\n ylabel='Maximum Force (N)', plot_title=plot_title)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L452_C4", "label": "legend()", "type": "expression", "loc": [452, 452], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L425_C0", "vector": [8, 1, 0.2754, 0.0006, 1, 0.5, 1.0, 880, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "legend", "arg_names": [], "import_names": [], "rhs_call_name": "legend", "annotation": ""}, "snippet": " mpu.legend()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L456_C0", "label": "errorbar_one_mechanism", "type": "function", "loc": [456, 554], "level": 0, "parent": null, "vector": [2, 0, 0.3077, 0.0603, 0, 0.66, 0.5111, 63, 0, 7, 0, 0, 0, 0, 40], "semantic": {"name": "errorbar_one_mechanism", "arg_names": ["dir_name", "open", "new_figure", "filter_speed", "plot_type", "color", "label"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def errorbar_one_mechanism(dir_name, open=True, new_figure=True,\n filter_speed = math.radians(100),\n plot_type='tangential', color=None,\n label = None):\n if new_figure:\n mpu.figure()\n nm = get_mech_name(dir_name)\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L460_C4", "label": "if", "type": "if", "loc": [460, 461], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L456_C0", "vector": [4, 1, 0.2806, 0.0012, 1, 0.06, 0.0, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if new_figure:\n mpu.figure()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L461_C8", "label": "figure()", "type": "expression", "loc": [461, 461], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L460_C4", "vector": [8, 2, 0.2809, 0.0006, 2, 0.6, 0.0, 789, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "figure", "arg_names": [], "import_names": [], "rhs_call_name": "figure", "annotation": ""}, "snippet": " mpu.figure()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L462_C4", "label": "nm = get_mech_name()", "type": "assigned_variable", "loc": [462, 462], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L456_C0", "vector": [14, 1, 0.2815, 0.0006, 1, 0.06, 0.0312, 931, 3, 1, 0, 0, 59, 10, 1], "semantic": {"name": "nm", "arg_names": [], "import_names": [], "rhs_call_name": "get_mech_name", "annotation": ""}, "snippet": " nm = get_mech_name(dir_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L464_C4", "label": "d = extract_pkls()", "type": "assigned_variable", "loc": [464, 464], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L456_C0", "vector": [14, 1, 0.2828, 0.0006, 1, 0.06, 0.0625, 355, 3, 2, 0, 0, 780, 10, 1], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "extract_pkls", "annotation": ""}, "snippet": " d = extract_pkls(dir_name, open)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L465_C4", "label": "ftan_l_l =", "type": "assigned_variable", "loc": [465, 465], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L456_C0", "vector": [14, 1, 0.2834, 0.0006, 1, 0.06, 0.0938, 2, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ftan_l_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ftan_l_l = d['ftan_l_l']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L466_C4", "label": "frad_l_l =", "type": "assigned_variable", "loc": [466, 466], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L456_C0", "vector": [14, 1, 0.284, 0.0006, 1, 0.06, 0.125, 269, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "frad_l_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " frad_l_l = d['frad_l_l']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L467_C4", "label": "mechx_l_l =", "type": "assigned_variable", "loc": [467, 467], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L456_C0", "vector": [14, 1, 0.2846, 0.0006, 1, 0.06, 0.1562, 760, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "mechx_l_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mechx_l_l = d['mechx_l_l']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L468_C4", "label": "time_l_l =", "type": "assigned_variable", "loc": [468, 468], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L456_C0", "vector": [14, 1, 0.2852, 0.0006, 1, 0.06, 0.1875, 201, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "time_l_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " time_l_l = d['time_l_l']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L469_C4", "label": "typ =", "type": "assigned_variable", "loc": [469, 469], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L456_C0", "vector": [14, 1, 0.2858, 0.0006, 1, 0.06, 0.2188, 722, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "typ", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " typ = d['typ']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L470_C4", "label": "rad =", "type": "assigned_variable", "loc": [470, 470], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L456_C0", "vector": [14, 1, 0.2864, 0.0006, 1, 0.06, 0.25, 439, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "rad", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rad = d['rad']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L472_C4", "label": "fn =", "type": "assigned_variable", "loc": [472, 472], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L456_C0", "vector": [14, 1, 0.2876, 0.0006, 1, 0.06, 0.2812, 59, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "fn", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " fn = list"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L474_C4", "label": "binned_mechx_l =", "type": "assigned_variable", "loc": [474, 474], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L456_C0", "vector": [14, 1, 0.2888, 0.0006, 1, 0.06, 0.3125, 443, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "binned_mechx_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " binned_mechx_l = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L475_C4", "label": "binned_ftan_ll =", "type": "assigned_variable", "loc": [475, 475], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L456_C0", "vector": [14, 1, 0.2895, 0.0006, 1, 0.06, 0.3438, 77, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "binned_ftan_ll", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " binned_ftan_ll = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L476_C4", "label": "use_trials_list =", "type": "assigned_variable", "loc": [476, 476], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L456_C0", "vector": [14, 1, 0.2901, 0.0006, 1, 0.06, 0.375, 41, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "use_trials_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " use_trials_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L478_C4", "label": "if", "type": "if", "loc": [478, 479], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L456_C0", "vector": [4, 1, 0.2916, 0.0012, 1, 0.06, 0.4062, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if plot_type == 'radial':\n force_l_l = frad_l_l"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L479_C8", "label": "force_l_l =", "type": "assigned_variable", "loc": [479, 479], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L478_C4", "vector": [14, 2, 0.2919, 0.0006, 2, 0.59, 0.0, 119, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "force_l_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " force_l_l = frad_l_l"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L480_C4", "label": "if", "type": "if", "loc": [480, 481], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L456_C0", "vector": [4, 1, 0.2928, 0.0012, 1, 0.06, 0.4375, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if plot_type == 'tangential':\n force_l_l = ftan_l_l"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L481_C8", "label": "force_l_l =", "type": "assigned_variable", "loc": [481, 481], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L480_C4", "vector": [14, 2, 0.2931, 0.0006, 2, 0.98, 0.0, 119, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "force_l_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " force_l_l = ftan_l_l"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L482_C4", "label": "if", "type": "if", "loc": [482, 485], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L456_C0", "vector": [4, 1, 0.2946, 0.0024, 1, 0.06, 0.4688, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if plot_type == 'magnitude':\n force_l_l = []\n for ta, ra in zip(ftan_l_l, frad_l_l):\n force_l_l.append(ut.norm(np.matrix([ta, ra])).A1.tolist())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L483_C8", "label": "force_l_l =", "type": "assigned_variable", "loc": [483, 483], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L482_C4", "vector": [14, 2, 0.2943, 0.0006, 2, 0.16, 0.0, 119, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "force_l_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " force_l_l = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L484_C8", "label": "for ta, ra", "type": "for", "loc": [484, 485], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L482_C4", "vector": [6, 2, 0.2952, 0.0012, 2, 0.16, 1.0, 479, 3, 0, 0, 0, 0, 0, 5], "semantic": {"name": "ta, ra", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for ta, ra in zip(ftan_l_l, frad_l_l):\n force_l_l.append(ut.norm(np.matrix([ta, ra])).A1.tolist())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L485_C12", "label": "append()", "type": "expression", "loc": [485, 485], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L484_C8", "vector": [8, 3, 0.2956, 0.0006, 3, 0.36, 0.0, 243, 3, 1, 0, 0, 0, 0, 4], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " force_l_l.append(ut.norm(np.matrix([ta, ra])).A1.tolist())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L487_C4", "label": "n_trials = len()", "type": "assigned_variable", "loc": [487, 487], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L456_C0", "vector": [14, 1, 0.2968, 0.0006, 1, 0.06, 0.5, 459, 3, 1, 0, 0, 890, 10, 1], "semantic": {"name": "n_trials", "arg_names": [], "import_names": [], "rhs_call_name": "len", "annotation": ""}, "snippet": " n_trials = len(force_l_l)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L488_C4", "label": "for i", "type": "for", "loc": [488, 502], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L456_C0", "vector": [6, 1, 0.3016, 0.0091, 1, 0.06, 0.5312, 826, 3, 0, 0, 0, 0, 0, 10], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(n_trials):\n if typ == 'rotary':\n traj_vel = compute_trajectory_velocity(mechx_l_l[i],\n time_l_l[i], 1)\n if traj_vel >= filter_speed:\n continue\n t, f = bin(mechx_l_l[i], force_l_l[i], math.radians(1.),\n fn, ignore_empty=False, max_pose=math.radians(60))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L489_C8", "label": "if", "type": "if", "loc": [489, 495], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L488_C4", "vector": [4, 2, 0.2998, 0.0043, 2, 0.33, 0.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if typ == 'rotary':\n traj_vel = compute_trajectory_velocity(mechx_l_l[i],\n time_l_l[i], 1)\n if traj_vel >= filter_speed:\n continue\n t, f = bin(mechx_l_l[i], force_l_l[i], math.radians(1.),\n fn, ignore_empty=False, max_pose=math.radians(60))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L490_C12", "label": "traj_vel = compute_trajectory_velocity()", "type": "assigned_variable", "loc": [490, 491], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L489_C8", "vector": [14, 3, 0.2989, 0.0012, 3, 0.04, 0.0, 279, 3, 3, 0, 0, 197, 10, 1], "semantic": {"name": "traj_vel", "arg_names": [], "import_names": [], "rhs_call_name": "compute_trajectory_velocity", "annotation": ""}, "snippet": " traj_vel = compute_trajectory_velocity(mechx_l_l[i],\n time_l_l[i], 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L492_C12", "label": "if", "type": "if", "loc": [492, 493], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L489_C8", "vector": [4, 3, 0.3001, 0.0012, 3, 0.04, 0.5, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if traj_vel >= filter_speed:\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L494_C12", "label": "t, f = bin()", "type": "assigned_variable", "loc": [494, 495], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L489_C8", "vector": [14, 3, 0.3013, 0.0012, 3, 0.04, 1.0, 519, 3, 6, 0, 0, 167, 10, 3], "semantic": {"name": "t, f", "arg_names": [], "import_names": [], "rhs_call_name": "bin", "annotation": ""}, "snippet": " t, f = bin(mechx_l_l[i], force_l_l[i], math.radians(1.),\n fn, ignore_empty=False, max_pose=math.radians(60))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L496_C8", "label": "if", "type": "if", "loc": [496, 498], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L488_C4", "vector": [4, 2, 0.3029, 0.0018, 2, 0.33, 0.25, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if typ == 'prismatic':\n t, f = bin(mechx_l_l[i], force_l_l[i], 0.01,\n fn, ignore_empty=False, max_pose=0.5)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L497_C12", "label": "t, f = bin()", "type": "assigned_variable", "loc": [497, 498], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L496_C8", "vector": [14, 3, 0.3032, 0.0012, 3, 0.5, 0.0, 519, 3, 6, 0, 0, 167, 10, 1], "semantic": {"name": "t, f", "arg_names": [], "import_names": [], "rhs_call_name": "bin", "annotation": ""}, "snippet": " t, f = bin(mechx_l_l[i], force_l_l[i], 0.01,\n fn, ignore_empty=False, max_pose=0.5)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L499_C8", "label": "if", "type": "if", "loc": [499, 500], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L488_C4", "vector": [4, 2, 0.3044, 0.0012, 2, 0.33, 0.5, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(t) > len(binned_mechx_l):\n binned_mechx_l = t"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L500_C12", "label": "binned_mechx_l =", "type": "assigned_variable", "loc": [500, 500], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L499_C8", "vector": [14, 3, 0.3047, 0.0006, 3, 0.66, 0.0, 443, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "binned_mechx_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " binned_mechx_l = t"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L501_C8", "label": "append()", "type": "expression", "loc": [501, 501], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L488_C4", "vector": [8, 2, 0.3053, 0.0006, 2, 0.33, 0.75, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " binned_ftan_ll.append(f)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L502_C8", "label": "append()", "type": "expression", "loc": [502, 502], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L488_C4", "vector": [8, 2, 0.3059, 0.0006, 2, 0.33, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " use_trials_list.append(i)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L504_C4", "label": "n_trials = len()", "type": "assigned_variable", "loc": [504, 504], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L456_C0", "vector": [14, 1, 0.3071, 0.0006, 1, 0.06, 0.5625, 459, 3, 1, 0, 0, 890, 10, 1], "semantic": {"name": "n_trials", "arg_names": [], "import_names": [], "rhs_call_name": "len", "annotation": ""}, "snippet": " n_trials = len(binned_ftan_ll)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L505_C4", "label": "n_bins = len()", "type": "assigned_variable", "loc": [505, 505], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L456_C0", "vector": [14, 1, 0.3077, 0.0006, 1, 0.06, 0.5938, 77, 3, 1, 0, 0, 890, 10, 1], "semantic": {"name": "n_bins", "arg_names": [], "import_names": [], "rhs_call_name": "len", "annotation": ""}, "snippet": " n_bins = len(binned_mechx_l)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L506_C4", "label": "force_list_combined =", "type": "assigned_variable", "loc": [506, 506], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L456_C0", "vector": [14, 1, 0.3083, 0.0006, 1, 0.06, 0.625, 891, 5, 0, 0, 0, 0, 0, 0], "semantic": {"name": "force_list_combined", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " force_list_combined = [[] for i in binned_mechx_l]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L507_C4", "label": "for i", "type": "for", "loc": [507, 519], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L456_C0", "vector": [6, 1, 0.3126, 0.0079, 1, 0.06, 0.6562, 826, 3, 0, 0, 0, 0, 0, 6], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(n_trials):\n force_l = binned_ftan_ll[i]\n for j,p in enumerate(binned_mechx_l):\n if force_l[j] != None:\n if open:\n if j < 5:\n force_list_combined[j].append(max(force_l[j]))\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L508_C8", "label": "force_l =", "type": "assigned_variable", "loc": [508, 508], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L507_C4", "vector": [14, 2, 0.3096, 0.0006, 2, 0.2, 0.0, 921, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "force_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " force_l = binned_ftan_ll[i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L509_C8", "label": "for j, p", "type": "for", "loc": [509, 519], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L507_C4", "vector": [6, 2, 0.3132, 0.0067, 2, 0.2, 1.0, 123, 3, 0, 0, 0, 0, 0, 5], "semantic": {"name": "j, p", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for j,p in enumerate(binned_mechx_l):\n if force_l[j] != None:\n if open:\n if j < 5:\n force_list_combined[j].append(max(force_l[j]))\n continue\n else:\n if (n_trials-j) < 5:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L510_C12", "label": "if", "type": "if", "loc": [510, 519], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L509_C8", "vector": [4, 3, 0.3135, 0.0061, 3, 0.63, 0.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if force_l[j] != None:\n if open:\n if j < 5:\n force_list_combined[j].append(max(force_l[j]))\n continue\n else:\n if (n_trials-j) < 5:\n force_list_combined[j].append(min(force_l[j]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L511_C16", "label": "if", "type": "if", "loc": [511, 518], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L510_C12", "vector": [4, 4, 0.3135, 0.0049, 4, 0.03, 0.0, 0, 2, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if open:\n if j < 5:\n force_list_combined[j].append(max(force_l[j]))\n continue\n else:\n if (n_trials-j) < 5:\n force_list_combined[j].append(min(force_l[j]))\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L512_C20", "label": "if", "type": "if", "loc": [512, 514], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L511_C16", "vector": [4, 5, 0.3126, 0.0018, 5, 0.69, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if j < 5:\n force_list_combined[j].append(max(force_l[j]))\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L513_C24", "label": "append()", "type": "expression", "loc": [513, 513], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L512_C20", "vector": [8, 6, 0.3126, 0.0006, 6, 0.65, 0.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " force_list_combined[j].append(max(force_l[j]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L516_C20", "label": "if", "type": "if", "loc": [516, 518], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L511_C16", "vector": [4, 5, 0.3151, 0.0018, 5, 0.69, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (n_trials-j) < 5:\n force_list_combined[j].append(min(force_l[j]))\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L517_C24", "label": "append()", "type": "expression", "loc": [517, 517], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L516_C20", "vector": [8, 6, 0.3151, 0.0006, 6, 0.93, 0.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " force_list_combined[j].append(min(force_l[j]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L521_C4", "label": "plot_mechx_l =", "type": "assigned_variable", "loc": [521, 521], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L456_C0", "vector": [14, 1, 0.3175, 0.0006, 1, 0.06, 0.6875, 171, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "plot_mechx_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " plot_mechx_l = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L522_C4", "label": "mean_l, std_l =", "type": "assigned_variable", "loc": [522, 522], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L456_C0", "vector": [14, 1, 0.3181, 0.0006, 1, 0.06, 0.7188, 714, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "mean_l, std_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mean_l, std_l = [], []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L523_C4", "label": "for i, p", "type": "for", "loc": [523, 529], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L456_C0", "vector": [6, 1, 0.3205, 0.0043, 1, 0.06, 0.75, 816, 3, 0, 0, 0, 0, 0, 7], "semantic": {"name": "i, p", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i,p in enumerate(binned_mechx_l):\n f_l = force_list_combined[i]\n if len(f_l) == 0:\n continue\n plot_mechx_l.append(p)\n mean_l.append(np.mean(f_l))\n std_l.append(np.std(f_l))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L524_C8", "label": "f_l =", "type": "assigned_variable", "loc": [524, 524], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L523_C4", "vector": [14, 2, 0.3193, 0.0006, 2, 0.73, 0.0, 265, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "f_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " f_l = force_list_combined[i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L525_C8", "label": "if", "type": "if", "loc": [525, 526], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L523_C4", "vector": [4, 2, 0.3202, 0.0012, 2, 0.73, 0.25, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(f_l) == 0:\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L527_C8", "label": "append()", "type": "expression", "loc": [527, 527], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L523_C4", "vector": [8, 2, 0.3211, 0.0006, 2, 0.73, 0.5, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " plot_mechx_l.append(p)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L528_C8", "label": "append()", "type": "expression", "loc": [528, 528], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L523_C4", "vector": [8, 2, 0.3218, 0.0006, 2, 0.73, 0.75, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " mean_l.append(np.mean(f_l))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L529_C8", "label": "append()", "type": "expression", "loc": [529, 529], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L523_C4", "vector": [8, 2, 0.3224, 0.0006, 2, 0.73, 1.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " std_l.append(np.std(f_l))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L531_C4", "label": "if", "type": "if", "loc": [531, 534], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L456_C0", "vector": [4, 1, 0.3245, 0.0024, 1, 0.06, 0.7812, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if open:\n trial = 'Open'\n else:\n trial = 'Close'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L532_C8", "label": "trial =", "type": "assigned_variable", "loc": [532, 532], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L531_C4", "vector": [14, 2, 0.3242, 0.0006, 2, 0.9, 0.0, 437, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "trial", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " trial = 'Open'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L534_C8", "label": "trial =", "type": "assigned_variable", "loc": [534, 534], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L531_C4", "vector": [14, 2, 0.3254, 0.0006, 2, 0.9, 1.0, 437, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "trial", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " trial = 'Close'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L536_C4", "label": "n_sigma =", "type": "assigned_variable", "loc": [536, 536], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L456_C0", "vector": [14, 1, 0.3266, 0.0006, 1, 0.06, 0.8125, 36, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "n_sigma", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " n_sigma = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L537_C4", "label": "if", "type": "if", "loc": [537, 542], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L456_C0", "vector": [4, 1, 0.3288, 0.0037, 1, 0.06, 0.8438, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if typ == 'rotary':\n x_l = np.degrees(plot_mechx_l)\n xlabel='\\huge{Angle (degrees)}'\n else:\n x_l = plot_mechx_l\n xlabel='Distance (m)'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L538_C8", "label": "x_l = degrees()", "type": "assigned_variable", "loc": [538, 538], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L537_C4", "vector": [14, 2, 0.3278, 0.0006, 2, 0.41, 0.0, 508, 3, 1, 0, 0, 633, 10, 1], "semantic": {"name": "x_l", "arg_names": [], "import_names": [], "rhs_call_name": "degrees", "annotation": ""}, "snippet": " x_l = np.degrees(plot_mechx_l)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L539_C8", "label": "xlabel =", "type": "assigned_variable", "loc": [539, 539], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L537_C4", "vector": [14, 2, 0.3285, 0.0006, 2, 0.41, 0.3333, 676, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "xlabel", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " xlabel='\\huge{Angle (degrees)}'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L541_C8", "label": "x_l =", "type": "assigned_variable", "loc": [541, 541], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L537_C4", "vector": [14, 2, 0.3297, 0.0006, 2, 0.41, 0.6667, 508, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "x_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " x_l = plot_mechx_l"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L542_C8", "label": "xlabel =", "type": "assigned_variable", "loc": [542, 542], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L537_C4", "vector": [14, 2, 0.3303, 0.0006, 2, 0.41, 1.0, 676, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "xlabel", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " xlabel='Distance (m)'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L544_C4", "label": "std_arr =", "type": "assigned_variable", "loc": [544, 544], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L456_C0", "vector": [14, 1, 0.3315, 0.0006, 1, 0.06, 0.875, 253, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "std_arr", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " std_arr = np.array(std_l) * n_sigma"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L545_C4", "label": "if", "type": "if", "loc": [545, 546], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L456_C0", "vector": [4, 1, 0.3324, 0.0012, 1, 0.06, 0.9062, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if color == None:\n color = mpu.random_color()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L546_C8", "label": "color = random_color()", "type": "assigned_variable", "loc": [546, 546], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L545_C4", "vector": [14, 2, 0.3327, 0.0006, 2, 0.52, 0.0, 776, 3, 0, 0, 0, 895, 10, 1], "semantic": {"name": "color", "arg_names": [], "import_names": [], "rhs_call_name": "random_color", "annotation": ""}, "snippet": " color = mpu.random_color()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L547_C4", "label": "if", "type": "if", "loc": [547, 548], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L456_C0", "vector": [4, 1, 0.3336, 0.0012, 1, 0.06, 0.9375, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if label == None:\n label= nm+' '+plot_type"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L548_C8", "label": "label =", "type": "assigned_variable", "loc": [548, 548], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L547_C4", "vector": [14, 2, 0.3339, 0.0006, 2, 0.5, 0.0, 811, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "label", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " label= nm+' '+plot_type"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L550_C4", "label": "plot_errorbar_yx()", "type": "expression", "loc": [550, 553], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L456_C0", "vector": [8, 1, 0.3361, 0.0024, 1, 0.06, 0.9688, 840, 3, 9, 0, 0, 0, 0, 1], "semantic": {"name": "plot_errorbar_yx", "arg_names": [], "import_names": [], "rhs_call_name": "plot_errorbar_yx", "annotation": ""}, "snippet": " mpu.plot_errorbar_yx(mean_l, std_arr, x_l, linewidth=1, color=color,\n plot_title='\\huge{Mean \\& %d$\\sigma$}'%(n_sigma),\n xlabel=xlabel, label=label,\n ylabel='\\huge{Force (N)}')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L554_C4", "label": "legend()", "type": "expression", "loc": [554, 554], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L456_C0", "vector": [8, 1, 0.3376, 0.0006, 1, 0.06, 1.0, 880, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "legend", "arg_names": [], "import_names": [], "rhs_call_name": "legend", "annotation": ""}, "snippet": " mpu.legend()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L557_C0", "label": "errorbar_one_mechanism_max", "type": "function", "loc": [557, 624], "level": 0, "parent": null, "vector": [2, 0, 0.3598, 0.0414, 0, 0.66, 0.5333, 802, 0, 3, 0, 0, 0, 0, 29], "semantic": {"name": "errorbar_one_mechanism_max", "arg_names": ["dir_name", "open", "filter_speed"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def errorbar_one_mechanism_max(dir_name, open=True,\n filter_speed=math.radians(100.)):\n# mpu.figure()\n nm = get_mech_name(dir_name)\n d = extract_pkls(dir_name, open)\n ftan_l_l = d['ftan_l_l']\n frad_l_l = d['frad_l_l']\n mechx_l_l = d['mechx_l_l']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L560_C4", "label": "nm = get_mech_name()", "type": "assigned_variable", "loc": [560, 560], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L557_C0", "vector": [14, 1, 0.3413, 0.0006, 1, 0.75, 0.0, 931, 3, 1, 0, 0, 59, 10, 1], "semantic": {"name": "nm", "arg_names": [], "import_names": [], "rhs_call_name": "get_mech_name", "annotation": ""}, "snippet": " nm = get_mech_name(dir_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L561_C4", "label": "d = extract_pkls()", "type": "assigned_variable", "loc": [561, 561], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L557_C0", "vector": [14, 1, 0.3419, 0.0006, 1, 0.75, 0.0417, 355, 3, 2, 0, 0, 780, 10, 1], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "extract_pkls", "annotation": ""}, "snippet": " d = extract_pkls(dir_name, open)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L562_C4", "label": "ftan_l_l =", "type": "assigned_variable", "loc": [562, 562], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L557_C0", "vector": [14, 1, 0.3425, 0.0006, 1, 0.75, 0.0833, 2, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ftan_l_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ftan_l_l = d['ftan_l_l']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L563_C4", "label": "frad_l_l =", "type": "assigned_variable", "loc": [563, 563], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L557_C0", "vector": [14, 1, 0.3431, 0.0006, 1, 0.75, 0.125, 269, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "frad_l_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " frad_l_l = d['frad_l_l']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L564_C4", "label": "mechx_l_l =", "type": "assigned_variable", "loc": [564, 564], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L557_C0", "vector": [14, 1, 0.3437, 0.0006, 1, 0.75, 0.1667, 760, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "mechx_l_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mechx_l_l = d['mechx_l_l']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L565_C4", "label": "time_l_l =", "type": "assigned_variable", "loc": [565, 565], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L557_C0", "vector": [14, 1, 0.3443, 0.0006, 1, 0.75, 0.2083, 201, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "time_l_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " time_l_l = d['time_l_l']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L566_C4", "label": "typ =", "type": "assigned_variable", "loc": [566, 566], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L557_C0", "vector": [14, 1, 0.3449, 0.0006, 1, 0.75, 0.25, 722, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "typ", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " typ = d['typ']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L567_C4", "label": "rad =", "type": "assigned_variable", "loc": [567, 567], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L557_C0", "vector": [14, 1, 0.3455, 0.0006, 1, 0.75, 0.2917, 439, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "rad", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rad = d['rad']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L569_C4", "label": "fn =", "type": "assigned_variable", "loc": [569, 569], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L557_C0", "vector": [14, 1, 0.3467, 0.0006, 1, 0.75, 0.3333, 59, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "fn", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " fn = max"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L570_C4", "label": "if", "type": "if", "loc": [570, 571], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L557_C0", "vector": [4, 1, 0.3477, 0.0012, 1, 0.75, 0.375, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if open == False:\n fn = min"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L571_C8", "label": "fn =", "type": "assigned_variable", "loc": [571, 571], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L570_C4", "vector": [14, 2, 0.348, 0.0006, 2, 0.41, 0.0, 59, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "fn", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " fn = min"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L573_C4", "label": "binned_mechx_l =", "type": "assigned_variable", "loc": [573, 573], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L557_C0", "vector": [14, 1, 0.3492, 0.0006, 1, 0.75, 0.4167, 443, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "binned_mechx_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " binned_mechx_l = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L574_C4", "label": "binned_ftan_ll =", "type": "assigned_variable", "loc": [574, 574], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L557_C0", "vector": [14, 1, 0.3498, 0.0006, 1, 0.75, 0.4583, 77, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "binned_ftan_ll", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " binned_ftan_ll = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L575_C4", "label": "use_trials_list =", "type": "assigned_variable", "loc": [575, 575], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L557_C0", "vector": [14, 1, 0.3504, 0.0006, 1, 0.75, 0.5, 41, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "use_trials_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " use_trials_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L577_C4", "label": "n_trials = len()", "type": "assigned_variable", "loc": [577, 577], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L557_C0", "vector": [14, 1, 0.3516, 0.0006, 1, 0.75, 0.5417, 459, 3, 1, 0, 0, 890, 10, 1], "semantic": {"name": "n_trials", "arg_names": [], "import_names": [], "rhs_call_name": "len", "annotation": ""}, "snippet": " n_trials = len(ftan_l_l)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L578_C4", "label": "for i", "type": "for", "loc": [578, 593], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L557_C0", "vector": [6, 1, 0.3568, 0.0098, 1, 0.75, 0.5833, 826, 3, 0, 0, 0, 0, 0, 10], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(n_trials):\n if typ == 'rotary':\n traj_vel = compute_trajectory_velocity(mechx_l_l[i],\n time_l_l[i], 1)\n if traj_vel >= filter_speed:\n continue\n t, f = bin(mechx_l_l[i], ftan_l_l[i], math.radians(1.),\n fn, ignore_empty=False, max_pose=math.radians(60))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L579_C8", "label": "if", "type": "if", "loc": [579, 585], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L578_C4", "vector": [4, 2, 0.3547, 0.0043, 2, 0.99, 0.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if typ == 'rotary':\n traj_vel = compute_trajectory_velocity(mechx_l_l[i],\n time_l_l[i], 1)\n if traj_vel >= filter_speed:\n continue\n t, f = bin(mechx_l_l[i], ftan_l_l[i], math.radians(1.),\n fn, ignore_empty=False, max_pose=math.radians(60))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L580_C12", "label": "traj_vel = compute_trajectory_velocity()", "type": "assigned_variable", "loc": [580, 581], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L579_C8", "vector": [14, 3, 0.3537, 0.0012, 3, 0.77, 0.0, 279, 3, 3, 0, 0, 197, 10, 1], "semantic": {"name": "traj_vel", "arg_names": [], "import_names": [], "rhs_call_name": "compute_trajectory_velocity", "annotation": ""}, "snippet": " traj_vel = compute_trajectory_velocity(mechx_l_l[i],\n time_l_l[i], 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L582_C12", "label": "if", "type": "if", "loc": [582, 583], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L579_C8", "vector": [4, 3, 0.355, 0.0012, 3, 0.77, 0.5, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if traj_vel >= filter_speed:\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L584_C12", "label": "t, f = bin()", "type": "assigned_variable", "loc": [584, 585], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L579_C8", "vector": [14, 3, 0.3562, 0.0012, 3, 0.77, 1.0, 519, 3, 6, 0, 0, 167, 10, 3], "semantic": {"name": "t, f", "arg_names": [], "import_names": [], "rhs_call_name": "bin", "annotation": ""}, "snippet": " t, f = bin(mechx_l_l[i], ftan_l_l[i], math.radians(1.),\n fn, ignore_empty=False, max_pose=math.radians(60))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L586_C8", "label": "if", "type": "if", "loc": [586, 588], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L578_C4", "vector": [4, 2, 0.3577, 0.0018, 2, 0.99, 0.25, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if typ == 'prismatic':\n t, f = bin(mechx_l_l[i], ftan_l_l[i], 0.01,\n fn, ignore_empty=False, max_pose=0.5)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L587_C12", "label": "t, f = bin()", "type": "assigned_variable", "loc": [587, 588], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L586_C8", "vector": [14, 3, 0.358, 0.0012, 3, 0.21, 0.0, 519, 3, 6, 0, 0, 167, 10, 1], "semantic": {"name": "t, f", "arg_names": [], "import_names": [], "rhs_call_name": "bin", "annotation": ""}, "snippet": " t, f = bin(mechx_l_l[i], ftan_l_l[i], 0.01,\n fn, ignore_empty=False, max_pose=0.5)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L590_C8", "label": "if", "type": "if", "loc": [590, 591], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L578_C4", "vector": [4, 2, 0.3598, 0.0012, 2, 0.99, 0.5, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(t) > len(binned_mechx_l):\n binned_mechx_l = t"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L591_C12", "label": "binned_mechx_l =", "type": "assigned_variable", "loc": [591, 591], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L590_C8", "vector": [14, 3, 0.3601, 0.0006, 3, 0.81, 0.0, 443, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "binned_mechx_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " binned_mechx_l = t"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L592_C8", "label": "append()", "type": "expression", "loc": [592, 592], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L578_C4", "vector": [8, 2, 0.3608, 0.0006, 2, 0.99, 0.75, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " binned_ftan_ll.append(f)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L593_C8", "label": "append()", "type": "expression", "loc": [593, 593], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L578_C4", "vector": [8, 2, 0.3614, 0.0006, 2, 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": " use_trials_list.append(i)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L595_C4", "label": "binned_ftan_arr = array()", "type": "assigned_variable", "loc": [595, 595], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L557_C0", "vector": [14, 1, 0.3626, 0.0006, 1, 0.75, 0.625, 200, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "binned_ftan_arr", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " binned_ftan_arr = np.array(binned_ftan_ll)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L596_C4", "label": "plot_mechx_l =", "type": "assigned_variable", "loc": [596, 596], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L557_C0", "vector": [14, 1, 0.3632, 0.0006, 1, 0.75, 0.6667, 171, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "plot_mechx_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " plot_mechx_l = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L597_C4", "label": "mean_l, std_l =", "type": "assigned_variable", "loc": [597, 597], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L557_C0", "vector": [14, 1, 0.3638, 0.0006, 1, 0.75, 0.7083, 714, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "mean_l, std_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mean_l, std_l = [], []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L598_C4", "label": "for i, p", "type": "for", "loc": [598, 607], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L557_C0", "vector": [6, 1, 0.3672, 0.0061, 1, 0.75, 0.75, 816, 3, 0, 0, 0, 0, 0, 10], "semantic": {"name": "i, p", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i,p in enumerate(binned_mechx_l):\n f_l = []\n for j in range(len(use_trials_list)):\n if binned_ftan_arr[j,i] != None:\n f_l.append(binned_ftan_arr[j,i])\n if len(f_l) == 0:\n continue\n plot_mechx_l.append(p)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L599_C8", "label": "f_l =", "type": "assigned_variable", "loc": [599, 599], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L598_C4", "vector": [14, 2, 0.365, 0.0006, 2, 0.79, 0.0, 265, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "f_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " f_l = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L600_C8", "label": "for j", "type": "for", "loc": [600, 602], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L598_C4", "vector": [6, 2, 0.3662, 0.0018, 2, 0.79, 0.2, 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(use_trials_list)):\n if binned_ftan_arr[j,i] != None:\n f_l.append(binned_ftan_arr[j,i])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L601_C12", "label": "if", "type": "if", "loc": [601, 602], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L600_C8", "vector": [4, 3, 0.3665, 0.0012, 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 binned_ftan_arr[j,i] != None:\n f_l.append(binned_ftan_arr[j,i])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L602_C16", "label": "append()", "type": "expression", "loc": [602, 602], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L601_C12", "vector": [8, 4, 0.3668, 0.0006, 4, 0.82, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " f_l.append(binned_ftan_arr[j,i])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L603_C8", "label": "if", "type": "if", "loc": [603, 604], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L598_C4", "vector": [4, 2, 0.3678, 0.0012, 2, 0.79, 0.4, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(f_l) == 0:\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L605_C8", "label": "append()", "type": "expression", "loc": [605, 605], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L598_C4", "vector": [8, 2, 0.3687, 0.0006, 2, 0.79, 0.6, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " plot_mechx_l.append(p)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L606_C8", "label": "append()", "type": "expression", "loc": [606, 606], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L598_C4", "vector": [8, 2, 0.3693, 0.0006, 2, 0.79, 0.8, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " mean_l.append(np.mean(f_l))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L607_C8", "label": "append()", "type": "expression", "loc": [607, 607], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L598_C4", "vector": [8, 2, 0.3699, 0.0006, 2, 0.79, 1.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " std_l.append(np.std(f_l))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L609_C4", "label": "xlabel =", "type": "assigned_variable", "loc": [609, 609], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L557_C0", "vector": [14, 1, 0.3711, 0.0006, 1, 0.75, 0.7917, 676, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "xlabel", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " xlabel = 'Angle (degrees)'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L611_C4", "label": "if", "type": "if", "loc": [611, 614], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L557_C0", "vector": [4, 1, 0.3732, 0.0024, 1, 0.75, 0.8333, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if open:\n trial = 'Open'\n else:\n trial = 'Close'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L612_C8", "label": "trial =", "type": "assigned_variable", "loc": [612, 612], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L611_C4", "vector": [14, 2, 0.3729, 0.0006, 2, 0.03, 0.0, 437, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "trial", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " trial = 'Open'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L614_C8", "label": "trial =", "type": "assigned_variable", "loc": [614, 614], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L611_C4", "vector": [14, 2, 0.3742, 0.0006, 2, 0.03, 1.0, 437, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "trial", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " trial = 'Close'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L616_C4", "label": "n_sigma =", "type": "assigned_variable", "loc": [616, 616], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L557_C0", "vector": [14, 1, 0.3754, 0.0006, 1, 0.75, 0.875, 36, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "n_sigma", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " n_sigma = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L617_C4", "label": "std_arr =", "type": "assigned_variable", "loc": [617, 617], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L557_C0", "vector": [14, 1, 0.376, 0.0006, 1, 0.75, 0.9167, 253, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "std_arr", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " std_arr = np.array(std_l) * n_sigma"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L618_C4", "label": "plot_errorbar_yx()", "type": "expression", "loc": [618, 623], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L557_C0", "vector": [8, 1, 0.3781, 0.0037, 1, 0.75, 0.9583, 840, 3, 9, 0, 0, 0, 0, 2], "semantic": {"name": "plot_errorbar_yx", "arg_names": [], "import_names": [], "rhs_call_name": "plot_errorbar_yx", "annotation": ""}, "snippet": " mpu.plot_errorbar_yx(mean_l, std_arr, np.degrees(plot_mechx_l),\n linewidth=1, plot_title=nm+': '+trial,\n xlabel='Angle (degrees)',\n label='Mean \\& %d$\\sigma$'%(n_sigma),\n ylabel='Tangential Force (N)',\n color='y')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L624_C4", "label": "legend()", "type": "expression", "loc": [624, 624], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L557_C0", "vector": [8, 1, 0.3803, 0.0006, 1, 0.75, 1.0, 880, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "legend", "arg_names": [], "import_names": [], "rhs_call_name": "legend", "annotation": ""}, "snippet": " mpu.legend()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L626_C0", "label": "plot_opening_distances_drawers", "type": "function", "loc": [626, 644], "level": 0, "parent": null, "vector": [2, 0, 0.387, 0.0116, 0, 0.66, 0.5556, 12, 0, 1, 0, 0, 0, 0, 7], "semantic": {"name": "plot_opening_distances_drawers", "arg_names": ["dir_name_list"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def plot_opening_distances_drawers(dir_name_list):\n mpu.figure()\n for d in dir_name_list:\n nm = get_mech_name(d)\n ftan_l_l, frad_l_l, mechx_l_l, typ, rad = extract_pkls(d)\n if rad != -1:\n # ignoring the cabinet doors.\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L627_C4", "label": "figure()", "type": "expression", "loc": [627, 627], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L626_C0", "vector": [8, 1, 0.3821, 0.0006, 1, 0.17, 0.0, 789, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "figure", "arg_names": [], "import_names": [], "rhs_call_name": "figure", "annotation": ""}, "snippet": " mpu.figure()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L628_C4", "label": "for d", "type": "for", "loc": [628, 643], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L626_C0", "vector": [6, 1, 0.3873, 0.0098, 1, 0.17, 0.5, 355, 2, 0, 0, 0, 0, 0, 5], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for d in dir_name_list:\n nm = get_mech_name(d)\n ftan_l_l, frad_l_l, mechx_l_l, typ, rad = extract_pkls(d)\n if rad != -1:\n # ignoring the cabinet doors.\n continue\n# print 'Aloha'\n# import pdb; pdb.set_trace()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L629_C8", "label": "nm = get_mech_name()", "type": "assigned_variable", "loc": [629, 629], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L628_C4", "vector": [14, 2, 0.3833, 0.0006, 2, 0.51, 0.0, 931, 3, 1, 0, 0, 59, 10, 1], "semantic": {"name": "nm", "arg_names": [], "import_names": [], "rhs_call_name": "get_mech_name", "annotation": ""}, "snippet": " nm = get_mech_name(d)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L630_C8", "label": "ftan_l_l, frad_l_l, mechx_l_l, typ, rad = extract_pkls()", "type": "assigned_variable", "loc": [630, 630], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L628_C4", "vector": [14, 2, 0.3839, 0.0006, 2, 0.51, 0.1667, 300, 3, 1, 0, 0, 780, 10, 1], "semantic": {"name": "ftan_l_l, frad_l_l, mechx_l_l, typ, rad", "arg_names": [], "import_names": [], "rhs_call_name": "extract_pkls", "annotation": ""}, "snippet": " ftan_l_l, frad_l_l, mechx_l_l, typ, rad = extract_pkls(d)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L631_C8", "label": "if", "type": "if", "loc": [631, 633], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L628_C4", "vector": [4, 2, 0.3851, 0.0018, 2, 0.51, 0.3333, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if rad != -1:\n # ignoring the cabinet doors.\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L636_C8", "label": "dist_opened_list =", "type": "assigned_variable", "loc": [636, 636], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L628_C4", "vector": [14, 2, 0.3876, 0.0006, 2, 0.51, 0.5, 257, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "dist_opened_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " dist_opened_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L637_C8", "label": "for x_l", "type": "for", "loc": [637, 638], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L628_C4", "vector": [6, 2, 0.3885, 0.0012, 2, 0.51, 0.6667, 508, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "x_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for x_l in mechx_l_l:\n dist_opened_list.append(x_l[-1] - x_l[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L638_C12", "label": "append()", "type": "expression", "loc": [638, 638], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L637_C8", "vector": [8, 3, 0.3888, 0.0006, 3, 0.2, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " dist_opened_list.append(x_l[-1] - x_l[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L640_C8", "label": "plot_title =", "type": "assigned_variable", "loc": [640, 640], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L628_C4", "vector": [14, 2, 0.39, 0.0006, 2, 0.51, 0.8333, 779, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "plot_title", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " plot_title = 'Opening distance for drawers'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L641_C8", "label": "plot_yx()", "type": "expression", "loc": [641, 643], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L628_C4", "vector": [8, 2, 0.3912, 0.0018, 2, 0.51, 1.0, 112, 3, 8, 0, 0, 0, 0, 2], "semantic": {"name": "plot_yx", "arg_names": [], "import_names": [], "rhs_call_name": "plot_yx", "annotation": ""}, "snippet": " mpu.plot_yx(dist_opened_list, color=mpu.random_color(), label=nm,\n axis=None, linewidth=0, xlabel='Nothing',\n ylabel='Distance opened', plot_title=plot_title)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L644_C4", "label": "legend()", "type": "expression", "loc": [644, 644], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L626_C0", "vector": [8, 1, 0.3924, 0.0006, 1, 0.17, 1.0, 880, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "legend", "arg_names": [], "import_names": [], "rhs_call_name": "legend", "annotation": ""}, "snippet": " mpu.legend()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L646_C0", "label": "handle_height_histogram", "type": "function", "loc": [646, 667], "level": 0, "parent": null, "vector": [2, 0, 0.4001, 0.0134, 0, 0.66, 0.5778, 456, 0, 2, 0, 0, 0, 0, 9], "semantic": {"name": "handle_height_histogram", "arg_names": ["dir_name_list", "plot_title"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def handle_height_histogram(dir_name_list, plot_title=''):\n mean_height_list = []\n for d in dir_name_list:\n nm = get_mech_name(d)\n pkl = glob.glob(d+'/mechanism_calc_dict.pkl')\n if pkl == []:\n print('Mechanism \"%s\" does not have a mechanism_calc_dict'%nm)\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L647_C4", "label": "mean_height_list =", "type": "assigned_variable", "loc": [647, 647], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L646_C0", "vector": [14, 1, 0.3943, 0.0006, 1, 0.15, 0.0, 233, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "mean_height_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mean_height_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L648_C4", "label": "for d", "type": "for", "loc": [648, 658], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L646_C0", "vector": [6, 1, 0.3979, 0.0067, 1, 0.15, 0.1667, 355, 2, 0, 0, 0, 0, 0, 5], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for d in dir_name_list:\n nm = get_mech_name(d)\n pkl = glob.glob(d+'/mechanism_calc_dict.pkl')\n if pkl == []:\n print('Mechanism \"%s\" does not have a mechanism_calc_dict'%nm)\n continue\n pkl = pkl[0]\n mech_calc_dict = ut.load_pickle(pkl)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L649_C8", "label": "nm = get_mech_name()", "type": "assigned_variable", "loc": [649, 649], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L648_C4", "vector": [14, 2, 0.3955, 0.0006, 2, 0.16, 0.0, 931, 3, 1, 0, 0, 59, 10, 1], "semantic": {"name": "nm", "arg_names": [], "import_names": [], "rhs_call_name": "get_mech_name", "annotation": ""}, "snippet": " nm = get_mech_name(d)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L650_C8", "label": "pkl = glob()", "type": "assigned_variable", "loc": [650, 650], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L648_C4", "vector": [14, 2, 0.3961, 0.0006, 2, 0.16, 0.1429, 419, 3, 1, 0, 0, 958, 10, 1], "semantic": {"name": "pkl", "arg_names": [], "import_names": [], "rhs_call_name": "glob", "annotation": ""}, "snippet": " pkl = glob.glob(d+'/mechanism_calc_dict.pkl')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L651_C8", "label": "if", "type": "if", "loc": [651, 653], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L648_C4", "vector": [4, 2, 0.3973, 0.0018, 2, 0.16, 0.2857, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if pkl == []:\n print('Mechanism \"%s\" does not have a mechanism_calc_dict'%nm)\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L652_C12", "label": "print()", "type": "expression", "loc": [652, 652], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L651_C8", "vector": [8, 3, 0.3973, 0.0006, 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('Mechanism \"%s\" does not have a mechanism_calc_dict'%nm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L654_C8", "label": "pkl =", "type": "assigned_variable", "loc": [654, 654], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L648_C4", "vector": [14, 2, 0.3985, 0.0006, 2, 0.16, 0.4286, 419, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pkl", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pkl = pkl[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L655_C8", "label": "mech_calc_dict = load_pickle()", "type": "assigned_variable", "loc": [655, 655], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L648_C4", "vector": [14, 2, 0.3991, 0.0006, 2, 0.16, 0.5714, 846, 3, 1, 0, 0, 65, 10, 1], "semantic": {"name": "mech_calc_dict", "arg_names": [], "import_names": [], "rhs_call_name": "load_pickle", "annotation": ""}, "snippet": " mech_calc_dict = ut.load_pickle(pkl)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L656_C8", "label": "hb =", "type": "assigned_variable", "loc": [656, 656], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L648_C4", "vector": [14, 2, 0.3998, 0.0006, 2, 0.16, 0.7143, 724, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "hb", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " hb = mech_calc_dict['handle_bottom']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L657_C8", "label": "ht =", "type": "assigned_variable", "loc": [657, 657], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L648_C4", "vector": [14, 2, 0.4004, 0.0006, 2, 0.16, 0.8571, 612, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ht", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ht = mech_calc_dict['handle_top']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L658_C8", "label": "append()", "type": "expression", "loc": [658, 658], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L648_C4", "vector": [8, 2, 0.401, 0.0006, 2, 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": " mean_height_list.append((hb+ht)/2.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L661_C4", "label": "max_height =", "type": "assigned_variable", "loc": [661, 661], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L646_C0", "vector": [14, 1, 0.4028, 0.0006, 1, 0.15, 0.3333, 648, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "max_height", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " max_height = 2.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L662_C4", "label": "bin_width =", "type": "assigned_variable", "loc": [662, 662], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L646_C0", "vector": [14, 1, 0.4034, 0.0006, 1, 0.15, 0.5, 331, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "bin_width", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " bin_width = 0.1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L663_C4", "label": "bins = arange()", "type": "assigned_variable", "loc": [663, 663], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L646_C0", "vector": [14, 1, 0.404, 0.0006, 1, 0.15, 0.6667, 792, 3, 3, 0, 0, 489, 10, 1], "semantic": {"name": "bins", "arg_names": [], "import_names": [], "rhs_call_name": "arange", "annotation": ""}, "snippet": " bins = np.arange(0.-bin_width/2., max_height+2*bin_width, bin_width)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L664_C4", "label": "hist, bin_edges = histogram()", "type": "assigned_variable", "loc": [664, 664], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L646_C0", "vector": [14, 1, 0.4046, 0.0006, 1, 0.15, 0.8333, 217, 3, 2, 0, 0, 428, 10, 2], "semantic": {"name": "hist, bin_edges", "arg_names": [], "import_names": [], "rhs_call_name": "histogram", "annotation": ""}, "snippet": " hist, bin_edges = np.histogram(np.array(mean_height_list), bins)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L665_C4", "label": "plot_histogram()", "type": "expression", "loc": [665, 667], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L646_C0", "vector": [8, 1, 0.4059, 0.0018, 1, 0.15, 1.0, 34, 3, 6, 0, 0, 0, 0, 1], "semantic": {"name": "plot_histogram", "arg_names": [], "import_names": [], "rhs_call_name": "plot_histogram", "annotation": ""}, "snippet": " mpu.plot_histogram(bin_edges[:-1]+bin_width/2., hist,\n width=bin_width*0.8, plot_title=plot_title,\n xlabel='Height (meters)', ylabel='\\# of mechanisms')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L669_C0", "label": "plot_handle_height", "type": "function", "loc": [669, 702], "level": 0, "parent": null, "vector": [2, 0, 0.4177, 0.0207, 0, 0.66, 0.6, 182, 0, 2, 0, 0, 0, 0, 17], "semantic": {"name": "plot_handle_height", "arg_names": ["dir_name_list", "plot_title"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def plot_handle_height(dir_name_list, plot_title):\n mpu.figure()\n for d in dir_name_list:\n nm = get_mech_name(d)\n pkl = glob.glob(d+'/mechanism_calc_dict.pkl')\n if pkl == []:\n print('Mechanism \"%s\" does not have a mechanism_calc_dict'%nm)\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L670_C4", "label": "figure()", "type": "expression", "loc": [670, 670], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L669_C0", "vector": [8, 1, 0.4083, 0.0006, 1, 0.74, 0.0, 789, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "figure", "arg_names": [], "import_names": [], "rhs_call_name": "figure", "annotation": ""}, "snippet": " mpu.figure()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L671_C4", "label": "for d", "type": "for", "loc": [671, 701], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L669_C0", "vector": [6, 1, 0.418, 0.0189, 1, 0.74, 0.5, 355, 2, 0, 0, 0, 0, 0, 15], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for d in dir_name_list:\n nm = get_mech_name(d)\n pkl = glob.glob(d+'/mechanism_calc_dict.pkl')\n if pkl == []:\n print('Mechanism \"%s\" does not have a mechanism_calc_dict'%nm)\n continue\n pkl = pkl[0]\n mech_calc_dict = ut.load_pickle(pkl)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L672_C8", "label": "nm = get_mech_name()", "type": "assigned_variable", "loc": [672, 672], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L671_C4", "vector": [14, 2, 0.4095, 0.0006, 2, 0.9, 0.0, 931, 3, 1, 0, 0, 59, 10, 1], "semantic": {"name": "nm", "arg_names": [], "import_names": [], "rhs_call_name": "get_mech_name", "annotation": ""}, "snippet": " nm = get_mech_name(d)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L673_C8", "label": "pkl = glob()", "type": "assigned_variable", "loc": [673, 673], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L671_C4", "vector": [14, 2, 0.4101, 0.0006, 2, 0.9, 0.0625, 419, 3, 1, 0, 0, 958, 10, 1], "semantic": {"name": "pkl", "arg_names": [], "import_names": [], "rhs_call_name": "glob", "annotation": ""}, "snippet": " pkl = glob.glob(d+'/mechanism_calc_dict.pkl')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L674_C8", "label": "if", "type": "if", "loc": [674, 676], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L671_C4", "vector": [4, 2, 0.4113, 0.0018, 2, 0.9, 0.125, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if pkl == []:\n print('Mechanism \"%s\" does not have a mechanism_calc_dict'%nm)\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L675_C12", "label": "print()", "type": "expression", "loc": [675, 675], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L674_C8", "vector": [8, 3, 0.4113, 0.0006, 3, 0.37, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Mechanism \"%s\" does not have a mechanism_calc_dict'%nm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L677_C8", "label": "pkl =", "type": "assigned_variable", "loc": [677, 677], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L671_C4", "vector": [14, 2, 0.4126, 0.0006, 2, 0.9, 0.1875, 419, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pkl", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pkl = pkl[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L678_C8", "label": "mech_calc_dict = load_pickle()", "type": "assigned_variable", "loc": [678, 678], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L671_C4", "vector": [14, 2, 0.4132, 0.0006, 2, 0.9, 0.25, 846, 3, 1, 0, 0, 65, 10, 1], "semantic": {"name": "mech_calc_dict", "arg_names": [], "import_names": [], "rhs_call_name": "load_pickle", "annotation": ""}, "snippet": " mech_calc_dict = ut.load_pickle(pkl)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L679_C8", "label": "hb =", "type": "assigned_variable", "loc": [679, 679], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L671_C4", "vector": [14, 2, 0.4138, 0.0006, 2, 0.9, 0.3125, 724, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "hb", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " hb = mech_calc_dict['handle_bottom']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L680_C8", "label": "ht =", "type": "assigned_variable", "loc": [680, 680], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L671_C4", "vector": [14, 2, 0.4144, 0.0006, 2, 0.9, 0.375, 612, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ht", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ht = mech_calc_dict['handle_top']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L682_C8", "label": "di = extract_pkls()", "type": "assigned_variable", "loc": [682, 682], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L671_C4", "vector": [14, 2, 0.4156, 0.0006, 2, 0.9, 0.4375, 700, 3, 2, 0, 0, 780, 10, 1], "semantic": {"name": "di", "arg_names": [], "import_names": [], "rhs_call_name": "extract_pkls", "annotation": ""}, "snippet": " di = extract_pkls(d, open=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L683_C8", "label": "ftan_l_l =", "type": "assigned_variable", "loc": [683, 683], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L671_C4", "vector": [14, 2, 0.4162, 0.0006, 2, 0.9, 0.5, 2, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ftan_l_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ftan_l_l = di['ftan_l_l']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L684_C8", "label": "frad_l_l =", "type": "assigned_variable", "loc": [684, 684], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L671_C4", "vector": [14, 2, 0.4168, 0.0006, 2, 0.9, 0.5625, 269, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "frad_l_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " frad_l_l = di['frad_l_l']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L685_C8", "label": "mechx_l_l =", "type": "assigned_variable", "loc": [685, 685], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L671_C4", "vector": [14, 2, 0.4174, 0.0006, 2, 0.9, 0.625, 760, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "mechx_l_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mechx_l_l = di['mechx_l_l']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L686_C8", "label": "time_l_l =", "type": "assigned_variable", "loc": [686, 686], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L671_C4", "vector": [14, 2, 0.418, 0.0006, 2, 0.9, 0.6875, 201, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "time_l_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " time_l_l = di['time_l_l']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L687_C8", "label": "typ =", "type": "assigned_variable", "loc": [687, 687], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L671_C4", "vector": [14, 2, 0.4186, 0.0006, 2, 0.9, 0.75, 722, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "typ", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " typ = di['typ']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L688_C8", "label": "rad =", "type": "assigned_variable", "loc": [688, 688], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L671_C4", "vector": [14, 2, 0.4193, 0.0006, 2, 0.9, 0.8125, 439, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "rad", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rad = di['rad']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L691_C8", "label": "fl, hl =", "type": "assigned_variable", "loc": [691, 691], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L671_C4", "vector": [14, 2, 0.4211, 0.0006, 2, 0.9, 0.875, 504, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "fl, hl", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " fl, hl = [], []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L692_C8", "label": "for n", "type": "for", "loc": [692, 697], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L671_C4", "vector": [6, 2, 0.4232, 0.0037, 2, 0.9, 0.9375, 773, 3, 0, 0, 0, 0, 0, 8], "semantic": {"name": "n", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for n in range(len(ftan_l_l)):\n fmax = np.max(np.abs(ftan_l_l[n][0:-50]))\n fl.append(fmax)\n fl.append(fmax)\n hl.append(ht)\n hl.append(hb)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L693_C12", "label": "fmax = max()", "type": "assigned_variable", "loc": [693, 693], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L692_C8", "vector": [14, 3, 0.4223, 0.0006, 3, 0.18, 0.0, 916, 3, 1, 0, 0, 442, 10, 2], "semantic": {"name": "fmax", "arg_names": [], "import_names": [], "rhs_call_name": "max", "annotation": ""}, "snippet": " fmax = np.max(np.abs(ftan_l_l[n][0:-50]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L694_C12", "label": "append()", "type": "expression", "loc": [694, 694], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L692_C8", "vector": [8, 3, 0.4229, 0.0006, 3, 0.18, 0.25, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " fl.append(fmax)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L695_C12", "label": "append()", "type": "expression", "loc": [695, 695], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L692_C8", "vector": [8, 3, 0.4235, 0.0006, 3, 0.18, 0.5, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " fl.append(fmax)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L696_C12", "label": "append()", "type": "expression", "loc": [696, 696], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L692_C8", "vector": [8, 3, 0.4241, 0.0006, 3, 0.18, 0.75, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " hl.append(ht)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L697_C12", "label": "append()", "type": "expression", "loc": [697, 697], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L692_C8", "vector": [8, 3, 0.4247, 0.0006, 3, 0.18, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " hl.append(hb)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L699_C8", "label": "plot_yx()", "type": "expression", "loc": [699, 701], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L671_C4", "vector": [8, 2, 0.4266, 0.0018, 2, 0.9, 1.0, 112, 3, 9, 0, 0, 0, 0, 2], "semantic": {"name": "plot_yx", "arg_names": [], "import_names": [], "rhs_call_name": "plot_yx", "annotation": ""}, "snippet": " mpu.plot_yx(hl, fl, color=mpu.random_color(), label=nm,\n axis=None, linewidth=0, xlabel='Max opening force',\n ylabel='Handle Height (m)', plot_title=plot_title)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L702_C4", "label": "legend()", "type": "expression", "loc": [702, 702], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L669_C0", "vector": [8, 1, 0.4278, 0.0006, 1, 0.74, 1.0, 880, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "legend", "arg_names": [], "import_names": [], "rhs_call_name": "legend", "annotation": ""}, "snippet": " mpu.legend()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L704_C0", "label": "distance_of_handle_from_edges", "type": "function", "loc": [704, 705], "level": 0, "parent": null, "vector": [2, 0, 0.4293, 0.0012, 0, 0.66, 0.6222, 48, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "distance_of_handle_from_edges", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def distance_of_handle_from_edges():\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L707_C0", "label": "plot_handle_height_no_office", "type": "function", "loc": [707, 715], "level": 0, "parent": null, "vector": [2, 0, 0.4333, 0.0055, 0, 0.66, 0.6444, 671, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "plot_handle_height_no_office", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def plot_handle_height_no_office():\n opt = commands.getoutput('cd aggregated_pkls_Feb11; ls --ignore=*HSI* --ignore=*HRL* --ignore=a.py')\n d_list = opt.splitlines()\n dir_list = []\n for d in d_list:\n dir_list.append('aggregated_pkls_Feb11/'+d)\n\n plot_title = 'Only homes. Excluding Offices'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L708_C4", "label": "opt = getoutput()", "type": "assigned_variable", "loc": [708, 708], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L707_C0", "vector": [14, 1, 0.4314, 0.0006, 1, 0.69, 0.0, 536, 3, 1, 0, 0, 13, 10, 1], "semantic": {"name": "opt", "arg_names": [], "import_names": [], "rhs_call_name": "getoutput", "annotation": ""}, "snippet": " opt = commands.getoutput('cd aggregated_pkls_Feb11; ls --ignore=*HSI* --ignore=*HRL* --ignore=a.py')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L709_C4", "label": "d_list = splitlines()", "type": "assigned_variable", "loc": [709, 709], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L707_C0", "vector": [14, 1, 0.4321, 0.0006, 1, 0.69, 0.2, 280, 3, 0, 0, 0, 296, 10, 1], "semantic": {"name": "d_list", "arg_names": [], "import_names": [], "rhs_call_name": "splitlines", "annotation": ""}, "snippet": " d_list = opt.splitlines()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L710_C4", "label": "dir_list =", "type": "assigned_variable", "loc": [710, 710], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L707_C0", "vector": [14, 1, 0.4327, 0.0006, 1, 0.69, 0.4, 18, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "dir_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " dir_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L711_C4", "label": "for d", "type": "for", "loc": [711, 712], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L707_C0", "vector": [6, 1, 0.4336, 0.0012, 1, 0.69, 0.6, 355, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for d in d_list:\n dir_list.append('aggregated_pkls_Feb11/'+d)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L712_C8", "label": "append()", "type": "expression", "loc": [712, 712], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L711_C4", "vector": [8, 2, 0.4339, 0.0006, 2, 0.09, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " dir_list.append('aggregated_pkls_Feb11/'+d)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L714_C4", "label": "plot_title =", "type": "assigned_variable", "loc": [714, 714], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L707_C0", "vector": [14, 1, 0.4351, 0.0006, 1, 0.69, 0.8, 779, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "plot_title", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " plot_title = 'Only homes. Excluding Offices'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L715_C4", "label": "plot_handle_height()", "type": "expression", "loc": [715, 715], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L707_C0", "vector": [8, 1, 0.4357, 0.0006, 1, 0.69, 1.0, 182, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "plot_handle_height", "arg_names": [], "import_names": [], "rhs_call_name": "plot_handle_height", "annotation": ""}, "snippet": " plot_handle_height(dir_list[0:], plot_title)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L717_C0", "label": "plot_handle_height_no_fridge_no_freezer", "type": "function", "loc": [717, 725], "level": 0, "parent": null, "vector": [2, 0, 0.4394, 0.0055, 0, 0.66, 0.6667, 284, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "plot_handle_height_no_fridge_no_freezer", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def plot_handle_height_no_fridge_no_freezer():\n opt = commands.getoutput('cd aggregated_pkls_Feb11; ls --ignore=*refrigerator* --ignore=*freezer* --ignore=a.py')\n d_list = opt.splitlines()\n dir_list = []\n for d in d_list:\n dir_list.append('aggregated_pkls_Feb11/'+d)\n\n plot_title = 'Excluding Refrigerators and Freezers'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L718_C4", "label": "opt = getoutput()", "type": "assigned_variable", "loc": [718, 718], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L717_C0", "vector": [14, 1, 0.4375, 0.0006, 1, 0.94, 0.0, 536, 3, 1, 0, 0, 13, 10, 1], "semantic": {"name": "opt", "arg_names": [], "import_names": [], "rhs_call_name": "getoutput", "annotation": ""}, "snippet": " opt = commands.getoutput('cd aggregated_pkls_Feb11; ls --ignore=*refrigerator* --ignore=*freezer* --ignore=a.py')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L719_C4", "label": "d_list = splitlines()", "type": "assigned_variable", "loc": [719, 719], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L717_C0", "vector": [14, 1, 0.4381, 0.0006, 1, 0.94, 0.2, 280, 3, 0, 0, 0, 296, 10, 1], "semantic": {"name": "d_list", "arg_names": [], "import_names": [], "rhs_call_name": "splitlines", "annotation": ""}, "snippet": " d_list = opt.splitlines()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L720_C4", "label": "dir_list =", "type": "assigned_variable", "loc": [720, 720], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L717_C0", "vector": [14, 1, 0.4388, 0.0006, 1, 0.94, 0.4, 18, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "dir_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " dir_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L721_C4", "label": "for d", "type": "for", "loc": [721, 722], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L717_C0", "vector": [6, 1, 0.4397, 0.0012, 1, 0.94, 0.6, 355, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for d in d_list:\n dir_list.append('aggregated_pkls_Feb11/'+d)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L722_C8", "label": "append()", "type": "expression", "loc": [722, 722], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L721_C4", "vector": [8, 2, 0.44, 0.0006, 2, 0.06, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " dir_list.append('aggregated_pkls_Feb11/'+d)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L724_C4", "label": "plot_title =", "type": "assigned_variable", "loc": [724, 724], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L717_C0", "vector": [14, 1, 0.4412, 0.0006, 1, 0.94, 0.8, 779, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "plot_title", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " plot_title = 'Excluding Refrigerators and Freezers'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L725_C4", "label": "plot_handle_height()", "type": "expression", "loc": [725, 725], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L717_C0", "vector": [8, 1, 0.4418, 0.0006, 1, 0.94, 1.0, 182, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "plot_handle_height", "arg_names": [], "import_names": [], "rhs_call_name": "plot_handle_height", "annotation": ""}, "snippet": " plot_handle_height(dir_list[0:], plot_title)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L729_C0", "label": "compute_velocity", "type": "function", "loc": [729, 735], "level": 0, "parent": null, "vector": [2, 0, 0.4461, 0.0043, 0, 0.66, 0.6889, 707, 0, 3, 1, 0, 0, 0, 5], "semantic": {"name": "compute_velocity", "arg_names": ["mech_x", "time_list", "smooth_window"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def compute_velocity(mech_x, time_list, smooth_window):\n x = np.array(mech_x)\n t = np.array(time_list)\n kin_info = {'disp_mech_coord_arr': np.array(mech_x),\n 'mech_time_arr': np.array(time_list)}\n vel_arr = mfc.velocity(kin_info, smooth_window)\n return vel_arr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L730_C4", "label": "x = array()", "type": "assigned_variable", "loc": [730, 730], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L729_C0", "vector": [14, 1, 0.4449, 0.0006, 1, 0.04, 0.0, 190, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "x", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " x = np.array(mech_x)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L731_C4", "label": "t = array()", "type": "assigned_variable", "loc": [731, 731], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L729_C0", "vector": [14, 1, 0.4455, 0.0006, 1, 0.04, 0.25, 15, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "t", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " t = np.array(time_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L732_C4", "label": "kin_info =", "type": "assigned_variable", "loc": [732, 733], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L729_C0", "vector": [14, 1, 0.4464, 0.0012, 1, 0.04, 0.5, 458, 0, 0, 0, 0, 0, 6, 2], "semantic": {"name": "kin_info", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " kin_info = {'disp_mech_coord_arr': np.array(mech_x),\n 'mech_time_arr': np.array(time_list)}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L734_C4", "label": "vel_arr = velocity()", "type": "assigned_variable", "loc": [734, 734], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L729_C0", "vector": [14, 1, 0.4473, 0.0006, 1, 0.04, 0.75, 86, 3, 2, 0, 0, 935, 10, 1], "semantic": {"name": "vel_arr", "arg_names": [], "import_names": [], "rhs_call_name": "velocity", "annotation": ""}, "snippet": " vel_arr = mfc.velocity(kin_info, smooth_window)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Return_L735_C4", "label": "return", "type": "return", "loc": [735, 735], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L729_C0", "vector": [13, 1, 0.4479, 0.0006, 1, 0.04, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return vel_arr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L739_C0", "label": "compute_trajectory_velocity", "type": "function", "loc": [739, 743], "level": 0, "parent": null, "vector": [2, 0, 0.4516, 0.003, 0, 0.66, 0.7111, 197, 0, 3, 1, 0, 0, 0, 4], "semantic": {"name": "compute_trajectory_velocity", "arg_names": ["mech_x", "time_list", "smooth_window"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def compute_trajectory_velocity(mech_x, time_list, smooth_window):\n vel_arr = compute_velocity(mech_x, time_list, smooth_window)\n filt_vel_arr = vel_arr[np.where(vel_arr>math.radians(2.))]\n median_vel = np.median(filt_vel_arr)\n return median_vel"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L740_C4", "label": "vel_arr = compute_velocity()", "type": "assigned_variable", "loc": [740, 740], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L739_C0", "vector": [14, 1, 0.4509, 0.0006, 1, 0.34, 0.0, 86, 3, 3, 0, 0, 707, 10, 1], "semantic": {"name": "vel_arr", "arg_names": [], "import_names": [], "rhs_call_name": "compute_velocity", "annotation": ""}, "snippet": " vel_arr = compute_velocity(mech_x, time_list, smooth_window)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L741_C4", "label": "filt_vel_arr =", "type": "assigned_variable", "loc": [741, 741], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L739_C0", "vector": [14, 1, 0.4516, 0.0006, 1, 0.34, 0.3333, 252, 6, 0, 0, 0, 0, 0, 2], "semantic": {"name": "filt_vel_arr", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " filt_vel_arr = vel_arr[np.where(vel_arr>math.radians(2.))]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L742_C4", "label": "median_vel = median()", "type": "assigned_variable", "loc": [742, 742], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L739_C0", "vector": [14, 1, 0.4522, 0.0006, 1, 0.34, 0.6667, 834, 3, 1, 0, 0, 247, 10, 1], "semantic": {"name": "median_vel", "arg_names": [], "import_names": [], "rhs_call_name": "median", "annotation": ""}, "snippet": " median_vel = np.median(filt_vel_arr)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Return_L743_C4", "label": "return", "type": "return", "loc": [743, 743], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L739_C0", "vector": [13, 1, 0.4528, 0.0006, 1, 0.34, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return median_vel"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L747_C0", "label": "compute_average_velocity", "type": "function", "loc": [747, 773], "level": 0, "parent": null, "vector": [2, 0, 0.4631, 0.0165, 0, 0.66, 0.7333, 59, 0, 4, 1, 0, 0, 0, 5], "semantic": {"name": "compute_average_velocity", "arg_names": ["mech_x", "time_list", "max_angle", "type"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def compute_average_velocity(mech_x, time_list, max_angle, type):\n reject_num = 20\n if len(mech_x) < reject_num:\n return -1\n\n mech_x = mech_x[reject_num:]\n time_list = time_list[reject_num:]\n if mech_x[-1] < max_angle:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L748_C4", "label": "reject_num =", "type": "assigned_variable", "loc": [748, 748], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L747_C0", "vector": [14, 1, 0.4558, 0.0006, 1, 0.35, 0.0, 853, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "reject_num", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " reject_num = 20"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L749_C4", "label": "if", "type": "if", "loc": [749, 750], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L747_C0", "vector": [4, 1, 0.4567, 0.0012, 1, 0.35, 0.0714, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(mech_x) < reject_num:\n return -1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Return_L750_C8", "label": "return", "type": "return", "loc": [750, 750], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L749_C4", "vector": [13, 2, 0.457, 0.0006, 2, 0.54, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return -1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L752_C4", "label": "mech_x =", "type": "assigned_variable", "loc": [752, 752], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L747_C0", "vector": [14, 1, 0.4583, 0.0006, 1, 0.35, 0.1429, 712, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "mech_x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mech_x = mech_x[reject_num:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L753_C4", "label": "time_list =", "type": "assigned_variable", "loc": [753, 753], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L747_C0", "vector": [14, 1, 0.4589, 0.0006, 1, 0.35, 0.2143, 941, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "time_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " time_list = time_list[reject_num:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L754_C4", "label": "if", "type": "if", "loc": [754, 755], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L747_C0", "vector": [4, 1, 0.4598, 0.0012, 1, 0.35, 0.2857, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if mech_x[-1] < max_angle:\n return -1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Return_L755_C8", "label": "return", "type": "return", "loc": [755, 755], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L754_C4", "vector": [13, 2, 0.4601, 0.0006, 2, 0.26, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return -1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L757_C4", "label": "if", "type": "if", "loc": [757, 760], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L747_C0", "vector": [4, 1, 0.4622, 0.0024, 1, 0.35, 0.3571, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if type == 'rotary':\n start_angle = math.radians(1)\n elif type == 'prismatic':\n start_angle = 0.01"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L758_C8", "label": "start_angle = radians()", "type": "assigned_variable", "loc": [758, 758], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L757_C4", "vector": [14, 2, 0.4619, 0.0006, 2, 0.94, 0.0, 662, 3, 1, 0, 0, 383, 10, 1], "semantic": {"name": "start_angle", "arg_names": [], "import_names": [], "rhs_call_name": "radians", "annotation": ""}, "snippet": " start_angle = math.radians(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L759_C4", "label": "if", "type": "if", "loc": [759, 760], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L757_C4", "vector": [4, 2, 0.4628, 0.0012, 2, 0.94, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif type == 'prismatic':\n start_angle = 0.01"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L760_C8", "label": "start_angle =", "type": "assigned_variable", "loc": [760, 760], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L759_C4", "vector": [14, 3, 0.4631, 0.0006, 3, 0.41, 0.0, 662, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "start_angle", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " start_angle = 0.01"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L762_C4", "label": "mech_x = array()", "type": "assigned_variable", "loc": [762, 762], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L747_C0", "vector": [14, 1, 0.4644, 0.0006, 1, 0.35, 0.4286, 712, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "mech_x", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " mech_x = np.array(mech_x)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L763_C4", "label": "start_idx =", "type": "assigned_variable", "loc": [763, 763], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L747_C0", "vector": [14, 1, 0.465, 0.0006, 1, 0.35, 0.5, 917, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "start_idx", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " start_idx = np.where(mech_x > start_angle)[0][0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L764_C4", "label": "end_idx =", "type": "assigned_variable", "loc": [764, 764], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L747_C0", "vector": [14, 1, 0.4656, 0.0006, 1, 0.35, 0.5714, 539, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "end_idx", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " end_idx = np.where(mech_x > max_angle)[0][0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L766_C4", "label": "start_x =", "type": "assigned_variable", "loc": [766, 766], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L747_C0", "vector": [14, 1, 0.4668, 0.0006, 1, 0.35, 0.6429, 744, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "start_x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " start_x = mech_x[start_idx]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L767_C4", "label": "end_x =", "type": "assigned_variable", "loc": [767, 767], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L747_C0", "vector": [14, 1, 0.4674, 0.0006, 1, 0.35, 0.7143, 810, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "end_x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " end_x = mech_x[end_idx]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L769_C4", "label": "start_time =", "type": "assigned_variable", "loc": [769, 769], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L747_C0", "vector": [14, 1, 0.4686, 0.0006, 1, 0.35, 0.7857, 511, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "start_time", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " start_time = time_list[start_idx]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L770_C4", "label": "end_time =", "type": "assigned_variable", "loc": [770, 770], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L747_C0", "vector": [14, 1, 0.4692, 0.0006, 1, 0.35, 0.8571, 483, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "end_time", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " end_time = time_list[end_idx]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L772_C4", "label": "avg_vel =", "type": "assigned_variable", "loc": [772, 772], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L747_C0", "vector": [14, 1, 0.4704, 0.0006, 1, 0.35, 0.9286, 359, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "avg_vel", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " avg_vel = (end_x - start_x) / (end_time - start_time)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Return_L773_C4", "label": "return", "type": "return", "loc": [773, 773], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L747_C0", "vector": [13, 1, 0.4711, 0.0006, 1, 0.35, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return avg_vel"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L776_C0", "label": "plot_velocity", "type": "function", "loc": [776, 802], "level": 0, "parent": null, "vector": [2, 0, 0.4808, 0.0165, 0, 0.66, 0.7556, 358, 0, 1, 0, 0, 0, 0, 23], "semantic": {"name": "plot_velocity", "arg_names": ["dir_name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def plot_velocity(dir_name):\n d = extract_pkls(dir_name, True)\n vel_fig = mpu.figure()\n acc_fig = mpu.figure()\n for i,time_list in enumerate(d['time_l_l']):\n mechx_l = d['mechx_l_l'][i]\n mechx_l, vel, acc, time_list = mfc.kinematic_params(mechx_l, time_list, 10)\n vel_arr = np.array(vel)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L777_C4", "label": "d = extract_pkls()", "type": "assigned_variable", "loc": [777, 777], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L776_C0", "vector": [14, 1, 0.4735, 0.0006, 1, 0.18, 0.0, 355, 3, 2, 0, 0, 780, 10, 1], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "extract_pkls", "annotation": ""}, "snippet": " d = extract_pkls(dir_name, True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L778_C4", "label": "vel_fig = figure()", "type": "assigned_variable", "loc": [778, 778], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L776_C0", "vector": [14, 1, 0.4741, 0.0006, 1, 0.18, 0.3333, 116, 3, 0, 0, 0, 789, 10, 1], "semantic": {"name": "vel_fig", "arg_names": [], "import_names": [], "rhs_call_name": "figure", "annotation": ""}, "snippet": " vel_fig = mpu.figure()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L779_C4", "label": "acc_fig = figure()", "type": "assigned_variable", "loc": [779, 779], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L776_C0", "vector": [14, 1, 0.4747, 0.0006, 1, 0.18, 0.6667, 540, 3, 0, 0, 0, 789, 10, 1], "semantic": {"name": "acc_fig", "arg_names": [], "import_names": [], "rhs_call_name": "figure", "annotation": ""}, "snippet": " acc_fig = mpu.figure()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L780_C4", "label": "for i, time_list", "type": "for", "loc": [780, 802], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L776_C0", "vector": [6, 1, 0.482, 0.014, 1, 0.18, 1.0, 618, 3, 0, 0, 0, 0, 0, 20], "semantic": {"name": "i, time_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i,time_list in enumerate(d['time_l_l']):\n mechx_l = d['mechx_l_l'][i]\n mechx_l, vel, acc, time_list = mfc.kinematic_params(mechx_l, time_list, 10)\n vel_arr = np.array(vel)\n acc_arr = np.array(acc)\n\n trial_num = d['trial_num_l'][i]\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L781_C8", "label": "mechx_l =", "type": "assigned_variable", "loc": [781, 781], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L780_C4", "vector": [14, 2, 0.4759, 0.0006, 2, 0.31, 0.0, 961, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "mechx_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mechx_l = d['mechx_l_l'][i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L782_C8", "label": "mechx_l, vel, acc, time_list = kinematic_params()", "type": "assigned_variable", "loc": [782, 782], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L780_C4", "vector": [14, 2, 0.4765, 0.0006, 2, 0.31, 0.0769, 935, 3, 3, 0, 0, 169, 10, 1], "semantic": {"name": "mechx_l, vel, acc, time_list", "arg_names": [], "import_names": [], "rhs_call_name": "kinematic_params", "annotation": ""}, "snippet": " mechx_l, vel, acc, time_list = mfc.kinematic_params(mechx_l, time_list, 10)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L783_C8", "label": "vel_arr = array()", "type": "assigned_variable", "loc": [783, 783], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L780_C4", "vector": [14, 2, 0.4771, 0.0006, 2, 0.31, 0.1538, 86, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "vel_arr", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " vel_arr = np.array(vel)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L784_C8", "label": "acc_arr = array()", "type": "assigned_variable", "loc": [784, 784], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L780_C4", "vector": [14, 2, 0.4778, 0.0006, 2, 0.31, 0.2308, 826, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "acc_arr", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " acc_arr = np.array(acc)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L786_C8", "label": "trial_num =", "type": "assigned_variable", "loc": [786, 786], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L780_C4", "vector": [14, 2, 0.479, 0.0006, 2, 0.31, 0.3077, 298, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "trial_num", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " trial_num = d['trial_num_l'][i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L788_C8", "label": "xarr = array()", "type": "assigned_variable", "loc": [788, 788], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L780_C4", "vector": [14, 2, 0.4802, 0.0006, 2, 0.31, 0.3846, 440, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "xarr", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " xarr = np.array(mechx_l)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L789_C8", "label": "idxs = where()", "type": "assigned_variable", "loc": [789, 790], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L780_C4", "vector": [14, 2, 0.4811, 0.0012, 2, 0.31, 0.4615, 677, 3, 1, 0, 0, 169, 10, 4], "semantic": {"name": "idxs", "arg_names": [], "import_names": [], "rhs_call_name": "where", "annotation": ""}, "snippet": " idxs = np.where(np.logical_and(xarr < math.radians(20.),\n xarr > math.radians(1.)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L792_C8", "label": "color = random_color()", "type": "assigned_variable", "loc": [792, 792], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L780_C4", "vector": [14, 2, 0.4826, 0.0006, 2, 0.31, 0.5385, 776, 3, 0, 0, 0, 895, 10, 1], "semantic": {"name": "color", "arg_names": [], "import_names": [], "rhs_call_name": "random_color", "annotation": ""}, "snippet": " color=mpu.random_color()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L793_C8", "label": "figure()", "type": "expression", "loc": [793, 793], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L780_C4", "vector": [8, 2, 0.4832, 0.0006, 2, 0.31, 0.6154, 789, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "figure", "arg_names": [], "import_names": [], "rhs_call_name": "figure", "annotation": ""}, "snippet": " mpu.figure(vel_fig.number)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L794_C8", "label": "plot_yx()", "type": "expression", "loc": [794, 796], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L780_C4", "vector": [8, 2, 0.4845, 0.0018, 2, 0.31, 0.6923, 112, 3, 5, 0, 0, 0, 0, 3], "semantic": {"name": "plot_yx", "arg_names": [], "import_names": [], "rhs_call_name": "plot_yx", "annotation": ""}, "snippet": " mpu.plot_yx(np.degrees(vel_arr[idxs]),\n np.degrees(xarr[idxs]), color=color,\n label='%d velocity'%trial_num, scatter_size=0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L797_C8", "label": "legend()", "type": "expression", "loc": [797, 797], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L780_C4", "vector": [8, 2, 0.4857, 0.0006, 2, 0.31, 0.7692, 880, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "legend", "arg_names": [], "import_names": [], "rhs_call_name": "legend", "annotation": ""}, "snippet": " mpu.legend()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L799_C8", "label": "figure()", "type": "expression", "loc": [799, 799], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L780_C4", "vector": [8, 2, 0.4869, 0.0006, 2, 0.31, 0.8462, 789, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "figure", "arg_names": [], "import_names": [], "rhs_call_name": "figure", "annotation": ""}, "snippet": " mpu.figure(acc_fig.number)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L800_C8", "label": "plot_yx()", "type": "expression", "loc": [800, 801], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L780_C4", "vector": [8, 2, 0.4878, 0.0012, 2, 0.31, 0.9231, 112, 3, 5, 0, 0, 0, 0, 3], "semantic": {"name": "plot_yx", "arg_names": [], "import_names": [], "rhs_call_name": "plot_yx", "annotation": ""}, "snippet": " mpu.plot_yx(np.degrees(acc_arr[idxs]), np.degrees(xarr[idxs]), color=color,\n label='%d acc'%trial_num, scatter_size=0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L802_C8", "label": "legend()", "type": "expression", "loc": [802, 802], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L780_C4", "vector": [8, 2, 0.4887, 0.0006, 2, 0.31, 1.0, 880, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "legend", "arg_names": [], "import_names": [], "rhs_call_name": "legend", "annotation": ""}, "snippet": " mpu.legend()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L809_C0", "label": "correlate_trials", "type": "function", "loc": [809, 831], "level": 0, "parent": null, "vector": [2, 0, 0.4997, 0.014, 0, 0.66, 0.7778, 926, 0, 3, 0, 0, 0, 0, 19], "semantic": {"name": "correlate_trials", "arg_names": ["c1", "l", "lab_list"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def correlate_trials(c1, l, lab_list):\n mpu.figure()\n x = 0\n corr_list = []\n x_l = []\n for i,c2 in enumerate(l):\n res = ss.correlate(np.array(c1), np.array(c2), 'valid')[0]\n r1 = ss.correlate(np.array(c1), np.array(c1), 'valid')[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L810_C4", "label": "figure()", "type": "expression", "loc": [810, 810], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L809_C0", "vector": [8, 1, 0.4936, 0.0006, 1, 0.41, 0.0, 789, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "figure", "arg_names": [], "import_names": [], "rhs_call_name": "figure", "annotation": ""}, "snippet": " mpu.figure()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L811_C4", "label": "x =", "type": "assigned_variable", "loc": [811, 811], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L809_C0", "vector": [14, 1, 0.4942, 0.0006, 1, 0.41, 0.1667, 190, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " x = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L812_C4", "label": "corr_list =", "type": "assigned_variable", "loc": [812, 812], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L809_C0", "vector": [14, 1, 0.4948, 0.0006, 1, 0.41, 0.3333, 13, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "corr_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " corr_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L813_C4", "label": "x_l =", "type": "assigned_variable", "loc": [813, 813], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L809_C0", "vector": [14, 1, 0.4954, 0.0006, 1, 0.41, 0.5, 508, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "x_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " x_l = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L814_C4", "label": "for i, c2", "type": "for", "loc": [814, 828], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L809_C0", "vector": [6, 1, 0.5003, 0.0091, 1, 0.41, 0.6667, 610, 3, 0, 0, 0, 0, 0, 15], "semantic": {"name": "i, c2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i,c2 in enumerate(l):\n res = ss.correlate(np.array(c1), np.array(c2), 'valid')[0]\n r1 = ss.correlate(np.array(c1), np.array(c1), 'valid')[0]\n r2 = ss.correlate(np.array(c2), np.array(c2), 'valid')[0]\n res = res/math.sqrt(r1*r2) # cross correlation coefficient http://www.staff.ncl.ac.uk/oliver.hinton/eee305/Chapter6.pdf\n if i == 0 or lab_list[i] == lab_list[i-1]:\n corr_list.append(res)\n x_l.append(x)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L815_C8", "label": "res =", "type": "assigned_variable", "loc": [815, 815], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L814_C4", "vector": [14, 2, 0.4966, 0.0006, 2, 0.28, 0.0, 413, 6, 0, 0, 0, 0, 0, 3], "semantic": {"name": "res", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " res = ss.correlate(np.array(c1), np.array(c2), 'valid')[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L816_C8", "label": "r1 =", "type": "assigned_variable", "loc": [816, 816], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L814_C4", "vector": [14, 2, 0.4973, 0.0006, 2, 0.28, 0.25, 648, 6, 0, 0, 0, 0, 0, 3], "semantic": {"name": "r1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " r1 = ss.correlate(np.array(c1), np.array(c1), 'valid')[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L817_C8", "label": "r2 =", "type": "assigned_variable", "loc": [817, 817], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L814_C4", "vector": [14, 2, 0.4979, 0.0006, 2, 0.28, 0.5, 959, 6, 0, 0, 0, 0, 0, 3], "semantic": {"name": "r2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " r2 = ss.correlate(np.array(c2), np.array(c2), 'valid')[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L818_C8", "label": "res =", "type": "assigned_variable", "loc": [818, 818], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L814_C4", "vector": [14, 2, 0.4985, 0.0006, 2, 0.28, 0.75, 413, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "res", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " res = res/math.sqrt(r1*r2) # cross correlation coefficient http://www.staff.ncl.ac.uk/oliver.hinton/eee305/Chapter6.pdf"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L819_C8", "label": "if", "type": "if", "loc": [819, 827], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L814_C4", "vector": [4, 2, 0.5015, 0.0055, 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 i == 0 or lab_list[i] == lab_list[i-1]:\n corr_list.append(res)\n x_l.append(x)\n else:\n mpu.plot_yx(corr_list, x_l, color=mpu.random_color(),\n label=lab_list[i-1], xlabel='Nothing',\n ylabel='Cross-Correlation Coefficient')\n corr_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L820_C12", "label": "append()", "type": "expression", "loc": [820, 820], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L819_C8", "vector": [8, 3, 0.4997, 0.0006, 3, 0.21, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " corr_list.append(res)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L821_C12", "label": "append()", "type": "expression", "loc": [821, 821], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L819_C8", "vector": [8, 3, 0.5003, 0.0006, 3, 0.21, 0.25, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " x_l.append(x)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L823_C12", "label": "plot_yx()", "type": "expression", "loc": [823, 825], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L819_C8", "vector": [8, 3, 0.5021, 0.0018, 3, 0.21, 0.5, 112, 3, 6, 0, 0, 0, 0, 2], "semantic": {"name": "plot_yx", "arg_names": [], "import_names": [], "rhs_call_name": "plot_yx", "annotation": ""}, "snippet": " mpu.plot_yx(corr_list, x_l, color=mpu.random_color(),\n label=lab_list[i-1], xlabel='Nothing',\n ylabel='Cross-Correlation Coefficient')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L826_C12", "label": "corr_list =", "type": "assigned_variable", "loc": [826, 826], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L819_C8", "vector": [14, 3, 0.5034, 0.0006, 3, 0.21, 0.75, 13, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "corr_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " corr_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L827_C12", "label": "x_l =", "type": "assigned_variable", "loc": [827, 827], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L819_C8", "vector": [14, 3, 0.504, 0.0006, 3, 0.21, 1.0, 508, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "x_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " x_l = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L829_C4", "label": "plot_yx()", "type": "expression", "loc": [829, 830], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L809_C0", "vector": [8, 1, 0.5055, 0.0012, 1, 0.41, 0.8333, 112, 3, 4, 0, 0, 0, 0, 2], "semantic": {"name": "plot_yx", "arg_names": [], "import_names": [], "rhs_call_name": "plot_yx", "annotation": ""}, "snippet": " mpu.plot_yx(corr_list, x_l, color=mpu.random_color(),\n label=lab_list[i-1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L831_C4", "label": "legend()", "type": "expression", "loc": [831, 831], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L809_C0", "vector": [8, 1, 0.5064, 0.0006, 1, 0.41, 1.0, 880, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "legend", "arg_names": [], "import_names": [], "rhs_call_name": "legend", "annotation": ""}, "snippet": " mpu.legend()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L837_C0", "label": "compare_tangential_total_magnitude", "type": "function", "loc": [837, 849], "level": 0, "parent": null, "vector": [2, 0, 0.5137, 0.0079, 0, 0.66, 0.8, 616, 0, 1, 0, 0, 0, 0, 5], "semantic": {"name": "compare_tangential_total_magnitude", "arg_names": ["dir"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def compare_tangential_total_magnitude(dir):\n mpu.figure()\n errorbar_one_mechanism(dir, open = True,\n filter_speed = math.radians(30),\n plot_type = 'magnitude',\n new_figure = False, color='y',\n label = '\\huge{$\\hat F_{normal}$}')\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L838_C4", "label": "figure()", "type": "expression", "loc": [838, 838], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L837_C0", "vector": [8, 1, 0.5107, 0.0006, 1, 0.64, 0.0, 789, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "figure", "arg_names": [], "import_names": [], "rhs_call_name": "figure", "annotation": ""}, "snippet": " mpu.figure()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L839_C4", "label": "errorbar_one_mechanism()", "type": "expression", "loc": [839, 843], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L837_C0", "vector": [8, 1, 0.5125, 0.003, 1, 0.64, 0.5, 63, 3, 7, 0, 0, 0, 0, 2], "semantic": {"name": "errorbar_one_mechanism", "arg_names": [], "import_names": [], "rhs_call_name": "errorbar_one_mechanism", "annotation": ""}, "snippet": " errorbar_one_mechanism(dir, open = True,\n filter_speed = math.radians(30),\n plot_type = 'magnitude',\n new_figure = False, color='y',\n label = '\\huge{$\\hat F_{normal}$}')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L845_C4", "label": "errorbar_one_mechanism()", "type": "expression", "loc": [845, 849], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L837_C0", "vector": [8, 1, 0.5161, 0.003, 1, 0.64, 1.0, 63, 3, 7, 0, 0, 0, 0, 2], "semantic": {"name": "errorbar_one_mechanism", "arg_names": [], "import_names": [], "rhs_call_name": "errorbar_one_mechanism", "annotation": ""}, "snippet": " errorbar_one_mechanism(dir, open = True,\n filter_speed = math.radians(30),\n plot_type = 'tangential', color='b',\n new_figure = False,\n label = '\\huge{$||\\hat F_{normal} + \\hat F_{plane}||$}')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L851_C0", "label": "max_force_vs_velocity", "type": "function", "loc": [851, 889], "level": 0, "parent": null, "vector": [2, 0, 0.5302, 0.0238, 0, 0.66, 0.8222, 218, 0, 1, 0, 0, 0, 0, 20], "semantic": {"name": "max_force_vs_velocity", "arg_names": ["dir"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def max_force_vs_velocity(dir):\n di = extract_pkls(dir, open)\n ftan_l_l = di['ftan_l_l']\n frad_l_l = di['frad_l_l']\n mechx_l_l = di['mechx_l_l']\n time_l_l = di['time_l_l']\n typ = di['typ']\n rad = di['rad']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L852_C4", "label": "di = extract_pkls()", "type": "assigned_variable", "loc": [852, 852], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L851_C0", "vector": [14, 1, 0.5192, 0.0006, 1, 0.39, 0.0, 700, 3, 2, 0, 0, 780, 10, 1], "semantic": {"name": "di", "arg_names": [], "import_names": [], "rhs_call_name": "extract_pkls", "annotation": ""}, "snippet": " di = extract_pkls(dir, open)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L853_C4", "label": "ftan_l_l =", "type": "assigned_variable", "loc": [853, 853], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L851_C0", "vector": [14, 1, 0.5198, 0.0006, 1, 0.39, 0.0769, 2, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ftan_l_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ftan_l_l = di['ftan_l_l']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L854_C4", "label": "frad_l_l =", "type": "assigned_variable", "loc": [854, 854], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L851_C0", "vector": [14, 1, 0.5204, 0.0006, 1, 0.39, 0.1538, 269, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "frad_l_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " frad_l_l = di['frad_l_l']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L855_C4", "label": "mechx_l_l =", "type": "assigned_variable", "loc": [855, 855], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L851_C0", "vector": [14, 1, 0.521, 0.0006, 1, 0.39, 0.2308, 760, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "mechx_l_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mechx_l_l = di['mechx_l_l']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L856_C4", "label": "time_l_l =", "type": "assigned_variable", "loc": [856, 856], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L851_C0", "vector": [14, 1, 0.5216, 0.0006, 1, 0.39, 0.3077, 201, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "time_l_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " time_l_l = di['time_l_l']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L857_C4", "label": "typ =", "type": "assigned_variable", "loc": [857, 857], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L851_C0", "vector": [14, 1, 0.5222, 0.0006, 1, 0.39, 0.3846, 722, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "typ", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " typ = di['typ']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L858_C4", "label": "rad =", "type": "assigned_variable", "loc": [858, 858], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L851_C0", "vector": [14, 1, 0.5229, 0.0006, 1, 0.39, 0.4615, 439, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "rad", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rad = di['rad']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L860_C4", "label": "nm = get_mech_name()", "type": "assigned_variable", "loc": [860, 860], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L851_C0", "vector": [14, 1, 0.5241, 0.0006, 1, 0.39, 0.5385, 931, 3, 1, 0, 0, 59, 10, 1], "semantic": {"name": "nm", "arg_names": [], "import_names": [], "rhs_call_name": "get_mech_name", "annotation": ""}, "snippet": " nm = get_mech_name(dir)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L862_C4", "label": "color = random_color()", "type": "assigned_variable", "loc": [862, 862], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L851_C0", "vector": [14, 1, 0.5253, 0.0006, 1, 0.39, 0.6154, 776, 3, 0, 0, 0, 895, 10, 1], "semantic": {"name": "color", "arg_names": [], "import_names": [], "rhs_call_name": "random_color", "annotation": ""}, "snippet": " color = mpu.random_color()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L863_C4", "label": "mfl =", "type": "assigned_variable", "loc": [863, 863], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L851_C0", "vector": [14, 1, 0.5259, 0.0006, 1, 0.39, 0.6923, 681, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "mfl", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mfl = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L864_C4", "label": "tvl =", "type": "assigned_variable", "loc": [864, 864], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L851_C0", "vector": [14, 1, 0.5265, 0.0006, 1, 0.39, 0.7692, 490, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "tvl", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tvl = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L865_C4", "label": "for i", "type": "for", "loc": [865, 884], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L851_C0", "vector": [6, 1, 0.5329, 0.0122, 1, 0.39, 0.8462, 826, 3, 0, 0, 0, 0, 0, 15], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(len(ftan_l_l)):\n\n xarr = np.array(mechx_l_l[i])\n idxs = np.where(np.logical_and(xarr < math.radians(20.),\n xarr > math.radians(1.)))\n\n max_force = np.max(np.array(ftan_l_l[i])[idxs])\n mechx_short = np.array(mechx_l_l[i])[idxs]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L867_C8", "label": "xarr = array()", "type": "assigned_variable", "loc": [867, 867], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L865_C4", "vector": [14, 2, 0.5283, 0.0006, 2, 0.5, 0.0, 440, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "xarr", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " xarr = np.array(mechx_l_l[i])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L868_C8", "label": "idxs = where()", "type": "assigned_variable", "loc": [868, 869], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L865_C4", "vector": [14, 2, 0.5293, 0.0012, 2, 0.5, 0.1111, 677, 3, 1, 0, 0, 169, 10, 4], "semantic": {"name": "idxs", "arg_names": [], "import_names": [], "rhs_call_name": "where", "annotation": ""}, "snippet": " idxs = np.where(np.logical_and(xarr < math.radians(20.),\n xarr > math.radians(1.)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L871_C8", "label": "max_force = max()", "type": "assigned_variable", "loc": [871, 871], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L865_C4", "vector": [14, 2, 0.5308, 0.0006, 2, 0.5, 0.2222, 874, 3, 1, 0, 0, 442, 10, 2], "semantic": {"name": "max_force", "arg_names": [], "import_names": [], "rhs_call_name": "max", "annotation": ""}, "snippet": " max_force = np.max(np.array(ftan_l_l[i])[idxs])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L872_C8", "label": "mechx_short =", "type": "assigned_variable", "loc": [872, 872], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L865_C4", "vector": [14, 2, 0.5314, 0.0006, 2, 0.5, 0.3333, 752, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "mechx_short", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mechx_short = np.array(mechx_l_l[i])[idxs]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L873_C8", "label": "time_short =", "type": "assigned_variable", "loc": [873, 873], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L865_C4", "vector": [14, 2, 0.532, 0.0006, 2, 0.5, 0.4444, 344, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "time_short", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " time_short = np.array(time_l_l[i])[idxs]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L875_C8", "label": "vel_arr = compute_velocity()", "type": "assigned_variable", "loc": [875, 875], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L865_C4", "vector": [14, 2, 0.5332, 0.0006, 2, 0.5, 0.5556, 86, 3, 3, 0, 0, 707, 10, 1], "semantic": {"name": "vel_arr", "arg_names": [], "import_names": [], "rhs_call_name": "compute_velocity", "annotation": ""}, "snippet": " vel_arr = compute_velocity(mechx_l_l[i], time_l_l[i], 5)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L877_C8", "label": "vel_short =", "type": "assigned_variable", "loc": [877, 877], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L865_C4", "vector": [14, 2, 0.5344, 0.0006, 2, 0.5, 0.6667, 942, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "vel_short", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " vel_short = vel_arr[idxs]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L878_C8", "label": "traj_vel = max()", "type": "assigned_variable", "loc": [878, 878], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L865_C4", "vector": [14, 2, 0.535, 0.0006, 2, 0.5, 0.7778, 279, 3, 1, 0, 0, 442, 10, 1], "semantic": {"name": "traj_vel", "arg_names": [], "import_names": [], "rhs_call_name": "max", "annotation": ""}, "snippet": " traj_vel = np.max(vel_short)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L883_C8", "label": "append()", "type": "expression", "loc": [883, 883], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L865_C4", "vector": [8, 2, 0.5381, 0.0006, 2, 0.5, 0.8889, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " mfl.append(max_force)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L884_C8", "label": "append()", "type": "expression", "loc": [884, 884], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L865_C4", "vector": [8, 2, 0.5387, 0.0006, 2, 0.5, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " tvl.append(traj_vel)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L886_C4", "label": "plot_yx()", "type": "expression", "loc": [886, 888], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L851_C0", "vector": [8, 1, 0.5405, 0.0018, 1, 0.39, 0.9231, 112, 3, 7, 0, 0, 0, 0, 1], "semantic": {"name": "plot_yx", "arg_names": [], "import_names": [], "rhs_call_name": "plot_yx", "annotation": ""}, "snippet": " mpu.plot_yx(mfl, tvl, color = color,\n xlabel = 'Trajectory vel', label = nm,\n ylabel = 'Max tangential force', linewidth=0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L889_C4", "label": "legend()", "type": "expression", "loc": [889, 889], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L851_C0", "vector": [8, 1, 0.5417, 0.0006, 1, 0.39, 1.0, 880, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "legend", "arg_names": [], "import_names": [], "rhs_call_name": "legend", "annotation": ""}, "snippet": " mpu.legend()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L891_C0", "label": "mechanism_radius_histogram", "type": "function", "loc": [891, 915], "level": 0, "parent": null, "vector": [2, 0, 0.5503, 0.0152, 0, 0.66, 0.8444, 183, 0, 2, 1, 0, 0, 0, 13], "semantic": {"name": "mechanism_radius_histogram", "arg_names": ["dir_list", "color"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def mechanism_radius_histogram(dir_list, color='b'):\n rad_list = []\n for d in dir_list:\n nm = get_mech_name(d)\n pkl = glob.glob(d+'/mechanism_info.pkl')\n if pkl == []:\n print('Mechanism \"%s\" does not have a mechanism_info_dict'%nm)\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L892_C4", "label": "rad_list =", "type": "assigned_variable", "loc": [892, 892], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L891_C0", "vector": [14, 1, 0.5436, 0.0006, 1, 0.1, 0.0, 124, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "rad_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rad_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L893_C4", "label": "for d", "type": "for", "loc": [893, 902], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L891_C0", "vector": [6, 1, 0.5469, 0.0061, 1, 0.1, 0.1, 355, 2, 0, 0, 0, 0, 0, 5], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for d in dir_list:\n nm = get_mech_name(d)\n pkl = glob.glob(d+'/mechanism_info.pkl')\n if pkl == []:\n print('Mechanism \"%s\" does not have a mechanism_info_dict'%nm)\n continue\n pkl = pkl[0]\n md = ut.load_pickle(pkl)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L894_C8", "label": "nm = get_mech_name()", "type": "assigned_variable", "loc": [894, 894], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L893_C4", "vector": [14, 2, 0.5448, 0.0006, 2, 0.52, 0.0, 931, 3, 1, 0, 0, 59, 10, 1], "semantic": {"name": "nm", "arg_names": [], "import_names": [], "rhs_call_name": "get_mech_name", "annotation": ""}, "snippet": " nm = get_mech_name(d)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L895_C8", "label": "pkl = glob()", "type": "assigned_variable", "loc": [895, 895], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L893_C4", "vector": [14, 2, 0.5454, 0.0006, 2, 0.52, 0.2, 419, 3, 1, 0, 0, 958, 10, 1], "semantic": {"name": "pkl", "arg_names": [], "import_names": [], "rhs_call_name": "glob", "annotation": ""}, "snippet": " pkl = glob.glob(d+'/mechanism_info.pkl')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L896_C8", "label": "if", "type": "if", "loc": [896, 898], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L893_C4", "vector": [4, 2, 0.5466, 0.0018, 2, 0.52, 0.4, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if pkl == []:\n print('Mechanism \"%s\" does not have a mechanism_info_dict'%nm)\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L897_C12", "label": "print()", "type": "expression", "loc": [897, 897], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L896_C8", "vector": [8, 3, 0.5466, 0.0006, 3, 0.9, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Mechanism \"%s\" does not have a mechanism_info_dict'%nm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L899_C8", "label": "pkl =", "type": "assigned_variable", "loc": [899, 899], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L893_C4", "vector": [14, 2, 0.5478, 0.0006, 2, 0.52, 0.6, 419, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pkl", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pkl = pkl[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L900_C8", "label": "md = load_pickle()", "type": "assigned_variable", "loc": [900, 900], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L893_C4", "vector": [14, 2, 0.5484, 0.0006, 2, 0.52, 0.8, 769, 3, 1, 0, 0, 65, 10, 1], "semantic": {"name": "md", "arg_names": [], "import_names": [], "rhs_call_name": "load_pickle", "annotation": ""}, "snippet": " md = ut.load_pickle(pkl)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L901_C8", "label": "if", "type": "if", "loc": [901, 902], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L893_C4", "vector": [4, 2, 0.5494, 0.0012, 2, 0.52, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if md['radius'] != -1:\n rad_list.append(md['radius'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L902_C12", "label": "append()", "type": "expression", "loc": [902, 902], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L901_C8", "vector": [8, 3, 0.5497, 0.0006, 3, 0.49, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " rad_list.append(md['radius'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L903_C4", "label": "max_radius = max()", "type": "assigned_variable", "loc": [903, 903], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L891_C0", "vector": [14, 1, 0.5503, 0.0006, 1, 0.1, 0.2, 202, 3, 1, 0, 0, 442, 10, 1], "semantic": {"name": "max_radius", "arg_names": [], "import_names": [], "rhs_call_name": "max", "annotation": ""}, "snippet": " max_radius = np.max(rad_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L904_C4", "label": "print()", "type": "expression", "loc": [904, 904], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L891_C0", "vector": [8, 1, 0.5509, 0.0006, 1, 0.1, 0.3, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Rad list:', rad_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L905_C4", "label": "bin_width =", "type": "assigned_variable", "loc": [905, 905], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L891_C0", "vector": [14, 1, 0.5515, 0.0006, 1, 0.1, 0.4, 331, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "bin_width", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " bin_width = 0.05"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L906_C4", "label": "bins = arange()", "type": "assigned_variable", "loc": [906, 906], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L891_C0", "vector": [14, 1, 0.5521, 0.0006, 1, 0.1, 0.5, 792, 3, 3, 0, 0, 489, 10, 1], "semantic": {"name": "bins", "arg_names": [], "import_names": [], "rhs_call_name": "arange", "annotation": ""}, "snippet": " bins = np.arange(0.-bin_width/2., max_radius+2*bin_width, bin_width)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L907_C4", "label": "hist, bin_edges = histogram()", "type": "assigned_variable", "loc": [907, 907], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L891_C0", "vector": [14, 1, 0.5527, 0.0006, 1, 0.1, 0.6, 217, 3, 2, 0, 0, 428, 10, 2], "semantic": {"name": "hist, bin_edges", "arg_names": [], "import_names": [], "rhs_call_name": "histogram", "annotation": ""}, "snippet": " hist, bin_edges = np.histogram(np.array(rad_list), bins)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L908_C4", "label": "print()", "type": "expression", "loc": [908, 908], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L891_C0", "vector": [8, 1, 0.5533, 0.0006, 1, 0.1, 0.7, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Bin Edges:', bin_edges)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L909_C4", "label": "print()", "type": "expression", "loc": [909, 909], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L891_C0", "vector": [8, 1, 0.5539, 0.0006, 1, 0.1, 0.8, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Hist:', hist)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L910_C4", "label": "h = plot_histogram()", "type": "assigned_variable", "loc": [910, 914], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L891_C0", "vector": [14, 1, 0.5558, 0.003, 1, 0.1, 0.9, 686, 3, 7, 0, 0, 34, 10, 1], "semantic": {"name": "h", "arg_names": [], "import_names": [], "rhs_call_name": "plot_histogram", "annotation": ""}, "snippet": " h = mpu.plot_histogram(bin_edges[:-1]+bin_width/2., hist,\n width=0.8*bin_width, xlabel='Radius(meters)',\n ylabel='\\# of mechanisms',\n plot_title='Histogram of radii of rotary mechanisms',\n color=color)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Return_L915_C4", "label": "return", "type": "return", "loc": [915, 915], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L891_C0", "vector": [13, 1, 0.5576, 0.0006, 1, 0.1, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return h"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L919_C0", "label": "make_vector", "type": "function", "loc": [919, 937], "level": 0, "parent": null, "vector": [2, 0, 0.5655, 0.0116, 0, 0.66, 0.8667, 20, 0, 4, 1, 0, 0, 0, 13], "semantic": {"name": "make_vector", "arg_names": ["mechx", "ftan_l", "lim", "bin_size"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def make_vector(mechx, ftan_l, lim, bin_size):\n t, f = bin(mechx, ftan_l, bin_size, max,\n ignore_empty=False, max_pose=lim,\n empty_value = np.nan)\n f = np.array(f)\n t = np.array(t)\n\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L920_C4", "label": "t, f = bin()", "type": "assigned_variable", "loc": [920, 922], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L919_C0", "vector": [14, 1, 0.5612, 0.0018, 1, 0.42, 0.0, 519, 3, 7, 0, 0, 167, 10, 1], "semantic": {"name": "t, f", "arg_names": [], "import_names": [], "rhs_call_name": "bin", "annotation": ""}, "snippet": " t, f = bin(mechx, ftan_l, bin_size, max,\n ignore_empty=False, max_pose=lim,\n empty_value = np.nan)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L923_C4", "label": "f = array()", "type": "assigned_variable", "loc": [923, 923], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L919_C0", "vector": [14, 1, 0.5625, 0.0006, 1, 0.42, 0.1667, 899, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " f = np.array(f)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L924_C4", "label": "t = array()", "type": "assigned_variable", "loc": [924, 924], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L919_C0", "vector": [14, 1, 0.5631, 0.0006, 1, 0.42, 0.3333, 15, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "t", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " t = np.array(t)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L927_C4", "label": "clean_idx = where()", "type": "assigned_variable", "loc": [927, 927], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L919_C0", "vector": [14, 1, 0.5649, 0.0006, 1, 0.42, 0.5, 54, 3, 1, 0, 0, 169, 10, 3], "semantic": {"name": "clean_idx", "arg_names": [], "import_names": [], "rhs_call_name": "where", "annotation": ""}, "snippet": " clean_idx = np.where(np.logical_not(np.isnan(f)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L928_C4", "label": "miss_idx = where()", "type": "assigned_variable", "loc": [928, 928], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L919_C0", "vector": [14, 1, 0.5655, 0.0006, 1, 0.42, 0.6667, 312, 3, 1, 0, 0, 169, 10, 2], "semantic": {"name": "miss_idx", "arg_names": [], "import_names": [], "rhs_call_name": "where", "annotation": ""}, "snippet": " miss_idx = np.where(np.isnan(f))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L929_C4", "label": "if", "type": "if", "loc": [929, 934], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L919_C0", "vector": [4, 1, 0.5676, 0.0037, 1, 0.42, 0.8333, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(miss_idx[0]) > 0:\n fclean = f[clean_idx]\n mechx_clean = t[clean_idx]\n mechx_miss = t[miss_idx]\n f_inter = mfc.interpolate_1d(mechx_clean, fclean, mechx_miss)\n f[np.where(np.isnan(f))] = f_inter"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L930_C8", "label": "fclean =", "type": "assigned_variable", "loc": [930, 930], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L929_C4", "vector": [14, 2, 0.5667, 0.0006, 2, 0.23, 0.0, 756, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "fclean", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " fclean = f[clean_idx]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L931_C8", "label": "mechx_clean =", "type": "assigned_variable", "loc": [931, 931], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L929_C4", "vector": [14, 2, 0.5673, 0.0006, 2, 0.23, 0.25, 780, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "mechx_clean", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mechx_clean = t[clean_idx]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L932_C8", "label": "mechx_miss =", "type": "assigned_variable", "loc": [932, 932], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L929_C4", "vector": [14, 2, 0.5679, 0.0006, 2, 0.23, 0.5, 372, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "mechx_miss", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mechx_miss = t[miss_idx]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L933_C8", "label": "f_inter = interpolate_1d()", "type": "assigned_variable", "loc": [933, 933], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L929_C4", "vector": [14, 2, 0.5686, 0.0006, 2, 0.23, 0.75, 21, 3, 3, 0, 0, 28, 10, 1], "semantic": {"name": "f_inter", "arg_names": [], "import_names": [], "rhs_call_name": "interpolate_1d", "annotation": ""}, "snippet": " f_inter = mfc.interpolate_1d(mechx_clean, fclean, mechx_miss)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L934_C8", "label": "assign", "type": "assigned_variable", "loc": [934, 934], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L929_C4", "vector": [14, 2, 0.5692, 0.0006, 2, 0.23, 1.0, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " f[np.where(np.isnan(f))] = f_inter"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Return_L937_C4", "label": "return", "type": "return", "loc": [937, 937], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L919_C0", "vector": [13, 1, 0.571, 0.0006, 1, 0.42, 1.0, 0, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return np.matrix(f).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L941_C0", "label": "make_vector_mechanism", "type": "function", "loc": [941, 1009], "level": 0, "parent": null, "vector": [2, 0, 0.5941, 0.042, 0, 0.66, 0.8889, 15, 0, 2, 1, 0, 0, 0, 23], "semantic": {"name": "make_vector_mechanism", "arg_names": ["dir", "use_moment"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def make_vector_mechanism(dir, use_moment = False):\n print('>>>>>>>>>>>>>>>>>>>>>>')\n print('dir:', dir)\n di = extract_pkls(dir)\n ftan_l_l = di['ftan_l_l']\n frad_l_l = di['frad_l_l']\n mechx_l_l = di['mechx_l_l']\n time_l_l = di['time_l_l']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L942_C4", "label": "print()", "type": "expression", "loc": [942, 942], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L941_C0", "vector": [8, 1, 0.574, 0.0006, 1, 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('>>>>>>>>>>>>>>>>>>>>>>')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L943_C4", "label": "print()", "type": "expression", "loc": [943, 943], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L941_C0", "vector": [8, 1, 0.5746, 0.0006, 1, 0.78, 0.0417, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('dir:', dir)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L944_C4", "label": "di = extract_pkls()", "type": "assigned_variable", "loc": [944, 944], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L941_C0", "vector": [14, 1, 0.5753, 0.0006, 1, 0.78, 0.0833, 700, 3, 1, 0, 0, 780, 10, 1], "semantic": {"name": "di", "arg_names": [], "import_names": [], "rhs_call_name": "extract_pkls", "annotation": ""}, "snippet": " di = extract_pkls(dir)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L945_C4", "label": "ftan_l_l =", "type": "assigned_variable", "loc": [945, 945], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L941_C0", "vector": [14, 1, 0.5759, 0.0006, 1, 0.78, 0.125, 2, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ftan_l_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ftan_l_l = di['ftan_l_l']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L946_C4", "label": "frad_l_l =", "type": "assigned_variable", "loc": [946, 946], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L941_C0", "vector": [14, 1, 0.5765, 0.0006, 1, 0.78, 0.1667, 269, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "frad_l_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " frad_l_l = di['frad_l_l']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L947_C4", "label": "mechx_l_l =", "type": "assigned_variable", "loc": [947, 947], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L941_C0", "vector": [14, 1, 0.5771, 0.0006, 1, 0.78, 0.2083, 760, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "mechx_l_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mechx_l_l = di['mechx_l_l']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L948_C4", "label": "time_l_l =", "type": "assigned_variable", "loc": [948, 948], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L941_C0", "vector": [14, 1, 0.5777, 0.0006, 1, 0.78, 0.25, 201, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "time_l_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " time_l_l = di['time_l_l']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L949_C4", "label": "moment_l_l =", "type": "assigned_variable", "loc": [949, 949], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L941_C0", "vector": [14, 1, 0.5783, 0.0006, 1, 0.78, 0.2917, 498, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "moment_l_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " moment_l_l = di['moment_l_l']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L950_C4", "label": "typ =", "type": "assigned_variable", "loc": [950, 950], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L941_C0", "vector": [14, 1, 0.5789, 0.0006, 1, 0.78, 0.3333, 722, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "typ", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " typ = di['typ']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L951_C4", "label": "rad =", "type": "assigned_variable", "loc": [951, 951], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L941_C0", "vector": [14, 1, 0.5795, 0.0006, 1, 0.78, 0.375, 439, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "rad", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rad = di['rad']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L953_C4", "label": "n_trials = len()", "type": "assigned_variable", "loc": [953, 953], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L941_C0", "vector": [14, 1, 0.5807, 0.0006, 1, 0.78, 0.4167, 459, 3, 1, 0, 0, 890, 10, 1], "semantic": {"name": "n_trials", "arg_names": [], "import_names": [], "rhs_call_name": "len", "annotation": ""}, "snippet": " n_trials = len(ftan_l_l)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L954_C4", "label": "vec_list =", "type": "assigned_variable", "loc": [954, 954], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L941_C0", "vector": [14, 1, 0.5814, 0.0006, 1, 0.78, 0.4583, 708, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "vec_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " vec_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L955_C4", "label": "tup_list =", "type": "assigned_variable", "loc": [955, 955], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L941_C0", "vector": [14, 1, 0.582, 0.0006, 1, 0.78, 0.5, 177, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "tup_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tup_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L956_C4", "label": "for i", "type": "for", "loc": [956, 980], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L941_C0", "vector": [6, 1, 0.5899, 0.0152, 1, 0.78, 0.5417, 826, 3, 0, 0, 0, 0, 0, 10], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(n_trials):\n if typ == 'rotary':\n if use_moment:\n torque_l = moment_l_l[i]\n else:\n torque_l = ftan_l_l[i]\n\n if len(mechx_l_l[i]) < 30:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L957_C8", "label": "if", "type": "if", "loc": [957, 968], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L956_C4", "vector": [4, 2, 0.5865, 0.0073, 2, 0.45, 0.0, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if typ == 'rotary':\n if use_moment:\n torque_l = moment_l_l[i]\n else:\n torque_l = ftan_l_l[i]\n\n if len(mechx_l_l[i]) < 30:\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L958_C12", "label": "if", "type": "if", "loc": [958, 961], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L957_C8", "vector": [4, 3, 0.5847, 0.0024, 3, 0.86, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if use_moment:\n torque_l = moment_l_l[i]\n else:\n torque_l = ftan_l_l[i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L959_C16", "label": "torque_l =", "type": "assigned_variable", "loc": [959, 959], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L958_C12", "vector": [14, 4, 0.5844, 0.0006, 4, 0.1, 0.0, 860, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "torque_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " torque_l = moment_l_l[i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L961_C16", "label": "torque_l =", "type": "assigned_variable", "loc": [961, 961], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L958_C12", "vector": [14, 4, 0.5856, 0.0006, 4, 0.1, 1.0, 860, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "torque_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " torque_l = ftan_l_l[i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L963_C12", "label": "if", "type": "if", "loc": [963, 964], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L957_C8", "vector": [4, 3, 0.5871, 0.0012, 3, 0.86, 0.3333, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(mechx_l_l[i]) < 30:\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L966_C12", "label": "v = make_vector()", "type": "assigned_variable", "loc": [966, 967], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L957_C8", "vector": [14, 3, 0.589, 0.0012, 3, 0.86, 0.6667, 553, 3, 4, 0, 0, 20, 10, 3], "semantic": {"name": "v", "arg_names": [], "import_names": [], "rhs_call_name": "make_vector", "annotation": ""}, "snippet": " v = make_vector(mechx_l_l[i], torque_l, lim = math.radians(50.),\n bin_size = math.radians(1))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L968_C12", "label": "max_angle = radians()", "type": "assigned_variable", "loc": [968, 968], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L957_C8", "vector": [14, 3, 0.5899, 0.0006, 3, 0.86, 1.0, 451, 3, 1, 0, 0, 383, 10, 1], "semantic": {"name": "max_angle", "arg_names": [], "import_names": [], "rhs_call_name": "radians", "annotation": ""}, "snippet": " max_angle = math.radians(30)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L970_C8", "label": "if", "type": "if", "loc": [970, 972], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L956_C4", "vector": [4, 2, 0.5917, 0.0018, 2, 0.45, 0.2, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if typ == 'prismatic':\n v = make_vector(mechx_l_l[i], ftan_l_l[i], lim = 0.25,\n bin_size = 0.01)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L971_C12", "label": "v = make_vector()", "type": "assigned_variable", "loc": [971, 972], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L970_C8", "vector": [14, 3, 0.592, 0.0012, 3, 0.33, 0.0, 553, 3, 4, 0, 0, 20, 10, 1], "semantic": {"name": "v", "arg_names": [], "import_names": [], "rhs_call_name": "make_vector", "annotation": ""}, "snippet": " v = make_vector(mechx_l_l[i], ftan_l_l[i], lim = 0.25,\n bin_size = 0.01)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L975_C8", "label": "traj_vel = compute_average_velocity()", "type": "assigned_variable", "loc": [975, 975], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L956_C4", "vector": [14, 2, 0.5941, 0.0006, 2, 0.45, 0.4, 279, 3, 4, 0, 0, 59, 10, 1], "semantic": {"name": "traj_vel", "arg_names": [], "import_names": [], "rhs_call_name": "compute_average_velocity", "annotation": ""}, "snippet": " traj_vel = compute_average_velocity(mechx_l_l[i], time_l_l[i], max_angle, typ)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L976_C8", "label": "if", "type": "if", "loc": [976, 977], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L956_C4", "vector": [4, 2, 0.5951, 0.0012, 2, 0.45, 0.6, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if traj_vel == -1:\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L979_C8", "label": "append()", "type": "expression", "loc": [979, 979], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L956_C4", "vector": [8, 2, 0.5966, 0.0006, 2, 0.45, 0.8, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " vec_list.append(v)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L980_C8", "label": "append()", "type": "expression", "loc": [980, 980], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L956_C4", "vector": [8, 2, 0.5972, 0.0006, 2, 0.45, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " tup_list.append((traj_vel,v))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L982_C4", "label": "if", "type": "if", "loc": [982, 983], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L941_C0", "vector": [4, 1, 0.5987, 0.0012, 1, 0.78, 0.5833, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(vec_list) <= 1:\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Return_L983_C8", "label": "return", "type": "return", "loc": [983, 983], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L982_C4", "vector": [13, 2, 0.599, 0.0006, 2, 0.9, 0.0, 0, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L985_C4", "label": "sort()", "type": "expression", "loc": [985, 985], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L941_C0", "vector": [8, 1, 0.6002, 0.0006, 1, 0.78, 0.625, 489, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "sort", "arg_names": [], "import_names": [], "rhs_call_name": "sort", "annotation": ""}, "snippet": " tup_list.sort()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L986_C4", "label": " = zip()", "type": "assigned_variable", "loc": [986, 986], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L941_C0", "vector": [14, 1, 0.6009, 0.0006, 1, 0.78, 0.6667, 0, 3, 1, 0, 0, 814, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "zip", "annotation": ""}, "snippet": " [vel_list, vec_list] = zip(*tup_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L988_C4", "label": "v_prev =", "type": "assigned_variable", "loc": [988, 988], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L941_C0", "vector": [14, 1, 0.6021, 0.0006, 1, 0.78, 0.7083, 738, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "v_prev", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " v_prev = vel_list[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L989_C4", "label": "t_v =", "type": "assigned_variable", "loc": [989, 989], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L941_C0", "vector": [14, 1, 0.6027, 0.0006, 1, 0.78, 0.75, 314, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "t_v", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " t_v = v_prev"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L990_C4", "label": "thresh = radians()", "type": "assigned_variable", "loc": [990, 990], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L941_C0", "vector": [14, 1, 0.6033, 0.0006, 1, 0.78, 0.7917, 844, 3, 1, 0, 0, 383, 10, 1], "semantic": {"name": "thresh", "arg_names": [], "import_names": [], "rhs_call_name": "radians", "annotation": ""}, "snippet": " thresh = math.radians(5)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L991_C4", "label": "i =", "type": "assigned_variable", "loc": [991, 991], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L941_C0", "vector": [14, 1, 0.6039, 0.0006, 1, 0.78, 0.8333, 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_99534:Assign_L992_C4", "label": "ret_list =", "type": "assigned_variable", "loc": [992, 992], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L941_C0", "vector": [14, 1, 0.6045, 0.0006, 1, 0.78, 0.875, 726, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "ret_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ret_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L993_C4", "label": "for j, v", "type": "for", "loc": [993, 999], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L941_C0", "vector": [6, 1, 0.6069, 0.0043, 1, 0.78, 0.9167, 655, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "j, v", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for j,v in enumerate(vel_list):\n if (v - v_prev) > thresh:\n i += 1\n if i >= 2:\n break\n v_prev = v\n ret_list.append(vec_list[j])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L994_C8", "label": "if", "type": "if", "loc": [994, 998], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L993_C4", "vector": [4, 2, 0.6069, 0.003, 2, 0.43, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (v - v_prev) > thresh:\n i += 1\n if i >= 2:\n break\n v_prev = v"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L996_C12", "label": "if", "type": "if", "loc": [996, 997], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L994_C8", "vector": [4, 3, 0.6073, 0.0012, 3, 0.48, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if i >= 2:\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L998_C12", "label": "v_prev =", "type": "assigned_variable", "loc": [998, 998], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L994_C8", "vector": [14, 3, 0.6082, 0.0006, 3, 0.48, 1.0, 738, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "v_prev", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " v_prev = v"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L999_C8", "label": "append()", "type": "expression", "loc": [999, 999], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L993_C4", "vector": [8, 2, 0.6088, 0.0006, 2, 0.43, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " ret_list.append(vec_list[j])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1001_C4", "label": "print()", "type": "expression", "loc": [1001, 1001], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L941_C0", "vector": [8, 1, 0.61, 0.0006, 1, 0.78, 0.9583, 535, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Number of trials:', len(ret_list))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Return_L1009_C4", "label": "return", "type": "return", "loc": [1009, 1009], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L941_C0", "vector": [13, 1, 0.6149, 0.0006, 1, 0.78, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return np.column_stack(ret_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1015_C0", "label": "different_classes_rotary", "type": "function", "loc": [1015, 1102], "level": 0, "parent": null, "vector": [2, 0, 0.645, 0.0536, 0, 0.66, 0.9111, 35, 0, 1, 0, 0, 0, 0, 37], "semantic": {"name": "different_classes_rotary", "arg_names": ["dir_list"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def different_classes_rotary(dir_list):\n mech_vec_list = []\n legend_list = []\n for d in dir_list:\n di = extract_pkls(d)\n if di == None:\n continue\n if di.has_key('typ'):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1016_C4", "label": "mech_vec_list =", "type": "assigned_variable", "loc": [1016, 1016], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1015_C0", "vector": [14, 1, 0.6191, 0.0006, 1, 0.87, 0.0, 543, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "mech_vec_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mech_vec_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1017_C4", "label": "legend_list =", "type": "assigned_variable", "loc": [1017, 1017], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1015_C0", "vector": [14, 1, 0.6197, 0.0006, 1, 0.87, 0.0385, 41, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "legend_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " legend_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1018_C4", "label": "for d", "type": "for", "loc": [1018, 1034], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1015_C0", "vector": [6, 1, 0.6252, 0.0104, 1, 0.87, 0.0769, 355, 2, 0, 0, 0, 0, 0, 6], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for d in dir_list:\n di = extract_pkls(d)\n if di == None:\n continue\n if di.has_key('typ'):\n typ = di['typ']\n if typ != 'rotary':\n #if typ != 'prismatic':"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1019_C8", "label": "di = extract_pkls()", "type": "assigned_variable", "loc": [1019, 1019], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1018_C4", "vector": [14, 2, 0.621, 0.0006, 2, 0.49, 0.0, 700, 3, 1, 0, 0, 780, 10, 1], "semantic": {"name": "di", "arg_names": [], "import_names": [], "rhs_call_name": "extract_pkls", "annotation": ""}, "snippet": " di = extract_pkls(d)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1020_C8", "label": "if", "type": "if", "loc": [1020, 1021], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1018_C4", "vector": [4, 2, 0.6219, 0.0012, 2, 0.49, 0.1667, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if di == None:\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1022_C8", "label": "if", "type": "if", "loc": [1022, 1028], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1018_C4", "vector": [4, 2, 0.6246, 0.0043, 2, 0.49, 0.3333, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if di.has_key('typ'):\n typ = di['typ']\n if typ != 'rotary':\n #if typ != 'prismatic':\n continue\n else:\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1023_C12", "label": "typ =", "type": "assigned_variable", "loc": [1023, 1023], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1022_C8", "vector": [14, 3, 0.6234, 0.0006, 3, 0.54, 0.0, 722, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "typ", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " typ = di['typ']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1024_C12", "label": "if", "type": "if", "loc": [1024, 1026], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1022_C8", "vector": [4, 3, 0.6246, 0.0018, 3, 0.54, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if typ != 'rotary':\n #if typ != 'prismatic':\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1030_C8", "label": "v = make_vector_mechanism()", "type": "assigned_variable", "loc": [1030, 1030], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1018_C4", "vector": [14, 2, 0.6277, 0.0006, 2, 0.49, 0.5, 553, 3, 1, 0, 0, 15, 10, 1], "semantic": {"name": "v", "arg_names": [], "import_names": [], "rhs_call_name": "make_vector_mechanism", "annotation": ""}, "snippet": " v = make_vector_mechanism(d)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1031_C8", "label": "if", "type": "if", "loc": [1031, 1032], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1018_C4", "vector": [4, 2, 0.6286, 0.0012, 2, 0.49, 0.6667, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if v == None:\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1033_C8", "label": "append()", "type": "expression", "loc": [1033, 1033], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1018_C4", "vector": [8, 2, 0.6295, 0.0006, 2, 0.49, 0.8333, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " mech_vec_list.append(v)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1034_C8", "label": "append()", "type": "expression", "loc": [1034, 1034], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1018_C4", "vector": [8, 2, 0.6301, 0.0006, 2, 0.49, 1.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " legend_list.append(get_mech_name(d))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1036_C4", "label": "all_vecs = column_stack()", "type": "assigned_variable", "loc": [1036, 1036], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1015_C0", "vector": [14, 1, 0.6313, 0.0006, 1, 0.87, 0.1154, 256, 3, 1, 0, 0, 724, 10, 1], "semantic": {"name": "all_vecs", "arg_names": [], "import_names": [], "rhs_call_name": "column_stack", "annotation": ""}, "snippet": " all_vecs = np.column_stack(mech_vec_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1037_C4", "label": "print()", "type": "expression", "loc": [1037, 1037], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1015_C0", "vector": [8, 1, 0.6319, 0.0006, 1, 0.87, 0.1538, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('>>>>>>>>> all_vecs.shape <<<<<<<<<<<<<', all_vecs.shape)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1038_C4", "label": "U, s, _ = svd()", "type": "assigned_variable", "loc": [1038, 1038], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1015_C0", "vector": [14, 1, 0.6325, 0.0006, 1, 0.87, 0.1923, 703, 3, 1, 0, 0, 388, 10, 2], "semantic": {"name": "U, s, _", "arg_names": [], "import_names": [], "rhs_call_name": "svd", "annotation": ""}, "snippet": " U, s, _ = np.linalg.svd(np.cov(all_vecs))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1039_C4", "label": "mn =", "type": "assigned_variable", "loc": [1039, 1039], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1015_C0", "vector": [14, 1, 0.6332, 0.0006, 1, 0.87, 0.2308, 747, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "mn", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mn = np.mean(all_vecs, 1).A1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1041_C4", "label": "set_figure_size()", "type": "expression", "loc": [1041, 1041], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1015_C0", "vector": [8, 1, 0.6344, 0.0006, 1, 0.87, 0.2692, 342, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "set_figure_size", "arg_names": [], "import_names": [], "rhs_call_name": "set_figure_size", "annotation": ""}, "snippet": " mpu.set_figure_size(3.,3.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1042_C4", "label": "figure()", "type": "expression", "loc": [1042, 1042], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1015_C0", "vector": [8, 1, 0.635, 0.0006, 1, 0.87, 0.3077, 789, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "figure", "arg_names": [], "import_names": [], "rhs_call_name": "figure", "annotation": ""}, "snippet": " mpu.figure()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1043_C4", "label": "proj_mat =", "type": "assigned_variable", "loc": [1043, 1043], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1015_C0", "vector": [14, 1, 0.6356, 0.0006, 1, 0.87, 0.3462, 608, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "proj_mat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " proj_mat = U[:, 0:2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1044_C4", "label": "legend_made_list =", "type": "assigned_variable", "loc": [1044, 1044], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1015_C0", "vector": [14, 1, 0.6362, 0.0006, 1, 0.87, 0.3846, 987, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "legend_made_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " legend_made_list = [False, False, False]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1045_C4", "label": "for i, v", "type": "for", "loc": [1045, 1079], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1015_C0", "vector": [6, 1, 0.6472, 0.0213, 1, 0.87, 0.4231, 843, 3, 0, 0, 0, 0, 0, 8], "semantic": {"name": "i, v", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i, v in enumerate(mech_vec_list):\n p = proj_mat.T * (v - np.matrix(mn).T)\n if np.any(p[0,:].A1<0):\n print('First principal component < 0 for some trial of:', legend_list[i])\n color = mpu.random_color()\n if 'ree' in legend_list[i]:\n #color = 'g'\n color = '#66FF33'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1046_C8", "label": "p =", "type": "assigned_variable", "loc": [1046, 1046], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1045_C4", "vector": [14, 2, 0.6374, 0.0006, 2, 0.9, 0.0, 491, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p = proj_mat.T * (v - np.matrix(mn).T)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1047_C8", "label": "if", "type": "if", "loc": [1047, 1048], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1045_C4", "vector": [4, 2, 0.6383, 0.0012, 2, 0.9, 0.25, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if np.any(p[0,:].A1<0):\n print('First principal component < 0 for some trial of:', legend_list[i])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1048_C12", "label": "print()", "type": "expression", "loc": [1048, 1048], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1047_C8", "vector": [8, 3, 0.6386, 0.0006, 3, 0.99, 0.0, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('First principal component < 0 for some trial of:', legend_list[i])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1049_C8", "label": "color = random_color()", "type": "assigned_variable", "loc": [1049, 1049], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1045_C4", "vector": [14, 2, 0.6392, 0.0006, 2, 0.9, 0.5, 776, 3, 0, 0, 0, 895, 10, 1], "semantic": {"name": "color", "arg_names": [], "import_names": [], "rhs_call_name": "random_color", "annotation": ""}, "snippet": " color = mpu.random_color()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1050_C8", "label": "if", "type": "if", "loc": [1050, 1077], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1045_C4", "vector": [4, 2, 0.6481, 0.0171, 2, 0.9, 0.75, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if 'ree' in legend_list[i]:\n #color = 'g'\n color = '#66FF33'\n if legend_made_list[0] == False:\n label = 'Freezers'\n legend_made_list[0] = True\n else:\n label = '__nolegend__'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1052_C12", "label": "color =", "type": "assigned_variable", "loc": [1052, 1052], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1050_C8", "vector": [14, 3, 0.6411, 0.0006, 3, 0.08, 0.0, 776, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "color", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " color = '#66FF33'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1053_C12", "label": "if", "type": "if", "loc": [1053, 1057], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1050_C8", "vector": [4, 3, 0.6429, 0.003, 3, 0.08, 0.25, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if legend_made_list[0] == False:\n label = 'Freezers'\n legend_made_list[0] = True\n else:\n label = '__nolegend__'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1054_C16", "label": "label =", "type": "assigned_variable", "loc": [1054, 1054], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1053_C12", "vector": [14, 4, 0.6423, 0.0006, 4, 0.01, 0.0, 811, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "label", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " label = 'Freezers'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1055_C16", "label": "assign", "type": "assigned_variable", "loc": [1055, 1055], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1053_C12", "vector": [14, 4, 0.6429, 0.0006, 4, 0.01, 0.5, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " legend_made_list[0] = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1057_C16", "label": "label =", "type": "assigned_variable", "loc": [1057, 1057], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1053_C12", "vector": [14, 4, 0.6441, 0.0006, 4, 0.01, 1.0, 811, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "label", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " label = '__nolegend__'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1058_C12", "label": "print()", "type": "expression", "loc": [1058, 1058], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1050_C8", "vector": [8, 3, 0.6447, 0.0006, 3, 0.08, 0.5, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('SHAPE:', p.shape)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1059_C12", "label": "print()", "type": "expression", "loc": [1059, 1059], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1050_C8", "vector": [8, 3, 0.6453, 0.0006, 3, 0.08, 0.75, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('p:', p)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1061_C8", "label": "if", "type": "if", "loc": [1061, 1077], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1050_C8", "vector": [4, 3, 0.6514, 0.0104, 3, 0.08, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif 'ge' in legend_list[i]:\n color = '#FF6633'\n #color = 'y'\n if legend_made_list[1] == False:\n label = 'Refrigerators'\n legend_made_list[1] = True\n else:\n label = '__nolegend__'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1062_C12", "label": "color =", "type": "assigned_variable", "loc": [1062, 1062], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1061_C8", "vector": [14, 4, 0.6472, 0.0006, 4, 0.84, 0.0, 776, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "color", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " color = '#FF6633'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1064_C12", "label": "if", "type": "if", "loc": [1064, 1068], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1061_C8", "vector": [4, 4, 0.6496, 0.003, 4, 0.84, 0.3333, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if legend_made_list[1] == False:\n label = 'Refrigerators'\n legend_made_list[1] = True\n else:\n label = '__nolegend__'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1065_C16", "label": "label =", "type": "assigned_variable", "loc": [1065, 1065], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1064_C12", "vector": [14, 5, 0.649, 0.0006, 5, 0.1, 0.0, 811, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "label", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " label = 'Refrigerators'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1066_C16", "label": "assign", "type": "assigned_variable", "loc": [1066, 1066], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1064_C12", "vector": [14, 5, 0.6496, 0.0006, 5, 0.1, 0.5, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " legend_made_list[1] = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1068_C16", "label": "label =", "type": "assigned_variable", "loc": [1068, 1068], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1064_C12", "vector": [14, 5, 0.6508, 0.0006, 5, 0.1, 1.0, 811, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "label", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " label = '__nolegend__'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1071_C12", "label": "color =", "type": "assigned_variable", "loc": [1071, 1071], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1061_C8", "vector": [14, 4, 0.6527, 0.0006, 4, 0.84, 0.6667, 776, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "color", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " color = '#3366FF'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1072_C12", "label": "if", "type": "if", "loc": [1072, 1077], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1061_C8", "vector": [4, 4, 0.6548, 0.0037, 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 legend_made_list[2] == False:\n #label = '\\\\flushleft Cabinets, Spring \\\\\\\\*[-2pt] Loaded Doors'\n label = 'Cabinets'\n legend_made_list[2] = True\n else:\n label = '__nolegend__'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1074_C16", "label": "label =", "type": "assigned_variable", "loc": [1074, 1074], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1072_C12", "vector": [14, 5, 0.6545, 0.0006, 5, 0.31, 0.0, 811, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "label", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " label = 'Cabinets'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1075_C16", "label": "assign", "type": "assigned_variable", "loc": [1075, 1075], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1072_C12", "vector": [14, 5, 0.6551, 0.0006, 5, 0.31, 0.5, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " legend_made_list[2] = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1077_C16", "label": "label =", "type": "assigned_variable", "loc": [1077, 1077], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1072_C12", "vector": [14, 5, 0.6563, 0.0006, 5, 0.31, 1.0, 811, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "label", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " label = '__nolegend__'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1078_C8", "label": "scatter()", "type": "expression", "loc": [1078, 1079], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1045_C4", "vector": [8, 2, 0.6572, 0.0012, 2, 0.9, 1.0, 990, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "scatter", "arg_names": [], "import_names": [], "rhs_call_name": "scatter", "annotation": ""}, "snippet": " mpu.pl.scatter(p[0,:].A1, p[1,:].A1, color = color, s = 15,\n label = label)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1080_C4", "label": "xlabel()", "type": "expression", "loc": [1080, 1080], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1015_C0", "vector": [8, 1, 0.6581, 0.0006, 1, 0.87, 0.4615, 676, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "xlabel", "arg_names": [], "import_names": [], "rhs_call_name": "xlabel", "annotation": ""}, "snippet": " mpu.pl.xlabel('First Principle Component')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1081_C4", "label": "ylabel()", "type": "expression", "loc": [1081, 1081], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1015_C0", "vector": [8, 1, 0.6587, 0.0006, 1, 0.87, 0.5, 584, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "ylabel", "arg_names": [], "import_names": [], "rhs_call_name": "ylabel", "annotation": ""}, "snippet": " mpu.pl.ylabel('Second Principle Component')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1082_C4", "label": "axis()", "type": "expression", "loc": [1082, 1082], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1015_C0", "vector": [8, 1, 0.6594, 0.0006, 1, 0.87, 0.5385, 860, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "axis", "arg_names": [], "import_names": [], "rhs_call_name": "axis", "annotation": ""}, "snippet": " mpu.pl.axis('equal')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1083_C4", "label": "axhline()", "type": "expression", "loc": [1083, 1083], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1015_C0", "vector": [8, 1, 0.66, 0.0006, 1, 0.87, 0.5769, 800, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "axhline", "arg_names": [], "import_names": [], "rhs_call_name": "axhline", "annotation": ""}, "snippet": " mpu.pl.axhline(y=0., color = 'k', ls='--')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1084_C4", "label": "axvline()", "type": "expression", "loc": [1084, 1084], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1015_C0", "vector": [8, 1, 0.6606, 0.0006, 1, 0.87, 0.6154, 455, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "axvline", "arg_names": [], "import_names": [], "rhs_call_name": "axvline", "annotation": ""}, "snippet": " mpu.pl.axvline(x=0., color = 'k', ls='--')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1086_C4", "label": "legend()", "type": "expression", "loc": [1086, 1086], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1015_C0", "vector": [8, 1, 0.6618, 0.0006, 1, 0.87, 0.6538, 880, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "legend", "arg_names": [], "import_names": [], "rhs_call_name": "legend", "annotation": ""}, "snippet": " mpu.legend(loc='center left', display_mode = 'less_space', draw_frame = True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1088_C4", "label": "figure()", "type": "expression", "loc": [1088, 1088], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1015_C0", "vector": [8, 1, 0.663, 0.0006, 1, 0.87, 0.6923, 789, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "figure", "arg_names": [], "import_names": [], "rhs_call_name": "figure", "annotation": ""}, "snippet": " mpu.figure()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1089_C4", "label": "mn =", "type": "assigned_variable", "loc": [1089, 1089], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1015_C0", "vector": [14, 1, 0.6636, 0.0006, 1, 0.87, 0.7308, 747, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "mn", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mn = np.mean(all_vecs, 1).A1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1090_C4", "label": "mn =", "type": "assigned_variable", "loc": [1090, 1090], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1015_C0", "vector": [14, 1, 0.6642, 0.0006, 1, 0.87, 0.7692, 747, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "mn", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mn = mn/np.linalg.norm(mn)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1091_C4", "label": "plot_yx()", "type": "expression", "loc": [1091, 1092], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1015_C0", "vector": [8, 1, 0.6651, 0.0012, 1, 0.87, 0.8077, 112, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "plot_yx", "arg_names": [], "import_names": [], "rhs_call_name": "plot_yx", "annotation": ""}, "snippet": " mpu.plot_yx(mn, color = '#FF3300',\n label = 'mean (normalized)', scatter_size=7)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1094_C4", "label": "c_list =", "type": "assigned_variable", "loc": [1094, 1094], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1015_C0", "vector": [14, 1, 0.6667, 0.0006, 1, 0.87, 0.8462, 110, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "c_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " c_list = ['#00CCFF', '#643DFF']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1095_C4", "label": "for i", "type": "for", "loc": [1095, 1097], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1015_C0", "vector": [6, 1, 0.6679, 0.0018, 1, 0.87, 0.8846, 826, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(2):\n mpu.plot_yx(U[:,i].flatten(), color = c_list[i],\n label = 'Eigenvector %d'%(i+1), scatter_size=7)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1096_C8", "label": "plot_yx()", "type": "expression", "loc": [1096, 1097], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1095_C4", "vector": [8, 2, 0.6682, 0.0012, 2, 0.38, 0.0, 112, 3, 4, 0, 0, 0, 0, 2], "semantic": {"name": "plot_yx", "arg_names": [], "import_names": [], "rhs_call_name": "plot_yx", "annotation": ""}, "snippet": " mpu.plot_yx(U[:,i].flatten(), color = c_list[i],\n label = 'Eigenvector %d'%(i+1), scatter_size=7)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1099_C4", "label": "axhline()", "type": "expression", "loc": [1099, 1099], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1015_C0", "vector": [8, 1, 0.6697, 0.0006, 1, 0.87, 0.9231, 800, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "axhline", "arg_names": [], "import_names": [], "rhs_call_name": "axhline", "annotation": ""}, "snippet": " mpu.pl.axhline(y=0., color = 'k', ls='--')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1100_C4", "label": "legend()", "type": "expression", "loc": [1100, 1100], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1015_C0", "vector": [8, 1, 0.6703, 0.0006, 1, 0.87, 0.9615, 880, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "legend", "arg_names": [], "import_names": [], "rhs_call_name": "legend", "annotation": ""}, "snippet": " mpu.legend(display_mode = 'less_space', draw_frame=False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1102_C4", "label": "show()", "type": "expression", "loc": [1102, 1102], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1015_C0", "vector": [8, 1, 0.6715, 0.0006, 1, 0.87, 1.0, 497, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "show", "arg_names": [], "import_names": [], "rhs_call_name": "show", "annotation": ""}, "snippet": " mpu.show()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1109_C0", "label": "max_force_hist", "type": "function", "loc": [1109, 1236], "level": 0, "parent": null, "vector": [2, 0, 0.7145, 0.078, 0, 0.66, 0.9333, 900, 0, 3, 0, 0, 0, 0, 64], "semantic": {"name": "max_force_hist", "arg_names": ["dir_name_list", "open", "type"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def max_force_hist(dir_name_list, open=True, type=''):\n if open:\n trial = 'Opening'\n else:\n trial = 'Closing'\n\n fls, freezer_list, fridge_list, springloaded_list = [],[],[],[]\n broiler_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1110_C4", "label": "if", "type": "if", "loc": [1110, 1113], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1109_C0", "vector": [4, 1, 0.6773, 0.0024, 1, 0.06, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if open:\n trial = 'Opening'\n else:\n trial = 'Closing'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1111_C8", "label": "trial =", "type": "assigned_variable", "loc": [1111, 1111], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1110_C4", "vector": [14, 2, 0.677, 0.0006, 2, 0.0, 0.0, 437, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "trial", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " trial = 'Opening'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1113_C8", "label": "trial =", "type": "assigned_variable", "loc": [1113, 1113], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1110_C4", "vector": [14, 2, 0.6782, 0.0006, 2, 0.0, 1.0, 437, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "trial", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " trial = 'Closing'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1115_C4", "label": "fls, freezer_list, fridge_list, springloaded_list =", "type": "assigned_variable", "loc": [1115, 1115], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1109_C0", "vector": [14, 1, 0.6795, 0.0006, 1, 0.06, 0.125, 819, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "fls, freezer_list, fridge_list, springloaded_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " fls, freezer_list, fridge_list, springloaded_list = [],[],[],[]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1116_C4", "label": "broiler_list =", "type": "assigned_variable", "loc": [1116, 1116], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1109_C0", "vector": [14, 1, 0.6801, 0.0006, 1, 0.06, 0.25, 593, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "broiler_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " broiler_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1117_C4", "label": "num_mech =", "type": "assigned_variable", "loc": [1117, 1117], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1109_C0", "vector": [14, 1, 0.6807, 0.0006, 1, 0.06, 0.375, 433, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "num_mech", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " num_mech = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1118_C4", "label": "lens =", "type": "assigned_variable", "loc": [1118, 1118], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1109_C0", "vector": [14, 1, 0.6813, 0.0006, 1, 0.06, 0.5, 770, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "lens", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " lens = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1120_C4", "label": "max_angle = radians()", "type": "assigned_variable", "loc": [1120, 1120], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1109_C0", "vector": [14, 1, 0.6825, 0.0006, 1, 0.06, 0.625, 451, 3, 1, 0, 0, 383, 10, 1], "semantic": {"name": "max_angle", "arg_names": [], "import_names": [], "rhs_call_name": "radians", "annotation": ""}, "snippet": " max_angle = math.radians(15.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1121_C4", "label": "max_dist =", "type": "assigned_variable", "loc": [1121, 1121], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1109_C0", "vector": [14, 1, 0.6831, 0.0006, 1, 0.06, 0.75, 822, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "max_dist", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " max_dist = 0.1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1123_C4", "label": "for d", "type": "for", "loc": [1123, 1173], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1109_C0", "vector": [6, 1, 0.6996, 0.0311, 1, 0.06, 0.875, 355, 2, 0, 0, 0, 0, 0, 25], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for d in dir_name_list:\n nm = get_mech_name(d)\n ep = extract_pkls(d, open, ignore_moment_list=True)\n if ep == None:\n continue\n ftan_l_l = ep['ftan_l_l']\n frad_l_l = ep['frad_l_l']\n mechx_l_l = ep['mechx_l_l']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1124_C8", "label": "nm = get_mech_name()", "type": "assigned_variable", "loc": [1124, 1124], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1123_C4", "vector": [14, 2, 0.6849, 0.0006, 2, 0.99, 0.0, 931, 3, 1, 0, 0, 59, 10, 1], "semantic": {"name": "nm", "arg_names": [], "import_names": [], "rhs_call_name": "get_mech_name", "annotation": ""}, "snippet": " nm = get_mech_name(d)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1125_C8", "label": "ep = extract_pkls()", "type": "assigned_variable", "loc": [1125, 1125], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1123_C4", "vector": [14, 2, 0.6856, 0.0006, 2, 0.99, 0.0769, 787, 3, 3, 0, 0, 780, 10, 1], "semantic": {"name": "ep", "arg_names": [], "import_names": [], "rhs_call_name": "extract_pkls", "annotation": ""}, "snippet": " ep = extract_pkls(d, open, ignore_moment_list=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1126_C8", "label": "if", "type": "if", "loc": [1126, 1127], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1123_C4", "vector": [4, 2, 0.6865, 0.0012, 2, 0.99, 0.1538, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if ep == None:\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1128_C8", "label": "ftan_l_l =", "type": "assigned_variable", "loc": [1128, 1128], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1123_C4", "vector": [14, 2, 0.6874, 0.0006, 2, 0.99, 0.2308, 2, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ftan_l_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ftan_l_l = ep['ftan_l_l']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1129_C8", "label": "frad_l_l =", "type": "assigned_variable", "loc": [1129, 1129], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1123_C4", "vector": [14, 2, 0.688, 0.0006, 2, 0.99, 0.3077, 269, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "frad_l_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " frad_l_l = ep['frad_l_l']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1130_C8", "label": "mechx_l_l =", "type": "assigned_variable", "loc": [1130, 1130], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1123_C4", "vector": [14, 2, 0.6886, 0.0006, 2, 0.99, 0.3846, 760, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "mechx_l_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mechx_l_l = ep['mechx_l_l']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1131_C8", "label": "typ =", "type": "assigned_variable", "loc": [1131, 1131], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1123_C4", "vector": [14, 2, 0.6892, 0.0006, 2, 0.99, 0.4615, 722, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "typ", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " typ = ep['typ']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1132_C8", "label": "rad =", "type": "assigned_variable", "loc": [1132, 1132], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1123_C4", "vector": [14, 2, 0.6898, 0.0006, 2, 0.99, 0.5385, 439, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "rad", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rad = ep['rad']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1134_C8", "label": "fl, rl =", "type": "assigned_variable", "loc": [1134, 1134], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1123_C4", "vector": [14, 2, 0.691, 0.0006, 2, 0.99, 0.6154, 420, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "fl, rl", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " fl, rl = [], []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1135_C8", "label": "for n", "type": "for", "loc": [1135, 1149], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1123_C4", "vector": [6, 2, 0.6959, 0.0091, 2, 0.99, 0.6923, 773, 3, 0, 0, 0, 0, 0, 12], "semantic": {"name": "n", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for n in range(len(ftan_l_l)):\n ftan_l = ftan_l_l[n]\n\n mechx_a = np.array(mechx_l_l[n]) \n if type == 'prismatic':\n indices = np.where(mechx_a < max_dist)[0]\n else:\n indices = np.where(mechx_a < max_angle)[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1136_C12", "label": "ftan_l =", "type": "assigned_variable", "loc": [1136, 1136], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1135_C8", "vector": [14, 3, 0.6923, 0.0006, 3, 0.63, 0.0, 989, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ftan_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ftan_l = ftan_l_l[n]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1138_C12", "label": "mechx_a = array()", "type": "assigned_variable", "loc": [1138, 1138], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1135_C8", "vector": [14, 3, 0.6935, 0.0006, 3, 0.63, 0.1667, 840, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "mechx_a", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " mechx_a = np.array(mechx_l_l[n]) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1139_C12", "label": "if", "type": "if", "loc": [1139, 1142], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1135_C8", "vector": [4, 3, 0.695, 0.0024, 3, 0.63, 0.3333, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if type == 'prismatic':\n indices = np.where(mechx_a < max_dist)[0]\n else:\n indices = np.where(mechx_a < max_angle)[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1140_C16", "label": "indices =", "type": "assigned_variable", "loc": [1140, 1140], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1139_C12", "vector": [14, 4, 0.6947, 0.0006, 4, 0.55, 0.0, 478, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "indices", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " indices = np.where(mechx_a < max_dist)[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1142_C16", "label": "indices =", "type": "assigned_variable", "loc": [1142, 1142], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1139_C12", "vector": [14, 4, 0.6959, 0.0006, 4, 0.55, 1.0, 478, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "indices", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " indices = np.where(mechx_a < max_angle)[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1144_C12", "label": "if", "type": "if", "loc": [1144, 1145], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1135_C8", "vector": [4, 3, 0.6974, 0.0012, 3, 0.63, 0.5, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(indices) > 0:\n ftan_l = np.array(ftan_l)[indices].tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1145_C16", "label": "ftan_l = tolist()", "type": "assigned_variable", "loc": [1145, 1145], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1144_C12", "vector": [14, 4, 0.6977, 0.0006, 4, 0.82, 0.0, 989, 3, 0, 0, 0, 185, 10, 2], "semantic": {"name": "ftan_l", "arg_names": [], "import_names": [], "rhs_call_name": "tolist", "annotation": ""}, "snippet": " ftan_l = np.array(ftan_l)[indices].tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1147_C12", "label": "fmax = max()", "type": "assigned_variable", "loc": [1147, 1147], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1135_C8", "vector": [14, 3, 0.699, 0.0006, 3, 0.63, 0.6667, 916, 3, 1, 0, 0, 442, 10, 2], "semantic": {"name": "fmax", "arg_names": [], "import_names": [], "rhs_call_name": "max", "annotation": ""}, "snippet": " fmax = np.max(np.abs(ftan_l))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1148_C12", "label": "append()", "type": "expression", "loc": [1148, 1148], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1135_C8", "vector": [8, 3, 0.6996, 0.0006, 3, 0.63, 0.8333, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " fl.append(fmax)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1149_C12", "label": "append()", "type": "expression", "loc": [1149, 1149], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1135_C8", "vector": [8, 3, 0.7002, 0.0006, 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": " rl.append(rad)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1152_C8", "label": "fmax_max = min()", "type": "assigned_variable", "loc": [1152, 1152], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1123_C4", "vector": [14, 2, 0.702, 0.0006, 2, 0.99, 0.7692, 135, 3, 1, 0, 0, 867, 10, 1], "semantic": {"name": "fmax_max", "arg_names": [], "import_names": [], "rhs_call_name": "min", "annotation": ""}, "snippet": " fmax_max = np.min(fl)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1153_C8", "label": "if", "type": "if", "loc": [1153, 1169], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1123_C4", "vector": [4, 2, 0.7075, 0.0104, 2, 0.99, 0.8462, 0, 0, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if type == 'rotary':\n if 'ree' in nm:\n freezer_list.append(fmax_max)\n elif 'naveen_microwave' in nm:\n # putting microwave in freezers\n freezer_list.append(fmax_max)\n if fmax_max < 5.:\n print('nm:', nm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1154_C12", "label": "if", "type": "if", "loc": [1154, 1164], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1153_C8", "vector": [4, 3, 0.7063, 0.0067, 3, 0.25, 0.0, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if 'ree' in nm:\n freezer_list.append(fmax_max)\n elif 'naveen_microwave' in nm:\n # putting microwave in freezers\n freezer_list.append(fmax_max)\n if fmax_max < 5.:\n print('nm:', nm)\n elif 'ge' in nm:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1155_C16", "label": "append()", "type": "expression", "loc": [1155, 1155], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1154_C12", "vector": [8, 4, 0.7038, 0.0006, 4, 0.23, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " freezer_list.append(fmax_max)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1156_C12", "label": "if", "type": "if", "loc": [1156, 1164], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1154_C12", "vector": [4, 4, 0.7069, 0.0055, 4, 0.23, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif 'naveen_microwave' in nm:\n # putting microwave in freezers\n freezer_list.append(fmax_max)\n if fmax_max < 5.:\n print('nm:', nm)\n elif 'ge' in nm:\n fridge_list.append(fmax_max)\n elif fmax > 60.:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1158_C16", "label": "append()", "type": "expression", "loc": [1158, 1158], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1156_C12", "vector": [8, 5, 0.7057, 0.0006, 5, 0.98, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " freezer_list.append(fmax_max)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1159_C16", "label": "if", "type": "if", "loc": [1159, 1160], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1156_C12", "vector": [4, 5, 0.7066, 0.0012, 5, 0.98, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if fmax_max < 5.:\n print('nm:', nm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1160_C20", "label": "print()", "type": "expression", "loc": [1160, 1160], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1159_C16", "vector": [8, 6, 0.7069, 0.0006, 6, 0.96, 0.0, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('nm:', nm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1161_C12", "label": "if", "type": "if", "loc": [1161, 1164], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1156_C12", "vector": [4, 5, 0.7084, 0.0024, 5, 0.98, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif 'ge' in nm:\n fridge_list.append(fmax_max)\n elif fmax > 60.:\n springloaded_list.append(fmax_max)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1162_C16", "label": "append()", "type": "expression", "loc": [1162, 1162], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1161_C12", "vector": [8, 6, 0.7081, 0.0006, 6, 0.46, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " fridge_list.append(fmax_max)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1163_C12", "label": "if", "type": "if", "loc": [1163, 1164], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1161_C12", "vector": [4, 6, 0.709, 0.0012, 6, 0.46, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif fmax > 60.:\n springloaded_list.append(fmax_max)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1164_C16", "label": "append()", "type": "expression", "loc": [1164, 1164], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1163_C12", "vector": [8, 7, 0.7093, 0.0006, 7, 0.56, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " springloaded_list.append(fmax_max)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1166_C12", "label": "if", "type": "if", "loc": [1166, 1167], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1153_C8", "vector": [4, 3, 0.7108, 0.0012, 3, 0.25, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if 'ven' in nm:\n broiler_list.append(fmax_max)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1167_C16", "label": "append()", "type": "expression", "loc": [1167, 1167], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1166_C12", "vector": [8, 4, 0.7112, 0.0006, 4, 0.98, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " broiler_list.append(fmax_max)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1168_C12", "label": "if", "type": "if", "loc": [1168, 1169], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1153_C8", "vector": [4, 3, 0.7121, 0.0012, 3, 0.25, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if fmax_max > 10.:\n print('nm:', nm, 'fmax:', fmax_max)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1169_C16", "label": "print()", "type": "expression", "loc": [1169, 1169], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1168_C12", "vector": [8, 4, 0.7124, 0.0006, 4, 0.7, 0.0, 535, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('nm:', nm, 'fmax:', fmax_max)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1171_C8", "label": "append()", "type": "expression", "loc": [1171, 1171], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1123_C4", "vector": [8, 2, 0.7136, 0.0006, 2, 0.99, 0.9231, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " fls.append(fmax_max)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1173_C8", "label": "append()", "type": "expression", "loc": [1173, 1173], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1123_C4", "vector": [8, 2, 0.7148, 0.0006, 2, 0.99, 1.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " lens.append(len(fl))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1175_C4", "label": "if", "type": "if", "loc": [1175, 1236], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1109_C0", "vector": [4, 1, 0.7346, 0.0378, 1, 0.06, 1.0, 0, 0, 0, 0, 0, 0, 0, 38], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(fls) > 0:\n max_force = np.max(fls)\n bin_width = 2.5\n bins = np.arange(0.-bin_width/2., max_force+2*bin_width, bin_width)\n if type == 'rotary':\n mpu.set_figure_size(3.,4.)\n mpu.figure()\n hist, bin_edges = np.histogram(fls, bins)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1176_C8", "label": "max_force = max()", "type": "assigned_variable", "loc": [1176, 1176], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1175_C4", "vector": [14, 2, 0.7166, 0.0006, 2, 0.67, 0.0, 874, 3, 1, 0, 0, 442, 10, 1], "semantic": {"name": "max_force", "arg_names": [], "import_names": [], "rhs_call_name": "max", "annotation": ""}, "snippet": " max_force = np.max(fls)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1177_C8", "label": "bin_width =", "type": "assigned_variable", "loc": [1177, 1177], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1175_C4", "vector": [14, 2, 0.7172, 0.0006, 2, 0.67, 0.0714, 331, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "bin_width", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " bin_width = 2.5"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1178_C8", "label": "bins = arange()", "type": "assigned_variable", "loc": [1178, 1178], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1175_C4", "vector": [14, 2, 0.7179, 0.0006, 2, 0.67, 0.1429, 792, 3, 3, 0, 0, 489, 10, 1], "semantic": {"name": "bins", "arg_names": [], "import_names": [], "rhs_call_name": "arange", "annotation": ""}, "snippet": " bins = np.arange(0.-bin_width/2., max_force+2*bin_width, bin_width)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1179_C8", "label": "if", "type": "if", "loc": [1179, 1219], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1175_C4", "vector": [4, 2, 0.7307, 0.025, 2, 0.67, 0.2143, 0, 0, 0, 0, 0, 0, 0, 21], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if type == 'rotary':\n mpu.set_figure_size(3.,4.)\n mpu.figure()\n hist, bin_edges = np.histogram(fls, bins)\n h = mpu.plot_histogram(bin_edges[:-1]+bin_width/2., hist,\n width=0.8*bin_width, xlabel='Force (Newtons)',\n ylabel='\\# of mechanisms',\n color='b', label='Cabinets')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1180_C12", "label": "set_figure_size()", "type": "expression", "loc": [1180, 1180], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1179_C8", "vector": [8, 3, 0.7191, 0.0006, 3, 0.73, 0.0, 342, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "set_figure_size", "arg_names": [], "import_names": [], "rhs_call_name": "set_figure_size", "annotation": ""}, "snippet": " mpu.set_figure_size(3.,4.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1181_C12", "label": "figure()", "type": "expression", "loc": [1181, 1181], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1179_C8", "vector": [8, 3, 0.7197, 0.0006, 3, 0.73, 0.0526, 789, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "figure", "arg_names": [], "import_names": [], "rhs_call_name": "figure", "annotation": ""}, "snippet": " mpu.figure()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1182_C12", "label": "hist, bin_edges = histogram()", "type": "assigned_variable", "loc": [1182, 1182], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1179_C8", "vector": [14, 3, 0.7203, 0.0006, 3, 0.73, 0.1053, 217, 3, 2, 0, 0, 428, 10, 1], "semantic": {"name": "hist, bin_edges", "arg_names": [], "import_names": [], "rhs_call_name": "histogram", "annotation": ""}, "snippet": " hist, bin_edges = np.histogram(fls, bins)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1183_C12", "label": "h = plot_histogram()", "type": "assigned_variable", "loc": [1183, 1186], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1179_C8", "vector": [14, 3, 0.7218, 0.0024, 3, 0.73, 0.1579, 686, 3, 7, 0, 0, 34, 10, 1], "semantic": {"name": "h", "arg_names": [], "import_names": [], "rhs_call_name": "plot_histogram", "annotation": ""}, "snippet": " h = mpu.plot_histogram(bin_edges[:-1]+bin_width/2., hist,\n width=0.8*bin_width, xlabel='Force (Newtons)',\n ylabel='\\# of mechanisms',\n color='b', label='Cabinets')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1187_C12", "label": "max_freq = max()", "type": "assigned_variable", "loc": [1187, 1187], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1179_C8", "vector": [14, 3, 0.7233, 0.0006, 3, 0.73, 0.2105, 410, 3, 1, 0, 0, 442, 10, 1], "semantic": {"name": "max_freq", "arg_names": [], "import_names": [], "rhs_call_name": "max", "annotation": ""}, "snippet": " max_freq = np.max(hist)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1189_C12", "label": "hist, bin_edges = histogram()", "type": "assigned_variable", "loc": [1189, 1189], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1179_C8", "vector": [14, 3, 0.7246, 0.0006, 3, 0.73, 0.2632, 217, 3, 2, 0, 0, 428, 10, 1], "semantic": {"name": "hist, bin_edges", "arg_names": [], "import_names": [], "rhs_call_name": "histogram", "annotation": ""}, "snippet": " hist, bin_edges = np.histogram(freezer_list + fridge_list, bins)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1190_C12", "label": "h = plot_histogram()", "type": "assigned_variable", "loc": [1190, 1193], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1179_C8", "vector": [14, 3, 0.7261, 0.0024, 3, 0.73, 0.3158, 686, 3, 7, 0, 0, 34, 10, 1], "semantic": {"name": "h", "arg_names": [], "import_names": [], "rhs_call_name": "plot_histogram", "annotation": ""}, "snippet": " h = mpu.plot_histogram(bin_edges[:-1]+bin_width/2., hist,\n width=0.8*bin_width, xlabel='Force (Newtons)',\n ylabel='\\# of mechanisms',\n color='y', label='Appliances')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1195_C12", "label": "hist, bin_edges = histogram()", "type": "assigned_variable", "loc": [1195, 1195], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1179_C8", "vector": [14, 3, 0.7282, 0.0006, 3, 0.73, 0.3684, 217, 3, 2, 0, 0, 428, 10, 1], "semantic": {"name": "hist, bin_edges", "arg_names": [], "import_names": [], "rhs_call_name": "histogram", "annotation": ""}, "snippet": " hist, bin_edges = np.histogram(springloaded_list, bins)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1196_C12", "label": "h = plot_histogram()", "type": "assigned_variable", "loc": [1196, 1199], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1179_C8", "vector": [14, 3, 0.7297, 0.0024, 3, 0.73, 0.4211, 686, 3, 7, 0, 0, 34, 10, 1], "semantic": {"name": "h", "arg_names": [], "import_names": [], "rhs_call_name": "plot_histogram", "annotation": ""}, "snippet": " h = mpu.plot_histogram(bin_edges[:-1]+bin_width/2., hist,\n width=0.8*bin_width, xlabel='Force (Newtons)',\n ylabel='\\# of mechanisms',\n color='g', label='Spring Loaded Doors')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1200_C12", "label": "xticks()", "type": "expression", "loc": [1200, 1200], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1179_C8", "vector": [8, 3, 0.7313, 0.0006, 3, 0.73, 0.4737, 875, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "xticks", "arg_names": [], "import_names": [], "rhs_call_name": "xticks", "annotation": ""}, "snippet": " mpu.pl.xticks(np.arange(0.,max_force+2*bin_width, 10.))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1201_C12", "label": "legend()", "type": "expression", "loc": [1201, 1201], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1179_C8", "vector": [8, 3, 0.7319, 0.0006, 3, 0.73, 0.5263, 880, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "legend", "arg_names": [], "import_names": [], "rhs_call_name": "legend", "annotation": ""}, "snippet": " mpu.legend(display_mode='less_space', handlelength=1.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1203_C12", "label": "xlim()", "type": "expression", "loc": [1203, 1203], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1179_C8", "vector": [8, 3, 0.7331, 0.0006, 3, 0.73, 0.5789, 907, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "xlim", "arg_names": [], "import_names": [], "rhs_call_name": "xlim", "annotation": ""}, "snippet": " pb.xlim(-bin_width, max_force+bin_width)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1204_C12", "label": "ylim()", "type": "expression", "loc": [1204, 1204], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1179_C8", "vector": [8, 3, 0.7337, 0.0006, 3, 0.73, 0.6316, 247, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "ylim", "arg_names": [], "import_names": [], "rhs_call_name": "ylim", "annotation": ""}, "snippet": " pb.ylim(0, max_freq+0.5)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1206_C12", "label": "set_figure_size()", "type": "expression", "loc": [1206, 1206], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1179_C8", "vector": [8, 3, 0.7349, 0.0006, 3, 0.73, 0.6842, 342, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "set_figure_size", "arg_names": [], "import_names": [], "rhs_call_name": "set_figure_size", "annotation": ""}, "snippet": " mpu.set_figure_size(3.,4.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1207_C12", "label": "figure()", "type": "expression", "loc": [1207, 1207], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1179_C8", "vector": [8, 3, 0.7355, 0.0006, 3, 0.73, 0.7368, 789, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "figure", "arg_names": [], "import_names": [], "rhs_call_name": "figure", "annotation": ""}, "snippet": " mpu.figure()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1208_C12", "label": "hist, bin_edges = histogram()", "type": "assigned_variable", "loc": [1208, 1208], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1179_C8", "vector": [14, 3, 0.7361, 0.0006, 3, 0.73, 0.7895, 217, 3, 2, 0, 0, 428, 10, 1], "semantic": {"name": "hist, bin_edges", "arg_names": [], "import_names": [], "rhs_call_name": "histogram", "annotation": ""}, "snippet": " hist, bin_edges = np.histogram(fls, bins)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1209_C12", "label": "h = plot_histogram()", "type": "assigned_variable", "loc": [1209, 1212], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1179_C8", "vector": [14, 3, 0.7377, 0.0024, 3, 0.73, 0.8421, 686, 3, 7, 0, 0, 34, 10, 1], "semantic": {"name": "h", "arg_names": [], "import_names": [], "rhs_call_name": "plot_histogram", "annotation": ""}, "snippet": " h = mpu.plot_histogram(bin_edges[:-1]+bin_width/2., hist,\n width=0.8*bin_width, xlabel='Force (Newtons)',\n ylabel='\\# of mechanisms',\n color='b', label='Drawers')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1213_C12", "label": "max_freq = max()", "type": "assigned_variable", "loc": [1213, 1213], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1179_C8", "vector": [14, 3, 0.7392, 0.0006, 3, 0.73, 0.8947, 410, 3, 1, 0, 0, 442, 10, 1], "semantic": {"name": "max_freq", "arg_names": [], "import_names": [], "rhs_call_name": "max", "annotation": ""}, "snippet": " max_freq = np.max(hist)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1215_C12", "label": "hist, bin_edges = histogram()", "type": "assigned_variable", "loc": [1215, 1215], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1179_C8", "vector": [14, 3, 0.7404, 0.0006, 3, 0.73, 0.9474, 217, 3, 2, 0, 0, 428, 10, 1], "semantic": {"name": "hist, bin_edges", "arg_names": [], "import_names": [], "rhs_call_name": "histogram", "annotation": ""}, "snippet": " hist, bin_edges = np.histogram(broiler_list, bins)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1216_C12", "label": "h = plot_histogram()", "type": "assigned_variable", "loc": [1216, 1219], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1179_C8", "vector": [14, 3, 0.7419, 0.0024, 3, 0.73, 1.0, 686, 3, 7, 0, 0, 34, 10, 1], "semantic": {"name": "h", "arg_names": [], "import_names": [], "rhs_call_name": "plot_histogram", "annotation": ""}, "snippet": " h = mpu.plot_histogram(bin_edges[:-1]+bin_width/2., hist,\n width=0.8*bin_width, xlabel='Force (Newtons)',\n ylabel='\\# of mechanisms',\n color='y', label='Broilers')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1222_C8", "label": "figure()", "type": "expression", "loc": [1222, 1222], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1175_C4", "vector": [8, 2, 0.7447, 0.0006, 2, 0.67, 0.2857, 789, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "figure", "arg_names": [], "import_names": [], "rhs_call_name": "figure", "annotation": ""}, "snippet": " mpu.figure()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1223_C8", "label": "bin_width =", "type": "assigned_variable", "loc": [1223, 1223], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1175_C4", "vector": [14, 2, 0.7453, 0.0006, 2, 0.67, 0.3571, 331, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "bin_width", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " bin_width = 2.5"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1224_C8", "label": "bins = arange()", "type": "assigned_variable", "loc": [1224, 1224], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1175_C4", "vector": [14, 2, 0.7459, 0.0006, 2, 0.67, 0.4286, 792, 3, 3, 0, 0, 489, 10, 1], "semantic": {"name": "bins", "arg_names": [], "import_names": [], "rhs_call_name": "arange", "annotation": ""}, "snippet": " bins = np.arange(0.-bin_width/2., max_force+2*bin_width, bin_width)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1225_C8", "label": "hist, bin_edges = histogram()", "type": "assigned_variable", "loc": [1225, 1225], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1175_C4", "vector": [14, 2, 0.7465, 0.0006, 2, 0.67, 0.5, 217, 3, 2, 0, 0, 428, 10, 1], "semantic": {"name": "hist, bin_edges", "arg_names": [], "import_names": [], "rhs_call_name": "histogram", "annotation": ""}, "snippet": " hist, bin_edges = np.histogram(fls, bins)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1226_C8", "label": "h = plot_histogram()", "type": "assigned_variable", "loc": [1226, 1229], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1175_C4", "vector": [14, 2, 0.748, 0.0024, 2, 0.67, 0.5714, 686, 3, 7, 0, 0, 34, 10, 1], "semantic": {"name": "h", "arg_names": [], "import_names": [], "rhs_call_name": "plot_histogram", "annotation": ""}, "snippet": " h = mpu.plot_histogram(bin_edges[:-1]+bin_width/2., hist,\n width=0.8*bin_width, xlabel='Force (Newtons)',\n ylabel='\\# of mechanisms',\n color='b', label='All')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1230_C8", "label": "legend()", "type": "expression", "loc": [1230, 1230], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1175_C4", "vector": [8, 2, 0.7495, 0.0006, 2, 0.67, 0.6429, 880, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "legend", "arg_names": [], "import_names": [], "rhs_call_name": "legend", "annotation": ""}, "snippet": " mpu.legend()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1231_C8", "label": "xlim()", "type": "expression", "loc": [1231, 1231], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1175_C4", "vector": [8, 2, 0.7502, 0.0006, 2, 0.67, 0.7143, 907, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "xlim", "arg_names": [], "import_names": [], "rhs_call_name": "xlim", "annotation": ""}, "snippet": " pb.xlim(-bin_width, max_force+bin_width)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1232_C8", "label": "ylim()", "type": "expression", "loc": [1232, 1232], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1175_C4", "vector": [8, 2, 0.7508, 0.0006, 2, 0.67, 0.7857, 247, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "ylim", "arg_names": [], "import_names": [], "rhs_call_name": "ylim", "annotation": ""}, "snippet": " pb.ylim(0, np.max(hist)+1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1233_C8", "label": "xticks()", "type": "expression", "loc": [1233, 1233], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1175_C4", "vector": [8, 2, 0.7514, 0.0006, 2, 0.67, 0.8571, 875, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "xticks", "arg_names": [], "import_names": [], "rhs_call_name": "xticks", "annotation": ""}, "snippet": " mpu.pl.xticks(np.arange(0.,max_force+2*bin_width, 5.))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1234_C8", "label": "yticks()", "type": "expression", "loc": [1234, 1234], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1175_C4", "vector": [8, 2, 0.752, 0.0006, 2, 0.67, 0.9286, 65, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "yticks", "arg_names": [], "import_names": [], "rhs_call_name": "yticks", "annotation": ""}, "snippet": " mpu.pl.yticks(np.arange(0.,np.max(hist)+0.5, 1.))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1236_C8", "label": "print()", "type": "expression", "loc": [1236, 1236], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1175_C4", "vector": [8, 2, 0.7532, 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(\"OH NO! FLS <= 0\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1239_C0", "label": "dimen_reduction_mechanisms", "type": "function", "loc": [1239, 1306], "level": 0, "parent": null, "vector": [2, 0, 0.7754, 0.0414, 0, 0.66, 0.9556, 578, 0, 2, 0, 0, 0, 0, 37], "semantic": {"name": "dimen_reduction_mechanisms", "arg_names": ["dir_list", "dimen"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def dimen_reduction_mechanisms(dir_list, dimen = 2):\n mech_vec_list = []\n legend_list = []\n dir_list = filter_dir_list(dir_list)\n dir_list_new = []\n for d in dir_list:\n v = make_vector_mechanism(d)\n if v == None:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1240_C4", "label": "mech_vec_list =", "type": "assigned_variable", "loc": [1240, 1240], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1239_C0", "vector": [14, 1, 0.7556, 0.0006, 1, 0.48, 0.0, 543, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "mech_vec_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mech_vec_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1241_C4", "label": "legend_list =", "type": "assigned_variable", "loc": [1241, 1241], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1239_C0", "vector": [14, 1, 0.7562, 0.0006, 1, 0.48, 0.05, 41, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "legend_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " legend_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1242_C4", "label": "dir_list = filter_dir_list()", "type": "assigned_variable", "loc": [1242, 1242], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1239_C0", "vector": [14, 1, 0.7569, 0.0006, 1, 0.48, 0.1, 18, 3, 1, 0, 0, 637, 10, 1], "semantic": {"name": "dir_list", "arg_names": [], "import_names": [], "rhs_call_name": "filter_dir_list", "annotation": ""}, "snippet": " dir_list = filter_dir_list(dir_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1243_C4", "label": "dir_list_new =", "type": "assigned_variable", "loc": [1243, 1243], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1239_C0", "vector": [14, 1, 0.7575, 0.0006, 1, 0.48, 0.15, 139, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "dir_list_new", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " dir_list_new = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1244_C4", "label": "for d", "type": "for", "loc": [1244, 1251], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1239_C0", "vector": [6, 1, 0.7602, 0.0049, 1, 0.48, 0.2, 355, 2, 0, 0, 0, 0, 0, 6], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for d in dir_list:\n v = make_vector_mechanism(d)\n if v == None:\n continue\n print('v.shape:', v.shape)\n mech_vec_list.append(v)\n legend_list.append(get_mech_name(d))\n dir_list_new.append(d)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1245_C8", "label": "v = make_vector_mechanism()", "type": "assigned_variable", "loc": [1245, 1245], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1244_C4", "vector": [14, 2, 0.7587, 0.0006, 2, 0.72, 0.0, 553, 3, 1, 0, 0, 15, 10, 1], "semantic": {"name": "v", "arg_names": [], "import_names": [], "rhs_call_name": "make_vector_mechanism", "annotation": ""}, "snippet": " v = make_vector_mechanism(d)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1246_C8", "label": "if", "type": "if", "loc": [1246, 1247], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1244_C4", "vector": [4, 2, 0.7596, 0.0012, 2, 0.72, 0.2, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if v == None:\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1248_C8", "label": "print()", "type": "expression", "loc": [1248, 1248], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1244_C4", "vector": [8, 2, 0.7605, 0.0006, 2, 0.72, 0.4, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('v.shape:', v.shape)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1249_C8", "label": "append()", "type": "expression", "loc": [1249, 1249], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1244_C4", "vector": [8, 2, 0.7611, 0.0006, 2, 0.72, 0.6, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " mech_vec_list.append(v)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1250_C8", "label": "append()", "type": "expression", "loc": [1250, 1250], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1244_C4", "vector": [8, 2, 0.7617, 0.0006, 2, 0.72, 0.8, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " legend_list.append(get_mech_name(d))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1251_C8", "label": "append()", "type": "expression", "loc": [1251, 1251], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1244_C4", "vector": [8, 2, 0.7623, 0.0006, 2, 0.72, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " dir_list_new.append(d)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1253_C4", "label": "all_vecs = column_stack()", "type": "assigned_variable", "loc": [1253, 1253], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1239_C0", "vector": [14, 1, 0.7636, 0.0006, 1, 0.48, 0.25, 256, 3, 1, 0, 0, 724, 10, 1], "semantic": {"name": "all_vecs", "arg_names": [], "import_names": [], "rhs_call_name": "column_stack", "annotation": ""}, "snippet": " all_vecs = np.column_stack(mech_vec_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1255_C4", "label": "normalized_all_vecs =", "type": "assigned_variable", "loc": [1255, 1255], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1239_C0", "vector": [14, 1, 0.7648, 0.0006, 1, 0.48, 0.3, 710, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "normalized_all_vecs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " normalized_all_vecs = all_vecs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1256_C4", "label": "print()", "type": "expression", "loc": [1256, 1256], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1239_C0", "vector": [8, 1, 0.7654, 0.0006, 1, 0.48, 0.35, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('>>>>>>>>>>>> all_vecs.shape <<<<<<<<<<<<<<<', all_vecs.shape)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1265_C4", "label": "U, s, _ = svd()", "type": "assigned_variable", "loc": [1265, 1265], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1239_C0", "vector": [14, 1, 0.7709, 0.0006, 1, 0.48, 0.4, 703, 3, 1, 0, 0, 388, 10, 2], "semantic": {"name": "U, s, _", "arg_names": [], "import_names": [], "rhs_call_name": "svd", "annotation": ""}, "snippet": " U, s, _ = np.linalg.svd(np.cov((normalized_all_vecs)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1267_C4", "label": "perc_account =", "type": "assigned_variable", "loc": [1267, 1267], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1239_C0", "vector": [14, 1, 0.7721, 0.0006, 1, 0.48, 0.45, 935, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "perc_account", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " perc_account = np.cumsum(s) / np.sum(s)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1268_C4", "label": "plot_yx()", "type": "expression", "loc": [1268, 1268], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1239_C0", "vector": [8, 1, 0.7727, 0.0006, 1, 0.48, 0.5, 112, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "plot_yx", "arg_names": [], "import_names": [], "rhs_call_name": "plot_yx", "annotation": ""}, "snippet": " mpu.plot_yx([0]+list(perc_account))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1270_C4", "label": "set_figure_size()", "type": "expression", "loc": [1270, 1270], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1239_C0", "vector": [8, 1, 0.7739, 0.0006, 1, 0.48, 0.55, 342, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "set_figure_size", "arg_names": [], "import_names": [], "rhs_call_name": "set_figure_size", "annotation": ""}, "snippet": " mpu.set_figure_size(5.,5.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1271_C4", "label": "figure()", "type": "expression", "loc": [1271, 1271], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1239_C0", "vector": [8, 1, 0.7745, 0.0006, 1, 0.48, 0.6, 789, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "figure", "arg_names": [], "import_names": [], "rhs_call_name": "figure", "annotation": ""}, "snippet": " mpu.figure()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1272_C4", "label": "mn =", "type": "assigned_variable", "loc": [1272, 1272], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1239_C0", "vector": [14, 1, 0.7751, 0.0006, 1, 0.48, 0.65, 747, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "mn", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mn = np.mean(all_vecs, 1).A1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1273_C4", "label": "plot_yx()", "type": "expression", "loc": [1273, 1274], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1239_C0", "vector": [8, 1, 0.7761, 0.0012, 1, 0.48, 0.7, 112, 3, 4, 0, 0, 0, 0, 2], "semantic": {"name": "plot_yx", "arg_names": [], "import_names": [], "rhs_call_name": "plot_yx", "annotation": ""}, "snippet": " mpu.plot_yx(mn/np.linalg.norm(mn), color = '#FF3300',\n label = 'mean (normalized)', scatter_size=5)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1276_C4", "label": "c_list =", "type": "assigned_variable", "loc": [1276, 1276], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1239_C0", "vector": [14, 1, 0.7776, 0.0006, 1, 0.48, 0.75, 110, 5, 0, 0, 0, 0, 0, 0], "semantic": {"name": "c_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " c_list = ['#%02x%02x%02x'%(r,g,b) for (r,g,b) in [(152, 32, 176), (23,94,16)]]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1277_C4", "label": "c_list =", "type": "assigned_variable", "loc": [1277, 1277], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1239_C0", "vector": [14, 1, 0.7782, 0.0006, 1, 0.48, 0.8, 110, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "c_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " c_list = ['#00CCFF', '#643DFF']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1278_C4", "label": "for i", "type": "for", "loc": [1278, 1280], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1239_C0", "vector": [6, 1, 0.7794, 0.0018, 1, 0.48, 0.85, 826, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(2):\n mpu.plot_yx(U[:,i].flatten(), color = c_list[i],\n label = 'Eigenvector %d'%(i+1), scatter_size=5)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1279_C8", "label": "plot_yx()", "type": "expression", "loc": [1279, 1280], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1278_C4", "vector": [8, 2, 0.7797, 0.0012, 2, 0.9, 0.0, 112, 3, 4, 0, 0, 0, 0, 2], "semantic": {"name": "plot_yx", "arg_names": [], "import_names": [], "rhs_call_name": "plot_yx", "annotation": ""}, "snippet": " mpu.plot_yx(U[:,i].flatten(), color = c_list[i],\n label = 'Eigenvector %d'%(i+1), scatter_size=5)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1282_C4", "label": "axhline()", "type": "expression", "loc": [1282, 1282], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1239_C0", "vector": [8, 1, 0.7812, 0.0006, 1, 0.48, 0.9, 800, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "axhline", "arg_names": [], "import_names": [], "rhs_call_name": "axhline", "annotation": ""}, "snippet": " mpu.pl.axhline(y=0., color = 'k')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1283_C4", "label": "legend()", "type": "expression", "loc": [1283, 1283], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1239_C0", "vector": [8, 1, 0.7818, 0.0006, 1, 0.48, 0.95, 880, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "legend", "arg_names": [], "import_names": [], "rhs_call_name": "legend", "annotation": ""}, "snippet": " mpu.legend(display_mode='less_space')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1285_C4", "label": "if", "type": "if", "loc": [1285, 1306], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1239_C0", "vector": [4, 1, 0.7895, 0.0134, 1, 0.48, 1.0, 0, 0, 0, 0, 0, 0, 0, 12], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if dimen == 2:\n fig = mpu.figure()\n proj_mat = U[:, 0:2]\n for i, v in enumerate(mech_vec_list[:]):\n p = proj_mat.T * (v - np.matrix(mn).T)\n color = mpu.random_color()\n label = legend_list[i]\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1286_C8", "label": "fig = figure()", "type": "assigned_variable", "loc": [1286, 1286], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1285_C4", "vector": [14, 2, 0.7837, 0.0006, 2, 0.72, 0.0, 806, 3, 0, 0, 0, 789, 10, 1], "semantic": {"name": "fig", "arg_names": [], "import_names": [], "rhs_call_name": "figure", "annotation": ""}, "snippet": " fig = mpu.figure()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1287_C8", "label": "proj_mat =", "type": "assigned_variable", "loc": [1287, 1287], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1285_C4", "vector": [14, 2, 0.7843, 0.0006, 2, 0.72, 0.125, 608, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "proj_mat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " proj_mat = U[:, 0:2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1288_C8", "label": "for i, v", "type": "for", "loc": [1288, 1297], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1285_C4", "vector": [6, 2, 0.7876, 0.0061, 2, 0.72, 0.25, 843, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "i, v", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i, v in enumerate(mech_vec_list[:]):\n p = proj_mat.T * (v - np.matrix(mn).T)\n color = mpu.random_color()\n label = legend_list[i]\n\n mpu.plot_yx(p[1,:].A1, p[0,:].A1, color = color,\n linewidth = 0, label = label,\n xlabel='\\huge{First Principle Component}',"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1289_C12", "label": "p =", "type": "assigned_variable", "loc": [1289, 1289], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1288_C8", "vector": [14, 3, 0.7855, 0.0006, 3, 0.73, 0.0, 491, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p = proj_mat.T * (v - np.matrix(mn).T)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1290_C12", "label": "color = random_color()", "type": "assigned_variable", "loc": [1290, 1290], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1288_C8", "vector": [14, 3, 0.7861, 0.0006, 3, 0.73, 0.3333, 776, 3, 0, 0, 0, 895, 10, 1], "semantic": {"name": "color", "arg_names": [], "import_names": [], "rhs_call_name": "random_color", "annotation": ""}, "snippet": " color = mpu.random_color()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1291_C12", "label": "label =", "type": "assigned_variable", "loc": [1291, 1291], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1288_C8", "vector": [14, 3, 0.7867, 0.0006, 3, 0.73, 0.6667, 811, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "label", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " label = legend_list[i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1293_C12", "label": "plot_yx()", "type": "expression", "loc": [1293, 1297], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1288_C8", "vector": [8, 3, 0.7892, 0.003, 3, 0.73, 1.0, 112, 3, 9, 0, 0, 0, 0, 1], "semantic": {"name": "plot_yx", "arg_names": [], "import_names": [], "rhs_call_name": "plot_yx", "annotation": ""}, "snippet": " mpu.plot_yx(p[1,:].A1, p[0,:].A1, color = color,\n linewidth = 0, label = label,\n xlabel='\\huge{First Principle Component}',\n ylabel='\\huge{Second Principle Component}',\n axis = 'equal', picker=0.5)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1299_C8", "label": "axhline()", "type": "expression", "loc": [1299, 1299], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1285_C4", "vector": [8, 2, 0.7916, 0.0006, 2, 0.72, 0.375, 800, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "axhline", "arg_names": [], "import_names": [], "rhs_call_name": "axhline", "annotation": ""}, "snippet": " mpu.pl.axhline(y=0., color = 'k', ls='--')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1300_C8", "label": "axvline()", "type": "expression", "loc": [1300, 1300], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1285_C4", "vector": [8, 2, 0.7922, 0.0006, 2, 0.72, 0.5, 455, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "axvline", "arg_names": [], "import_names": [], "rhs_call_name": "axvline", "annotation": ""}, "snippet": " mpu.pl.axvline(x=0., color = 'k', ls='--')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1301_C8", "label": "legend()", "type": "expression", "loc": [1301, 1301], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1285_C4", "vector": [8, 2, 0.7928, 0.0006, 2, 0.72, 0.625, 880, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "legend", "arg_names": [], "import_names": [], "rhs_call_name": "legend", "annotation": ""}, "snippet": " mpu.legend()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1303_C8", "label": "ppg = pca_plot_gui()", "type": "assigned_variable", "loc": [1303, 1304], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1285_C4", "vector": [14, 2, 0.7943, 0.0012, 2, 0.72, 0.75, 629, 3, 5, 0, 0, 428, 10, 2], "semantic": {"name": "ppg", "arg_names": [], "import_names": [], "rhs_call_name": "pca_plot_gui", "annotation": ""}, "snippet": " ppg = pca_plot_gui(legend_list, mech_vec_list, U,\n dir_list_new, np.matrix(mn).T)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1305_C8", "label": "mpl_connect()", "type": "expression", "loc": [1305, 1305], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1285_C4", "vector": [8, 2, 0.7952, 0.0006, 2, 0.72, 0.875, 609, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "mpl_connect", "arg_names": [], "import_names": [], "rhs_call_name": "mpl_connect", "annotation": ""}, "snippet": " fig.canvas.mpl_connect('button_press_event', ppg.pick_cb)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1306_C8", "label": "show()", "type": "expression", "loc": [1306, 1306], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1285_C4", "vector": [8, 2, 0.7959, 0.0006, 2, 0.72, 1.0, 497, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "show", "arg_names": [], "import_names": [], "rhs_call_name": "show", "annotation": ""}, "snippet": " mpu.show()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1308_C0", "label": "filter_dir_list", "type": "function", "loc": [1308, 1334], "level": 0, "parent": null, "vector": [2, 0, 0.805, 0.0165, 0, 0.66, 0.9778, 637, 0, 3, 1, 0, 0, 0, 4], "semantic": {"name": "filter_dir_list", "arg_names": ["dir_list", "typ", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def filter_dir_list(dir_list, typ = 'rotary', name = None):\n filt_list = []\n for d in dir_list:\n nm = get_mech_name(d)\n if name != None:\n if name not in nm:\n continue\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1309_C4", "label": "filt_list =", "type": "assigned_variable", "loc": [1309, 1309], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1308_C0", "vector": [14, 1, 0.7977, 0.0006, 1, 0.8, 0.0, 522, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "filt_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " filt_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1310_C4", "label": "for d", "type": "for", "loc": [1310, 1333], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1308_C0", "vector": [6, 1, 0.8053, 0.0146, 1, 0.8, 0.5, 355, 2, 0, 0, 0, 0, 0, 4], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for d in dir_list:\n nm = get_mech_name(d)\n if name != None:\n if name not in nm:\n continue\n\n# trial = 'open'\n# l = glob.glob(d+'/*'+trial+'*mechanism_trajectories*.pkl')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1311_C8", "label": "nm = get_mech_name()", "type": "assigned_variable", "loc": [1311, 1311], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1310_C4", "vector": [14, 2, 0.7989, 0.0006, 2, 0.04, 0.0, 931, 3, 1, 0, 0, 59, 10, 1], "semantic": {"name": "nm", "arg_names": [], "import_names": [], "rhs_call_name": "get_mech_name", "annotation": ""}, "snippet": " nm = get_mech_name(d)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1312_C8", "label": "if", "type": "if", "loc": [1312, 1314], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1310_C4", "vector": [4, 2, 0.8001, 0.0018, 2, 0.04, 0.25, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if name != None:\n if name not in nm:\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1313_C12", "label": "if", "type": "if", "loc": [1313, 1314], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1312_C8", "vector": [4, 3, 0.8004, 0.0012, 3, 0.12, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if name not in nm:\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1324_C8", "label": "di = extract_pkls()", "type": "assigned_variable", "loc": [1324, 1324], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1310_C4", "vector": [14, 2, 0.8068, 0.0006, 2, 0.04, 0.5, 700, 3, 2, 0, 0, 780, 10, 1], "semantic": {"name": "di", "arg_names": [], "import_names": [], "rhs_call_name": "extract_pkls", "annotation": ""}, "snippet": " di = extract_pkls(d, quiet=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1325_C8", "label": "if", "type": "if", "loc": [1325, 1326], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1310_C4", "vector": [4, 2, 0.8077, 0.0012, 2, 0.04, 0.75, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if di == None:\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1327_C8", "label": "if", "type": "if", "loc": [1327, 1333], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1310_C4", "vector": [4, 2, 0.8105, 0.0043, 2, 0.04, 1.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if di.has_key('typ'):\n m_typ = di['typ']\n if m_typ != typ:\n continue\n filt_list.append(d)\n else:\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1328_C12", "label": "m_typ =", "type": "assigned_variable", "loc": [1328, 1328], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1327_C8", "vector": [14, 3, 0.8093, 0.0006, 3, 0.49, 0.0, 520, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "m_typ", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " m_typ = di['typ']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1329_C12", "label": "if", "type": "if", "loc": [1329, 1330], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1327_C8", "vector": [4, 3, 0.8102, 0.0012, 3, 0.49, 0.5, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if m_typ != typ:\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1331_C12", "label": "append()", "type": "expression", "loc": [1331, 1331], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1327_C8", "vector": [8, 3, 0.8111, 0.0006, 3, 0.49, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " filt_list.append(d)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Return_L1334_C4", "label": "return", "type": "return", "loc": [1334, 1334], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1308_C0", "vector": [13, 1, 0.8129, 0.0006, 1, 0.8, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return filt_list"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1338_C0", "label": "if", "type": "if", "loc": [1338, 1637], "level": 0, "parent": null, "vector": [4, 0, 0.9065, 0.1828, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 99], "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('-d', '--dir', action='store', default='',\n type='string', dest='dir', help='directory with logged data')\n p.add_option('--check_data', action='store_true', dest='check_data',\n help='count the number of trajectories for each mechanism')\n p.add_option('--rearrange', action='store_true', dest='rearrange',"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Import_L1339_C4", "label": "optparse import optparse", "type": "import", "loc": [1339, 1339], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1338_C0", "vector": [1, 1, 0.816, 0.0006, 1, 0.67, 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_99534:Assign_L1340_C4", "label": "p = OptionParser()", "type": "assigned_variable", "loc": [1340, 1340], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1338_C0", "vector": [14, 1, 0.8166, 0.0006, 1, 0.67, 0.0526, 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_99534:Expr_L1341_C4", "label": "add_option()", "type": "expression", "loc": [1341, 1342], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1338_C0", "vector": [8, 1, 0.8175, 0.0012, 1, 0.67, 0.1053, 176, 3, 7, 0, 0, 0, 0, 1], "semantic": {"name": "add_option", "arg_names": [], "import_names": [], "rhs_call_name": "add_option", "annotation": ""}, "snippet": " p.add_option('-d', '--dir', action='store', default='',\n type='string', dest='dir', help='directory with logged data')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1343_C4", "label": "add_option()", "type": "expression", "loc": [1343, 1344], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1338_C0", "vector": [8, 1, 0.8187, 0.0012, 1, 0.67, 0.1579, 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('--check_data', action='store_true', dest='check_data',\n help='count the number of trajectories for each mechanism')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1345_C4", "label": "add_option()", "type": "expression", "loc": [1345, 1346], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1338_C0", "vector": [8, 1, 0.8199, 0.0012, 1, 0.67, 0.2105, 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('--rearrange', action='store_true', dest='rearrange',\n help='rearrange aggregated pkls into separate folders for each mechanism')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1347_C4", "label": "add_option()", "type": "expression", "loc": [1347, 1348], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1338_C0", "vector": [8, 1, 0.8211, 0.0012, 1, 0.67, 0.2632, 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('--clean', action='store_true', dest='clean',\n help='remove pkls with corrupted data')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1350_C4", "label": "add_option()", "type": "expression", "loc": [1350, 1351], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1338_C0", "vector": [8, 1, 0.823, 0.0012, 1, 0.67, 0.3158, 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('--max_force_hist', action='store_true',\n dest='max_force_hist', help='histogram of max forces')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1352_C4", "label": "add_option()", "type": "expression", "loc": [1352, 1353], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1338_C0", "vector": [8, 1, 0.8242, 0.0012, 1, 0.67, 0.3684, 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('--max_force_radius_scatter', action='store_true',\n dest='max_force_radius_scatter', help='scatter plot of max force vs radius')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1354_C4", "label": "add_option()", "type": "expression", "loc": [1354, 1355], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1338_C0", "vector": [8, 1, 0.8254, 0.0012, 1, 0.67, 0.4211, 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('--opening_distances_drawers', action='store_true',\n dest='opening_distances_drawers', help='opening distances for drawers')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1356_C4", "label": "add_option()", "type": "expression", "loc": [1356, 1357], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1338_C0", "vector": [8, 1, 0.8266, 0.0012, 1, 0.67, 0.4737, 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('--plot_handle_height', action='store_true',\n dest='plot_handle_height', help='handle height above the ground')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1358_C4", "label": "add_option()", "type": "expression", "loc": [1358, 1359], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1338_C0", "vector": [8, 1, 0.8278, 0.0012, 1, 0.67, 0.5263, 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('--plot_radius', action='store_true',\n dest='plot_radius', help='histogram of radii of the mechanisms')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1360_C4", "label": "add_option()", "type": "expression", "loc": [1360, 1361], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1338_C0", "vector": [8, 1, 0.8291, 0.0012, 1, 0.67, 0.5789, 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('--correlate', action='store_true',\n dest='correlate', help='correlation across different trials')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1362_C4", "label": "add_option()", "type": "expression", "loc": [1362, 1364], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1338_C0", "vector": [8, 1, 0.8306, 0.0018, 1, 0.67, 0.6316, 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('--consistent_across_people', action='store_true',\n dest='consistent_across_people',\n help='plot mean and std for tangential and total magnitude of the force')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1365_C4", "label": "add_option()", "type": "expression", "loc": [1365, 1366], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1338_C0", "vector": [8, 1, 0.8321, 0.0012, 1, 0.67, 0.6842, 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('--dimen_reduc', action='store_true',\n dest='dimen_reduc', help='try dimen reduction')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1367_C4", "label": "add_option()", "type": "expression", "loc": [1367, 1368], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1338_C0", "vector": [8, 1, 0.8333, 0.0012, 1, 0.67, 0.7368, 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('--independence', action='store_true', \n dest='independence', help='test for conditional independence')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1369_C4", "label": "add_option()", "type": "expression", "loc": [1369, 1370], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1338_C0", "vector": [8, 1, 0.8346, 0.0012, 1, 0.67, 0.7895, 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('--mech_models', action='store_true',\n dest='mech_models', help='fit mechanical models to data')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1371_C4", "label": "add_option()", "type": "expression", "loc": [1371, 1373], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1338_C0", "vector": [8, 1, 0.8361, 0.0018, 1, 0.67, 0.8421, 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('--different_classes_rotary', action='store_true',\n dest='different_classes_rotary',\n help='scatter plot showing the differnt mechanism classes')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1375_C4", "label": "opt, args = parse_args()", "type": "assigned_variable", "loc": [1375, 1375], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1338_C0", "vector": [14, 1, 0.8379, 0.0006, 1, 0.67, 0.8947, 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_99534:Assign_L1377_C4", "label": "dir_list = splitlines()", "type": "assigned_variable", "loc": [1377, 1377], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1338_C0", "vector": [14, 1, 0.8391, 0.0006, 1, 0.67, 0.9474, 18, 3, 0, 0, 0, 296, 10, 2], "semantic": {"name": "dir_list", "arg_names": [], "import_names": [], "rhs_call_name": "splitlines", "annotation": ""}, "snippet": " dir_list = commands.getoutput('ls -d %s/*/'%(opt.dir)).splitlines()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1396_C4", "label": "if", "type": "if", "loc": [1396, 1637], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1338_C0", "vector": [4, 1, 0.9241, 0.1475, 1, 0.67, 1.0, 0, 7, 0, 0, 0, 0, 0, 99], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if opt.clean:\n clean_data_forces(opt.dir)\n elif opt.rearrange:\n # listing all the different mechanisms\n pkl_list = commands.getoutput('ls %s/*.pkl'%(opt.dir)).splitlines()\n mech_name_list = []\n for p in pkl_list:\n nm = '_'.join(p.split('/')[-1].split('_')[:-5])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1397_C8", "label": "clean_data_forces()", "type": "expression", "loc": [1397, 1397], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1396_C4", "vector": [8, 2, 0.8513, 0.0006, 2, 0.57, 0.0, 507, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "clean_data_forces", "arg_names": [], "import_names": [], "rhs_call_name": "clean_data_forces", "annotation": ""}, "snippet": " clean_data_forces(opt.dir)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1398_C4", "label": "if", "type": "if", "loc": [1398, 1637], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1396_C4", "vector": [4, 2, 0.9247, 0.1463, 2, 0.57, 1.0, 0, 7, 0, 0, 0, 0, 0, 99], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif opt.rearrange:\n # listing all the different mechanisms\n pkl_list = commands.getoutput('ls %s/*.pkl'%(opt.dir)).splitlines()\n mech_name_list = []\n for p in pkl_list:\n nm = '_'.join(p.split('/')[-1].split('_')[:-5])\n print('p:', p)\n print('nm:', nm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1400_C8", "label": "pkl_list = splitlines()", "type": "assigned_variable", "loc": [1400, 1400], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1398_C4", "vector": [14, 3, 0.8531, 0.0006, 3, 0.06, 0.0, 191, 3, 0, 0, 0, 296, 10, 2], "semantic": {"name": "pkl_list", "arg_names": [], "import_names": [], "rhs_call_name": "splitlines", "annotation": ""}, "snippet": " pkl_list = commands.getoutput('ls %s/*.pkl'%(opt.dir)).splitlines()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1401_C8", "label": "mech_name_list =", "type": "assigned_variable", "loc": [1401, 1401], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1398_C4", "vector": [14, 3, 0.8537, 0.0006, 3, 0.06, 0.1667, 912, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "mech_name_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mech_name_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1402_C8", "label": "for p", "type": "for", "loc": [1402, 1406], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1398_C4", "vector": [6, 3, 0.8556, 0.003, 3, 0.06, 0.3333, 491, 2, 0, 0, 0, 0, 0, 6], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for p in pkl_list:\n nm = '_'.join(p.split('/')[-1].split('_')[:-5])\n print('p:', p)\n print('nm:', nm)\n mech_name_list.append(nm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1403_C12", "label": "nm = join()", "type": "assigned_variable", "loc": [1403, 1403], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1402_C8", "vector": [14, 4, 0.855, 0.0006, 4, 0.88, 0.0, 931, 3, 1, 0, 0, 933, 10, 3], "semantic": {"name": "nm", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " nm = '_'.join(p.split('/')[-1].split('_')[:-5])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1404_C12", "label": "print()", "type": "expression", "loc": [1404, 1404], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1402_C8", "vector": [8, 4, 0.8556, 0.0006, 4, 0.88, 0.3333, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('p:', p)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1405_C12", "label": "print()", "type": "expression", "loc": [1405, 1405], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1402_C8", "vector": [8, 4, 0.8562, 0.0006, 4, 0.88, 0.6667, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('nm:', nm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1406_C12", "label": "append()", "type": "expression", "loc": [1406, 1406], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1402_C8", "vector": [8, 4, 0.8568, 0.0006, 4, 0.88, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " mech_name_list.append(nm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1407_C8", "label": "mech_name_list = list()", "type": "assigned_variable", "loc": [1407, 1407], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1398_C4", "vector": [14, 3, 0.8574, 0.0006, 3, 0.06, 0.5, 912, 3, 1, 0, 0, 430, 10, 2], "semantic": {"name": "mech_name_list", "arg_names": [], "import_names": [], "rhs_call_name": "list", "annotation": ""}, "snippet": " mech_name_list = list(set(mech_name_list))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1408_C8", "label": "print()", "type": "expression", "loc": [1408, 1408], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1398_C4", "vector": [8, 3, 0.858, 0.0006, 3, 0.06, 0.6667, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('List of unique mechanisms:', mech_name_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1410_C8", "label": "for mech_name", "type": "for", "loc": [1410, 1413], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1398_C4", "vector": [6, 3, 0.8601, 0.0024, 3, 0.06, 0.8333, 884, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "mech_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for mech_name in mech_name_list:\n nm = '%s/%s'%(opt.dir, mech_name)\n os.system('mkdir %s'%nm)\n os.system('mv %s/*%s*.pkl %s'%(opt.dir, mech_name, nm))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1411_C12", "label": "nm =", "type": "assigned_variable", "loc": [1411, 1411], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1410_C8", "vector": [14, 4, 0.8598, 0.0006, 4, 0.95, 0.0, 931, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "nm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " nm = '%s/%s'%(opt.dir, mech_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1412_C12", "label": "system()", "type": "expression", "loc": [1412, 1412], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1410_C8", "vector": [8, 4, 0.8605, 0.0006, 4, 0.95, 0.5, 856, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "system", "arg_names": [], "import_names": [], "rhs_call_name": "system", "annotation": ""}, "snippet": " os.system('mkdir %s'%nm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1413_C12", "label": "system()", "type": "expression", "loc": [1413, 1413], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1410_C8", "vector": [8, 4, 0.8611, 0.0006, 4, 0.95, 1.0, 856, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "system", "arg_names": [], "import_names": [], "rhs_call_name": "system", "annotation": ""}, "snippet": " os.system('mv %s/*%s*.pkl %s'%(opt.dir, mech_name, nm))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1414_C4", "label": "if", "type": "if", "loc": [1414, 1637], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1398_C4", "vector": [4, 3, 0.9296, 0.1365, 3, 0.06, 1.0, 0, 7, 0, 0, 0, 0, 0, 99], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif opt.check_data:\n mech_list = []\n for i, m in enumerate(dir_list):\n t = m.split('/')\n mech = t[-1]\n if mech == '':\n mech = t[-2]\n mech_list.append(mech)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1415_C8", "label": "mech_list =", "type": "assigned_variable", "loc": [1415, 1415], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1414_C4", "vector": [14, 4, 0.8623, 0.0006, 4, 0.41, 0.0, 478, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "mech_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mech_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1416_C8", "label": "for i, m", "type": "for", "loc": [1416, 1422], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1414_C4", "vector": [6, 4, 0.8647, 0.0043, 4, 0.41, 0.3333, 489, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "i, m", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i, m in enumerate(dir_list):\n t = m.split('/')\n mech = t[-1]\n if mech == '':\n mech = t[-2]\n mech_list.append(mech)\n print('%d. %s'%(i, mech))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1417_C12", "label": "t = split()", "type": "assigned_variable", "loc": [1417, 1417], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1416_C8", "vector": [14, 5, 0.8635, 0.0006, 5, 0.73, 0.0, 15, 3, 1, 0, 0, 908, 10, 1], "semantic": {"name": "t", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": " t = m.split('/')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1418_C12", "label": "mech =", "type": "assigned_variable", "loc": [1418, 1418], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1416_C8", "vector": [14, 5, 0.8641, 0.0006, 5, 0.73, 0.25, 184, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "mech", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mech = t[-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1419_C12", "label": "if", "type": "if", "loc": [1419, 1420], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1416_C8", "vector": [4, 5, 0.865, 0.0012, 5, 0.73, 0.5, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if mech == '':\n mech = t[-2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1420_C16", "label": "mech =", "type": "assigned_variable", "loc": [1420, 1420], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1419_C12", "vector": [14, 6, 0.8653, 0.0006, 6, 0.03, 0.0, 184, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "mech", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mech = t[-2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1421_C12", "label": "append()", "type": "expression", "loc": [1421, 1421], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1416_C8", "vector": [8, 5, 0.8659, 0.0006, 5, 0.73, 0.75, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " mech_list.append(mech)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1422_C12", "label": "print()", "type": "expression", "loc": [1422, 1422], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1416_C8", "vector": [8, 5, 0.8665, 0.0006, 5, 0.73, 1.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('%d. %s'%(i, mech))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1424_C8", "label": "for i, d", "type": "for", "loc": [1424, 1431], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1414_C4", "vector": [6, 4, 0.8699, 0.0049, 4, 0.41, 0.6667, 775, 3, 0, 0, 0, 0, 0, 7], "semantic": {"name": "i, d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i,d in enumerate(dir_list):\n mech_nm = mech_list[i]\n print('------------------------------------')\n print('Mechanism name:', mech_nm)\n for trial in ['open', 'close']:\n l = glob.glob(d+'/*'+trial+'*mechanism_trajectories*.pkl')\n l.sort()\n print('Number of %s trials: %d'%(trial, len(l)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1425_C12", "label": "mech_nm =", "type": "assigned_variable", "loc": [1425, 1425], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1424_C8", "vector": [14, 5, 0.8684, 0.0006, 5, 0.58, 0.0, 758, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "mech_nm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mech_nm = mech_list[i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1426_C12", "label": "print()", "type": "expression", "loc": [1426, 1426], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1424_C8", "vector": [8, 5, 0.869, 0.0006, 5, 0.58, 0.3333, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('------------------------------------')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1427_C12", "label": "print()", "type": "expression", "loc": [1427, 1427], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1424_C8", "vector": [8, 5, 0.8696, 0.0006, 5, 0.58, 0.6667, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Mechanism name:', mech_nm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1428_C12", "label": "for trial", "type": "for", "loc": [1428, 1431], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1424_C8", "vector": [6, 5, 0.8711, 0.0024, 5, 0.58, 1.0, 437, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "trial", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for trial in ['open', 'close']:\n l = glob.glob(d+'/*'+trial+'*mechanism_trajectories*.pkl')\n l.sort()\n print('Number of %s trials: %d'%(trial, len(l)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1429_C16", "label": "l = glob()", "type": "assigned_variable", "loc": [1429, 1429], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1428_C12", "vector": [14, 6, 0.8708, 0.0006, 6, 0.99, 0.0, 810, 3, 1, 0, 0, 958, 10, 1], "semantic": {"name": "l", "arg_names": [], "import_names": [], "rhs_call_name": "glob", "annotation": ""}, "snippet": " l = glob.glob(d+'/*'+trial+'*mechanism_trajectories*.pkl')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1430_C16", "label": "sort()", "type": "expression", "loc": [1430, 1430], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1428_C12", "vector": [8, 6, 0.8714, 0.0006, 6, 0.99, 0.5, 489, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "sort", "arg_names": [], "import_names": [], "rhs_call_name": "sort", "annotation": ""}, "snippet": " l.sort()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1431_C16", "label": "print()", "type": "expression", "loc": [1431, 1431], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1428_C12", "vector": [8, 6, 0.872, 0.0006, 6, 0.99, 1.0, 535, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Number of %s trials: %d'%(trial, len(l)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1432_C4", "label": "if", "type": "if", "loc": [1432, 1637], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1414_C4", "vector": [4, 4, 0.9351, 0.1255, 4, 0.41, 1.0, 0, 7, 0, 0, 0, 0, 0, 99], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif opt.max_force_radius_scatter:\n max_force_radius_scatter(dir_list[0:], open=True)\n max_force_radius_scatter(dir_list[0:], open=False)\n mpu.show()\n elif opt.max_force_hist:\n print('Found %d mechanisms' % len(dir_list[0:]))\n max_force_hist(filter_dir_list(dir_list[0:], typ='rotary'), open=True, type='rotary')\n max_force_hist(filter_dir_list(dir_list[0:], typ='prismatic'), open=True, type='prismatic')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1433_C8", "label": "max_force_radius_scatter()", "type": "expression", "loc": [1433, 1433], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1432_C4", "vector": [8, 5, 0.8732, 0.0006, 5, 0.01, 0.0, 698, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "max_force_radius_scatter", "arg_names": [], "import_names": [], "rhs_call_name": "max_force_radius_scatter", "annotation": ""}, "snippet": " max_force_radius_scatter(dir_list[0:], open=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1434_C8", "label": "max_force_radius_scatter()", "type": "expression", "loc": [1434, 1434], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1432_C4", "vector": [8, 5, 0.8739, 0.0006, 5, 0.01, 0.3333, 698, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "max_force_radius_scatter", "arg_names": [], "import_names": [], "rhs_call_name": "max_force_radius_scatter", "annotation": ""}, "snippet": " max_force_radius_scatter(dir_list[0:], open=False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1435_C8", "label": "show()", "type": "expression", "loc": [1435, 1435], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1432_C4", "vector": [8, 5, 0.8745, 0.0006, 5, 0.01, 0.6667, 497, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "show", "arg_names": [], "import_names": [], "rhs_call_name": "show", "annotation": ""}, "snippet": " mpu.show()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1436_C4", "label": "if", "type": "if", "loc": [1436, 1637], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1432_C4", "vector": [4, 5, 0.9363, 0.1231, 5, 0.01, 1.0, 0, 7, 0, 0, 0, 0, 0, 99], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif opt.max_force_hist:\n print('Found %d mechanisms' % len(dir_list[0:]))\n max_force_hist(filter_dir_list(dir_list[0:], typ='rotary'), open=True, type='rotary')\n max_force_hist(filter_dir_list(dir_list[0:], typ='prismatic'), open=True, type='prismatic')\n mpu.show()\n elif opt.opening_distances_drawers:\n plot_opening_distances_drawers(dir_list[0:])\n mpu.show()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1437_C8", "label": "print()", "type": "expression", "loc": [1437, 1437], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1436_C4", "vector": [8, 6, 0.8757, 0.0006, 6, 0.19, 0.0, 535, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Found %d mechanisms' % len(dir_list[0:]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1438_C8", "label": "max_force_hist()", "type": "expression", "loc": [1438, 1438], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1436_C4", "vector": [8, 6, 0.8763, 0.0006, 6, 0.19, 0.25, 900, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "max_force_hist", "arg_names": [], "import_names": [], "rhs_call_name": "max_force_hist", "annotation": ""}, "snippet": " max_force_hist(filter_dir_list(dir_list[0:], typ='rotary'), open=True, type='rotary')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1439_C8", "label": "max_force_hist()", "type": "expression", "loc": [1439, 1439], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1436_C4", "vector": [8, 6, 0.8769, 0.0006, 6, 0.19, 0.5, 900, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "max_force_hist", "arg_names": [], "import_names": [], "rhs_call_name": "max_force_hist", "annotation": ""}, "snippet": " max_force_hist(filter_dir_list(dir_list[0:], typ='prismatic'), open=True, type='prismatic')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1440_C8", "label": "show()", "type": "expression", "loc": [1440, 1440], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1436_C4", "vector": [8, 6, 0.8775, 0.0006, 6, 0.19, 0.75, 497, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "show", "arg_names": [], "import_names": [], "rhs_call_name": "show", "annotation": ""}, "snippet": " mpu.show()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1441_C4", "label": "if", "type": "if", "loc": [1441, 1637], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1436_C4", "vector": [4, 6, 0.9378, 0.12, 6, 0.19, 1.0, 0, 7, 0, 0, 0, 0, 0, 94], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif opt.opening_distances_drawers:\n plot_opening_distances_drawers(dir_list[0:])\n mpu.show()\n elif opt.plot_radius:\n l1 = filter_dir_list(dir_list, name='ree')\n l2 = filter_dir_list(dir_list, name='ge')\n print('LEN:', len(filter_dir_list(dir_list, name=None)))\n bar1 = mechanism_radius_histogram(filter_dir_list(dir_list, name=None))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1442_C8", "label": "plot_opening_distances_drawers()", "type": "expression", "loc": [1442, 1442], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1441_C4", "vector": [8, 7, 0.8787, 0.0006, 7, 0.96, 0.0, 12, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "plot_opening_distances_drawers", "arg_names": [], "import_names": [], "rhs_call_name": "plot_opening_distances_drawers", "annotation": ""}, "snippet": " plot_opening_distances_drawers(dir_list[0:])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1443_C8", "label": "show()", "type": "expression", "loc": [1443, 1443], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1441_C4", "vector": [8, 7, 0.8793, 0.0006, 7, 0.96, 0.5, 497, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "show", "arg_names": [], "import_names": [], "rhs_call_name": "show", "annotation": ""}, "snippet": " mpu.show()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1444_C4", "label": "if", "type": "if", "loc": [1444, 1637], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1441_C4", "vector": [4, 7, 0.9388, 0.1182, 7, 0.96, 1.0, 0, 7, 0, 0, 0, 0, 0, 92], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif opt.plot_radius:\n l1 = filter_dir_list(dir_list, name='ree')\n l2 = filter_dir_list(dir_list, name='ge')\n print('LEN:', len(filter_dir_list(dir_list, name=None)))\n bar1 = mechanism_radius_histogram(filter_dir_list(dir_list, name=None))\n bar2 = mechanism_radius_histogram(l1+l2, color='y')\n labels = ['Other', 'Freezers and Refrigerators']\n mpu.pl.legend([bar1[0],bar2[0]], labels, loc='best')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1445_C8", "label": "l1 = filter_dir_list()", "type": "assigned_variable", "loc": [1445, 1445], "level": 8, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1444_C4", "vector": [14, 8, 0.8806, 0.0006, 8, 0.3, 0.0, 888, 3, 2, 0, 0, 637, 10, 1], "semantic": {"name": "l1", "arg_names": [], "import_names": [], "rhs_call_name": "filter_dir_list", "annotation": ""}, "snippet": " l1 = filter_dir_list(dir_list, name='ree')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1446_C8", "label": "l2 = filter_dir_list()", "type": "assigned_variable", "loc": [1446, 1446], "level": 8, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1444_C4", "vector": [14, 8, 0.8812, 0.0006, 8, 0.3, 0.125, 40, 3, 2, 0, 0, 637, 10, 1], "semantic": {"name": "l2", "arg_names": [], "import_names": [], "rhs_call_name": "filter_dir_list", "annotation": ""}, "snippet": " l2 = filter_dir_list(dir_list, name='ge')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1447_C8", "label": "print()", "type": "expression", "loc": [1447, 1447], "level": 8, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1444_C4", "vector": [8, 8, 0.8818, 0.0006, 8, 0.3, 0.25, 535, 3, 2, 0, 0, 0, 0, 3], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('LEN:', len(filter_dir_list(dir_list, name=None)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1448_C8", "label": "bar1 = mechanism_radius_histogram()", "type": "assigned_variable", "loc": [1448, 1448], "level": 8, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1444_C4", "vector": [14, 8, 0.8824, 0.0006, 8, 0.3, 0.375, 102, 3, 1, 0, 0, 183, 10, 2], "semantic": {"name": "bar1", "arg_names": [], "import_names": [], "rhs_call_name": "mechanism_radius_histogram", "annotation": ""}, "snippet": " bar1 = mechanism_radius_histogram(filter_dir_list(dir_list, name=None))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1449_C8", "label": "bar2 = mechanism_radius_histogram()", "type": "assigned_variable", "loc": [1449, 1449], "level": 8, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1444_C4", "vector": [14, 8, 0.883, 0.0006, 8, 0.3, 0.5, 733, 3, 2, 0, 0, 183, 10, 1], "semantic": {"name": "bar2", "arg_names": [], "import_names": [], "rhs_call_name": "mechanism_radius_histogram", "annotation": ""}, "snippet": " bar2 = mechanism_radius_histogram(l1+l2, color='y')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1450_C8", "label": "labels =", "type": "assigned_variable", "loc": [1450, 1450], "level": 8, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1444_C4", "vector": [14, 8, 0.8836, 0.0006, 8, 0.3, 0.625, 283, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "labels", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " labels = ['Other', 'Freezers and Refrigerators']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1451_C8", "label": "legend()", "type": "expression", "loc": [1451, 1451], "level": 8, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1444_C4", "vector": [8, 8, 0.8842, 0.0006, 8, 0.3, 0.75, 880, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "legend", "arg_names": [], "import_names": [], "rhs_call_name": "legend", "annotation": ""}, "snippet": " mpu.pl.legend([bar1[0],bar2[0]], labels, loc='best')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1452_C8", "label": "show()", "type": "expression", "loc": [1452, 1452], "level": 8, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1444_C4", "vector": [8, 8, 0.8848, 0.0006, 8, 0.3, 0.875, 497, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "show", "arg_names": [], "import_names": [], "rhs_call_name": "show", "annotation": ""}, "snippet": " mpu.show()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1453_C4", "label": "if", "type": "if", "loc": [1453, 1637], "level": 8, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1444_C4", "vector": [4, 8, 0.9415, 0.1127, 8, 0.3, 1.0, 0, 7, 0, 0, 0, 0, 0, 82], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif opt.plot_handle_height:\n #plot_title = 'Opening force at different heights'\n #plot_handle_height(dir_list[:], plot_title)\n\n #plot_handle_height_no_fridge_no_freezer()\n# plot_handle_height_no_office()\n #handle_height_histogram(dir_list, plot_title='Homes excluding \\n refrigerators and freezers')\n #handle_height_histogram(filter_dir_list(dir_list, name='ge'),"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1462_C8", "label": "handle_height_histogram()", "type": "expression", "loc": [1462, 1463], "level": 9, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1453_C4", "vector": [8, 9, 0.8912, 0.0012, 9, 0.19, 0.0, 456, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "handle_height_histogram", "arg_names": [], "import_names": [], "rhs_call_name": "handle_height_histogram", "annotation": ""}, "snippet": " handle_height_histogram(filter_dir_list(dir_list, name='ree'),\n plot_title = 'Freezers')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1464_C8", "label": "show()", "type": "expression", "loc": [1464, 1464], "level": 9, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1453_C4", "vector": [8, 9, 0.8921, 0.0006, 9, 0.19, 0.5, 497, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "show", "arg_names": [], "import_names": [], "rhs_call_name": "show", "annotation": ""}, "snippet": " mpu.show()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1465_C4", "label": "if", "type": "if", "loc": [1465, 1637], "level": 9, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1453_C4", "vector": [4, 9, 0.9452, 0.1054, 9, 0.19, 1.0, 0, 7, 0, 0, 0, 0, 0, 79], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif opt.correlate:\n cl = []\n lab_list = []\n ch_list = input_mechanism_list(dir_list)\n for i, d in enumerate(ch_list):\n nm = get_mech_name(d)\n di = extract_pkls(d, open)\n ftan_l_l = di['ftan_l_l']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1466_C8", "label": "cl =", "type": "assigned_variable", "loc": [1466, 1466], "level": 10, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1465_C4", "vector": [14, 10, 0.8934, 0.0006, 10, 0.88, 0.0, 649, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "cl", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cl = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1467_C8", "label": "lab_list =", "type": "assigned_variable", "loc": [1467, 1467], "level": 10, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1465_C4", "vector": [14, 10, 0.894, 0.0006, 10, 0.88, 0.1667, 221, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "lab_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " lab_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1468_C8", "label": "ch_list = input_mechanism_list()", "type": "assigned_variable", "loc": [1468, 1468], "level": 10, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1465_C4", "vector": [14, 10, 0.8946, 0.0006, 10, 0.88, 0.3333, 83, 3, 1, 0, 0, 660, 10, 1], "semantic": {"name": "ch_list", "arg_names": [], "import_names": [], "rhs_call_name": "input_mechanism_list", "annotation": ""}, "snippet": " ch_list = input_mechanism_list(dir_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1469_C8", "label": "for i, d", "type": "for", "loc": [1469, 1490], "level": 10, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1465_C4", "vector": [6, 10, 0.9016, 0.0134, 10, 0.88, 0.5, 775, 3, 0, 0, 0, 0, 0, 13], "semantic": {"name": "i, d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i, d in enumerate(ch_list):\n nm = get_mech_name(d)\n di = extract_pkls(d, open)\n ftan_l_l = di['ftan_l_l']\n frad_l_l = di['frad_l_l']\n mechx_l_l = di['mechx_l_l']\n time_l_l = di['time_l_l']\n typ = di['typ']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1470_C12", "label": "nm = get_mech_name()", "type": "assigned_variable", "loc": [1470, 1470], "level": 11, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1469_C8", "vector": [14, 11, 0.8958, 0.0006, 11, 0.65, 0.0, 931, 3, 1, 0, 0, 59, 10, 1], "semantic": {"name": "nm", "arg_names": [], "import_names": [], "rhs_call_name": "get_mech_name", "annotation": ""}, "snippet": " nm = get_mech_name(d)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1471_C12", "label": "di = extract_pkls()", "type": "assigned_variable", "loc": [1471, 1471], "level": 11, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1469_C8", "vector": [14, 11, 0.8964, 0.0006, 11, 0.65, 0.125, 700, 3, 2, 0, 0, 780, 10, 1], "semantic": {"name": "di", "arg_names": [], "import_names": [], "rhs_call_name": "extract_pkls", "annotation": ""}, "snippet": " di = extract_pkls(d, open)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1472_C12", "label": "ftan_l_l =", "type": "assigned_variable", "loc": [1472, 1472], "level": 11, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1469_C8", "vector": [14, 11, 0.897, 0.0006, 11, 0.65, 0.25, 2, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ftan_l_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ftan_l_l = di['ftan_l_l']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1473_C12", "label": "frad_l_l =", "type": "assigned_variable", "loc": [1473, 1473], "level": 11, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1469_C8", "vector": [14, 11, 0.8976, 0.0006, 11, 0.65, 0.375, 269, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "frad_l_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " frad_l_l = di['frad_l_l']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1474_C12", "label": "mechx_l_l =", "type": "assigned_variable", "loc": [1474, 1474], "level": 11, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1469_C8", "vector": [14, 11, 0.8982, 0.0006, 11, 0.65, 0.5, 760, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "mechx_l_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mechx_l_l = di['mechx_l_l']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1475_C12", "label": "time_l_l =", "type": "assigned_variable", "loc": [1475, 1475], "level": 11, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1469_C8", "vector": [14, 11, 0.8988, 0.0006, 11, 0.65, 0.625, 201, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "time_l_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " time_l_l = di['time_l_l']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1476_C12", "label": "typ =", "type": "assigned_variable", "loc": [1476, 1476], "level": 11, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1469_C8", "vector": [14, 11, 0.8995, 0.0006, 11, 0.65, 0.75, 722, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "typ", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " typ = di['typ']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1477_C12", "label": "rad =", "type": "assigned_variable", "loc": [1477, 1477], "level": 11, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1469_C8", "vector": [14, 11, 0.9001, 0.0006, 11, 0.65, 0.875, 439, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "rad", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rad = di['rad']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1479_C12", "label": "for j", "type": "for", "loc": [1479, 1490], "level": 11, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1469_C8", "vector": [6, 11, 0.9046, 0.0073, 11, 0.65, 1.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(len(ftan_l_l)):\n if typ == 'rotary':\n traj_vel = compute_trajectory_velocity(mechx_l_l[j],time_l_l[j],1)\n if traj_vel > math.radians(30):\n continue\n t, f = bin(mechx_l_l[j], ftan_l_l[j], math.radians(1.),\n max, ignore_empty=True, max_pose=math.radians(60))\n if typ == 'prismatic':"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1480_C16", "label": "if", "type": "if", "loc": [1480, 1485], "level": 12, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1479_C12", "vector": [4, 12, 0.9034, 0.0037, 12, 0.91, 0.0, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if typ == 'rotary':\n traj_vel = compute_trajectory_velocity(mechx_l_l[j],time_l_l[j],1)\n if traj_vel > math.radians(30):\n continue\n t, f = bin(mechx_l_l[j], ftan_l_l[j], math.radians(1.),\n max, ignore_empty=True, max_pose=math.radians(60))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1481_C20", "label": "traj_vel = compute_trajectory_velocity()", "type": "assigned_variable", "loc": [1481, 1481], "level": 13, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1480_C16", "vector": [14, 13, 0.9025, 0.0006, 13, 0.75, 0.0, 279, 3, 3, 0, 0, 197, 10, 1], "semantic": {"name": "traj_vel", "arg_names": [], "import_names": [], "rhs_call_name": "compute_trajectory_velocity", "annotation": ""}, "snippet": " traj_vel = compute_trajectory_velocity(mechx_l_l[j],time_l_l[j],1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1482_C20", "label": "if", "type": "if", "loc": [1482, 1483], "level": 13, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1480_C16", "vector": [4, 13, 0.9034, 0.0012, 13, 0.75, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if traj_vel > math.radians(30):\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1484_C20", "label": "t, f = bin()", "type": "assigned_variable", "loc": [1484, 1485], "level": 13, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1480_C16", "vector": [14, 13, 0.9046, 0.0012, 13, 0.75, 1.0, 519, 3, 6, 0, 0, 167, 10, 3], "semantic": {"name": "t, f", "arg_names": [], "import_names": [], "rhs_call_name": "bin", "annotation": ""}, "snippet": " t, f = bin(mechx_l_l[j], ftan_l_l[j], math.radians(1.),\n max, ignore_empty=True, max_pose=math.radians(60))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1486_C16", "label": "if", "type": "if", "loc": [1486, 1488], "level": 12, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1479_C12", "vector": [4, 12, 0.9062, 0.0018, 12, 0.91, 0.3333, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if typ == 'prismatic':\n t, f = bin(mechx_l_l[j], ftan_l_l[j], 0.01,\n max, ignore_empty=True, max_pose=0.3)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1487_C20", "label": "t, f = bin()", "type": "assigned_variable", "loc": [1487, 1488], "level": 13, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1486_C16", "vector": [14, 13, 0.9065, 0.0012, 13, 0.42, 0.0, 519, 3, 6, 0, 0, 167, 10, 1], "semantic": {"name": "t, f", "arg_names": [], "import_names": [], "rhs_call_name": "bin", "annotation": ""}, "snippet": " t, f = bin(mechx_l_l[j], ftan_l_l[j], 0.01,\n max, ignore_empty=True, max_pose=0.3)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1489_C16", "label": "append()", "type": "expression", "loc": [1489, 1489], "level": 12, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1479_C12", "vector": [8, 12, 0.9074, 0.0006, 12, 0.91, 0.6667, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " cl.append(f)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1490_C16", "label": "append()", "type": "expression", "loc": [1490, 1490], "level": 12, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1479_C12", "vector": [8, 12, 0.908, 0.0006, 12, 0.91, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " lab_list.append(nm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1491_C8", "label": "correlate_trials()", "type": "expression", "loc": [1491, 1491], "level": 10, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1465_C4", "vector": [8, 10, 0.9086, 0.0006, 10, 0.88, 0.6667, 926, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "correlate_trials", "arg_names": [], "import_names": [], "rhs_call_name": "correlate_trials", "annotation": ""}, "snippet": " correlate_trials(cl[0], cl[:], lab_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1492_C8", "label": "show()", "type": "expression", "loc": [1492, 1492], "level": 10, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1465_C4", "vector": [8, 10, 0.9092, 0.0006, 10, 0.88, 0.8333, 497, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "show", "arg_names": [], "import_names": [], "rhs_call_name": "show", "annotation": ""}, "snippet": " mpu.show()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1493_C4", "label": "if", "type": "if", "loc": [1493, 1637], "level": 10, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1465_C4", "vector": [4, 10, 0.9537, 0.0884, 10, 0.88, 1.0, 0, 7, 0, 0, 0, 0, 0, 63], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif opt.consistent_across_people:\n ch_list = input_mechanism_list(dir_list)\n for dir in ch_list:\n compare_tangential_total_magnitude(dir)\n mpu.show()\n elif opt.different_classes_rotary:\n different_classes_rotary(dir_list)\n elif opt.independence:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1494_C8", "label": "ch_list = input_mechanism_list()", "type": "assigned_variable", "loc": [1494, 1494], "level": 11, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1493_C4", "vector": [14, 11, 0.9104, 0.0006, 11, 0.89, 0.0, 83, 3, 1, 0, 0, 660, 10, 1], "semantic": {"name": "ch_list", "arg_names": [], "import_names": [], "rhs_call_name": "input_mechanism_list", "annotation": ""}, "snippet": " ch_list = input_mechanism_list(dir_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1495_C8", "label": "for dir", "type": "for", "loc": [1495, 1496], "level": 11, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1493_C4", "vector": [6, 11, 0.9113, 0.0012, 11, 0.89, 0.3333, 152, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "dir", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for dir in ch_list:\n compare_tangential_total_magnitude(dir)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1496_C12", "label": "compare_tangential_total_magnitude()", "type": "expression", "loc": [1496, 1496], "level": 12, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1495_C8", "vector": [8, 12, 0.9116, 0.0006, 12, 0.23, 0.0, 616, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "compare_tangential_total_magnitude", "arg_names": [], "import_names": [], "rhs_call_name": "compare_tangential_total_magnitude", "annotation": ""}, "snippet": " compare_tangential_total_magnitude(dir)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1497_C8", "label": "show()", "type": "expression", "loc": [1497, 1497], "level": 11, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1493_C4", "vector": [8, 11, 0.9122, 0.0006, 11, 0.89, 0.6667, 497, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "show", "arg_names": [], "import_names": [], "rhs_call_name": "show", "annotation": ""}, "snippet": " mpu.show()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1498_C4", "label": "if", "type": "if", "loc": [1498, 1637], "level": 11, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1493_C4", "vector": [4, 11, 0.9552, 0.0853, 11, 0.89, 1.0, 0, 7, 0, 0, 0, 0, 0, 60], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif opt.different_classes_rotary:\n different_classes_rotary(dir_list)\n elif opt.independence:\n test_independence_mechanism(dir_list)\n\n elif opt.dimen_reduc:\n #ch_list = input_mechanism_list(dir_list)\n #dimen_reduction_mechanisms(ch_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1499_C8", "label": "different_classes_rotary()", "type": "expression", "loc": [1499, 1499], "level": 12, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1498_C4", "vector": [8, 12, 0.9135, 0.0006, 12, 0.63, 0.0, 35, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "different_classes_rotary", "arg_names": [], "import_names": [], "rhs_call_name": "different_classes_rotary", "annotation": ""}, "snippet": " different_classes_rotary(dir_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1500_C4", "label": "if", "type": "if", "loc": [1500, 1637], "level": 12, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1498_C4", "vector": [4, 12, 0.9558, 0.0841, 12, 0.63, 1.0, 0, 7, 0, 0, 0, 0, 0, 59], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif opt.independence:\n test_independence_mechanism(dir_list)\n\n elif opt.dimen_reduc:\n #ch_list = input_mechanism_list(dir_list)\n #dimen_reduction_mechanisms(ch_list)\n #dimen_reduction_mechanisms(filter_dir_list(dir_list, name='HSI_Suite_210_brown_cabinet_right'))\n dimen_reduction_mechanisms(dir_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1501_C8", "label": "test_independence_mechanism()", "type": "expression", "loc": [1501, 1501], "level": 13, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1500_C4", "vector": [8, 13, 0.9147, 0.0006, 13, 0.49, 0.0, 199, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "test_independence_mechanism", "arg_names": [], "import_names": [], "rhs_call_name": "test_independence_mechanism", "annotation": ""}, "snippet": " test_independence_mechanism(dir_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1503_C4", "label": "if", "type": "if", "loc": [1503, 1637], "level": 13, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1500_C4", "vector": [4, 13, 0.9567, 0.0823, 13, 0.49, 1.0, 0, 7, 0, 0, 0, 0, 0, 58], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif opt.dimen_reduc:\n #ch_list = input_mechanism_list(dir_list)\n #dimen_reduction_mechanisms(ch_list)\n #dimen_reduction_mechanisms(filter_dir_list(dir_list, name='HSI_Suite_210_brown_cabinet_right'))\n dimen_reduction_mechanisms(dir_list)\n elif opt.mech_models:\n dir = filter_dir_list(dir_list,\n name='patient_room_door')[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1507_C8", "label": "dimen_reduction_mechanisms()", "type": "expression", "loc": [1507, 1507], "level": 14, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1503_C4", "vector": [8, 14, 0.9183, 0.0006, 14, 0.24, 0.0, 578, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "dimen_reduction_mechanisms", "arg_names": [], "import_names": [], "rhs_call_name": "dimen_reduction_mechanisms", "annotation": ""}, "snippet": " dimen_reduction_mechanisms(dir_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1508_C4", "label": "if", "type": "if", "loc": [1508, 1637], "level": 14, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1503_C4", "vector": [4, 14, 0.9583, 0.0792, 14, 0.24, 1.0, 0, 7, 0, 0, 0, 0, 0, 57], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif opt.mech_models:\n dir = filter_dir_list(dir_list,\n name='patient_room_door')[0]\n d = extract_pkls(dir, True)\n trial_num_list = d['trial_num_l']\n states_l = []\n xarr_l = [] \n varr_l = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1509_C8", "label": "dir =", "type": "assigned_variable", "loc": [1509, 1510], "level": 15, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1508_C4", "vector": [14, 15, 0.9199, 0.0012, 15, 0.76, 0.0, 152, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "dir", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " dir = filter_dir_list(dir_list,\n name='patient_room_door')[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1511_C8", "label": "d = extract_pkls()", "type": "assigned_variable", "loc": [1511, 1511], "level": 15, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1508_C4", "vector": [14, 15, 0.9208, 0.0006, 15, 0.76, 0.0417, 355, 3, 2, 0, 0, 780, 10, 1], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "extract_pkls", "annotation": ""}, "snippet": " d = extract_pkls(dir, True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1512_C8", "label": "trial_num_list =", "type": "assigned_variable", "loc": [1512, 1512], "level": 15, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1508_C4", "vector": [14, 15, 0.9214, 0.0006, 15, 0.76, 0.0833, 166, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "trial_num_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " trial_num_list = d['trial_num_l']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1513_C8", "label": "states_l =", "type": "assigned_variable", "loc": [1513, 1513], "level": 15, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1508_C4", "vector": [14, 15, 0.922, 0.0006, 15, 0.76, 0.125, 827, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "states_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " states_l = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1514_C8", "label": "xarr_l =", "type": "assigned_variable", "loc": [1514, 1514], "level": 15, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1508_C4", "vector": [14, 15, 0.9226, 0.0006, 15, 0.76, 0.1667, 308, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "xarr_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " xarr_l = [] "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1515_C8", "label": "varr_l =", "type": "assigned_variable", "loc": [1515, 1515], "level": 15, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1508_C4", "vector": [14, 15, 0.9232, 0.0006, 15, 0.76, 0.2083, 738, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "varr_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " varr_l = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1516_C8", "label": "aarr_l =", "type": "assigned_variable", "loc": [1516, 1516], "level": 15, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1508_C4", "vector": [14, 15, 0.9238, 0.0006, 15, 0.76, 0.25, 141, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "aarr_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " aarr_l = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1517_C8", "label": "forces_l =", "type": "assigned_variable", "loc": [1517, 1517], "level": 15, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1508_C4", "vector": [14, 15, 0.9244, 0.0006, 15, 0.76, 0.2917, 32, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "forces_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " forces_l = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1519_C8", "label": "for i, n", "type": "for", "loc": [1519, 1557], "level": 15, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1508_C4", "vector": [6, 15, 0.9372, 0.0238, 15, 0.76, 0.3333, 217, 3, 0, 0, 0, 0, 0, 23], "semantic": {"name": "i, n", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i, n in enumerate(trial_num_list):\n print('i:', i)\n# if i != 5:\n# continue\n #trial_idx = trial_num_list.index()\n mechx_l = d['mechx_l_l'][i]\n time_list = d['time_l_l'][i]\n forces = np.matrix(d['ftan_l_l'][i])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1520_C12", "label": "print()", "type": "expression", "loc": [1520, 1520], "level": 16, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1519_C8", "vector": [8, 16, 0.9263, 0.0006, 16, 0.98, 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:', i)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1524_C12", "label": "mechx_l =", "type": "assigned_variable", "loc": [1524, 1524], "level": 16, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1519_C8", "vector": [14, 16, 0.9287, 0.0006, 16, 0.98, 0.0417, 961, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "mechx_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mechx_l = d['mechx_l_l'][i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1525_C12", "label": "time_list =", "type": "assigned_variable", "loc": [1525, 1525], "level": 16, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1519_C8", "vector": [14, 16, 0.9293, 0.0006, 16, 0.98, 0.0833, 941, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "time_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " time_list = d['time_l_l'][i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1526_C12", "label": "forces = matrix()", "type": "assigned_variable", "loc": [1526, 1526], "level": 16, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1519_C8", "vector": [14, 16, 0.9299, 0.0006, 16, 0.98, 0.125, 817, 3, 1, 0, 0, 162, 10, 1], "semantic": {"name": "forces", "arg_names": [], "import_names": [], "rhs_call_name": "matrix", "annotation": ""}, "snippet": " forces = np.matrix(d['ftan_l_l'][i])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1527_C12", "label": "radius =", "type": "assigned_variable", "loc": [1527, 1527], "level": 16, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1519_C8", "vector": [14, 16, 0.9305, 0.0006, 16, 0.98, 0.1667, 731, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "radius", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " radius = d['rad']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1528_C12", "label": "window_len =", "type": "assigned_variable", "loc": [1528, 1528], "level": 16, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1519_C8", "vector": [14, 16, 0.9311, 0.0006, 16, 0.98, 0.2083, 352, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "window_len", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " window_len = 15"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1529_C12", "label": "mechx_l, vel, acc, time_list = kinematic_params()", "type": "assigned_variable", "loc": [1529, 1529], "level": 16, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1519_C8", "vector": [14, 16, 0.9317, 0.0006, 16, 0.98, 0.25, 935, 3, 3, 0, 0, 169, 10, 1], "semantic": {"name": "mechx_l, vel, acc, time_list", "arg_names": [], "import_names": [], "rhs_call_name": "kinematic_params", "annotation": ""}, "snippet": " mechx_l, vel, acc, time_list = mfc.kinematic_params(mechx_l, time_list, window_len)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1530_C12", "label": "xarr = array()", "type": "assigned_variable", "loc": [1530, 1530], "level": 16, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1519_C8", "vector": [14, 16, 0.9324, 0.0006, 16, 0.98, 0.2917, 440, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "xarr", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " xarr = np.array(mechx_l)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1531_C12", "label": "idxs = where()", "type": "assigned_variable", "loc": [1531, 1531], "level": 16, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1519_C8", "vector": [14, 16, 0.933, 0.0006, 16, 0.98, 0.3333, 677, 3, 1, 0, 0, 169, 10, 4], "semantic": {"name": "idxs", "arg_names": [], "import_names": [], "rhs_call_name": "where", "annotation": ""}, "snippet": " idxs = np.where(np.logical_and(xarr > math.radians(1), xarr < math.radians(15)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1534_C12", "label": "forces =", "type": "assigned_variable", "loc": [1534, 1534], "level": 16, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1519_C8", "vector": [14, 16, 0.9348, 0.0006, 16, 0.98, 0.375, 817, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "forces", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " forces = forces[0, window_len-1:-window_len+1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1536_C12", "label": "forces =", "type": "assigned_variable", "loc": [1536, 1536], "level": 16, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1519_C8", "vector": [14, 16, 0.936, 0.0006, 16, 0.98, 0.4167, 817, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "forces", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " forces = forces[0, 1:-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1538_C12", "label": "forces =", "type": "assigned_variable", "loc": [1538, 1538], "level": 16, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1519_C8", "vector": [14, 16, 0.9372, 0.0006, 16, 0.98, 0.4583, 817, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "forces", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " forces = forces[0, window_len-1:-window_len+1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1540_C12", "label": "forces =", "type": "assigned_variable", "loc": [1540, 1540], "level": 16, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1519_C8", "vector": [14, 16, 0.9385, 0.0006, 16, 0.98, 0.5, 817, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "forces", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " forces = forces[0, 1:-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1542_C12", "label": "forces =", "type": "assigned_variable", "loc": [1542, 1542], "level": 16, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1519_C8", "vector": [14, 16, 0.9397, 0.0006, 16, 0.98, 0.5417, 817, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "forces", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " forces = forces[0, window_len-1:-window_len+1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1543_C12", "label": "forces =", "type": "assigned_variable", "loc": [1543, 1543], "level": 16, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1519_C8", "vector": [14, 16, 0.9403, 0.0006, 16, 0.98, 0.5833, 817, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "forces", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " forces = forces[0, idxs[0]]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1544_C12", "label": "xarr = matrix()", "type": "assigned_variable", "loc": [1544, 1544], "level": 16, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1519_C8", "vector": [14, 16, 0.9409, 0.0006, 16, 0.98, 0.625, 440, 3, 1, 0, 0, 162, 10, 1], "semantic": {"name": "xarr", "arg_names": [], "import_names": [], "rhs_call_name": "matrix", "annotation": ""}, "snippet": " xarr = np.matrix(xarr[idxs])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1545_C12", "label": "varr = matrix()", "type": "assigned_variable", "loc": [1545, 1545], "level": 16, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1519_C8", "vector": [14, 16, 0.9415, 0.0006, 16, 0.98, 0.6667, 862, 3, 1, 0, 0, 162, 10, 2], "semantic": {"name": "varr", "arg_names": [], "import_names": [], "rhs_call_name": "matrix", "annotation": ""}, "snippet": " varr = np.matrix(np.array(vel)[idxs])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1546_C12", "label": "aarr = matrix()", "type": "assigned_variable", "loc": [1546, 1546], "level": 16, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1519_C8", "vector": [14, 16, 0.9421, 0.0006, 16, 0.98, 0.7083, 362, 3, 1, 0, 0, 162, 10, 2], "semantic": {"name": "aarr", "arg_names": [], "import_names": [], "rhs_call_name": "matrix", "annotation": ""}, "snippet": " aarr = np.matrix(np.array(acc)[idxs])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1547_C12", "label": "append()", "type": "expression", "loc": [1547, 1547], "level": 16, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1519_C8", "vector": [8, 16, 0.9427, 0.0006, 16, 0.98, 0.75, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " xarr_l.append(xarr)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1548_C12", "label": "append()", "type": "expression", "loc": [1548, 1548], "level": 16, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1519_C8", "vector": [8, 16, 0.9433, 0.0006, 16, 0.98, 0.7917, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " varr_l.append(varr)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1549_C12", "label": "append()", "type": "expression", "loc": [1549, 1549], "level": 16, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1519_C8", "vector": [8, 16, 0.9439, 0.0006, 16, 0.98, 0.8333, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " aarr_l.append(aarr)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1550_C12", "label": "append()", "type": "expression", "loc": [1550, 1550], "level": 16, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1519_C8", "vector": [8, 16, 0.9445, 0.0006, 16, 0.98, 0.875, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " forces_l.append(forces)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1555_C12", "label": "door_smd = DoorMassDamper()", "type": "assigned_variable", "loc": [1555, 1555], "level": 16, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1519_C8", "vector": [14, 16, 0.9476, 0.0006, 16, 0.98, 0.9167, 189, 3, 1, 0, 0, 872, 10, 1], "semantic": {"name": "door_smd", "arg_names": [], "import_names": [], "rhs_call_name": "DoorMassDamper", "annotation": ""}, "snippet": " door_smd = mfd.DoorMassDamper(radius)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1556_C12", "label": "ones = ones()", "type": "assigned_variable", "loc": [1556, 1556], "level": 16, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1519_C8", "vector": [14, 16, 0.9482, 0.0006, 16, 0.98, 0.9583, 530, 3, 1, 0, 0, 530, 10, 1], "semantic": {"name": "ones", "arg_names": [], "import_names": [], "rhs_call_name": "ones", "annotation": ""}, "snippet": " ones = np.ones(xarr.shape[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1557_C12", "label": "append()", "type": "expression", "loc": [1557, 1557], "level": 16, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1519_C8", "vector": [8, 16, 0.9488, 0.0006, 16, 0.98, 1.0, 243, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " states_l.append(np.matrix(np.row_stack((xarr, varr, aarr, ones))))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1559_C8", "label": "states = column_stack()", "type": "assigned_variable", "loc": [1559, 1559], "level": 15, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1508_C4", "vector": [14, 15, 0.95, 0.0006, 15, 0.76, 0.375, 728, 3, 1, 0, 0, 724, 10, 1], "semantic": {"name": "states", "arg_names": [], "import_names": [], "rhs_call_name": "column_stack", "annotation": ""}, "snippet": " states = np.column_stack(states_l)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1560_C8", "label": "forces = column_stack()", "type": "assigned_variable", "loc": [1560, 1560], "level": 15, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1508_C4", "vector": [14, 15, 0.9506, 0.0006, 15, 0.76, 0.4167, 817, 3, 1, 0, 0, 724, 10, 1], "semantic": {"name": "forces", "arg_names": [], "import_names": [], "rhs_call_name": "column_stack", "annotation": ""}, "snippet": " forces = np.column_stack(forces_l)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1561_C8", "label": "acc_arr =", "type": "assigned_variable", "loc": [1561, 1561], "level": 15, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1508_C4", "vector": [14, 15, 0.9512, 0.0006, 15, 0.76, 0.4583, 826, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "acc_arr", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " acc_arr = states[2,:].A1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1562_C8", "label": "farr =", "type": "assigned_variable", "loc": [1562, 1562], "level": 15, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1508_C4", "vector": [14, 15, 0.9519, 0.0006, 15, 0.76, 0.5, 559, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "farr", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " farr = forces.A1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1564_C8", "label": "print()", "type": "expression", "loc": [1564, 1564], "level": 15, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1508_C4", "vector": [8, 15, 0.9531, 0.0006, 15, 0.76, 0.5417, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('farr:', farr)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1565_C8", "label": "print()", "type": "expression", "loc": [1565, 1565], "level": 15, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1508_C4", "vector": [8, 15, 0.9537, 0.0006, 15, 0.76, 0.5833, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('acc_arr:', acc_arr)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1566_C8", "label": "mass = mean()", "type": "assigned_variable", "loc": [1566, 1566], "level": 15, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1508_C4", "vector": [14, 15, 0.9543, 0.0006, 15, 0.76, 0.625, 844, 3, 1, 0, 0, 856, 10, 2], "semantic": {"name": "mass", "arg_names": [], "import_names": [], "rhs_call_name": "mean", "annotation": ""}, "snippet": " mass = np.mean(np.divide(farr, acc_arr))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1567_C8", "label": "print()", "type": "expression", "loc": [1567, 1567], "level": 15, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1508_C4", "vector": [8, 15, 0.9549, 0.0006, 15, 0.76, 0.6667, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('mass:', mass)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1569_C8", "label": "door_smd = fit()", "type": "assigned_variable", "loc": [1569, 1569], "level": 15, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1508_C4", "vector": [14, 15, 0.9561, 0.0006, 15, 0.76, 0.7083, 189, 3, 2, 0, 0, 828, 10, 1], "semantic": {"name": "door_smd", "arg_names": [], "import_names": [], "rhs_call_name": "fit", "annotation": ""}, "snippet": " door_smd = door_smd.fit(states[[1,2],:], forces.T)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1571_C8", "label": "print()", "type": "expression", "loc": [1571, 1571], "level": 15, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1508_C4", "vector": [8, 15, 0.9573, 0.0006, 15, 0.76, 0.75, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('fitted model', door_smd)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1572_C8", "label": "for i", "type": "for", "loc": [1572, 1585], "level": 15, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1508_C4", "vector": [6, 15, 0.9619, 0.0085, 15, 0.76, 0.7917, 826, 3, 0, 0, 0, 0, 0, 19], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(len(xarr_l)):\n forces = forces_l[i]\n xarr = xarr_l[i]\n varr = varr_l[i]\n aarr = aarr_l[i]\n predicted_forces = door_smd.predict(states_l[i][[1,2],:])\n predicted_forces_mass = mass * states_l[i][2,:].A1\n mpu.figure()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1573_C12", "label": "forces =", "type": "assigned_variable", "loc": [1573, 1573], "level": 16, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1572_C8", "vector": [14, 16, 0.9586, 0.0006, 16, 0.66, 0.0, 817, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "forces", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " forces = forces_l[i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1574_C12", "label": "xarr =", "type": "assigned_variable", "loc": [1574, 1574], "level": 16, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1572_C8", "vector": [14, 16, 0.9592, 0.0006, 16, 0.66, 0.0833, 440, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "xarr", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " xarr = xarr_l[i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1575_C12", "label": "varr =", "type": "assigned_variable", "loc": [1575, 1575], "level": 16, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1572_C8", "vector": [14, 16, 0.9598, 0.0006, 16, 0.66, 0.1667, 862, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "varr", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " varr = varr_l[i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1576_C12", "label": "aarr =", "type": "assigned_variable", "loc": [1576, 1576], "level": 16, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1572_C8", "vector": [14, 16, 0.9604, 0.0006, 16, 0.66, 0.25, 362, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "aarr", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " aarr = aarr_l[i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1577_C12", "label": "predicted_forces = predict()", "type": "assigned_variable", "loc": [1577, 1577], "level": 16, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1572_C8", "vector": [14, 16, 0.961, 0.0006, 16, 0.66, 0.3333, 881, 3, 1, 0, 0, 127, 10, 1], "semantic": {"name": "predicted_forces", "arg_names": [], "import_names": [], "rhs_call_name": "predict", "annotation": ""}, "snippet": " predicted_forces = door_smd.predict(states_l[i][[1,2],:])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1578_C12", "label": "predicted_forces_mass =", "type": "assigned_variable", "loc": [1578, 1578], "level": 16, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1572_C8", "vector": [14, 16, 0.9616, 0.0006, 16, 0.66, 0.4167, 951, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "predicted_forces_mass", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " predicted_forces_mass = mass * states_l[i][2,:].A1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1579_C12", "label": "figure()", "type": "expression", "loc": [1579, 1579], "level": 16, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1572_C8", "vector": [8, 16, 0.9622, 0.0006, 16, 0.66, 0.5, 789, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "figure", "arg_names": [], "import_names": [], "rhs_call_name": "figure", "annotation": ""}, "snippet": " mpu.figure()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1580_C12", "label": "plot_yx()", "type": "expression", "loc": [1580, 1580], "level": 16, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1572_C8", "vector": [8, 16, 0.9628, 0.0006, 16, 0.66, 0.5833, 112, 3, 4, 0, 0, 0, 0, 2], "semantic": {"name": "plot_yx", "arg_names": [], "import_names": [], "rhs_call_name": "plot_yx", "annotation": ""}, "snippet": " mpu.plot_yx(forces.A1, np.degrees(xarr.A1), label='actual', color='g')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1581_C12", "label": "plot_yx()", "type": "expression", "loc": [1581, 1581], "level": 16, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1572_C8", "vector": [8, 16, 0.9634, 0.0006, 16, 0.66, 0.6667, 112, 3, 4, 0, 0, 0, 0, 2], "semantic": {"name": "plot_yx", "arg_names": [], "import_names": [], "rhs_call_name": "plot_yx", "annotation": ""}, "snippet": " mpu.plot_yx(predicted_forces.A1, np.degrees(xarr.A1), label='predicted SMD', color='b')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1582_C12", "label": "plot_yx()", "type": "expression", "loc": [1582, 1582], "level": 16, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1572_C8", "vector": [8, 16, 0.964, 0.0006, 16, 0.66, 0.75, 112, 3, 4, 0, 0, 0, 0, 2], "semantic": {"name": "plot_yx", "arg_names": [], "import_names": [], "rhs_call_name": "plot_yx", "annotation": ""}, "snippet": " mpu.plot_yx(predicted_forces_mass, np.degrees(xarr.A1), label='predicted (mass only)', color='r')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1583_C12", "label": "plot_yx()", "type": "expression", "loc": [1583, 1583], "level": 16, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1572_C8", "vector": [8, 16, 0.9647, 0.0006, 16, 0.66, 0.8333, 112, 3, 4, 0, 0, 0, 0, 4], "semantic": {"name": "plot_yx", "arg_names": [], "import_names": [], "rhs_call_name": "plot_yx", "annotation": ""}, "snippet": " mpu.plot_yx(np.degrees(varr.A1), np.degrees(xarr.A1), label='vel', color=mpu.random_color())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1584_C12", "label": "plot_yx()", "type": "expression", "loc": [1584, 1584], "level": 16, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1572_C8", "vector": [8, 16, 0.9653, 0.0006, 16, 0.66, 0.9167, 112, 3, 4, 0, 0, 0, 0, 4], "semantic": {"name": "plot_yx", "arg_names": [], "import_names": [], "rhs_call_name": "plot_yx", "annotation": ""}, "snippet": " mpu.plot_yx(np.degrees(aarr.A1), np.degrees(xarr.A1), label='acel', color=mpu.random_color())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1585_C12", "label": "legend()", "type": "expression", "loc": [1585, 1585], "level": 16, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1572_C8", "vector": [8, 16, 0.9659, 0.0006, 16, 0.66, 1.0, 880, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "legend", "arg_names": [], "import_names": [], "rhs_call_name": "legend", "annotation": ""}, "snippet": " mpu.legend()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1589_C8", "label": "show()", "type": "expression", "loc": [1589, 1589], "level": 15, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1508_C4", "vector": [8, 15, 0.9683, 0.0006, 15, 0.76, 0.8333, 497, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "show", "arg_names": [], "import_names": [], "rhs_call_name": "show", "annotation": ""}, "snippet": " mpu.show()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1596_C8", "label": "d_list = input_mechanism_list()", "type": "assigned_variable", "loc": [1596, 1596], "level": 15, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1508_C4", "vector": [14, 15, 0.9726, 0.0006, 15, 0.76, 0.875, 280, 3, 1, 0, 0, 660, 10, 1], "semantic": {"name": "d_list", "arg_names": [], "import_names": [], "rhs_call_name": "input_mechanism_list", "annotation": ""}, "snippet": " d_list = input_mechanism_list(dir_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1599_C8", "label": "traj_vel_l =", "type": "assigned_variable", "loc": [1599, 1599], "level": 15, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1508_C4", "vector": [14, 15, 0.9744, 0.0006, 15, 0.76, 0.9167, 725, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "traj_vel_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " traj_vel_l = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1600_C8", "label": "for dir", "type": "for", "loc": [1600, 1631], "level": 15, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1508_C4", "vector": [6, 15, 0.9845, 0.0195, 15, 0.76, 0.9583, 152, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "dir", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for dir in d_list:\n #make_vector_mechanism(dir)\n\n\n# vel_l = []\n# nm = get_mech_name(dir)\n# print '>>>>>>>>>> nm:', nm\n# d = extract_pkls(dir, ignore_moment_list=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1631_C12", "label": "plot_tangential_force()", "type": "expression", "loc": [1631, 1631], "level": 16, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1600_C8", "vector": [8, 16, 0.9939, 0.0006, 16, 0.45, 0.0, 803, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "plot_tangential_force", "arg_names": [], "import_names": [], "rhs_call_name": "plot_tangential_force", "annotation": ""}, "snippet": " plot_tangential_force(dir, all_trials = True, open = True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1637_C8", "label": "show()", "type": "expression", "loc": [1637, 1637], "level": 15, "parent": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1508_C4", "vector": [8, 15, 0.9976, 0.0006, 15, 0.76, 1.0, 497, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "show", "arg_names": [], "import_names": [], "rhs_call_name": "show", "annotation": ""}, "snippet": " mpu.show()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99534:ClassDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L27_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L28_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L29_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L30_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:ClassDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L33_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L34_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Return_L35_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L36_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L38_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L39_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L39_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L40_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L39_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L41_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L43_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L44_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L46_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L58_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L67_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L68_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L67_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L69_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L69_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L69_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L71_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L69_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L72_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L72_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L73_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L69_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L74_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L69_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L75_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L67_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L77_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L67_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L78_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L67_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L79_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L67_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L80_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L67_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L81_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L67_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L82_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L83_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L67_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Return_L84_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L88_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L89_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L88_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L90_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L90_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L91_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L90_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L92_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L90_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L93_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L90_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L94_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L90_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L95_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L90_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L97_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L97_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L98_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L97_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L99_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L90_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L102_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L90_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L104_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L104_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L105_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L104_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L106_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L90_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L108_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L90_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L109_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L109_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L110_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L109_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L111_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L90_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L113_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L113_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L114_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L113_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L115_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L115_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L116_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L115_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L117_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L117_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L118_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L117_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L119_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L90_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L122_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L122_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L123_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L122_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L124_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L122_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L125_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L125_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L126_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L125_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L127_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L122_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L130_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L122_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L131_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L131_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L132_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L131_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L133_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L131_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L134_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L143_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L145_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L143_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L146_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L143_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L149_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L149_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L150_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L149_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L152_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L143_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L154_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L143_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L155_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L143_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L158_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L143_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L159_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L159_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L160_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L159_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L161_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L161_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L162_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L161_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L163_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L161_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L165_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L161_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L166_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L159_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L168_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L159_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L169_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L159_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L170_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L159_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L172_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L143_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L178_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L143_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L179_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L143_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L180_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L143_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L181_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L143_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L182_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L143_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L183_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L143_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L184_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L143_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L185_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L185_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L186_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L185_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L187_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L185_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L189_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L185_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L190_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L143_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L192_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L143_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L193_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L143_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L194_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L194_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L195_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L195_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L196_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L196_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L197_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L196_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L199_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L195_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L200_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L195_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L201_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L201_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L202_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L201_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L204_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L195_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L206_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L206_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L207_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L206_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L208_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L208_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L209_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L208_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L211_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L195_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L213_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L195_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L215_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L195_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L217_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L194_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L218_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L194_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L219_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L143_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L221_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L221_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L222_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L221_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L224_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L143_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L226_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L143_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L227_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L143_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L228_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L143_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L230_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L143_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L232_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L232_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L233_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L232_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L234_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L232_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L235_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L232_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L236_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L232_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L238_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L232_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L240_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L232_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L242_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L232_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L245_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L232_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L246_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L232_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L247_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L247_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L251_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L247_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L252_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L247_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L253_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L247_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L255_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L247_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L256_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L247_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L257_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L247_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L262_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L247_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L263_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L247_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L264_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L232_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L266_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L232_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L268_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L232_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L269_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L269_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L270_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L232_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L271_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L271_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L272_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L232_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L274_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L143_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L276_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L143_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L277_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L277_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L278_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L143_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L283_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L143_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L285_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L289_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L290_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L289_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L291_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L289_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L292_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L289_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L293_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L289_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L294_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L289_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L295_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L295_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L296_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L295_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L297_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L295_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L298_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L295_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L299_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L295_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L300_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L295_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L301_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L308_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L309_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L308_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L310_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L308_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L311_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L311_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L312_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L308_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Return_L313_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L319_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L320_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L320_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L321_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L320_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L323_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L319_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L324_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L319_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L325_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L319_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L326_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L319_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L327_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L319_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L328_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L319_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L329_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L319_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L330_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L330_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L331_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L330_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L333_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L333_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L334_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L333_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L336_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L330_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L341_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L341_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L343_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L343_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L344_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L343_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L349_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L330_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L351_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L330_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L352_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L330_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L353_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L330_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L354_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L330_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L356_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L356_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L357_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L356_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L359_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L359_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L360_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L356_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Return_L361_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L330_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L363_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L330_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L365_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L365_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L366_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L365_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L368_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L330_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L372_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L319_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L374_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L319_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L375_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L319_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L376_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L319_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L377_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L319_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L378_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L319_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L379_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L319_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L380_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L319_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L381_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L319_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L382_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L319_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Return_L384_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L395_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L397_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L397_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L398_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L397_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L400_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L395_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L402_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L395_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L403_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L395_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L405_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L395_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L406_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L395_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L407_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L395_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L409_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L409_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L410_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L409_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L412_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L412_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L413_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L412_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L414_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L412_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L415_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L415_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L416_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L415_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L417_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L395_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Return_L419_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L425_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L426_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L425_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L427_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L427_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L428_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L427_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L430_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L425_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L432_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L432_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L433_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L432_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L434_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L432_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L435_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L432_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L436_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L432_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L437_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L432_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L438_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L432_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L439_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L439_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L440_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L439_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L441_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L439_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L442_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L439_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L443_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L432_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L444_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L432_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L445_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L432_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L446_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L432_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L448_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L432_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L449_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L425_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L452_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L456_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L460_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L460_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L461_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L456_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L462_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L456_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L464_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L456_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L465_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L456_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L466_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L456_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L467_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L456_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L468_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L456_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L469_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L456_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L470_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L456_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L472_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L456_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L474_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L456_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L475_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L456_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L476_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L456_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L478_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L478_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L479_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L456_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L480_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L480_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L481_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L456_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L482_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L482_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L483_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L482_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L484_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L484_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L485_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L456_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L487_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L456_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L488_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L488_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L489_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L489_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L490_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L489_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L492_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L489_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L494_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L488_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L496_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L496_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L497_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L488_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L499_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L499_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L500_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L488_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L501_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L488_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L502_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L456_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L504_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L456_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L505_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L456_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L506_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L456_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L507_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L507_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L508_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L507_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L509_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L509_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L510_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L510_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L511_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L511_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L512_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L512_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L513_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L511_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L516_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L516_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L517_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L456_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L521_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L456_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L522_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L456_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L523_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L523_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L524_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L523_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L525_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L523_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L527_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L523_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L528_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L523_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L529_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L456_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L531_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L531_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L532_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L531_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L534_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L456_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L536_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L456_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L537_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L537_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L538_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L537_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L539_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L537_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L541_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L537_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L542_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L456_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L544_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L456_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L545_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L545_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L546_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L456_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L547_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L547_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L548_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L456_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L550_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L456_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L554_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L557_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L560_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L557_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L561_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L557_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L562_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L557_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L563_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L557_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L564_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L557_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L565_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L557_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L566_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L557_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L567_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L557_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L569_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L557_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L570_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L570_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L571_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L557_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L573_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L557_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L574_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L557_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L575_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L557_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L577_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L557_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L578_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L578_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L579_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L579_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L580_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L579_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L582_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L579_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L584_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L578_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L586_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L586_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L587_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L578_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L590_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L590_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L591_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L578_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L592_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L578_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L593_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L557_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L595_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L557_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L596_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L557_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L597_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L557_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L598_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L598_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L599_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L598_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L600_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L600_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L601_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L601_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L602_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L598_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L603_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L598_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L605_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L598_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L606_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L598_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L607_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L557_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L609_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L557_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L611_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L611_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L612_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L611_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L614_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L557_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L616_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L557_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L617_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L557_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L618_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L557_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L624_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L626_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L627_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L626_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L628_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L628_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L629_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L628_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L630_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L628_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L631_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L628_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L636_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L628_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L637_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L637_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L638_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L628_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L640_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L628_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L641_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L626_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L644_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L646_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L647_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L646_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L648_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L648_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L649_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L648_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L650_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L648_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L651_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L651_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L652_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L648_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L654_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L648_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L655_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L648_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L656_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L648_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L657_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L648_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L658_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L646_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L661_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L646_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L662_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L646_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L663_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L646_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L664_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L646_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L665_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L669_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L670_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L669_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L671_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L671_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L672_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L671_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L673_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L671_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L674_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L674_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L675_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L671_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L677_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L671_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L678_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L671_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L679_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L671_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L680_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L671_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L682_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L671_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L683_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L671_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L684_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L671_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L685_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L671_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L686_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L671_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L687_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L671_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L688_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L671_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L691_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L671_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L692_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L692_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L693_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L692_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L694_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L692_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L695_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L692_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L696_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L692_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L697_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L671_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L699_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L669_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L702_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L707_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L708_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L707_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L709_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L707_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L710_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L707_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L711_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L711_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L712_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L707_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L714_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L707_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L715_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L717_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L718_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L717_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L719_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L717_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L720_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L717_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L721_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L721_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L722_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L717_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L724_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L717_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L725_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L729_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L730_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L729_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L731_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L729_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L732_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L729_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L734_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L729_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Return_L735_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L739_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L740_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L739_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L741_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L739_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L742_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L739_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Return_L743_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L747_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L748_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L747_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L749_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L749_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Return_L750_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L747_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L752_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L747_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L753_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L747_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L754_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L754_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Return_L755_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L747_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L757_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L757_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L758_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L757_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L759_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L759_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L760_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L747_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L762_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L747_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L763_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L747_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L764_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L747_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L766_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L747_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L767_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L747_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L769_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L747_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L770_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L747_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L772_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L747_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Return_L773_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L776_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L777_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L776_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L778_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L776_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L779_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L776_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L780_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L780_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L781_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L780_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L782_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L780_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L783_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L780_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L784_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L780_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L786_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L780_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L788_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L780_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L789_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L780_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L792_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L780_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L793_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L780_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L794_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L780_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L797_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L780_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L799_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L780_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L800_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L780_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L802_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L809_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L810_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L809_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L811_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L809_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L812_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L809_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L813_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L809_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L814_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L814_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L815_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L814_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L816_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L814_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L817_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L814_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L818_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L814_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L819_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L819_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L820_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L819_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L821_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L819_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L823_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L819_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L826_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L819_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L827_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L809_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L829_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L809_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L831_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L837_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L838_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L837_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L839_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L837_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L845_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L851_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L852_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L851_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L853_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L851_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L854_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L851_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L855_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L851_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L856_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L851_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L857_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L851_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L858_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L851_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L860_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L851_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L862_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L851_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L863_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L851_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L864_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L851_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L865_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L865_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L867_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L865_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L868_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L865_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L871_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L865_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L872_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L865_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L873_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L865_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L875_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L865_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L877_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L865_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L878_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L865_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L883_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L865_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L884_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L851_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L886_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L851_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L889_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L891_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L892_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L891_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L893_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L893_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L894_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L893_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L895_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L893_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L896_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L896_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L897_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L893_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L899_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L893_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L900_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L893_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L901_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L901_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L902_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L891_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L903_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L891_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L904_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L891_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L905_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L891_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L906_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L891_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L907_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L891_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L908_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L891_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L909_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L891_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L910_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L891_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Return_L915_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L919_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L920_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L919_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L923_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L919_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L924_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L919_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L927_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L919_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L928_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L919_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L929_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L929_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L930_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L929_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L931_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L929_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L932_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L929_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L933_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L929_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L934_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L919_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Return_L937_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L941_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L942_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L941_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L943_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L941_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L944_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L941_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L945_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L941_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L946_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L941_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L947_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L941_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L948_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L941_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L949_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L941_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L950_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L941_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L951_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L941_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L953_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L941_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L954_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L941_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L955_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L941_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L956_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L956_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L957_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L957_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L958_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L958_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L959_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L958_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L961_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L957_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L963_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L957_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L966_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L957_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L968_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L956_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L970_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L970_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L971_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L956_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L975_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L956_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L976_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L956_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L979_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L956_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L980_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L941_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L982_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L982_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Return_L983_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L941_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L985_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L941_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L986_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L941_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L988_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L941_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L989_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L941_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L990_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L941_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L991_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L941_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L992_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L941_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L993_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L993_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L994_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L994_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L996_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L994_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L998_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L993_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L999_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L941_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1001_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L941_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Return_L1009_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1015_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1016_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1015_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1017_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1015_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1018_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1018_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1019_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1018_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1020_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1018_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1022_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1022_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1023_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1022_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1024_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1018_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1030_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1018_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1031_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1018_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1033_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1018_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1034_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1015_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1036_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1015_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1037_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1015_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1038_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1015_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1039_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1015_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1041_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1015_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1042_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1015_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1043_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1015_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1044_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1015_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1045_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1045_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1046_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1045_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1047_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1047_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1048_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1045_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1049_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1045_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1050_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1050_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1052_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1050_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1053_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1053_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1054_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1053_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1055_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1053_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1057_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1050_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1058_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1050_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1059_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1050_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1061_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1061_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1062_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1061_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1064_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1064_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1065_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1064_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1066_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1064_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1068_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1061_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1071_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1061_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1072_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1072_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1074_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1072_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1075_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1072_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1077_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1045_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1078_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1015_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1080_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1015_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1081_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1015_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1082_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1015_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1083_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1015_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1084_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1015_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1086_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1015_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1088_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1015_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1089_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1015_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1090_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1015_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1091_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1015_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1094_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1015_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1095_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1095_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1096_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1015_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1099_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1015_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1100_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1015_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1102_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1109_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1110_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1110_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1111_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1110_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1113_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1109_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1115_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1109_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1116_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1109_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1117_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1109_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1118_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1109_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1120_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1109_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1121_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1109_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1123_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1123_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1124_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1123_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1125_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1123_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1126_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1123_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1128_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1123_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1129_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1123_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1130_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1123_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1131_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1123_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1132_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1123_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1134_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1123_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1135_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1135_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1136_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1135_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1138_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1135_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1139_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1139_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1140_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1139_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1142_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1135_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1144_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1144_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1145_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1135_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1147_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1135_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1148_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1135_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1149_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1123_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1152_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1123_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1153_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1153_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1154_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1154_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1155_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1154_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1156_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1156_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1158_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1156_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1159_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1159_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1160_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1156_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1161_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1161_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1162_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1161_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1163_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1163_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1164_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1153_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1166_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1166_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1167_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1153_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1168_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1168_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1169_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1123_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1171_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1123_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1173_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1109_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1175_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1175_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1176_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1175_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1177_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1175_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1178_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1175_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1179_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1179_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1180_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1179_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1181_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1179_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1182_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1179_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1183_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1179_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1187_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1179_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1189_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1179_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1190_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1179_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1195_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1179_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1196_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1179_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1200_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1179_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1201_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1179_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1203_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1179_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1204_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1179_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1206_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1179_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1207_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1179_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1208_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1179_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1209_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1179_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1213_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1179_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1215_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1179_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1216_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1175_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1222_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1175_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1223_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1175_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1224_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1175_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1225_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1175_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1226_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1175_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1230_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1175_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1231_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1175_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1232_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1175_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1233_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1175_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1234_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1175_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1236_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1239_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1240_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1239_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1241_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1239_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1242_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1239_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1243_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1239_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1244_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1244_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1245_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1244_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1246_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1244_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1248_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1244_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1249_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1244_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1250_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1244_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1251_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1239_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1253_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1239_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1255_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1239_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1256_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1239_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1265_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1239_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1267_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1239_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1268_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1239_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1270_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1239_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1271_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1239_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1272_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1239_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1273_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1239_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1276_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1239_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1277_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1239_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1278_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1278_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1279_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1239_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1282_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1239_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1283_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1239_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1285_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1285_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1286_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1285_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1287_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1285_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1288_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1288_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1289_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1288_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1290_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1288_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1291_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1288_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1293_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1285_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1299_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1285_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1300_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1285_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1301_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1285_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1303_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1285_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1305_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1285_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1306_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1308_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1309_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1308_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1310_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1310_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1311_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1310_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1312_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1312_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1313_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1310_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1324_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1310_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1325_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1310_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1327_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1327_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1328_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1327_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1329_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1327_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1331_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:FunctionDef_L1308_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Return_L1334_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1338_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Import_L1339_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1338_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1340_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1338_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1341_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1338_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1343_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1338_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1345_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1338_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1347_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1338_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1350_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1338_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1352_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1338_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1354_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1338_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1356_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1338_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1358_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1338_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1360_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1338_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1362_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1338_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1365_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1338_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1367_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1338_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1369_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1338_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1371_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1338_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1375_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1338_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1377_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1338_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1396_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1396_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1397_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1396_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1398_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1398_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1400_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1398_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1401_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1398_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1402_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1402_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1403_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1402_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1404_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1402_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1405_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1402_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1406_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1398_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1407_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1398_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1408_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1398_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1410_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1410_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1411_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1410_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1412_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1410_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1413_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1398_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1414_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1414_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1415_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1414_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1416_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1416_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1417_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1416_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1418_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1416_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1419_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1419_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1420_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1416_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1421_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1416_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1422_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1414_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1424_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1424_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1425_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1424_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1426_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1424_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1427_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1424_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1428_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1428_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1429_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1428_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1430_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1428_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1431_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1414_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1432_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1432_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1433_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1432_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1434_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1432_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1435_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1432_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1436_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1436_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1437_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1436_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1438_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1436_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1439_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1436_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1440_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1436_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1441_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1441_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1442_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1441_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1443_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1441_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1444_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1444_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1445_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1444_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1446_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1444_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1447_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1444_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1448_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1444_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1449_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1444_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1450_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1444_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1451_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1444_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1452_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1444_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1453_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1453_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1462_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1453_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1464_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1453_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1465_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1465_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1466_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1465_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1467_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1465_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1468_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1465_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1469_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1469_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1470_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1469_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1471_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1469_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1472_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1469_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1473_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1469_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1474_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1469_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1475_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1469_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1476_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1469_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1477_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1469_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1479_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1479_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1480_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1480_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1481_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1480_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1482_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1480_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1484_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1479_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1486_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1486_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1487_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1479_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1489_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1479_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1490_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1465_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1491_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1465_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1492_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1465_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1493_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1493_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1494_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1493_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1495_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1495_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1496_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1493_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1497_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1493_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1498_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1498_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1499_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1498_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1500_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1500_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1501_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1500_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1503_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1503_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1507_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1503_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1508_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1508_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1509_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1508_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1511_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1508_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1512_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1508_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1513_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1508_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1514_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1508_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1515_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1508_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1516_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1508_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1517_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1508_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1519_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1519_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1520_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1519_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1524_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1519_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1525_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1519_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1526_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1519_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1527_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1519_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1528_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1519_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1529_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1519_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1530_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1519_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1531_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1519_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1534_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1519_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1536_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1519_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1538_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1519_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1540_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1519_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1542_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1519_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1543_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1519_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1544_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1519_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1545_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1519_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1546_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1519_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1547_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1519_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1548_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1519_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1549_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1519_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1550_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1519_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1555_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1519_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1556_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1519_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1557_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1508_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1559_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1508_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1560_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1508_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1561_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1508_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1562_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1508_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1564_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1508_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1565_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1508_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1566_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1508_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1567_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1508_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1569_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1508_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1571_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1508_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1572_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1572_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1573_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1572_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1574_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1572_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1575_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1572_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1576_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1572_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1577_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1572_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1578_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1572_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1579_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1572_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1580_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1572_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1581_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1572_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1582_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1572_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1583_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1572_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1584_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1572_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1585_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1508_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1589_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1508_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1596_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1508_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Assign_L1599_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1508_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1600_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:For_L1600_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1631_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99534:If_L1508_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99534:Expr_L1637_C8"}]
import roslib; roslib.load_manifest('modeling_forces') import rospy import hrl_lib.util as ut import hrl_lib.transforms as tr import matplotlib_util.util as mpu import hrl_tilting_hokuyo.display_3d_mayavi as d3m import modeling_forces.smooth as mfs import kinematics_estimation as ke import glob import math, numpy as np import sys ## # plot to ensure that the time stamps in the different logs are # reasonable. # TODO - check for the rates too. def check_time_sync(ft_time_list, mechanism_time_list, hand_time_list): mpu.plot_yx(np.zeros(len(ft_time_list))+1, ft_time_list, color = mpu.random_color(), label='ft\_time\_list', axis=None, linewidth=0.5, scatter_size=10) mpu.plot_yx(np.zeros(len(mechanism_time_list))+2, mechanism_time_list, color = mpu.random_color(), label='mechanism\_time\_list', axis=None, linewidth=0.5, scatter_size=10) mpu.plot_yx(np.zeros(len(hand_time_list))+3, hand_time_list, color = mpu.random_color(), label='hand\_time\_list', axis=None, linewidth=0.5, scatter_size=10) mpu.legend() # mpu.show() ## # # @return single dict with ft_list, mech_pose_lists, hand_pose_lists # and ONE time_list def synchronize(ft_dict, mechanism_dict, hand_dict): ft_time_arr = np.array(ft_dict['time_list']) mech_time_arr = np.array(mechanism_dict['time_list']) hand_time_arr = np.array(hand_dict['time_list']) print 'ft_time_arr.shape:', ft_time_arr.shape print 'mech_time_arr.shape:', mech_time_arr.shape print 'hand_time_arr.shape:', hand_time_arr.shape start_time = max(ft_time_arr[0], mech_time_arr[0], hand_time_arr[0]) end_time = min(ft_time_arr[-1], mech_time_arr[-1], hand_time_arr[-1]) t1_arr = mech_time_arr[np.where(np.logical_and(mech_time_arr >= start_time, mech_time_arr <= end_time))] t2_arr = hand_time_arr[np.where(np.logical_and(hand_time_arr >= start_time, hand_time_arr <= end_time))] #time_arr = np.arange(start_time, end_time, 0.03) # 30ms n_times = min(len(t1_arr), len(t2_arr)) time_arr_list = [] i, j = 0, 0 while True: if t1_arr[i] == t2_arr[j]: time_arr_list.append(t1_arr[i]) i += 1 j += 1 elif t1_arr[i] > t2_arr[j]: j += 1 else: i += 1 if j == n_times or i == n_times: break time_arr = np.array(time_arr_list) tstep_size = .03333333333 uniform_time = np.cumsum(np.round((time_arr[1:] - time_arr[:-1]) / tstep_size) * tstep_size) uniform_time = np.concatenate((np.array([0]), uniform_time)) uniform_time = uniform_time + time_arr_list[0] time_arr = uniform_time # adding a 50ms bias. see modeling_forces/image_ft_sync_test ft_time_arr = ft_time_arr + 0.05 raw_ft_arr = np.array(ft_dict['ft_list']).T window_len = 3 sm_ft_l = [] for i in range(raw_ft_arr.shape[0]): s = mfs.smooth(raw_ft_arr[i,:], window_len,'blackman') sm_ft_l.append(s.tolist()) # smooth truncates the array if window_len != 1: ft_time_arr = ft_time_arr[window_len-1:-window_len+1] raw_ft_arr = (np.array(sm_ft_l).T).tolist() raw_mech_pos_arr = mechanism_dict['pos_list'] raw_mech_rot_arr = mechanism_dict['rot_list'] raw_hand_pos_arr = hand_dict['pos_list'] raw_hand_rot_arr = hand_dict['rot_list'] raw_arr_list = [raw_ft_arr, raw_mech_pos_arr, raw_mech_rot_arr, raw_hand_pos_arr, raw_hand_rot_arr] time_arr_list = [ft_time_arr, mech_time_arr, mech_time_arr, hand_time_arr, hand_time_arr] n_arr = len(raw_arr_list) ft_list = [] mech_pos_list, mech_rot_list = [], [] hand_pos_list, hand_rot_list = [], [] acc_list = [ft_list, mech_pos_list, mech_rot_list, hand_pos_list, hand_rot_list] key_list = ['ft_list', 'mech_pos_list', 'mech_rot_list', 'hand_pos_list', 'hand_rot_list'] for i in range(time_arr.shape[0]): t = time_arr[i] for j in range(n_arr): # nearest neighbor interpolation min_idx = np.argmin(np.abs(time_arr_list[j] - t)) acc_list[j].append(raw_arr_list[j][min_idx]) d = {} d['time_list'] = time_arr.tolist() for i in range(n_arr): d[key_list[i]] = acc_list[i] return d #--------------- functions that operate on combined pkl ---------------------- ## # transform forces to camera coord frame. # @param hand_rot_matrix - rotation matrix for camera to hand checker. # @param hand_pos_matrix - position of hand checkerboard in camera coord frame. # @param mech_pos_matrix - position of mechanism checkerboard in camera coord frame. # @param number - checkerboard number (1, 2, 3 or 4) def ft_to_camera(force_tool, hand_rot_matrix, hand_pos_matrix, mech_pos_matrix, number): # hc == hand checkerboard hc_rot_tool = tr.Rx(math.radians(90)) * tr.Ry(math.radians(180.)) * tr.Rz(math.radians(30.)) while number != 1: hc_rot_tool = tr.Ry(math.radians(90.)) * hc_rot_tool number = number-1 force_hc = hc_rot_tool * force_tool p_hc_ft = np.matrix([0.04, 0.01, 0.09]).T # vector from hook checkerboard origin to the base of the FT sensor in hook checker coordinates. # vec from FT sensor to mechanism checker origin in camera coordinates. p_ft_mech = -hand_pos_matrix + mech_pos_matrix - hand_rot_matrix * p_hc_ft force_cam = hand_rot_matrix * force_hc # force at hook base in camera coordinates moment_cam = hand_rot_matrix * moment_hc force_at_mech_origin = force_cam moment_at_mech_origin = moment_cam + np.matrix(np.cross(-p_ft_mech.A1, force_cam.A1)).T return hand_rot_matrix * force_hc ## # transform force to camera coord frame. def ft_to_camera_3(force_tool, moment_tool, hand_rot_matrix, number, return_moment_cam = False): # hc == hand checkerboard hc_rot_tool = tr.Rx(math.radians(90)) * tr.Ry(math.radians(180.)) * tr.Rz(math.radians(30.)) while number != 1: hc_rot_tool = tr.Ry(math.radians(90.)) * hc_rot_tool number = number-1 force_hc = hc_rot_tool * force_tool moment_hc = hc_rot_tool * moment_tool p_ft_hooktip = np.matrix([0.0, -0.08, 0.00]).T # vector from FT sensor to the tip of the hook in hook checker coordinates. # p_ft_hooktip = np.matrix([0.0, -0.08 - 0.034, 0.00]).T # vector from FT sensor to the tip of the hook in hook checker coordinates. p_ft_hooktip = hand_rot_matrix * p_ft_hooktip force_cam = hand_rot_matrix * force_hc # force at hook base in camera coordinates moment_cam = hand_rot_matrix * moment_hc force_at_hook_tip = force_cam moment_at_hook_tip = moment_cam + np.matrix(np.cross(-p_ft_hooktip.A1, force_cam.A1)).T # if np.linalg.norm(moment_at_hook_tip) > 0.7: # import pdb; pdb.set_trace() if return_moment_cam: return force_at_hook_tip, moment_at_hook_tip, moment_cam else: return force_at_hook_tip, moment_at_hook_tip def plot(combined_dict, savefig): plot_trajectories(combined_dict) # tup = ke.init_ros_node() # mech_rot_list = compute_mech_rot_list(combined_dict, tup) # combined_dict['mech_rot_list'] = mech_rot_list # plot_trajectories(combined_dict) cd = combined_dict ft_mat = np.matrix(cd['ft_list']).T force_mat = ft_mat[0:3, :] mpu.plot_yx(ut.norm(force_mat).A1, cd['time_list']) mpu.show() # plot_forces(combined_dict) # if savefig: # d3m.savefig(opt.dir+'/trajectory_check.png', size=(900, 800)) # else: # d3m.show() ## # @param pts - 3xN np matrix def project_points_plane(pts): # import mdp # p = mdp.nodes.PCANode(svd=True) # p.train((pts-np.mean(pts, 1)).T.A) # print 'min mdp:', p.get_projmatrix() # # U, s , _ = np.linalg.svd(np.cov(pts)) # print 'min svd:', U[:,2] eval, evec = np.linalg.eig(np.cov(pts)) min_idx = np.argmin(eval) min_evec = np.matrix(evec[:,min_idx]).T if min_evec[1,0] > 0: min_evec = min_evec * -1 print 'min evec:', min_evec pts_proj = pts - np.multiply((min_evec.T * pts), min_evec) return pts_proj, min_evec ## # use method 1 to compute the mechanism angle from combined dict. # method 1 - angle between the x axis of checkerboard coord frame. # @return list of mechanism angles. def compute_mech_angle_1(cd, axis_direc=None): mech_rot = cd['mech_rot_list'] directions_x = (np.row_stack(mech_rot)[:,0]).T.reshape(len(mech_rot), 3).T if axis_direc != None: directions_x = directions_x - np.multiply(axis_direc.T * directions_x, axis_direc) directions_x = directions_x/ut.norm(directions_x) start_normal = directions_x[:,0] mech_angle = np.arccos(start_normal.T * directions_x).A1.tolist() return mech_angle ## # use method 2 to compute the mechanism angle from combined dict. # method 2 - fit a circle to estimate location of axis of rotation and # radius. Then use that to compute the angle of the mechanism. # @return list of mechanism angles. def compute_mech_angle_2(cd, tup, project_plane=False): pos_mat = np.column_stack(cd['mech_pos_list']) if project_plane: pts_proj, min_evec = project_points_plane(pos_arr) pos_arr = pts_proj kin_dict = ke.fit(pos_mat, tup) center = np.matrix((kin_dict['cx'], kin_dict['cy'], kin_dict['cz'])).T directions_x = pos_mat - center directions_x = directions_x / ut.norm(directions_x) start_normal = directions_x[:,0] #mech_angle = np.arccos(start_normal.T * directions_x).A1.tolist() ct = (start_normal.T * directions_x).A1 st = ut.norm(np.matrix(np.cross(start_normal.A1, directions_x.T.A)).T).A1 mech_angle = np.arctan2(st, ct).tolist() return mech_angle def compute_mech_rot_list(cd, tup, project_plane=False): pos_arr = np.column_stack(cd['mech_pos_list']) rot_list = cd['mech_rot_list'] directions_y = (np.row_stack(rot_list)[:,1]).T.reshape(len(rot_list), 3).T start_y = directions_y[:,0] pts_proj, y_mech = project_points_plane(pos_arr) if np.dot(y_mech.T, start_y.A1) < 0: print 'Negative hai boss' y_mech = -1 * y_mech if project_plane: pos_arr = pts_proj kin_dict = ke.fit(np.matrix(pos_arr), tup) center = np.array((kin_dict['cx'], kin_dict['cy'], kin_dict['cz'])).T print 'pos_arr[:,0]', pos_arr[:,0] print 'center:', center directions_x = (np.row_stack(rot_list)[:,0]).T.reshape(len(rot_list), 3).T start_x = directions_x[:,0] directions_x = np.matrix(pos_arr) - np.matrix(center).T.A directions_x = directions_x / ut.norm(directions_x) if np.dot(directions_x[:,0].A1, start_x.A1) < 0: print 'Negative hai boss' directions_x = -1 * directions_x mech_rot_list = [] for i in range(len(rot_list)): x = -directions_x[:, i] y = np.matrix(y_mech) z = np.matrix(np.cross(x.A1, y.A1)).T rot_mat = np.column_stack((x, y, z)) mech_rot_list.append(rot_mat) # return mech_rot_list return rot_list ## # @param tup - if None then use method 1 else use method 2 to # compute mech angle. # @return 1d array (radial force), 1d array (tangential force), list of mechanism angles, type ('rotary' or 'prismatic') def compute_mechanism_properties(combined_dict, bias_ft = False, tup = None, cd_pkl_name = None): cd = combined_dict force_cam, moment_cam, _ = fts_to_camera(combined_dict) moment_contact_l = None if bias_ft: print 'Biasing magnitude:', np.linalg.norm(force_cam[:,0]) force_cam = force_cam - force_cam[:,0] moment_cam = moment_cam - moment_cam[:,0] if cd['radius'] != -1: if tup == None: mech_angle = compute_mech_angle_1(cd) else: mech_angle = compute_mech_angle_2(cd, tup) # compute new mech_rot_list. used for factoring the forces. mech_rot_list = compute_mech_rot_list(combined_dict, tup) combined_dict['mech_rot_list'] = mech_rot_list hook_tip_l = compute_hook_tip_trajectory(cd) hand_mat = np.column_stack(hook_tip_l) for i,f in enumerate(force_cam.T): fmag = np.linalg.norm(f) if fmag > 1.0: break end_idx = np.argmax(mech_angle) hand_mat_short = hand_mat[:,i:end_idx] kin_dict = ke.fit(hand_mat_short, tup) center_hand = np.matrix((kin_dict['cx'], kin_dict['cy'], kin_dict['cz'])).T radius_hand = kin_dict['r'] center_mech_coord = mech_rot_list[0].T * center_hand start_mech_coord = mech_rot_list[0].T * hand_mat_short[:,0] opens_right = False if start_mech_coord[0,0] < center_mech_coord[0,0]: print 'Opens Right' opens_right = True # radial vectors. radial_mat = hand_mat - center_hand radial_mat = radial_mat / ut.norm(radial_mat) _, nrm_hand = project_points_plane(hand_mat_short) if np.dot(nrm_hand.A1, mech_rot_list[0][:,1].A1) < 0: nrm_hand = -1 * nrm_hand if opens_right == False: nrm_hand = -1 * nrm_hand frad_l = [] ftan_l = [] moment_contact_l = [] for i, f in enumerate(force_cam.T): f = f.T m = (moment_cam[:,i].T * nrm_hand)[0,0] moment_contact_l.append(m) tvec = np.matrix(np.cross(nrm_hand.A1, radial_mat[:,i].A1)).T ftan = (f.T * tvec)[0,0] ftan_l.append(ftan) frad = np.linalg.norm(f - tvec * ftan) #frad = (f_cam.T*radial_mat[:,i])[0,0] frad_l.append(abs(frad)) typ = 'rotary' else: pos_mat = np.column_stack(cd['mech_pos_list']) mech_angle = ut.norm(pos_mat-pos_mat[:,0]).A1.tolist() #print 'mech_angle:', mech_angle typ = 'prismatic' moment_axis_list = None frad_l = [] ftan_l = [] moment_contact_l = [] rot_list = cd['mech_rot_list'] directions_z = (np.row_stack(rot_list)[:,2]).T.reshape(len(rot_list), 3).T for i, f in enumerate(force_cam.T): f = f.T tvec = np.matrix(directions_z[:,i]) ftan = (f.T * tvec)[0,0] ftan_l.append(ftan) frad = np.linalg.norm(f - tvec * ftan) #frad = (f_cam.T*radial_mat[:,i])[0,0] frad_l.append(abs(frad)) radius_hand = 10. ut.save_pickle(combined_dict, cd_pkl_name) return np.array(frad_l), np.array(ftan_l), mech_angle, typ, \ np.array(ftan_l)*radius_hand, np.array(moment_contact_l) def plot_radial_tangential(mech_dict, savefig, fig_name=''): radial_mech = mech_dict['force_rad_list'] tangential_mech = mech_dict['force_tan_list'] typ = mech_dict['mech_type'] mech_x = mech_dict['mechanism_x'] if typ == 'rotary': mech_x_degrees = np.degrees(mech_x) xlabel = 'angle (degrees)' else: mech_x_degrees = mech_x xlabel = 'distance (meters)' mpu.pl.clf() mpu.plot_yx(radial_mech, mech_x_degrees, axis=None, label='radial force', xlabel=xlabel, ylabel='N', color='r') mpu.plot_yx(tangential_mech, mech_x_degrees, axis=None, label='tangential force', xlabel=xlabel, ylabel='N', color='g') mpu.legend() if typ == 'rotary': mpu.figure() rad = mech_dict['radius'] torques_1 = rad * np.array(tangential_mech) torques_3 = np.array(mech_dict['moment_tip_list']) + torques_1 mpu.plot_yx(torques_1, mech_x_degrees, axis=None, label='torque from tangential', xlabel=xlabel, ylabel='moment', color='r') mpu.plot_yx(torques_3, mech_x_degrees, axis=None, label='total torque', xlabel=xlabel, ylabel='moment', color='y') mpu.legend() if savefig: mpu.savefig(opt.dir+'/%s_force_components.png'%fig_name) else: mpu.show() ## # returns force and moment at the tip of the hook in camera # coordinates. def fts_to_camera(combined_dict): cd = combined_dict number = cd['hook_checker_number'] hand_rot = cd['hand_rot_list'] hand_pos = cd['hand_pos_list'] ft_mat = np.matrix(cd['ft_list']).T # 6xN np matrix force_mat = ft_mat[0:3, :] moment_mat = ft_mat[3:6, :] n_forces = force_mat.shape[1] force_cam_list = [] moment_cam_list = [] moment_base_list = [] for i in range(n_forces): f,m,m_base = ft_to_camera_3(force_mat[:,i], moment_mat[:,i], hand_rot[i], number, return_moment_cam = True) force_cam_list.append(f) moment_cam_list.append(m) moment_base_list.append(m_base) force_cam = np.column_stack(force_cam_list) moment_cam = np.column_stack(moment_cam_list) moment_base = np.column_stack(moment_base_list) return force_cam, moment_cam, moment_base def plot_forces(combined_dict): cd = combined_dict hand_mat = np.column_stack(cd['hand_pos_list']) hand_rot = cd['hand_rot_list'] mech_mat = np.column_stack(cd['mech_pos_list']) mech_rot = cd['mech_rot_list'] directions_x = (np.row_stack(mech_rot)[:,0]).T.reshape(len(mech_rot), 3).T force_cam, moment_cam, _ = fts_to_camera(combined_dict) d3m.plot_points(hand_mat, color = (1.,0.,0.), mode='sphere') d3m.plot_points(mech_mat, color = (0.,0.,1.), mode='sphere') d3m.plot_normals(mech_mat, directions_x, color=(1.,0,0.)) # d3m.plot_normals(mech_mat, force_mat, color=(0.,1,0.)) d3m.plot_normals(mech_mat, force_cam, color=(0.,0,1.)) def plot_trajectories(combined_dict): cd = combined_dict hand_mat = np.column_stack(cd['hand_pos_list']) hand_rot = cd['hand_rot_list'] directions_x = (np.row_stack(hand_rot)[:,0]).T.reshape(len(hand_rot), 3).T directions_y = (np.row_stack(hand_rot)[:,1]).T.reshape(len(hand_rot), 3).T directions_z = (np.row_stack(hand_rot)[:,2]).T.reshape(len(hand_rot), 3).T #d3m.white_bg() d3m.plot_points(hand_mat, color = (1.,0.,0.), mode='sphere', scale_factor = 0.005) d3m.plot_normals(hand_mat, directions_x, color=(1.,0,0.), scale_factor = 0.02) d3m.plot_normals(hand_mat, directions_y, color=(0.,1,0.), scale_factor = 0.02) d3m.plot_normals(hand_mat, directions_z, color=(0.,0,1.), scale_factor = 0.02) mech_mat = np.column_stack(cd['mech_pos_list']) mech_rot = cd['mech_rot_list'] directions_x = (np.row_stack(mech_rot)[:,0]).T.reshape(len(mech_rot), 3).T directions_y = (np.row_stack(mech_rot)[:,1]).T.reshape(len(hand_rot), 3).T directions_z = (np.row_stack(mech_rot)[:,2]).T.reshape(len(mech_rot), 3).T d3m.plot_points(mech_mat[:,0:1], color = (0.,0.,0.), mode='sphere', scale_factor = 0.01) d3m.plot_points(mech_mat, color = (0.,0.,1.), mode='sphere', scale_factor = 0.005) d3m.plot_normals(mech_mat, directions_x, color=(1.,0,0.), scale_factor = 0.02) d3m.plot_normals(mech_mat, directions_y, color=(0.,1,0.), scale_factor = 0.02) d3m.plot_normals(mech_mat, directions_z, color=(0.,0,1.), scale_factor = 0.02) m = np.mean(mech_mat, 1) d3m.mlab.view(azimuth=-120, elevation=60, distance=1.60, focalpoint=(m[0,0], m[1,0], m[2,0])) ## # @return list of hook tip coodinates in camera coordinate frame. def compute_hook_tip_trajectory(combined_dict): cd = combined_dict hand_mat = np.column_stack(cd['hand_pos_list']) hand_rot_l = cd['hand_rot_list'] directions_x = (np.row_stack(hand_rot_l)[:,0]).T.reshape(len(hand_rot_l), 3).T directions_y = (np.row_stack(hand_rot_l)[:,1]).T.reshape(len(hand_rot_l), 3).T directions_z = (np.row_stack(hand_rot_l)[:,2]).T.reshape(len(hand_rot_l), 3).T hand_pos_list = cd['hand_pos_list'] hook_tip_l = [] for i,p in enumerate(hand_pos_list): # p - hook checker origin in camera coordinates. hc_P_hc_hooktip = np.matrix([0.035, -0.0864, 0.09]).T # vector from hook checkerboard origin to the tip of the hook in hook checker coordinates. cam_P_hc_hooktip = hand_rot_l[i] * hc_P_hc_hooktip hook_tip_l.append(p + cam_P_hc_hooktip) return hook_tip_l ## # take the open + close trajectory and split it into two separate # trajectories and save them as pkls. def split_open_close(rad, tan, ang, typ, mech_radius, time_list, moment_axis, moment_tip): ang = np.array(ang) incr = ang[1:] - ang[:-1] n_pts = ang.shape[0] - 2 #ignoring first and last readings. rad_l, tan_l, ang_l = [], [], [] for i in range(n_pts): if typ == 'rotary': sgn = incr[i] * incr[i+1] mag = abs(incr[i] - incr[i+1]) if sgn < 0 and mag > math.radians(10): continue rad_l.append(rad[i+1]) tan_l.append(tan[i+1]) ang_l.append(ang[i+1]) else: # no cleanup for prismatic joints, for now rad_l.append(rad[i+1]) tan_l.append(tan[i+1]) ang_l.append(ang[i+1]) rad, tan, ang = rad_l, tan_l, ang_l max_idx = np.argmax(ang) d_open = {'force_rad_list': rad[:max_idx+1], 'force_tan_list': tan[:max_idx+1], 'mechanism_x': ang[:max_idx+1], 'mech_type': typ, 'radius': mech_radius, 'time_list': time_list[:max_idx+1]} if moment_tip != None: d_open['moment_tip_list'] = moment_tip[:max_idx+1] d_open['moment_list'] = moment_axis[:max_idx+1] ut.save_pickle(d_open, opt.dir + '/open_mechanism_trajectories_handhook.pkl') d_close = {'force_rad_list': rad[max_idx+1:], 'force_tan_list': tan[max_idx+1:], 'mechanism_x': ang[max_idx+1:], 'mech_type': typ, 'radius': mech_radius, 'time_list': time_list[max_idx+1:]} if moment_tip != None: d_open['moment_tip_list'] = moment_tip[max_idx+1:] d_open['moment_list'] = moment_axis[max_idx+1:] ut.save_pickle(d_close, opt.dir + '/close_mechanism_trajectories_handhook.pkl') def plot_hooktip_trajectory_and_force(cd): hook_tip_l = compute_hook_tip_trajectory(cd) # plot trajectory in 3D. d3m.white_bg() d3m.plot_points(np.column_stack(hook_tip_l), color = (1.,0.,0.), mode='sphere', scale_factor = 0.005) # d3m.plot_points(mech_proj[:,0:1], color = (0.,0.,0.), mode='sphere', # scale_factor = 0.01) # d3m.plot_points(mech_proj, color = (0.,0.,1.), mode='sphere', # scale_factor = 0.005) # d3m.plot(np.column_stack((mech_proj[:,-1],center_mech, mech_proj[:,0])), # color = (0.,0.,1.)) # d3m.plot(np.column_stack((hand_proj[:,-1],center_hand, hand_proj[:,0])), # color = (1.,0.,0.)) d3m.show() ## # sanity check - fitting circle to mechanism and hook tip # trajectories, computing the angle between the initial radial # direction of the mechanism and the radial directions for the hook # tip. This angle starts out at a slightly positive angle. I'm # assuming that this corresponds to the fact that the handle sticks # out from the cabinet door. What makes me nervous is that I am still # fitting two different circles to the mechanism and hook # trajectories. def compare_tip_mechanism_trajectories(mech_mat, hand_mat): # hand_proj, nrm_hand = project_points_plane(hand_mat) # mech_proj, nrm_mech = project_points_plane(mech_mat) hand_proj = hand_mat mech_proj = mech_mat kin_dict = ke.fit(hand_proj, tup) print 'kin_dict from hook tip:', kin_dict print 'measured radius:', cd['radius'] center_hand = np.matrix((kin_dict['cx'], kin_dict['cy'], kin_dict['cz'])).T kin_dict = ke.fit(mech_proj, tup) print 'kin_dict from mechanism:', kin_dict center_mech = np.matrix((kin_dict['cx'], kin_dict['cy'], kin_dict['cz'])).T # working with the projected coordinates. directions_hand = hand_proj - center_hand directions_hand = directions_hand / ut.norm(directions_hand) directions_mech = mech_proj - center_mech directions_mech = directions_mech / ut.norm(directions_mech) start_normal = directions_mech[:,0] print 'directions_mech[:,0]', directions_mech[:,0].A1 print 'directions_hand[:,0]', directions_hand[:,0].A1 ct = (start_normal.T * directions_hand).A1 st = ut.norm(np.matrix(np.cross(start_normal.A1, directions_hand.T.A)).T).A1 mech_angle = np.arctan2(st, ct).tolist() #mech_angle = np.arccos(start_normal.T * directions_hand).A1.tolist() mpu.plot_yx(np.degrees(mech_angle)) mpu.show() # plot trajectory in 3D. d3m.white_bg() d3m.plot_points(hand_proj, color = (1.,0.,0.), mode='sphere', scale_factor = 0.005) d3m.plot_points(mech_proj[:,0:1], color = (0.,0.,0.), mode='sphere', scale_factor = 0.01) d3m.plot_points(mech_proj, color = (0.,0.,1.), mode='sphere', scale_factor = 0.005) d3m.plot(np.column_stack((mech_proj[:,-1],center_mech, mech_proj[:,0])), color = (0.,0.,1.)) d3m.plot(np.column_stack((hand_proj[:,-1],center_hand, hand_proj[:,0])), color = (1.,0.,0.)) d3m.show() def angle_between_hooktip_mechanism_radial_vectors(mech_mat, hand_mat): kin_dict = ke.fit(hand_mat, tup) print 'kin_dict from hook tip:', kin_dict print 'measured radius:', cd['radius'] center_hand = np.matrix((kin_dict['cx'], kin_dict['cy'], kin_dict['cz'])).T kin_dict = ke.fit(mech_mat, tup) print 'kin_dict from mechanism:', kin_dict center_mech = np.matrix((kin_dict['cx'], kin_dict['cy'], kin_dict['cz'])).T # working with the projected coordinates. directions_hand = hand_mat - center_hand directions_hand = directions_hand / ut.norm(directions_hand) directions_mech = mech_mat - center_mech directions_mech = directions_mech / ut.norm(directions_mech) #import pdb; pdb.set_trace() ang = np.degrees(np.arccos(np.sum(np.multiply(directions_mech, directions_hand), 0))).A1 mpu.plot_yx(ang, label = 'angle between hooktip-radial and mechanism radial') mpu.legend() mpu.show() def split_forces_hooktip_test(hand_mat): kin_dict = ke.fit(hand_mat, tup) center_hand = np.matrix((kin_dict['cx'], kin_dict['cy'], kin_dict['cz'])).T print 'kin_dict:', kin_dict # radial vectors. radial_mat = hand_mat - center_hand radial_mat = radial_mat / ut.norm(radial_mat) # cannot use hook tip to compute mechanism angle because I # don't have a way of knowing when the hook starts opening the # mechanism. (Think hook makes contact with door, moves in # freespace and then makes contact with the handle.) #start_rad = radial_mat[:,0] #ct = (start_rad.T * radial_mat).A1 #st = ut.norm(np.matrix(np.cross(start_rad.A1, radial_mat.T.A)).T).A1 #mech_angle_l = np.arctan2(st, ct).tolist() _, nrm_hand = project_points_plane(hand_mat) print 'nrm_hand:', nrm_hand.A1 f_cam_l = [] m_cam_l = [] m_base_l = [] frad_l = [] ftan_l = [] hook_num = cd['hook_checker_number'] print 'hook_num:', hook_num for i, f in enumerate(force_mat.T): f = f.T m = moment_mat[:,i] f_cam, m_cam, m_base = ft_to_camera_3(f, m, hook_rot_l[i], hook_num, return_moment_cam = True) f_cam_l.append(f_cam) m_cam_l.append(abs((m_cam.T*nrm_hand)[0,0])) m_base_l.append(abs((m_base.T*nrm_hand)[0,0])) #m_base_l.append(np.linalg.norm(f)) tangential_vec = np.matrix(np.cross(radial_mat[:,i].A1, nrm_hand.A1)).T ftan = (f_cam.T * tangential_vec)[0,0] ftan_l.append(ftan) #frad = np.linalg.norm(f_cam - tangential_vec * ftan) frad = (f_cam.T*radial_mat[:,i])[0,0] frad_l.append(abs(frad)) fig1 = mpu.figure() mech_ang_deg = np.degrees(mech_angle_l) mpu.plot_yx(ftan_l, mech_ang_deg, label='Tangential Force (hook tip)', color='b') mpu.plot_yx(frad_l, mech_ang_deg, label='Radial Force (hook tip)', color='y') mech_pkl_name = glob.glob(opt.dir + '/open_mechanism_trajectories_*.pkl')[0] md = ut.load_pickle(mech_pkl_name) radial_mech = md['force_rad_list'] tangential_mech = md['force_tan_list'] mech_x = np.degrees(md['mechanism_x']) mpu.plot_yx(tangential_mech, mech_x, label='Tangential Force (mechanism checker)', color='g') mpu.plot_yx(radial_mech, mech_x, label='Radial Force (mechanism checker)', color='r') mpu.legend() fig2 = mpu.figure() mpu.plot_yx(m_cam_l, mech_ang_deg, label='\huge{$m_{axis}$}') mpu.plot_yx(m_base_l, mech_ang_deg, label='\huge{$m^s$}', color = 'r') mpu.legend() mpu.show() if __name__ == '__main__': import optparse p = optparse.OptionParser() p.add_option('-d', '--dir', action='store', default='', type='string', dest='dir', help='directory with logged data') p.add_option('-t', '--time_check', action='store_true', dest='tc', help='plot to check the consistency of time stamps') p.add_option('-s', '--sync', action='store_true', dest='sync', help='time synchronize poses, forces etc.') p.add_option('--split', action='store_true', dest='split_forces', help='split forces into radial and tangential and save in a pickle') p.add_option('--savefig', action='store_true', dest='savefig', help='save the plot instead of showing it.') p.add_option('-c', '--cd', action='store_true', dest='cd', help='work with the combined dict') p.add_option('-f', '--force', action='store_true', dest='force', help='plot radial and tangential force') p.add_option('--mech_prop_ros', action='store_true', dest='mech_prop_ros', help='plot radial and tangential force') p.add_option('--moment_test', action='store_true', dest='moment_test', help='trying to compute moment about the joint axis.') p.add_option('--hook_tip_test', action='store_true', dest='hook_tip_test', help='plot trajectory of hook tip for debugging etc.') opt, args = p.parse_args() if opt.dir == '': raise RuntimeError('Need a directory to work with (-d or --dir)') if opt.force: mech_pkl_name = glob.glob(opt.dir + '/open_mechanism_trajectories_*.pkl')[0] md = ut.load_pickle(mech_pkl_name) plot_radial_tangential(md, opt.savefig, 'open') # mech_pkl_name = glob.glob(opt.dir + '/close_mechanism_trajectories_handhook.pkl')[0] # md = ut.load_pickle(mech_pkl_name) # plot_radial_tangential(md, opt.savefig, 'close') ft_pkl = glob.glob(opt.dir + '/ft_log*.pkl')[0] poses_pkl = glob.glob(opt.dir + '/poses_dict*.pkl')[0] ft_dict = ut.load_pickle(ft_pkl) poses_dict = ut.load_pickle(poses_pkl) mechanism_dict = poses_dict['mechanism'] hand_dict = poses_dict['hand'] ft_time_list = ft_dict['time_list'] mechanism_time_list = mechanism_dict['time_list'] hand_time_list = hand_dict['time_list'] if opt.tc: check_time_sync(ft_time_list, mechanism_time_list, hand_time_list) if opt.savefig: mpu.savefig(opt.dir+'/time_check.png') else: mpu.show() if opt.sync: print 'Begin synchronize' d = synchronize(ft_dict, mechanism_dict, hand_dict) print 'End synchronize' #ut.save_pickle(d, opt.dir+'/combined_log'+ut.formatted_time()+'.pkl') ut.save_pickle(d, opt.dir+'/combined_log.pkl') print 'Saved pickle' if opt.cd: cd = ut.load_pickle(glob.glob(opt.dir + '/combined_log*.pkl')[0]) plot(cd, opt.savefig) if opt.mech_prop_ros: import mechanism_analyse as ma cd = ut.load_pickle(glob.glob(opt.dir + '/combined_log*.pkl')[0]) tup = ke.init_ros_node() ma2 = compute_mech_angle_2(cd, tup, project_plane=False) ma1 = compute_mech_angle_1(cd) ma3 = compute_mech_angle_2(cd, tup, project_plane=True) # ma4 = compute_mech_angle_1(cd, min_evec) lab1 = 'orientation only' lab2 = 'checker origin position + circle fit' lab3 = 'checker origin position + PCA projection + circle fit' # lab4 = 'PCA projection + orientation' mpu.figure() mpu.plot_yx(np.degrees(ma3), color='r', label=lab3, linewidth = 1, scatter_size = 5) mpu.plot_yx(np.degrees(ma2), color='b', label=lab2, linewidth = 1, scatter_size = 5) mpu.plot_yx(np.degrees(ma1), color='y', label=lab1, linewidth = 1, scatter_size = 5) mpu.legend() vel3 = ma.compute_velocity(ma3, cd['time_list'], 1) vel2 = ma.compute_velocity(ma2, cd['time_list'], 1) vel1 = ma.compute_velocity(ma1, cd['time_list'], 1) mpu.figure() mpu.plot_yx(np.degrees(vel3), np.degrees(ma3), color='r', label=lab3, linewidth = 1, scatter_size = 5) mpu.plot_yx(np.degrees(vel2), np.degrees(ma2), color='b', label=lab2, linewidth = 1, scatter_size = 5) mpu.plot_yx(np.degrees(vel1), np.degrees(ma1), color='y', label=lab1, linewidth = 1, scatter_size = 5) mpu.legend() # acc3 = ma.compute_velocity(vel3, cd['time_list'], 1) # mpu.figure() # mpu.plot_yx(np.degrees(acc3), np.degrees(ma3), color='r', # label=lab3, linewidth = 1, scatter_size = 5) # mpu.legend() mpu.show() if opt.split_forces: tup = ke.init_ros_node() pkl_name = glob.glob(opt.dir + '/combined_log*.pkl')[0] mech_pkl_name = glob.glob(opt.dir + '/mechanism_info*.pkl')[0] md = ut.load_pickle(mech_pkl_name) cd = ut.load_pickle(pkl_name) cd['hook_checker_number'] = md['checkerboard_number'] cd['radius'] = md['radius'] rad, tan, ang, typ, moment_axis, moment_tip = compute_mechanism_properties(cd, bias_ft=True, tup=tup, cd_pkl_name = pkl_name) split_open_close(rad, tan, ang, typ, md['radius'], cd['time_list'], moment_axis, moment_tip) if opt.moment_test: tup = ke.init_ros_node() pkl_name = glob.glob(opt.dir + '/combined_log*.pkl')[0] mech_pkl_name = glob.glob(opt.dir + '/mechanism_info*.pkl')[0] md = ut.load_pickle(mech_pkl_name) cd = ut.load_pickle(pkl_name) cd['hook_checker_number'] = md['checkerboard_number'] cd['radius'] = md['radius'] rad, tan, ang, typ, moment_axis, moment_tip = compute_mechanism_properties(cd, bias_ft=True, tup=tup, cd_pkl_name = pkl_name) ang = np.array(ang) incr = ang[1:] - ang[:-1] n_pts = ang.shape[0] - 2 #ignoring first and last readings. rad_l, tan_l, ang_l = [], [], [] for i in range(n_pts): if typ == 'rotary': sgn = incr[i] * incr[i+1] mag = abs(incr[i] - incr[i+1]) if sgn < 0 and mag > math.radians(10): continue rad_l.append(rad[i+1]) tan_l.append(tan[i+1]) ang_l.append(ang[i+1]) else: # no cleanup for prismatic joints, for now rad_l.append(rad[i+1]) tan_l.append(tan[i+1]) ang_l.append(ang[i+1]) rad, tan, ang = rad_l, tan_l, ang_l max_idx = np.argmax(ang) rad = np.array(rad[:max_idx+1]) tan = np.array(tan[:max_idx+1]) ang = np.array(ang[:max_idx+1]) moment_axis = np.array(moment_axis[:max_idx+1]) moment_tip = np.array(moment_tip[:max_idx+1]) fig1 = mpu.figure() mpu.plot_yx(tan * cd['radius'], np.degrees(ang), label = 'Moment from Tangential Force', color = 'b') mpu.plot_yx(moment_axis, np.degrees(ang), label = 'Computed Moment', color = 'g') mpu.plot_yx(moment_tip, np.degrees(ang), label = 'Computed Moment using tip model', color = 'y') mpu.legend() mpu.show() if opt.hook_tip_test: tup = ke.init_ros_node() pkl_name = glob.glob(opt.dir + '/combined_log*.pkl')[0] mech_pkl_name = glob.glob(opt.dir + '/mechanism_info*.pkl')[0] md = ut.load_pickle(mech_pkl_name) cd = ut.load_pickle(pkl_name) cd['hook_checker_number'] = md['checkerboard_number'] cd['radius'] = md['radius'] hook_tip_l = compute_hook_tip_trajectory(cd) hook_rot_l = cd['hand_rot_list'] mech_mat = np.column_stack(cd['mech_pos_list']) hand_mat = np.column_stack(hook_tip_l) ft_mat = np.matrix(cd['ft_list']).T # 6xN np matrix force_mat = ft_mat[0:3, :] # force_mat = force_mat - force_mat[:,0] moment_mat = ft_mat[3:6, :] # moment_mat = moment_mat - moment_mat[:,0] for i,f in enumerate(force_mat.T): fmag = np.linalg.norm(f) if fmag > 1.0: print 'i:', i break mech_angle_l = compute_mech_angle_2(cd, tup, project_plane=False) end_idx = np.argmax(mech_angle_l) hand_mat = hand_mat[:,i:end_idx] mech_mat = mech_mat[:,i:end_idx] force_mat = force_mat[:,i:end_idx] moment_mat = moment_mat[:,i:end_idx] hook_rot_l = hook_rot_l[i:end_idx] mech_angle_l = mech_angle_l[i:end_idx] compare_tip_mechanism_trajectories(mech_mat[:,i:], hand_mat[:,i:]) #angle_between_hooktip_mechanism_radial_vectors(mech_mat, hand_mat) #plot moment at hook ti and base. #split_forces_hooktip_test(hand_mat)
ajibawa-2023/Python-Code-Large/train/row_99535
599
994
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Import_L2_C0", "label": "roslib import roslib", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.002, 0.001, 0, 0.66, 0.0, 796, 0, 1, 0, 0, 796, 0, 0], "semantic": {"name": "roslib", "arg_names": [], "import_names": ["roslib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('modeling_forces')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L2_C15", "label": "load_manifest()", "type": "expression", "loc": [2, 2], "level": 0, "parent": null, "vector": [8, 0, 0.002, 0.001, 0, 0.66, 0.0312, 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('modeling_forces')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Import_L3_C0", "label": "rospy import rospy", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.003, 0.001, 0, 0.66, 0.0625, 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_99535:Import_L5_C0", "label": "hrl_lib.util import ut", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.005, 0.001, 0, 0.66, 0.0938, 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_99535:Import_L6_C0", "label": "hrl_lib.transforms import tr", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.006, 0.001, 0, 0.66, 0.125, 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_99535:Import_L7_C0", "label": "matplotlib_util.util import mpu", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.007, 0.001, 0, 0.66, 0.1562, 781, 0, 1, 0, 0, 781, 0, 0], "semantic": {"name": "matplotlib_util.util", "arg_names": [], "import_names": ["mpu"], "rhs_call_name": "", "annotation": ""}, "snippet": "import matplotlib_util.util as mpu"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Import_L8_C0", "label": "hrl_tilting_hokuyo.display_3d_mayavi import d3m", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.008, 0.001, 0, 0.66, 0.1875, 181, 0, 1, 0, 0, 181, 0, 0], "semantic": {"name": "hrl_tilting_hokuyo.display_3d_mayavi", "arg_names": [], "import_names": ["d3m"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_tilting_hokuyo.display_3d_mayavi as d3m"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Import_L10_C0", "label": "modeling_forces.smooth import mfs", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.0101, 0.001, 0, 0.66, 0.2188, 966, 0, 1, 0, 0, 966, 0, 0], "semantic": {"name": "modeling_forces.smooth", "arg_names": [], "import_names": ["mfs"], "rhs_call_name": "", "annotation": ""}, "snippet": "import modeling_forces.smooth as mfs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Import_L11_C0", "label": "kinematics_estimation import ke", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.0111, 0.001, 0, 0.66, 0.25, 240, 0, 1, 0, 0, 240, 0, 0], "semantic": {"name": "kinematics_estimation", "arg_names": [], "import_names": ["ke"], "rhs_call_name": "", "annotation": ""}, "snippet": "import kinematics_estimation as ke"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Import_L13_C0", "label": "glob import glob", "type": "import", "loc": [13, 13], "level": 0, "parent": null, "vector": [1, 0, 0.0131, 0.001, 0, 0.66, 0.2812, 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_99535:Import_L14_C0", "label": "math import math, np", "type": "import", "loc": [14, 14], "level": 0, "parent": null, "vector": [1, 0, 0.0141, 0.001, 0, 0.66, 0.3125, 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_99535:Import_L15_C0", "label": "sys import sys", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.0151, 0.001, 0, 0.66, 0.3438, 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_99535:FunctionDef_L21_C0", "label": "check_time_sync", "type": "function", "loc": [21, 31], "level": 0, "parent": null, "vector": [2, 0, 0.0262, 0.0111, 0, 0.66, 0.375, 181, 0, 3, 0, 0, 0, 0, 13], "semantic": {"name": "check_time_sync", "arg_names": ["ft_time_list", "mechanism_time_list", "hand_time_list"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def check_time_sync(ft_time_list, mechanism_time_list, hand_time_list):\n mpu.plot_yx(np.zeros(len(ft_time_list))+1, ft_time_list,\n color = mpu.random_color(), label='ft\\_time\\_list',\n axis=None, linewidth=0.5, scatter_size=10)\n mpu.plot_yx(np.zeros(len(mechanism_time_list))+2, mechanism_time_list,\n color = mpu.random_color(), label='mechanism\\_time\\_list',\n axis=None, linewidth=0.5, scatter_size=10)\n mpu.plot_yx(np.zeros(len(hand_time_list))+3, hand_time_list,"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L22_C4", "label": "plot_yx()", "type": "expression", "loc": [22, 24], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L21_C0", "vector": [8, 1, 0.0231, 0.003, 1, 0.07, 0.0, 112, 3, 7, 0, 0, 0, 0, 4], "semantic": {"name": "plot_yx", "arg_names": [], "import_names": [], "rhs_call_name": "plot_yx", "annotation": ""}, "snippet": " mpu.plot_yx(np.zeros(len(ft_time_list))+1, ft_time_list,\n color = mpu.random_color(), label='ft\\_time\\_list',\n axis=None, linewidth=0.5, scatter_size=10)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L25_C4", "label": "plot_yx()", "type": "expression", "loc": [25, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L21_C0", "vector": [8, 1, 0.0262, 0.003, 1, 0.07, 0.3333, 112, 3, 7, 0, 0, 0, 0, 4], "semantic": {"name": "plot_yx", "arg_names": [], "import_names": [], "rhs_call_name": "plot_yx", "annotation": ""}, "snippet": " mpu.plot_yx(np.zeros(len(mechanism_time_list))+2, mechanism_time_list,\n color = mpu.random_color(), label='mechanism\\_time\\_list',\n axis=None, linewidth=0.5, scatter_size=10)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L28_C4", "label": "plot_yx()", "type": "expression", "loc": [28, 30], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L21_C0", "vector": [8, 1, 0.0292, 0.003, 1, 0.07, 0.6667, 112, 3, 7, 0, 0, 0, 0, 4], "semantic": {"name": "plot_yx", "arg_names": [], "import_names": [], "rhs_call_name": "plot_yx", "annotation": ""}, "snippet": " mpu.plot_yx(np.zeros(len(hand_time_list))+3, hand_time_list,\n color = mpu.random_color(), label='hand\\_time\\_list',\n axis=None, linewidth=0.5, scatter_size=10)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L31_C4", "label": "legend()", "type": "expression", "loc": [31, 31], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L21_C0", "vector": [8, 1, 0.0312, 0.001, 1, 0.07, 1.0, 880, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "legend", "arg_names": [], "import_names": [], "rhs_call_name": "legend", "annotation": ""}, "snippet": " mpu.legend()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L39_C0", "label": "synchronize", "type": "function", "loc": [39, 126], "level": 0, "parent": null, "vector": [2, 0, 0.083, 0.0885, 0, 0.66, 0.4062, 267, 0, 3, 1, 0, 0, 0, 36], "semantic": {"name": "synchronize", "arg_names": ["ft_dict", "mechanism_dict", "hand_dict"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def synchronize(ft_dict, mechanism_dict, hand_dict):\n ft_time_arr = np.array(ft_dict['time_list'])\n mech_time_arr = np.array(mechanism_dict['time_list'])\n hand_time_arr = np.array(hand_dict['time_list'])\n \n print('ft_time_arr.shape:', ft_time_arr.shape)\n print('mech_time_arr.shape:', mech_time_arr.shape)\n print('hand_time_arr.shape:', hand_time_arr.shape)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L40_C4", "label": "ft_time_arr = array()", "type": "assigned_variable", "loc": [40, 40], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L39_C0", "vector": [14, 1, 0.0402, 0.001, 1, 0.75, 0.0, 736, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "ft_time_arr", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " ft_time_arr = np.array(ft_dict['time_list'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L41_C4", "label": "mech_time_arr = array()", "type": "assigned_variable", "loc": [41, 41], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L39_C0", "vector": [14, 1, 0.0412, 0.001, 1, 0.75, 0.0233, 524, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "mech_time_arr", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " mech_time_arr = np.array(mechanism_dict['time_list'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L42_C4", "label": "hand_time_arr = array()", "type": "assigned_variable", "loc": [42, 42], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L39_C0", "vector": [14, 1, 0.0423, 0.001, 1, 0.75, 0.0465, 359, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "hand_time_arr", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " hand_time_arr = np.array(hand_dict['time_list'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L44_C4", "label": "print()", "type": "expression", "loc": [44, 44], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L39_C0", "vector": [8, 1, 0.0443, 0.001, 1, 0.75, 0.0698, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('ft_time_arr.shape:', ft_time_arr.shape)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L45_C4", "label": "print()", "type": "expression", "loc": [45, 45], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L39_C0", "vector": [8, 1, 0.0453, 0.001, 1, 0.75, 0.093, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('mech_time_arr.shape:', mech_time_arr.shape)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L46_C4", "label": "print()", "type": "expression", "loc": [46, 46], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L39_C0", "vector": [8, 1, 0.0463, 0.001, 1, 0.75, 0.1163, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('hand_time_arr.shape:', hand_time_arr.shape)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L48_C4", "label": "start_time = max()", "type": "assigned_variable", "loc": [48, 49], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L39_C0", "vector": [14, 1, 0.0488, 0.002, 1, 0.75, 0.1395, 511, 3, 3, 0, 0, 442, 10, 1], "semantic": {"name": "start_time", "arg_names": [], "import_names": [], "rhs_call_name": "max", "annotation": ""}, "snippet": " start_time = max(ft_time_arr[0], mech_time_arr[0],\n hand_time_arr[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L50_C4", "label": "end_time = min()", "type": "assigned_variable", "loc": [50, 51], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L39_C0", "vector": [14, 1, 0.0508, 0.002, 1, 0.75, 0.1628, 483, 3, 3, 0, 0, 867, 10, 1], "semantic": {"name": "end_time", "arg_names": [], "import_names": [], "rhs_call_name": "min", "annotation": ""}, "snippet": " end_time = min(ft_time_arr[-1], mech_time_arr[-1],\n hand_time_arr[-1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L53_C4", "label": "t1_arr =", "type": "assigned_variable", "loc": [53, 54], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L39_C0", "vector": [14, 1, 0.0538, 0.002, 1, 0.75, 0.186, 52, 6, 0, 0, 0, 0, 0, 2], "semantic": {"name": "t1_arr", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " t1_arr = mech_time_arr[np.where(np.logical_and(mech_time_arr >= start_time,\n mech_time_arr <= end_time))]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L55_C4", "label": "t2_arr =", "type": "assigned_variable", "loc": [55, 56], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L39_C0", "vector": [14, 1, 0.0558, 0.002, 1, 0.75, 0.2093, 40, 6, 0, 0, 0, 0, 0, 2], "semantic": {"name": "t2_arr", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " t2_arr = hand_time_arr[np.where(np.logical_and(hand_time_arr >= start_time,\n hand_time_arr <= end_time))]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L59_C4", "label": "n_times = min()", "type": "assigned_variable", "loc": [59, 59], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L39_C0", "vector": [14, 1, 0.0594, 0.001, 1, 0.75, 0.2326, 104, 3, 2, 0, 0, 867, 10, 3], "semantic": {"name": "n_times", "arg_names": [], "import_names": [], "rhs_call_name": "min", "annotation": ""}, "snippet": " n_times = min(len(t1_arr), len(t2_arr))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L60_C4", "label": "time_arr_list =", "type": "assigned_variable", "loc": [60, 60], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L39_C0", "vector": [14, 1, 0.0604, 0.001, 1, 0.75, 0.2558, 126, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "time_arr_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " time_arr_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L61_C4", "label": "i, j =", "type": "assigned_variable", "loc": [61, 61], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L39_C0", "vector": [14, 1, 0.0614, 0.001, 1, 0.75, 0.2791, 170, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "i, j", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " i, j = 0, 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:While_L62_C4", "label": "while", "type": "while", "loc": [62, 72], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L39_C0", "vector": [5, 1, 0.0674, 0.0111, 1, 0.75, 0.3023, 0, 1, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while True:\n if t1_arr[i] == t2_arr[j]:\n time_arr_list.append(t1_arr[i])\n i += 1\n j += 1\n elif t1_arr[i] > t2_arr[j]:\n j += 1\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L63_C8", "label": "if", "type": "if", "loc": [63, 70], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:While_L62_C4", "vector": [4, 2, 0.0669, 0.008, 2, 0.89, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if t1_arr[i] == t2_arr[j]:\n time_arr_list.append(t1_arr[i])\n i += 1\n j += 1\n elif t1_arr[i] > t2_arr[j]:\n j += 1\n else:\n i += 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L64_C12", "label": "append()", "type": "expression", "loc": [64, 64], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L63_C8", "vector": [8, 3, 0.0644, 0.001, 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": " time_arr_list.append(t1_arr[i])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L67_C8", "label": "if", "type": "if", "loc": [67, 70], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L63_C8", "vector": [4, 3, 0.0689, 0.004, 3, 0.63, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif t1_arr[i] > t2_arr[j]:\n j += 1\n else:\n i += 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L71_C8", "label": "if", "type": "if", "loc": [71, 72], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:While_L62_C4", "vector": [4, 2, 0.0719, 0.002, 2, 0.89, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if j == n_times or i == n_times:\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L73_C4", "label": "time_arr = array()", "type": "assigned_variable", "loc": [73, 73], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L39_C0", "vector": [14, 1, 0.0734, 0.001, 1, 0.75, 0.3256, 664, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "time_arr", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " time_arr = np.array(time_arr_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L74_C4", "label": "tstep_size =", "type": "assigned_variable", "loc": [74, 74], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L39_C0", "vector": [14, 1, 0.0744, 0.001, 1, 0.75, 0.3488, 182, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "tstep_size", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tstep_size = .03333333333"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L75_C4", "label": "uniform_time = cumsum()", "type": "assigned_variable", "loc": [75, 75], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L39_C0", "vector": [14, 1, 0.0755, 0.001, 1, 0.75, 0.3721, 513, 3, 1, 0, 0, 214, 10, 2], "semantic": {"name": "uniform_time", "arg_names": [], "import_names": [], "rhs_call_name": "cumsum", "annotation": ""}, "snippet": " uniform_time = np.cumsum(np.round((time_arr[1:] - time_arr[:-1]) / tstep_size) * tstep_size)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L76_C4", "label": "uniform_time = concatenate()", "type": "assigned_variable", "loc": [76, 76], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L39_C0", "vector": [14, 1, 0.0765, 0.001, 1, 0.75, 0.3953, 513, 3, 1, 0, 0, 63, 10, 2], "semantic": {"name": "uniform_time", "arg_names": [], "import_names": [], "rhs_call_name": "concatenate", "annotation": ""}, "snippet": " uniform_time = np.concatenate((np.array([0]), uniform_time))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L77_C4", "label": "uniform_time =", "type": "assigned_variable", "loc": [77, 77], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L39_C0", "vector": [14, 1, 0.0775, 0.001, 1, 0.75, 0.4186, 513, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "uniform_time", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " uniform_time = uniform_time + time_arr_list[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L78_C4", "label": "time_arr =", "type": "assigned_variable", "loc": [78, 78], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L39_C0", "vector": [14, 1, 0.0785, 0.001, 1, 0.75, 0.4419, 664, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "time_arr", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " time_arr = uniform_time"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L81_C4", "label": "ft_time_arr =", "type": "assigned_variable", "loc": [81, 81], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L39_C0", "vector": [14, 1, 0.0815, 0.001, 1, 0.75, 0.4651, 736, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ft_time_arr", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ft_time_arr = ft_time_arr + 0.05"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L82_C4", "label": "raw_ft_arr =", "type": "assigned_variable", "loc": [82, 82], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L39_C0", "vector": [14, 1, 0.0825, 0.001, 1, 0.75, 0.4884, 568, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "raw_ft_arr", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " raw_ft_arr = np.array(ft_dict['ft_list']).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L83_C4", "label": "window_len =", "type": "assigned_variable", "loc": [83, 83], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L39_C0", "vector": [14, 1, 0.0835, 0.001, 1, 0.75, 0.5116, 352, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "window_len", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " window_len = 3"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L85_C4", "label": "sm_ft_l =", "type": "assigned_variable", "loc": [85, 85], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L39_C0", "vector": [14, 1, 0.0855, 0.001, 1, 0.75, 0.5349, 399, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "sm_ft_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " sm_ft_l = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L86_C4", "label": "for i", "type": "for", "loc": [86, 88], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L39_C0", "vector": [6, 1, 0.0875, 0.003, 1, 0.75, 0.5581, 826, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(raw_ft_arr.shape[0]):\n s = mfs.smooth(raw_ft_arr[i,:], window_len,'blackman')\n sm_ft_l.append(s.tolist())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L87_C8", "label": "s = smooth()", "type": "assigned_variable", "loc": [87, 87], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L86_C4", "vector": [14, 2, 0.0875, 0.001, 2, 0.33, 0.0, 553, 3, 3, 0, 0, 186, 10, 1], "semantic": {"name": "s", "arg_names": [], "import_names": [], "rhs_call_name": "smooth", "annotation": ""}, "snippet": " s = mfs.smooth(raw_ft_arr[i,:], window_len,'blackman')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L88_C8", "label": "append()", "type": "expression", "loc": [88, 88], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L86_C4", "vector": [8, 2, 0.0885, 0.001, 2, 0.33, 1.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " sm_ft_l.append(s.tolist())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L90_C4", "label": "if", "type": "if", "loc": [90, 91], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L39_C0", "vector": [4, 1, 0.091, 0.002, 1, 0.75, 0.5814, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if window_len != 1:\n ft_time_arr = ft_time_arr[window_len-1:-window_len+1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L91_C8", "label": "ft_time_arr =", "type": "assigned_variable", "loc": [91, 91], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L90_C4", "vector": [14, 2, 0.0915, 0.001, 2, 0.06, 0.0, 736, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ft_time_arr", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ft_time_arr = ft_time_arr[window_len-1:-window_len+1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L92_C4", "label": "raw_ft_arr = tolist()", "type": "assigned_variable", "loc": [92, 92], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L39_C0", "vector": [14, 1, 0.0926, 0.001, 1, 0.75, 0.6047, 568, 3, 0, 0, 0, 185, 10, 2], "semantic": {"name": "raw_ft_arr", "arg_names": [], "import_names": [], "rhs_call_name": "tolist", "annotation": ""}, "snippet": " raw_ft_arr = (np.array(sm_ft_l).T).tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L94_C4", "label": "raw_mech_pos_arr =", "type": "assigned_variable", "loc": [94, 94], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L39_C0", "vector": [14, 1, 0.0946, 0.001, 1, 0.75, 0.6279, 988, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "raw_mech_pos_arr", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " raw_mech_pos_arr = mechanism_dict['pos_list']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L95_C4", "label": "raw_mech_rot_arr =", "type": "assigned_variable", "loc": [95, 95], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L39_C0", "vector": [14, 1, 0.0956, 0.001, 1, 0.75, 0.6512, 45, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "raw_mech_rot_arr", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " raw_mech_rot_arr = mechanism_dict['rot_list']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L97_C4", "label": "raw_hand_pos_arr =", "type": "assigned_variable", "loc": [97, 97], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L39_C0", "vector": [14, 1, 0.0976, 0.001, 1, 0.75, 0.6744, 218, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "raw_hand_pos_arr", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " raw_hand_pos_arr = hand_dict['pos_list']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L98_C4", "label": "raw_hand_rot_arr =", "type": "assigned_variable", "loc": [98, 98], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L39_C0", "vector": [14, 1, 0.0986, 0.001, 1, 0.75, 0.6977, 962, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "raw_hand_rot_arr", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " raw_hand_rot_arr = hand_dict['rot_list']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L100_C4", "label": "raw_arr_list =", "type": "assigned_variable", "loc": [100, 101], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L39_C0", "vector": [14, 1, 0.1011, 0.002, 1, 0.75, 0.7209, 873, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "raw_arr_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " raw_arr_list = [raw_ft_arr, raw_mech_pos_arr, raw_mech_rot_arr,\n raw_hand_pos_arr, raw_hand_rot_arr]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L102_C4", "label": "time_arr_list =", "type": "assigned_variable", "loc": [102, 103], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L39_C0", "vector": [14, 1, 0.1031, 0.002, 1, 0.75, 0.7442, 126, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "time_arr_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " time_arr_list = [ft_time_arr, mech_time_arr, mech_time_arr,\n hand_time_arr, hand_time_arr]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L104_C4", "label": "n_arr = len()", "type": "assigned_variable", "loc": [104, 104], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L39_C0", "vector": [14, 1, 0.1046, 0.001, 1, 0.75, 0.7674, 912, 3, 1, 0, 0, 890, 10, 1], "semantic": {"name": "n_arr", "arg_names": [], "import_names": [], "rhs_call_name": "len", "annotation": ""}, "snippet": " n_arr = len(raw_arr_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L106_C4", "label": "ft_list =", "type": "assigned_variable", "loc": [106, 106], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L39_C0", "vector": [14, 1, 0.1066, 0.001, 1, 0.75, 0.7907, 147, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "ft_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ft_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L107_C4", "label": "mech_pos_list, mech_rot_list =", "type": "assigned_variable", "loc": [107, 107], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L39_C0", "vector": [14, 1, 0.1076, 0.001, 1, 0.75, 0.814, 622, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "mech_pos_list, mech_rot_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mech_pos_list, mech_rot_list = [], []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L108_C4", "label": "hand_pos_list, hand_rot_list =", "type": "assigned_variable", "loc": [108, 108], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L39_C0", "vector": [14, 1, 0.1087, 0.001, 1, 0.75, 0.8372, 890, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "hand_pos_list, hand_rot_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " hand_pos_list, hand_rot_list = [], []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L109_C4", "label": "acc_list =", "type": "assigned_variable", "loc": [109, 110], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L39_C0", "vector": [14, 1, 0.1102, 0.002, 1, 0.75, 0.8605, 449, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "acc_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " acc_list = [ft_list, mech_pos_list, mech_rot_list, hand_pos_list,\n hand_rot_list]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L111_C4", "label": "key_list =", "type": "assigned_variable", "loc": [111, 112], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L39_C0", "vector": [14, 1, 0.1122, 0.002, 1, 0.75, 0.8837, 422, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "key_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " key_list = ['ft_list', 'mech_pos_list', 'mech_rot_list',\n 'hand_pos_list', 'hand_rot_list']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L114_C4", "label": "for i", "type": "for", "loc": [114, 119], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L39_C0", "vector": [6, 1, 0.1172, 0.006, 1, 0.75, 0.907, 826, 3, 0, 0, 0, 0, 0, 5], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(time_arr.shape[0]):\n t = time_arr[i]\n for j in range(n_arr):\n # nearest neighbor interpolation\n min_idx = np.argmin(np.abs(time_arr_list[j] - t))\n acc_list[j].append(raw_arr_list[j][min_idx])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L115_C8", "label": "t =", "type": "assigned_variable", "loc": [115, 115], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L114_C4", "vector": [14, 2, 0.1157, 0.001, 2, 0.87, 0.0, 15, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "t", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " t = time_arr[i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L116_C8", "label": "for j", "type": "for", "loc": [116, 119], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L114_C4", "vector": [6, 2, 0.1182, 0.004, 2, 0.87, 1.0, 100, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "j", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for j in range(n_arr):\n # nearest neighbor interpolation\n min_idx = np.argmin(np.abs(time_arr_list[j] - t))\n acc_list[j].append(raw_arr_list[j][min_idx])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L118_C12", "label": "min_idx = argmin()", "type": "assigned_variable", "loc": [118, 118], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L116_C8", "vector": [14, 3, 0.1187, 0.001, 3, 0.34, 0.0, 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(np.abs(time_arr_list[j] - t))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L119_C12", "label": "append()", "type": "expression", "loc": [119, 119], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L116_C8", "vector": [8, 3, 0.1197, 0.001, 3, 0.34, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " acc_list[j].append(raw_arr_list[j][min_idx])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L121_C4", "label": "d =", "type": "assigned_variable", "loc": [121, 121], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L39_C0", "vector": [14, 1, 0.1217, 0.001, 1, 0.75, 0.9302, 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_99535:Assign_L122_C4", "label": " = tolist()", "type": "assigned_variable", "loc": [122, 122], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L39_C0", "vector": [14, 1, 0.1227, 0.001, 1, 0.75, 0.9535, 0, 3, 0, 0, 0, 185, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "tolist", "annotation": ""}, "snippet": " d['time_list'] = time_arr.tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L123_C4", "label": "for i", "type": "for", "loc": [123, 124], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L39_C0", "vector": [6, 1, 0.1242, 0.002, 1, 0.75, 0.9767, 826, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(n_arr):\n d[key_list[i]] = acc_list[i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L124_C8", "label": "assign", "type": "assigned_variable", "loc": [124, 124], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L123_C4", "vector": [14, 2, 0.1247, 0.001, 2, 0.38, 0.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " d[key_list[i]] = acc_list[i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Return_L126_C4", "label": "return", "type": "return", "loc": [126, 126], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L39_C0", "vector": [13, 1, 0.1268, 0.001, 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 d"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L137_C0", "label": "ft_to_camera", "type": "function", "loc": [137, 156], "level": 0, "parent": null, "vector": [2, 0, 0.1474, 0.0201, 0, 0.66, 0.4375, 556, 0, 5, 1, 0, 0, 0, 11], "semantic": {"name": "ft_to_camera", "arg_names": ["force_tool", "hand_rot_matrix", "hand_pos_matrix", "mech_pos_matrix", "number"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def ft_to_camera(force_tool, hand_rot_matrix, hand_pos_matrix, mech_pos_matrix, number):\n # hc == hand checkerboard\n hc_rot_tool = tr.Rx(math.radians(90)) * tr.Ry(math.radians(180.)) * tr.Rz(math.radians(30.))\n\n while number != 1:\n hc_rot_tool = tr.Ry(math.radians(90.)) * hc_rot_tool\n number = number-1\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L139_C4", "label": "hc_rot_tool =", "type": "assigned_variable", "loc": [139, 139], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L137_C0", "vector": [14, 1, 0.1398, 0.001, 1, 0.66, 0.0, 242, 4, 0, 0, 0, 0, 0, 6], "semantic": {"name": "hc_rot_tool", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " hc_rot_tool = tr.Rx(math.radians(90)) * tr.Ry(math.radians(180.)) * tr.Rz(math.radians(30.))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:While_L141_C4", "label": "while", "type": "while", "loc": [141, 143], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L137_C0", "vector": [5, 1, 0.1429, 0.003, 1, 0.66, 0.1111, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while number != 1:\n hc_rot_tool = tr.Ry(math.radians(90.)) * hc_rot_tool\n number = number-1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L142_C8", "label": "hc_rot_tool =", "type": "assigned_variable", "loc": [142, 142], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:While_L141_C4", "vector": [14, 2, 0.1429, 0.001, 2, 0.16, 0.0, 242, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "hc_rot_tool", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " hc_rot_tool = tr.Ry(math.radians(90.)) * hc_rot_tool"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L143_C8", "label": "number =", "type": "assigned_variable", "loc": [143, 143], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:While_L141_C4", "vector": [14, 2, 0.1439, 0.001, 2, 0.16, 1.0, 408, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "number", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " number = number-1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L145_C4", "label": "force_hc =", "type": "assigned_variable", "loc": [145, 145], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L137_C0", "vector": [14, 1, 0.1459, 0.001, 1, 0.66, 0.2222, 466, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "force_hc", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " force_hc = hc_rot_tool * force_tool"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L146_C4", "label": "p_hc_ft =", "type": "assigned_variable", "loc": [146, 146], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L137_C0", "vector": [14, 1, 0.1469, 0.001, 1, 0.66, 0.3333, 455, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "p_hc_ft", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p_hc_ft = np.matrix([0.04, 0.01, 0.09]).T # vector from hook checkerboard origin to the base of the FT sensor in hook checker coordinates."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L149_C4", "label": "p_ft_mech =", "type": "assigned_variable", "loc": [149, 149], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L137_C0", "vector": [14, 1, 0.1499, 0.001, 1, 0.66, 0.4444, 370, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "p_ft_mech", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p_ft_mech = -hand_pos_matrix + mech_pos_matrix - hand_rot_matrix * p_hc_ft"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L151_C4", "label": "force_cam =", "type": "assigned_variable", "loc": [151, 151], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L137_C0", "vector": [14, 1, 0.1519, 0.001, 1, 0.66, 0.5556, 645, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "force_cam", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " force_cam = hand_rot_matrix * force_hc # force at hook base in camera coordinates"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L152_C4", "label": "moment_cam =", "type": "assigned_variable", "loc": [152, 152], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L137_C0", "vector": [14, 1, 0.1529, 0.001, 1, 0.66, 0.6667, 231, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "moment_cam", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " moment_cam = hand_rot_matrix * moment_hc"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L153_C4", "label": "force_at_mech_origin =", "type": "assigned_variable", "loc": [153, 153], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L137_C0", "vector": [14, 1, 0.1539, 0.001, 1, 0.66, 0.7778, 717, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "force_at_mech_origin", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " force_at_mech_origin = force_cam"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L154_C4", "label": "moment_at_mech_origin =", "type": "assigned_variable", "loc": [154, 154], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L137_C0", "vector": [14, 1, 0.1549, 0.001, 1, 0.66, 0.8889, 64, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "moment_at_mech_origin", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " moment_at_mech_origin = moment_cam + np.matrix(np.cross(-p_ft_mech.A1, force_cam.A1)).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Return_L156_C4", "label": "return", "type": "return", "loc": [156, 156], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L137_C0", "vector": [13, 1, 0.1569, 0.001, 1, 0.66, 1.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return hand_rot_matrix * force_hc"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L160_C0", "label": "ft_to_camera_3", "type": "function", "loc": [160, 186], "level": 0, "parent": null, "vector": [2, 0, 0.174, 0.0272, 0, 0.66, 0.4688, 909, 0, 5, 1, 0, 0, 0, 11], "semantic": {"name": "ft_to_camera_3", "arg_names": ["force_tool", "moment_tool", "hand_rot_matrix", "number", "return_moment_cam"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def ft_to_camera_3(force_tool, moment_tool, hand_rot_matrix, number,\n return_moment_cam = False):\n # hc == hand checkerboard\n hc_rot_tool = tr.Rx(math.radians(90)) * tr.Ry(math.radians(180.)) * tr.Rz(math.radians(30.))\n\n while number != 1:\n hc_rot_tool = tr.Ry(math.radians(90.)) * hc_rot_tool\n number = number-1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L163_C4", "label": "hc_rot_tool =", "type": "assigned_variable", "loc": [163, 163], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L160_C0", "vector": [14, 1, 0.164, 0.001, 1, 0.71, 0.0, 242, 4, 0, 0, 0, 0, 0, 6], "semantic": {"name": "hc_rot_tool", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " hc_rot_tool = tr.Rx(math.radians(90)) * tr.Ry(math.radians(180.)) * tr.Rz(math.radians(30.))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:While_L165_C4", "label": "while", "type": "while", "loc": [165, 167], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L160_C0", "vector": [5, 1, 0.167, 0.003, 1, 0.71, 0.1, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while number != 1:\n hc_rot_tool = tr.Ry(math.radians(90.)) * hc_rot_tool\n number = number-1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L166_C8", "label": "hc_rot_tool =", "type": "assigned_variable", "loc": [166, 166], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:While_L165_C4", "vector": [14, 2, 0.167, 0.001, 2, 0.0, 0.0, 242, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "hc_rot_tool", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " hc_rot_tool = tr.Ry(math.radians(90.)) * hc_rot_tool"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L167_C8", "label": "number =", "type": "assigned_variable", "loc": [167, 167], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:While_L165_C4", "vector": [14, 2, 0.168, 0.001, 2, 0.0, 1.0, 408, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "number", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " number = number-1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L169_C4", "label": "force_hc =", "type": "assigned_variable", "loc": [169, 169], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L160_C0", "vector": [14, 1, 0.17, 0.001, 1, 0.71, 0.2, 466, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "force_hc", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " force_hc = hc_rot_tool * force_tool"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L170_C4", "label": "moment_hc =", "type": "assigned_variable", "loc": [170, 170], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L160_C0", "vector": [14, 1, 0.171, 0.001, 1, 0.71, 0.3, 684, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "moment_hc", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " moment_hc = hc_rot_tool * moment_tool"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L171_C4", "label": "p_ft_hooktip =", "type": "assigned_variable", "loc": [171, 171], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L160_C0", "vector": [14, 1, 0.172, 0.001, 1, 0.71, 0.4, 695, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "p_ft_hooktip", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p_ft_hooktip = np.matrix([0.0, -0.08, 0.00]).T # vector from FT sensor to the tip of the hook in hook checker coordinates."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L174_C4", "label": "p_ft_hooktip =", "type": "assigned_variable", "loc": [174, 174], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L160_C0", "vector": [14, 1, 0.1751, 0.001, 1, 0.71, 0.5, 695, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "p_ft_hooktip", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p_ft_hooktip = hand_rot_matrix * p_ft_hooktip"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L175_C4", "label": "force_cam =", "type": "assigned_variable", "loc": [175, 175], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L160_C0", "vector": [14, 1, 0.1761, 0.001, 1, 0.71, 0.6, 645, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "force_cam", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " force_cam = hand_rot_matrix * force_hc # force at hook base in camera coordinates"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L176_C4", "label": "moment_cam =", "type": "assigned_variable", "loc": [176, 176], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L160_C0", "vector": [14, 1, 0.1771, 0.001, 1, 0.71, 0.7, 231, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "moment_cam", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " moment_cam = hand_rot_matrix * moment_hc"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L177_C4", "label": "force_at_hook_tip =", "type": "assigned_variable", "loc": [177, 177], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L160_C0", "vector": [14, 1, 0.1781, 0.001, 1, 0.71, 0.8, 388, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "force_at_hook_tip", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " force_at_hook_tip = force_cam"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L178_C4", "label": "moment_at_hook_tip =", "type": "assigned_variable", "loc": [178, 178], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L160_C0", "vector": [14, 1, 0.1791, 0.001, 1, 0.71, 0.9, 978, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "moment_at_hook_tip", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " moment_at_hook_tip = moment_cam + np.matrix(np.cross(-p_ft_hooktip.A1, force_cam.A1)).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L183_C4", "label": "if", "type": "if", "loc": [183, 186], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L160_C0", "vector": [4, 1, 0.1856, 0.004, 1, 0.71, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if return_moment_cam:\n return force_at_hook_tip, moment_at_hook_tip, moment_cam\n else:\n return force_at_hook_tip, moment_at_hook_tip"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Return_L184_C8", "label": "return", "type": "return", "loc": [184, 184], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L183_C4", "vector": [13, 2, 0.1851, 0.001, 2, 0.06, 0.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return force_at_hook_tip, moment_at_hook_tip, moment_cam"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Return_L186_C8", "label": "return", "type": "return", "loc": [186, 186], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L183_C4", "vector": [13, 2, 0.1871, 0.001, 2, 0.06, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return force_at_hook_tip, moment_at_hook_tip"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L188_C0", "label": "plot", "type": "function", "loc": [188, 200], "level": 0, "parent": null, "vector": [2, 0, 0.1952, 0.0131, 0, 0.66, 0.5, 929, 0, 2, 0, 0, 0, 0, 5], "semantic": {"name": "plot", "arg_names": ["combined_dict", "savefig"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def plot(combined_dict, savefig):\n plot_trajectories(combined_dict)\n\n# tup = ke.init_ros_node()\n# mech_rot_list = compute_mech_rot_list(combined_dict, tup)\n# combined_dict['mech_rot_list'] = mech_rot_list\n# plot_trajectories(combined_dict)\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L189_C4", "label": "plot_trajectories()", "type": "expression", "loc": [189, 189], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L188_C0", "vector": [8, 1, 0.1901, 0.001, 1, 0.86, 0.0, 173, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "plot_trajectories", "arg_names": [], "import_names": [], "rhs_call_name": "plot_trajectories", "annotation": ""}, "snippet": " plot_trajectories(combined_dict)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L196_C4", "label": "cd =", "type": "assigned_variable", "loc": [196, 196], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L188_C0", "vector": [14, 1, 0.1972, 0.001, 1, 0.86, 0.2, 214, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "cd", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cd = combined_dict"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L197_C4", "label": "ft_mat =", "type": "assigned_variable", "loc": [197, 197], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L188_C0", "vector": [14, 1, 0.1982, 0.001, 1, 0.86, 0.4, 624, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "ft_mat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ft_mat = np.matrix(cd['ft_list']).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L198_C4", "label": "force_mat =", "type": "assigned_variable", "loc": [198, 198], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L188_C0", "vector": [14, 1, 0.1992, 0.001, 1, 0.86, 0.6, 156, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "force_mat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " force_mat = ft_mat[0:3, :]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L199_C4", "label": "plot_yx()", "type": "expression", "loc": [199, 199], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L188_C0", "vector": [8, 1, 0.2002, 0.001, 1, 0.86, 0.8, 112, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "plot_yx", "arg_names": [], "import_names": [], "rhs_call_name": "plot_yx", "annotation": ""}, "snippet": " mpu.plot_yx(ut.norm(force_mat).A1, cd['time_list'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L200_C4", "label": "show()", "type": "expression", "loc": [200, 200], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L188_C0", "vector": [8, 1, 0.2012, 0.001, 1, 0.86, 1.0, 497, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "show", "arg_names": [], "import_names": [], "rhs_call_name": "show", "annotation": ""}, "snippet": " mpu.show()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L211_C0", "label": "project_points_plane", "type": "function", "loc": [211, 226], "level": 0, "parent": null, "vector": [2, 0, 0.2198, 0.0161, 0, 0.66, 0.5312, 771, 0, 1, 1, 0, 0, 0, 6], "semantic": {"name": "project_points_plane", "arg_names": ["pts"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def project_points_plane(pts):\n# import mdp\n# p = mdp.nodes.PCANode(svd=True)\n# p.train((pts-np.mean(pts, 1)).T.A)\n# print 'min mdp:', p.get_projmatrix()\n#\n# U, s , _ = np.linalg.svd(np.cov(pts))\n# print 'min svd:', U[:,2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L219_C4", "label": "eval, evec = eig()", "type": "assigned_variable", "loc": [219, 219], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L211_C0", "vector": [14, 1, 0.2203, 0.001, 1, 0.82, 0.0, 375, 3, 1, 0, 0, 971, 10, 2], "semantic": {"name": "eval, evec", "arg_names": [], "import_names": [], "rhs_call_name": "eig", "annotation": ""}, "snippet": " eval, evec = np.linalg.eig(np.cov(pts))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L220_C4", "label": "min_idx = argmin()", "type": "assigned_variable", "loc": [220, 220], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L211_C0", "vector": [14, 1, 0.2213, 0.001, 1, 0.82, 0.1667, 912, 3, 1, 0, 0, 879, 10, 1], "semantic": {"name": "min_idx", "arg_names": [], "import_names": [], "rhs_call_name": "argmin", "annotation": ""}, "snippet": " min_idx = np.argmin(eval)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L221_C4", "label": "min_evec =", "type": "assigned_variable", "loc": [221, 221], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L211_C0", "vector": [14, 1, 0.2223, 0.001, 1, 0.82, 0.3333, 193, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "min_evec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " min_evec = np.matrix(evec[:,min_idx]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L222_C4", "label": "if", "type": "if", "loc": [222, 223], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L211_C0", "vector": [4, 1, 0.2238, 0.002, 1, 0.82, 0.5, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if min_evec[1,0] > 0:\n min_evec = min_evec * -1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L223_C8", "label": "min_evec =", "type": "assigned_variable", "loc": [223, 223], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L222_C4", "vector": [14, 2, 0.2243, 0.001, 2, 0.31, 0.0, 193, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "min_evec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " min_evec = min_evec * -1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L224_C4", "label": "print()", "type": "expression", "loc": [224, 224], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L211_C0", "vector": [8, 1, 0.2254, 0.001, 1, 0.82, 0.6667, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('min evec:', min_evec)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L225_C4", "label": "pts_proj =", "type": "assigned_variable", "loc": [225, 225], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L211_C0", "vector": [14, 1, 0.2264, 0.001, 1, 0.82, 0.8333, 70, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "pts_proj", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pts_proj = pts - np.multiply((min_evec.T * pts), min_evec)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Return_L226_C4", "label": "return", "type": "return", "loc": [226, 226], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L211_C0", "vector": [13, 1, 0.2274, 0.001, 1, 0.82, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return pts_proj, min_evec"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L232_C0", "label": "compute_mech_angle_1", "type": "function", "loc": [232, 241], "level": 0, "parent": null, "vector": [2, 0, 0.2379, 0.0101, 0, 0.66, 0.5625, 466, 0, 2, 1, 0, 0, 0, 7], "semantic": {"name": "compute_mech_angle_1", "arg_names": ["cd", "axis_direc"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def compute_mech_angle_1(cd, axis_direc=None):\n mech_rot = cd['mech_rot_list']\n directions_x = (np.row_stack(mech_rot)[:,0]).T.reshape(len(mech_rot), 3).T\n if axis_direc != None:\n directions_x = directions_x - np.multiply(axis_direc.T * directions_x,\n axis_direc)\n directions_x = directions_x/ut.norm(directions_x)\n start_normal = directions_x[:,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L233_C4", "label": "mech_rot =", "type": "assigned_variable", "loc": [233, 233], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L232_C0", "vector": [14, 1, 0.2344, 0.001, 1, 0.44, 0.0, 682, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "mech_rot", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mech_rot = cd['mech_rot_list']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L234_C4", "label": "directions_x =", "type": "assigned_variable", "loc": [234, 234], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L232_C0", "vector": [14, 1, 0.2354, 0.001, 1, 0.44, 0.2, 755, 7, 0, 0, 0, 0, 0, 3], "semantic": {"name": "directions_x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " directions_x = (np.row_stack(mech_rot)[:,0]).T.reshape(len(mech_rot), 3).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L235_C4", "label": "if", "type": "if", "loc": [235, 238], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L232_C0", "vector": [4, 1, 0.2379, 0.004, 1, 0.44, 0.4, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if axis_direc != None:\n directions_x = directions_x - np.multiply(axis_direc.T * directions_x,\n axis_direc)\n directions_x = directions_x/ut.norm(directions_x)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L236_C8", "label": "directions_x =", "type": "assigned_variable", "loc": [236, 237], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L235_C4", "vector": [14, 2, 0.2379, 0.002, 2, 0.49, 0.0, 755, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "directions_x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " directions_x = directions_x - np.multiply(axis_direc.T * directions_x,\n axis_direc)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L238_C8", "label": "directions_x =", "type": "assigned_variable", "loc": [238, 238], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L235_C4", "vector": [14, 2, 0.2394, 0.001, 2, 0.49, 1.0, 755, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "directions_x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " directions_x = directions_x/ut.norm(directions_x)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L239_C4", "label": "start_normal =", "type": "assigned_variable", "loc": [239, 239], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L232_C0", "vector": [14, 1, 0.2404, 0.001, 1, 0.44, 0.6, 759, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "start_normal", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " start_normal = directions_x[:,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L240_C4", "label": "mech_angle = tolist()", "type": "assigned_variable", "loc": [240, 240], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L232_C0", "vector": [14, 1, 0.2414, 0.001, 1, 0.44, 0.8, 945, 3, 0, 0, 0, 185, 10, 2], "semantic": {"name": "mech_angle", "arg_names": [], "import_names": [], "rhs_call_name": "tolist", "annotation": ""}, "snippet": " mech_angle = np.arccos(start_normal.T * directions_x).A1.tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Return_L241_C4", "label": "return", "type": "return", "loc": [241, 241], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L232_C0", "vector": [13, 1, 0.2425, 0.001, 1, 0.44, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return mech_angle"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L248_C0", "label": "compute_mech_angle_2", "type": "function", "loc": [248, 265], "level": 0, "parent": null, "vector": [2, 0, 0.258, 0.0181, 0, 0.66, 0.5938, 910, 0, 3, 1, 0, 0, 0, 10], "semantic": {"name": "compute_mech_angle_2", "arg_names": ["cd", "tup", "project_plane"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def compute_mech_angle_2(cd, tup, project_plane=False):\n pos_mat = np.column_stack(cd['mech_pos_list'])\n if project_plane:\n pts_proj, min_evec = project_points_plane(pos_arr)\n pos_arr = pts_proj\n\n kin_dict = ke.fit(pos_mat, tup)\n center = np.matrix((kin_dict['cx'], kin_dict['cy'],"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L249_C4", "label": "pos_mat = column_stack()", "type": "assigned_variable", "loc": [249, 249], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L248_C0", "vector": [14, 1, 0.2505, 0.001, 1, 0.38, 0.0, 932, 3, 1, 0, 0, 724, 10, 1], "semantic": {"name": "pos_mat", "arg_names": [], "import_names": [], "rhs_call_name": "column_stack", "annotation": ""}, "snippet": " pos_mat = np.column_stack(cd['mech_pos_list'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L250_C4", "label": "if", "type": "if", "loc": [250, 252], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L248_C0", "vector": [4, 1, 0.2525, 0.003, 1, 0.38, 0.1, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if project_plane:\n pts_proj, min_evec = project_points_plane(pos_arr)\n pos_arr = pts_proj"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L251_C8", "label": "pts_proj, min_evec = project_points_plane()", "type": "assigned_variable", "loc": [251, 251], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L250_C4", "vector": [14, 2, 0.2525, 0.001, 2, 0.03, 0.0, 855, 3, 1, 0, 0, 771, 10, 1], "semantic": {"name": "pts_proj, min_evec", "arg_names": [], "import_names": [], "rhs_call_name": "project_points_plane", "annotation": ""}, "snippet": " pts_proj, min_evec = project_points_plane(pos_arr)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L252_C8", "label": "pos_arr =", "type": "assigned_variable", "loc": [252, 252], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L250_C4", "vector": [14, 2, 0.2535, 0.001, 2, 0.03, 1.0, 412, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pos_arr", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pos_arr = pts_proj"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L254_C4", "label": "kin_dict = fit()", "type": "assigned_variable", "loc": [254, 254], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L248_C0", "vector": [14, 1, 0.2555, 0.001, 1, 0.38, 0.2, 775, 3, 2, 0, 0, 828, 10, 1], "semantic": {"name": "kin_dict", "arg_names": [], "import_names": [], "rhs_call_name": "fit", "annotation": ""}, "snippet": " kin_dict = ke.fit(pos_mat, tup)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L255_C4", "label": "center =", "type": "assigned_variable", "loc": [255, 256], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L248_C0", "vector": [14, 1, 0.257, 0.002, 1, 0.38, 0.3, 546, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "center", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " center = np.matrix((kin_dict['cx'], kin_dict['cy'],\n kin_dict['cz'])).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L257_C4", "label": "directions_x =", "type": "assigned_variable", "loc": [257, 257], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L248_C0", "vector": [14, 1, 0.2586, 0.001, 1, 0.38, 0.4, 755, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "directions_x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " directions_x = pos_mat - center"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L258_C4", "label": "directions_x =", "type": "assigned_variable", "loc": [258, 258], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L248_C0", "vector": [14, 1, 0.2596, 0.001, 1, 0.38, 0.5, 755, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "directions_x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " directions_x = directions_x / ut.norm(directions_x)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L259_C4", "label": "start_normal =", "type": "assigned_variable", "loc": [259, 259], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L248_C0", "vector": [14, 1, 0.2606, 0.001, 1, 0.38, 0.6, 759, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "start_normal", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " start_normal = directions_x[:,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L262_C4", "label": "ct =", "type": "assigned_variable", "loc": [262, 262], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L248_C0", "vector": [14, 1, 0.2636, 0.001, 1, 0.38, 0.7, 147, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ct", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ct = (start_normal.T * directions_x).A1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L263_C4", "label": "st =", "type": "assigned_variable", "loc": [263, 263], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L248_C0", "vector": [14, 1, 0.2646, 0.001, 1, 0.38, 0.8, 93, 7, 0, 0, 0, 0, 0, 3], "semantic": {"name": "st", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " st = ut.norm(np.matrix(np.cross(start_normal.A1, directions_x.T.A)).T).A1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L264_C4", "label": "mech_angle = tolist()", "type": "assigned_variable", "loc": [264, 264], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L248_C0", "vector": [14, 1, 0.2656, 0.001, 1, 0.38, 0.9, 945, 3, 0, 0, 0, 185, 10, 2], "semantic": {"name": "mech_angle", "arg_names": [], "import_names": [], "rhs_call_name": "tolist", "annotation": ""}, "snippet": " mech_angle = np.arctan2(st, ct).tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Return_L265_C4", "label": "return", "type": "return", "loc": [265, 265], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L248_C0", "vector": [13, 1, 0.2666, 0.001, 1, 0.38, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return mech_angle"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L267_C0", "label": "compute_mech_rot_list", "type": "function", "loc": [267, 305], "level": 0, "parent": null, "vector": [2, 0, 0.2877, 0.0392, 0, 0.66, 0.625, 679, 0, 3, 1, 0, 0, 0, 27], "semantic": {"name": "compute_mech_rot_list", "arg_names": ["cd", "tup", "project_plane"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def compute_mech_rot_list(cd, tup, project_plane=False):\n pos_arr = np.column_stack(cd['mech_pos_list'])\n rot_list = cd['mech_rot_list']\n directions_y = (np.row_stack(rot_list)[:,1]).T.reshape(len(rot_list), 3).T\n start_y = directions_y[:,0]\n\n pts_proj, y_mech = project_points_plane(pos_arr)\n if np.dot(y_mech.T, start_y.A1) < 0:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L268_C4", "label": "pos_arr = column_stack()", "type": "assigned_variable", "loc": [268, 268], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L267_C0", "vector": [14, 1, 0.2696, 0.001, 1, 0.29, 0.0, 412, 3, 1, 0, 0, 724, 10, 1], "semantic": {"name": "pos_arr", "arg_names": [], "import_names": [], "rhs_call_name": "column_stack", "annotation": ""}, "snippet": " pos_arr = np.column_stack(cd['mech_pos_list'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L269_C4", "label": "rot_list =", "type": "assigned_variable", "loc": [269, 269], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L267_C0", "vector": [14, 1, 0.2706, 0.001, 1, 0.29, 0.0556, 352, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "rot_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rot_list = cd['mech_rot_list']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L270_C4", "label": "directions_y =", "type": "assigned_variable", "loc": [270, 270], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L267_C0", "vector": [14, 1, 0.2716, 0.001, 1, 0.29, 0.1111, 862, 7, 0, 0, 0, 0, 0, 3], "semantic": {"name": "directions_y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " directions_y = (np.row_stack(rot_list)[:,1]).T.reshape(len(rot_list), 3).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L271_C4", "label": "start_y =", "type": "assigned_variable", "loc": [271, 271], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L267_C0", "vector": [14, 1, 0.2726, 0.001, 1, 0.29, 0.1667, 679, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "start_y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " start_y = directions_y[:,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L273_C4", "label": "pts_proj, y_mech = project_points_plane()", "type": "assigned_variable", "loc": [273, 273], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L267_C0", "vector": [14, 1, 0.2746, 0.001, 1, 0.29, 0.2222, 791, 3, 1, 0, 0, 771, 10, 1], "semantic": {"name": "pts_proj, y_mech", "arg_names": [], "import_names": [], "rhs_call_name": "project_points_plane", "annotation": ""}, "snippet": " pts_proj, y_mech = project_points_plane(pos_arr)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L274_C4", "label": "if", "type": "if", "loc": [274, 276], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L267_C0", "vector": [4, 1, 0.2767, 0.003, 1, 0.29, 0.2778, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if np.dot(y_mech.T, start_y.A1) < 0:\n print('Negative hai boss')\n y_mech = -1 * y_mech"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L275_C8", "label": "print()", "type": "expression", "loc": [275, 275], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L274_C4", "vector": [8, 2, 0.2767, 0.001, 2, 0.66, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Negative hai boss')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L276_C8", "label": "y_mech =", "type": "assigned_variable", "loc": [276, 276], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L274_C4", "vector": [14, 2, 0.2777, 0.001, 2, 0.66, 1.0, 948, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "y_mech", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " y_mech = -1 * y_mech"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L278_C4", "label": "if", "type": "if", "loc": [278, 279], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L267_C0", "vector": [4, 1, 0.2802, 0.002, 1, 0.29, 0.3333, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if project_plane:\n pos_arr = pts_proj"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L279_C8", "label": "pos_arr =", "type": "assigned_variable", "loc": [279, 279], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L278_C4", "vector": [14, 2, 0.2807, 0.001, 2, 0.16, 0.0, 412, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pos_arr", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pos_arr = pts_proj"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L281_C4", "label": "kin_dict = fit()", "type": "assigned_variable", "loc": [281, 281], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L267_C0", "vector": [14, 1, 0.2827, 0.001, 1, 0.29, 0.3889, 775, 3, 2, 0, 0, 828, 10, 2], "semantic": {"name": "kin_dict", "arg_names": [], "import_names": [], "rhs_call_name": "fit", "annotation": ""}, "snippet": " kin_dict = ke.fit(np.matrix(pos_arr), tup)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L282_C4", "label": "center =", "type": "assigned_variable", "loc": [282, 283], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L267_C0", "vector": [14, 1, 0.2842, 0.002, 1, 0.29, 0.4444, 546, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "center", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " center = np.array((kin_dict['cx'], kin_dict['cy'],\n kin_dict['cz'])).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L285_C4", "label": "print()", "type": "expression", "loc": [285, 285], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L267_C0", "vector": [8, 1, 0.2867, 0.001, 1, 0.29, 0.5, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('pos_arr[:,0]', pos_arr[:,0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L286_C4", "label": "print()", "type": "expression", "loc": [286, 286], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L267_C0", "vector": [8, 1, 0.2877, 0.001, 1, 0.29, 0.5556, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('center:', center)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L288_C4", "label": "directions_x =", "type": "assigned_variable", "loc": [288, 288], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L267_C0", "vector": [14, 1, 0.2897, 0.001, 1, 0.29, 0.6111, 755, 7, 0, 0, 0, 0, 0, 3], "semantic": {"name": "directions_x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " directions_x = (np.row_stack(rot_list)[:,0]).T.reshape(len(rot_list), 3).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L289_C4", "label": "start_x =", "type": "assigned_variable", "loc": [289, 289], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L267_C0", "vector": [14, 1, 0.2907, 0.001, 1, 0.29, 0.6667, 744, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "start_x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " start_x = directions_x[:,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L290_C4", "label": "directions_x =", "type": "assigned_variable", "loc": [290, 290], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L267_C0", "vector": [14, 1, 0.2918, 0.001, 1, 0.29, 0.7222, 755, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "directions_x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " directions_x = np.matrix(pos_arr) - np.matrix(center).T.A"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L291_C4", "label": "directions_x =", "type": "assigned_variable", "loc": [291, 291], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L267_C0", "vector": [14, 1, 0.2928, 0.001, 1, 0.29, 0.7778, 755, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "directions_x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " directions_x = directions_x / ut.norm(directions_x)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L292_C4", "label": "if", "type": "if", "loc": [292, 294], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L267_C0", "vector": [4, 1, 0.2948, 0.003, 1, 0.29, 0.8333, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if np.dot(directions_x[:,0].A1, start_x.A1) < 0:\n print('Negative hai boss')\n directions_x = -1 * directions_x"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L293_C8", "label": "print()", "type": "expression", "loc": [293, 293], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L292_C4", "vector": [8, 2, 0.2948, 0.001, 2, 0.93, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Negative hai boss')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L294_C8", "label": "directions_x =", "type": "assigned_variable", "loc": [294, 294], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L292_C4", "vector": [14, 2, 0.2958, 0.001, 2, 0.93, 1.0, 755, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "directions_x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " directions_x = -1 * directions_x"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L296_C4", "label": "mech_rot_list =", "type": "assigned_variable", "loc": [296, 296], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L267_C0", "vector": [14, 1, 0.2978, 0.001, 1, 0.29, 0.8889, 39, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "mech_rot_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mech_rot_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L297_C4", "label": "for i", "type": "for", "loc": [297, 302], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L267_C0", "vector": [6, 1, 0.3013, 0.006, 1, 0.29, 0.9444, 826, 3, 0, 0, 0, 0, 0, 7], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(len(rot_list)):\n x = -directions_x[:, i]\n y = np.matrix(y_mech)\n z = np.matrix(np.cross(x.A1, y.A1)).T\n rot_mat = np.column_stack((x, y, z))\n mech_rot_list.append(rot_mat)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L298_C8", "label": "x =", "type": "assigned_variable", "loc": [298, 298], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L297_C4", "vector": [14, 2, 0.2998, 0.001, 2, 0.9, 0.0, 190, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " x = -directions_x[:, i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L299_C8", "label": "y = matrix()", "type": "assigned_variable", "loc": [299, 299], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L297_C4", "vector": [14, 2, 0.3008, 0.001, 2, 0.9, 0.25, 304, 3, 1, 0, 0, 162, 10, 1], "semantic": {"name": "y", "arg_names": [], "import_names": [], "rhs_call_name": "matrix", "annotation": ""}, "snippet": " y = np.matrix(y_mech)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L300_C8", "label": "z =", "type": "assigned_variable", "loc": [300, 300], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L297_C4", "vector": [14, 2, 0.3018, 0.001, 2, 0.9, 0.5, 859, 7, 0, 0, 0, 0, 0, 2], "semantic": {"name": "z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " z = np.matrix(np.cross(x.A1, y.A1)).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L301_C8", "label": "rot_mat = column_stack()", "type": "assigned_variable", "loc": [301, 301], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L297_C4", "vector": [14, 2, 0.3028, 0.001, 2, 0.9, 0.75, 968, 3, 1, 0, 0, 724, 10, 1], "semantic": {"name": "rot_mat", "arg_names": [], "import_names": [], "rhs_call_name": "column_stack", "annotation": ""}, "snippet": " rot_mat = np.column_stack((x, y, z))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L302_C8", "label": "append()", "type": "expression", "loc": [302, 302], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L297_C4", "vector": [8, 2, 0.3038, 0.001, 2, 0.9, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " mech_rot_list.append(rot_mat)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Return_L305_C4", "label": "return", "type": "return", "loc": [305, 305], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L267_C0", "vector": [13, 1, 0.3068, 0.001, 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 rot_list"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L311_C0", "label": "compute_mechanism_properties", "type": "function", "loc": [311, 403], "level": 0, "parent": null, "vector": [2, 0, 0.3592, 0.0936, 0, 0.66, 0.6562, 143, 0, 4, 1, 0, 0, 0, 42], "semantic": {"name": "compute_mechanism_properties", "arg_names": ["combined_dict", "bias_ft", "tup", "cd_pkl_name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def compute_mechanism_properties(combined_dict, bias_ft = False,\n tup = None, cd_pkl_name = None):\n cd = combined_dict\n force_cam, moment_cam, _ = fts_to_camera(combined_dict)\n moment_contact_l = None\n if bias_ft:\n print('Biasing magnitude:', np.linalg.norm(force_cam[:,0]))\n force_cam = force_cam - force_cam[:,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L313_C4", "label": "cd =", "type": "assigned_variable", "loc": [313, 313], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L311_C0", "vector": [14, 1, 0.3149, 0.001, 1, 0.69, 0.0, 214, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "cd", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cd = combined_dict"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L314_C4", "label": "force_cam, moment_cam, _ = fts_to_camera()", "type": "assigned_variable", "loc": [314, 314], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L311_C0", "vector": [14, 1, 0.3159, 0.001, 1, 0.69, 0.1667, 540, 3, 1, 0, 0, 531, 10, 1], "semantic": {"name": "force_cam, moment_cam, _", "arg_names": [], "import_names": [], "rhs_call_name": "fts_to_camera", "annotation": ""}, "snippet": " force_cam, moment_cam, _ = fts_to_camera(combined_dict)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L315_C4", "label": "moment_contact_l =", "type": "assigned_variable", "loc": [315, 315], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L311_C0", "vector": [14, 1, 0.3169, 0.001, 1, 0.69, 0.3333, 166, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "moment_contact_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " moment_contact_l = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L316_C4", "label": "if", "type": "if", "loc": [316, 319], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L311_C0", "vector": [4, 1, 0.3194, 0.004, 1, 0.69, 0.5, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if bias_ft:\n print('Biasing magnitude:', np.linalg.norm(force_cam[:,0]))\n force_cam = force_cam - force_cam[:,0]\n moment_cam = moment_cam - moment_cam[:,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L317_C8", "label": "print()", "type": "expression", "loc": [317, 317], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L316_C4", "vector": [8, 2, 0.3189, 0.001, 2, 0.77, 0.0, 535, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Biasing magnitude:', np.linalg.norm(force_cam[:,0]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L318_C8", "label": "force_cam =", "type": "assigned_variable", "loc": [318, 318], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L316_C4", "vector": [14, 2, 0.3199, 0.001, 2, 0.77, 0.5, 645, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "force_cam", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " force_cam = force_cam - force_cam[:,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L319_C8", "label": "moment_cam =", "type": "assigned_variable", "loc": [319, 319], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L316_C4", "vector": [14, 2, 0.3209, 0.001, 2, 0.77, 1.0, 231, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "moment_cam", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " moment_cam = moment_cam - moment_cam[:,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L321_C4", "label": "if", "type": "if", "loc": [321, 398], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L311_C0", "vector": [4, 1, 0.3617, 0.0785, 1, 0.69, 0.6667, 0, 0, 0, 0, 0, 0, 0, 34], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if cd['radius'] != -1:\n if tup == None:\n mech_angle = compute_mech_angle_1(cd)\n else:\n mech_angle = compute_mech_angle_2(cd, tup)\n # compute new mech_rot_list. used for factoring the forces.\n mech_rot_list = compute_mech_rot_list(combined_dict, tup)\n combined_dict['mech_rot_list'] = mech_rot_list"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L322_C8", "label": "if", "type": "if", "loc": [322, 373], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L321_C4", "vector": [4, 2, 0.3496, 0.0523, 2, 0.68, 0.0, 0, 0, 0, 0, 0, 0, 0, 22], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if tup == None:\n mech_angle = compute_mech_angle_1(cd)\n else:\n mech_angle = compute_mech_angle_2(cd, tup)\n # compute new mech_rot_list. used for factoring the forces.\n mech_rot_list = compute_mech_rot_list(combined_dict, tup)\n combined_dict['mech_rot_list'] = mech_rot_list\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L323_C12", "label": "mech_angle = compute_mech_angle_1()", "type": "assigned_variable", "loc": [323, 323], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L322_C8", "vector": [14, 3, 0.3249, 0.001, 3, 0.76, 0.0, 945, 3, 1, 0, 0, 466, 10, 1], "semantic": {"name": "mech_angle", "arg_names": [], "import_names": [], "rhs_call_name": "compute_mech_angle_1", "annotation": ""}, "snippet": " mech_angle = compute_mech_angle_1(cd)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L325_C12", "label": "mech_angle = compute_mech_angle_2()", "type": "assigned_variable", "loc": [325, 325], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L322_C8", "vector": [14, 3, 0.327, 0.001, 3, 0.76, 0.0417, 945, 3, 2, 0, 0, 910, 10, 1], "semantic": {"name": "mech_angle", "arg_names": [], "import_names": [], "rhs_call_name": "compute_mech_angle_2", "annotation": ""}, "snippet": " mech_angle = compute_mech_angle_2(cd, tup)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L327_C12", "label": "mech_rot_list = compute_mech_rot_list()", "type": "assigned_variable", "loc": [327, 327], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L322_C8", "vector": [14, 3, 0.329, 0.001, 3, 0.76, 0.0833, 39, 3, 2, 0, 0, 679, 10, 1], "semantic": {"name": "mech_rot_list", "arg_names": [], "import_names": [], "rhs_call_name": "compute_mech_rot_list", "annotation": ""}, "snippet": " mech_rot_list = compute_mech_rot_list(combined_dict, tup)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L328_C12", "label": "assign", "type": "assigned_variable", "loc": [328, 328], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L322_C8", "vector": [14, 3, 0.33, 0.001, 3, 0.76, 0.125, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " combined_dict['mech_rot_list'] = mech_rot_list"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L330_C12", "label": "hook_tip_l = compute_hook_tip_trajectory()", "type": "assigned_variable", "loc": [330, 330], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L322_C8", "vector": [14, 3, 0.332, 0.001, 3, 0.76, 0.1667, 521, 3, 1, 0, 0, 585, 10, 1], "semantic": {"name": "hook_tip_l", "arg_names": [], "import_names": [], "rhs_call_name": "compute_hook_tip_trajectory", "annotation": ""}, "snippet": " hook_tip_l = compute_hook_tip_trajectory(cd)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L331_C12", "label": "hand_mat = column_stack()", "type": "assigned_variable", "loc": [331, 331], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L322_C8", "vector": [14, 3, 0.333, 0.001, 3, 0.76, 0.2083, 181, 3, 1, 0, 0, 724, 10, 1], "semantic": {"name": "hand_mat", "arg_names": [], "import_names": [], "rhs_call_name": "column_stack", "annotation": ""}, "snippet": " hand_mat = np.column_stack(hook_tip_l)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L332_C12", "label": "for i, f", "type": "for", "loc": [332, 335], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L322_C8", "vector": [6, 3, 0.3355, 0.004, 3, 0.76, 0.25, 291, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "i, f", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i,f in enumerate(force_cam.T):\n fmag = np.linalg.norm(f)\n if fmag > 1.0:\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L333_C16", "label": "fmag = norm()", "type": "assigned_variable", "loc": [333, 333], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L332_C12", "vector": [14, 4, 0.335, 0.001, 4, 0.77, 0.0, 470, 3, 1, 0, 0, 902, 10, 1], "semantic": {"name": "fmag", "arg_names": [], "import_names": [], "rhs_call_name": "norm", "annotation": ""}, "snippet": " fmag = np.linalg.norm(f)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L334_C16", "label": "if", "type": "if", "loc": [334, 335], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L332_C12", "vector": [4, 4, 0.3365, 0.002, 4, 0.77, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if fmag > 1.0:\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L336_C12", "label": "end_idx = argmax()", "type": "assigned_variable", "loc": [336, 336], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L322_C8", "vector": [14, 3, 0.338, 0.001, 3, 0.76, 0.2917, 539, 3, 1, 0, 0, 593, 10, 1], "semantic": {"name": "end_idx", "arg_names": [], "import_names": [], "rhs_call_name": "argmax", "annotation": ""}, "snippet": " end_idx = np.argmax(mech_angle)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L337_C12", "label": "hand_mat_short =", "type": "assigned_variable", "loc": [337, 337], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L322_C8", "vector": [14, 3, 0.339, 0.001, 3, 0.76, 0.3333, 77, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "hand_mat_short", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " hand_mat_short = hand_mat[:,i:end_idx]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L339_C12", "label": "kin_dict = fit()", "type": "assigned_variable", "loc": [339, 339], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L322_C8", "vector": [14, 3, 0.341, 0.001, 3, 0.76, 0.375, 775, 3, 2, 0, 0, 828, 10, 1], "semantic": {"name": "kin_dict", "arg_names": [], "import_names": [], "rhs_call_name": "fit", "annotation": ""}, "snippet": " kin_dict = ke.fit(hand_mat_short, tup)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L340_C12", "label": "center_hand =", "type": "assigned_variable", "loc": [340, 341], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L322_C8", "vector": [14, 3, 0.3426, 0.002, 3, 0.76, 0.4167, 453, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "center_hand", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " center_hand = np.matrix((kin_dict['cx'], kin_dict['cy'],\n kin_dict['cz'])).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L342_C12", "label": "radius_hand =", "type": "assigned_variable", "loc": [342, 342], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L322_C8", "vector": [14, 3, 0.3441, 0.001, 3, 0.76, 0.4583, 437, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "radius_hand", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " radius_hand = kin_dict['r']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L344_C12", "label": "center_mech_coord =", "type": "assigned_variable", "loc": [344, 344], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L322_C8", "vector": [14, 3, 0.3461, 0.001, 3, 0.76, 0.5, 980, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "center_mech_coord", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " center_mech_coord = mech_rot_list[0].T * center_hand"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L345_C12", "label": "start_mech_coord =", "type": "assigned_variable", "loc": [345, 345], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L322_C8", "vector": [14, 3, 0.3471, 0.001, 3, 0.76, 0.5417, 576, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "start_mech_coord", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " start_mech_coord = mech_rot_list[0].T * hand_mat_short[:,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L346_C12", "label": "opens_right =", "type": "assigned_variable", "loc": [346, 346], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L322_C8", "vector": [14, 3, 0.3481, 0.001, 3, 0.76, 0.5833, 22, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "opens_right", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " opens_right = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L347_C12", "label": "if", "type": "if", "loc": [347, 349], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L322_C8", "vector": [4, 3, 0.3501, 0.003, 3, 0.76, 0.625, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if start_mech_coord[0,0] < center_mech_coord[0,0]:\n print('Opens Right')\n opens_right = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L348_C16", "label": "print()", "type": "expression", "loc": [348, 348], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L347_C12", "vector": [8, 4, 0.3501, 0.001, 4, 0.77, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Opens Right')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L349_C16", "label": "opens_right =", "type": "assigned_variable", "loc": [349, 349], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L347_C12", "vector": [14, 4, 0.3511, 0.001, 4, 0.77, 1.0, 22, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "opens_right", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " opens_right = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L352_C12", "label": "radial_mat =", "type": "assigned_variable", "loc": [352, 352], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L322_C8", "vector": [14, 3, 0.3541, 0.001, 3, 0.76, 0.6667, 516, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "radial_mat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " radial_mat = hand_mat - center_hand"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L353_C12", "label": "radial_mat =", "type": "assigned_variable", "loc": [353, 353], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L322_C8", "vector": [14, 3, 0.3551, 0.001, 3, 0.76, 0.7083, 516, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "radial_mat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " radial_mat = radial_mat / ut.norm(radial_mat)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L354_C12", "label": "_, nrm_hand = project_points_plane()", "type": "assigned_variable", "loc": [354, 354], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L322_C8", "vector": [14, 3, 0.3561, 0.001, 3, 0.76, 0.75, 699, 3, 1, 0, 0, 771, 10, 1], "semantic": {"name": "_, nrm_hand", "arg_names": [], "import_names": [], "rhs_call_name": "project_points_plane", "annotation": ""}, "snippet": " _, nrm_hand = project_points_plane(hand_mat_short)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L355_C12", "label": "if", "type": "if", "loc": [355, 356], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L322_C8", "vector": [4, 3, 0.3576, 0.002, 3, 0.76, 0.7917, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if np.dot(nrm_hand.A1, mech_rot_list[0][:,1].A1) < 0:\n nrm_hand = -1 * nrm_hand"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L356_C16", "label": "nrm_hand =", "type": "assigned_variable", "loc": [356, 356], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L355_C12", "vector": [14, 4, 0.3581, 0.001, 4, 0.33, 0.0, 806, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "nrm_hand", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " nrm_hand = -1 * nrm_hand"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L357_C12", "label": "if", "type": "if", "loc": [357, 358], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L322_C8", "vector": [4, 3, 0.3597, 0.002, 3, 0.76, 0.8333, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if opens_right == False:\n nrm_hand = -1 * nrm_hand"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L358_C16", "label": "nrm_hand =", "type": "assigned_variable", "loc": [358, 358], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L357_C12", "vector": [14, 4, 0.3602, 0.001, 4, 0.04, 0.0, 806, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "nrm_hand", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " nrm_hand = -1 * nrm_hand"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L360_C12", "label": "frad_l =", "type": "assigned_variable", "loc": [360, 360], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L322_C8", "vector": [14, 3, 0.3622, 0.001, 3, 0.76, 0.875, 863, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "frad_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " frad_l = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L361_C12", "label": "ftan_l =", "type": "assigned_variable", "loc": [361, 361], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L322_C8", "vector": [14, 3, 0.3632, 0.001, 3, 0.76, 0.9167, 989, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "ftan_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ftan_l = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L362_C12", "label": "moment_contact_l =", "type": "assigned_variable", "loc": [362, 362], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L322_C8", "vector": [14, 3, 0.3642, 0.001, 3, 0.76, 0.9583, 166, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "moment_contact_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " moment_contact_l = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L363_C12", "label": "for i, f", "type": "for", "loc": [363, 373], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L322_C8", "vector": [6, 3, 0.3702, 0.0111, 3, 0.76, 1.0, 291, 3, 0, 0, 0, 0, 0, 8], "semantic": {"name": "i, f", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i, f in enumerate(force_cam.T):\n f = f.T\n m = (moment_cam[:,i].T * nrm_hand)[0,0]\n moment_contact_l.append(m)\n tvec = np.matrix(np.cross(nrm_hand.A1, radial_mat[:,i].A1)).T\n ftan = (f.T * tvec)[0,0]\n ftan_l.append(ftan)\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L364_C16", "label": "f =", "type": "assigned_variable", "loc": [364, 364], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L363_C12", "vector": [14, 4, 0.3662, 0.001, 4, 0.02, 0.0, 899, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " f = f.T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L365_C16", "label": "m =", "type": "assigned_variable", "loc": [365, 365], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L363_C12", "vector": [14, 4, 0.3672, 0.001, 4, 0.02, 0.1429, 711, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " m = (moment_cam[:,i].T * nrm_hand)[0,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L366_C16", "label": "append()", "type": "expression", "loc": [366, 366], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L363_C12", "vector": [8, 4, 0.3682, 0.001, 4, 0.02, 0.2857, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " moment_contact_l.append(m)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L367_C16", "label": "tvec =", "type": "assigned_variable", "loc": [367, 367], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L363_C12", "vector": [14, 4, 0.3692, 0.001, 4, 0.02, 0.4286, 214, 7, 0, 0, 0, 0, 0, 2], "semantic": {"name": "tvec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tvec = np.matrix(np.cross(nrm_hand.A1, radial_mat[:,i].A1)).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L368_C16", "label": "ftan =", "type": "assigned_variable", "loc": [368, 368], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L363_C12", "vector": [14, 4, 0.3702, 0.001, 4, 0.02, 0.5714, 771, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ftan", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ftan = (f.T * tvec)[0,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L369_C16", "label": "append()", "type": "expression", "loc": [369, 369], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L363_C12", "vector": [8, 4, 0.3712, 0.001, 4, 0.02, 0.7143, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " ftan_l.append(ftan)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L371_C16", "label": "frad = norm()", "type": "assigned_variable", "loc": [371, 371], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L363_C12", "vector": [14, 4, 0.3732, 0.001, 4, 0.02, 0.8571, 209, 3, 1, 0, 0, 902, 10, 1], "semantic": {"name": "frad", "arg_names": [], "import_names": [], "rhs_call_name": "norm", "annotation": ""}, "snippet": " frad = np.linalg.norm(f - tvec * ftan)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L373_C16", "label": "append()", "type": "expression", "loc": [373, 373], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L363_C12", "vector": [8, 4, 0.3753, 0.001, 4, 0.02, 1.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " frad_l.append(abs(frad))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L375_C8", "label": "typ =", "type": "assigned_variable", "loc": [375, 375], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L321_C4", "vector": [14, 2, 0.3773, 0.001, 2, 0.68, 0.0909, 722, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "typ", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " typ = 'rotary'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L378_C8", "label": "pos_mat = column_stack()", "type": "assigned_variable", "loc": [378, 378], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L321_C4", "vector": [14, 2, 0.3803, 0.001, 2, 0.68, 0.1818, 932, 3, 1, 0, 0, 724, 10, 1], "semantic": {"name": "pos_mat", "arg_names": [], "import_names": [], "rhs_call_name": "column_stack", "annotation": ""}, "snippet": " pos_mat = np.column_stack(cd['mech_pos_list'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L379_C8", "label": "mech_angle = tolist()", "type": "assigned_variable", "loc": [379, 379], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L321_C4", "vector": [14, 2, 0.3813, 0.001, 2, 0.68, 0.2727, 945, 3, 0, 0, 0, 185, 10, 2], "semantic": {"name": "mech_angle", "arg_names": [], "import_names": [], "rhs_call_name": "tolist", "annotation": ""}, "snippet": " mech_angle = ut.norm(pos_mat-pos_mat[:,0]).A1.tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L381_C8", "label": "typ =", "type": "assigned_variable", "loc": [381, 381], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L321_C4", "vector": [14, 2, 0.3833, 0.001, 2, 0.68, 0.3636, 722, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "typ", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " typ = 'prismatic'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L382_C8", "label": "moment_axis_list =", "type": "assigned_variable", "loc": [382, 382], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L321_C4", "vector": [14, 2, 0.3843, 0.001, 2, 0.68, 0.4545, 418, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "moment_axis_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " moment_axis_list = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L384_C8", "label": "frad_l =", "type": "assigned_variable", "loc": [384, 384], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L321_C4", "vector": [14, 2, 0.3863, 0.001, 2, 0.68, 0.5455, 863, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "frad_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " frad_l = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L385_C8", "label": "ftan_l =", "type": "assigned_variable", "loc": [385, 385], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L321_C4", "vector": [14, 2, 0.3873, 0.001, 2, 0.68, 0.6364, 989, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "ftan_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ftan_l = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L386_C8", "label": "moment_contact_l =", "type": "assigned_variable", "loc": [386, 386], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L321_C4", "vector": [14, 2, 0.3883, 0.001, 2, 0.68, 0.7273, 166, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "moment_contact_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " moment_contact_l = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L387_C8", "label": "rot_list =", "type": "assigned_variable", "loc": [387, 387], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L321_C4", "vector": [14, 2, 0.3893, 0.001, 2, 0.68, 0.8182, 352, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "rot_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rot_list = cd['mech_rot_list']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L388_C8", "label": "directions_z =", "type": "assigned_variable", "loc": [388, 388], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L321_C4", "vector": [14, 2, 0.3903, 0.001, 2, 0.68, 0.9091, 12, 7, 0, 0, 0, 0, 0, 3], "semantic": {"name": "directions_z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " directions_z = (np.row_stack(rot_list)[:,2]).T.reshape(len(rot_list), 3).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L389_C8", "label": "for i, f", "type": "for", "loc": [389, 398], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L321_C4", "vector": [6, 2, 0.3959, 0.0101, 2, 0.68, 1.0, 291, 3, 0, 0, 0, 0, 0, 6], "semantic": {"name": "i, f", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i, f in enumerate(force_cam.T):\n f = f.T\n tvec = np.matrix(directions_z[:,i])\n ftan = (f.T * tvec)[0,0]\n ftan_l.append(ftan)\n\n frad = np.linalg.norm(f - tvec * ftan)\n #frad = (f_cam.T*radial_mat[:,i])[0,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L390_C12", "label": "f =", "type": "assigned_variable", "loc": [390, 390], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L389_C8", "vector": [14, 3, 0.3924, 0.001, 3, 0.82, 0.0, 899, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " f = f.T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L391_C12", "label": "tvec = matrix()", "type": "assigned_variable", "loc": [391, 391], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L389_C8", "vector": [14, 3, 0.3934, 0.001, 3, 0.82, 0.1667, 214, 3, 1, 0, 0, 162, 10, 1], "semantic": {"name": "tvec", "arg_names": [], "import_names": [], "rhs_call_name": "matrix", "annotation": ""}, "snippet": " tvec = np.matrix(directions_z[:,i])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L392_C12", "label": "ftan =", "type": "assigned_variable", "loc": [392, 392], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L389_C8", "vector": [14, 3, 0.3944, 0.001, 3, 0.82, 0.3333, 771, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ftan", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ftan = (f.T * tvec)[0,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L393_C12", "label": "append()", "type": "expression", "loc": [393, 393], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L389_C8", "vector": [8, 3, 0.3954, 0.001, 3, 0.82, 0.5, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " ftan_l.append(ftan)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L395_C12", "label": "frad = norm()", "type": "assigned_variable", "loc": [395, 395], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L389_C8", "vector": [14, 3, 0.3974, 0.001, 3, 0.82, 0.6667, 209, 3, 1, 0, 0, 902, 10, 1], "semantic": {"name": "frad", "arg_names": [], "import_names": [], "rhs_call_name": "norm", "annotation": ""}, "snippet": " frad = np.linalg.norm(f - tvec * ftan)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L397_C12", "label": "append()", "type": "expression", "loc": [397, 397], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L389_C8", "vector": [8, 3, 0.3994, 0.001, 3, 0.82, 0.8333, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " frad_l.append(abs(frad))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L398_C12", "label": "radius_hand =", "type": "assigned_variable", "loc": [398, 398], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L389_C8", "vector": [14, 3, 0.4004, 0.001, 3, 0.82, 1.0, 437, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "radius_hand", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " radius_hand = 10."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L400_C4", "label": "save_pickle()", "type": "expression", "loc": [400, 400], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L311_C0", "vector": [8, 1, 0.4024, 0.001, 1, 0.69, 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": " ut.save_pickle(combined_dict, cd_pkl_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Return_L402_C4", "label": "return", "type": "return", "loc": [402, 403], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L311_C0", "vector": [13, 1, 0.4049, 0.002, 1, 0.69, 1.0, 0, 0, 0, 0, 0, 0, 8, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return np.array(frad_l), np.array(ftan_l), mech_angle, typ, \\\n np.array(ftan_l)*radius_hand, np.array(moment_contact_l)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L405_C0", "label": "plot_radial_tangential", "type": "function", "loc": [405, 440], "level": 0, "parent": null, "vector": [2, 0, 0.4251, 0.0362, 0, 0.66, 0.6875, 73, 0, 3, 0, 0, 0, 0, 13], "semantic": {"name": "plot_radial_tangential", "arg_names": ["mech_dict", "savefig", "fig_name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def plot_radial_tangential(mech_dict, savefig, fig_name=''):\n radial_mech = mech_dict['force_rad_list']\n tangential_mech = mech_dict['force_tan_list']\n typ = mech_dict['mech_type']\n mech_x = mech_dict['mechanism_x']\n if typ == 'rotary':\n mech_x_degrees = np.degrees(mech_x)\n xlabel = 'angle (degrees)'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L406_C4", "label": "radial_mech =", "type": "assigned_variable", "loc": [406, 406], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L405_C0", "vector": [14, 1, 0.4085, 0.001, 1, 0.15, 0.0, 852, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "radial_mech", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " radial_mech = mech_dict['force_rad_list']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L407_C4", "label": "tangential_mech =", "type": "assigned_variable", "loc": [407, 407], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L405_C0", "vector": [14, 1, 0.4095, 0.001, 1, 0.15, 0.1, 528, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "tangential_mech", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tangential_mech = mech_dict['force_tan_list']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L408_C4", "label": "typ =", "type": "assigned_variable", "loc": [408, 408], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L405_C0", "vector": [14, 1, 0.4105, 0.001, 1, 0.15, 0.2, 722, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "typ", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " typ = mech_dict['mech_type']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L409_C4", "label": "mech_x =", "type": "assigned_variable", "loc": [409, 409], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L405_C0", "vector": [14, 1, 0.4115, 0.001, 1, 0.15, 0.3, 712, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "mech_x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mech_x = mech_dict['mechanism_x']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L410_C4", "label": "if", "type": "if", "loc": [410, 415], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L405_C0", "vector": [4, 1, 0.415, 0.006, 1, 0.15, 0.4, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if typ == 'rotary':\n mech_x_degrees = np.degrees(mech_x)\n xlabel = 'angle (degrees)'\n else:\n mech_x_degrees = mech_x\n xlabel = 'distance (meters)'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L411_C8", "label": "mech_x_degrees = degrees()", "type": "assigned_variable", "loc": [411, 411], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L410_C4", "vector": [14, 2, 0.4135, 0.001, 2, 0.31, 0.0, 378, 3, 1, 0, 0, 633, 10, 1], "semantic": {"name": "mech_x_degrees", "arg_names": [], "import_names": [], "rhs_call_name": "degrees", "annotation": ""}, "snippet": " mech_x_degrees = np.degrees(mech_x)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L412_C8", "label": "xlabel =", "type": "assigned_variable", "loc": [412, 412], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L410_C4", "vector": [14, 2, 0.4145, 0.001, 2, 0.31, 0.3333, 676, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "xlabel", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " xlabel = 'angle (degrees)'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L414_C8", "label": "mech_x_degrees =", "type": "assigned_variable", "loc": [414, 414], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L410_C4", "vector": [14, 2, 0.4165, 0.001, 2, 0.31, 0.6667, 378, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "mech_x_degrees", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mech_x_degrees = mech_x"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L415_C8", "label": "xlabel =", "type": "assigned_variable", "loc": [415, 415], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L410_C4", "vector": [14, 2, 0.4175, 0.001, 2, 0.31, 1.0, 676, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "xlabel", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " xlabel = 'distance (meters)'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L416_C4", "label": "clf()", "type": "expression", "loc": [416, 416], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L405_C0", "vector": [8, 1, 0.4185, 0.001, 1, 0.15, 0.5, 704, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "clf", "arg_names": [], "import_names": [], "rhs_call_name": "clf", "annotation": ""}, "snippet": " mpu.pl.clf()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L417_C4", "label": "plot_yx()", "type": "expression", "loc": [417, 418], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L405_C0", "vector": [8, 1, 0.42, 0.002, 1, 0.15, 0.6, 112, 3, 7, 0, 0, 0, 0, 1], "semantic": {"name": "plot_yx", "arg_names": [], "import_names": [], "rhs_call_name": "plot_yx", "annotation": ""}, "snippet": " mpu.plot_yx(radial_mech, mech_x_degrees, axis=None, label='radial force',\n xlabel=xlabel, ylabel='N', color='r')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L419_C4", "label": "plot_yx()", "type": "expression", "loc": [419, 420], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L405_C0", "vector": [8, 1, 0.422, 0.002, 1, 0.15, 0.7, 112, 3, 7, 0, 0, 0, 0, 1], "semantic": {"name": "plot_yx", "arg_names": [], "import_names": [], "rhs_call_name": "plot_yx", "annotation": ""}, "snippet": " mpu.plot_yx(tangential_mech, mech_x_degrees, axis=None, label='tangential force',\n xlabel=xlabel, ylabel='N', color='g')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L421_C4", "label": "legend()", "type": "expression", "loc": [421, 421], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L405_C0", "vector": [8, 1, 0.4235, 0.001, 1, 0.15, 0.8, 880, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "legend", "arg_names": [], "import_names": [], "rhs_call_name": "legend", "annotation": ""}, "snippet": " mpu.legend()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L423_C4", "label": "if", "type": "if", "loc": [423, 434], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L405_C0", "vector": [4, 1, 0.4311, 0.0121, 1, 0.15, 0.9, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if typ == 'rotary':\n mpu.figure()\n rad = mech_dict['radius']\n torques_1 = rad * np.array(tangential_mech)\n torques_3 = np.array(mech_dict['moment_tip_list']) + torques_1\n mpu.plot_yx(torques_1, mech_x_degrees, axis=None,\n label='torque from tangential',\n xlabel=xlabel, ylabel='moment', color='r')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L424_C8", "label": "figure()", "type": "expression", "loc": [424, 424], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L423_C4", "vector": [8, 2, 0.4266, 0.001, 2, 0.61, 0.0, 789, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "figure", "arg_names": [], "import_names": [], "rhs_call_name": "figure", "annotation": ""}, "snippet": " mpu.figure()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L425_C8", "label": "rad =", "type": "assigned_variable", "loc": [425, 425], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L423_C4", "vector": [14, 2, 0.4276, 0.001, 2, 0.61, 0.1667, 439, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "rad", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rad = mech_dict['radius']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L426_C8", "label": "torques_1 =", "type": "assigned_variable", "loc": [426, 426], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L423_C4", "vector": [14, 2, 0.4286, 0.001, 2, 0.61, 0.3333, 346, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "torques_1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " torques_1 = rad * np.array(tangential_mech)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L427_C8", "label": "torques_3 =", "type": "assigned_variable", "loc": [427, 427], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L423_C4", "vector": [14, 2, 0.4296, 0.001, 2, 0.61, 0.5, 517, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "torques_3", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " torques_3 = np.array(mech_dict['moment_tip_list']) + torques_1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L428_C8", "label": "plot_yx()", "type": "expression", "loc": [428, 430], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L423_C4", "vector": [8, 2, 0.4316, 0.003, 2, 0.61, 0.6667, 112, 3, 7, 0, 0, 0, 0, 1], "semantic": {"name": "plot_yx", "arg_names": [], "import_names": [], "rhs_call_name": "plot_yx", "annotation": ""}, "snippet": " mpu.plot_yx(torques_1, mech_x_degrees, axis=None,\n label='torque from tangential',\n xlabel=xlabel, ylabel='moment', color='r')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L431_C8", "label": "plot_yx()", "type": "expression", "loc": [431, 433], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L423_C4", "vector": [8, 2, 0.4346, 0.003, 2, 0.61, 0.8333, 112, 3, 7, 0, 0, 0, 0, 1], "semantic": {"name": "plot_yx", "arg_names": [], "import_names": [], "rhs_call_name": "plot_yx", "annotation": ""}, "snippet": " mpu.plot_yx(torques_3, mech_x_degrees, axis=None,\n label='total torque',\n xlabel=xlabel, ylabel='moment', color='y')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L434_C8", "label": "legend()", "type": "expression", "loc": [434, 434], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L423_C4", "vector": [8, 2, 0.4366, 0.001, 2, 0.61, 1.0, 880, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "legend", "arg_names": [], "import_names": [], "rhs_call_name": "legend", "annotation": ""}, "snippet": " mpu.legend()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L437_C4", "label": "if", "type": "if", "loc": [437, 440], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L405_C0", "vector": [4, 1, 0.4411, 0.004, 1, 0.15, 1.0, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if savefig:\n mpu.savefig(opt.dir+'/%s_force_components.png'%fig_name)\n else:\n mpu.show()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L438_C8", "label": "savefig()", "type": "expression", "loc": [438, 438], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L437_C4", "vector": [8, 2, 0.4406, 0.001, 2, 0.85, 0.0, 677, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "savefig", "arg_names": [], "import_names": [], "rhs_call_name": "savefig", "annotation": ""}, "snippet": " mpu.savefig(opt.dir+'/%s_force_components.png'%fig_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L440_C8", "label": "show()", "type": "expression", "loc": [440, 440], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L437_C4", "vector": [8, 2, 0.4427, 0.001, 2, 0.85, 1.0, 497, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "show", "arg_names": [], "import_names": [], "rhs_call_name": "show", "annotation": ""}, "snippet": " mpu.show()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L445_C0", "label": "fts_to_camera", "type": "function", "loc": [445, 467], "level": 0, "parent": null, "vector": [2, 0, 0.4588, 0.0231, 0, 0.66, 0.7188, 531, 0, 1, 1, 0, 0, 0, 9], "semantic": {"name": "fts_to_camera", "arg_names": ["combined_dict"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def fts_to_camera(combined_dict):\n cd = combined_dict\n number = cd['hook_checker_number']\n hand_rot = cd['hand_rot_list']\n hand_pos = cd['hand_pos_list']\n ft_mat = np.matrix(cd['ft_list']).T # 6xN np matrix\n force_mat = ft_mat[0:3, :]\n moment_mat = ft_mat[3:6, :]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L446_C4", "label": "cd =", "type": "assigned_variable", "loc": [446, 446], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L445_C0", "vector": [14, 1, 0.4487, 0.001, 1, 0.06, 0.0, 214, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "cd", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cd = combined_dict"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L447_C4", "label": "number =", "type": "assigned_variable", "loc": [447, 447], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L445_C0", "vector": [14, 1, 0.4497, 0.001, 1, 0.06, 0.0667, 408, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "number", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " number = cd['hook_checker_number']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L448_C4", "label": "hand_rot =", "type": "assigned_variable", "loc": [448, 448], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L445_C0", "vector": [14, 1, 0.4507, 0.001, 1, 0.06, 0.1333, 648, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "hand_rot", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " hand_rot = cd['hand_rot_list']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L449_C4", "label": "hand_pos =", "type": "assigned_variable", "loc": [449, 449], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L445_C0", "vector": [14, 1, 0.4517, 0.001, 1, 0.06, 0.2, 165, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "hand_pos", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " hand_pos = cd['hand_pos_list']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L450_C4", "label": "ft_mat =", "type": "assigned_variable", "loc": [450, 450], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L445_C0", "vector": [14, 1, 0.4527, 0.001, 1, 0.06, 0.2667, 624, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "ft_mat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ft_mat = np.matrix(cd['ft_list']).T # 6xN np matrix"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L451_C4", "label": "force_mat =", "type": "assigned_variable", "loc": [451, 451], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L445_C0", "vector": [14, 1, 0.4537, 0.001, 1, 0.06, 0.3333, 156, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "force_mat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " force_mat = ft_mat[0:3, :]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L452_C4", "label": "moment_mat =", "type": "assigned_variable", "loc": [452, 452], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L445_C0", "vector": [14, 1, 0.4547, 0.001, 1, 0.06, 0.4, 931, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "moment_mat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " moment_mat = ft_mat[3:6, :]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L454_C4", "label": "n_forces =", "type": "assigned_variable", "loc": [454, 454], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L445_C0", "vector": [14, 1, 0.4567, 0.001, 1, 0.06, 0.4667, 103, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "n_forces", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " n_forces = force_mat.shape[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L455_C4", "label": "force_cam_list =", "type": "assigned_variable", "loc": [455, 455], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L445_C0", "vector": [14, 1, 0.4577, 0.001, 1, 0.06, 0.5333, 532, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "force_cam_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " force_cam_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L456_C4", "label": "moment_cam_list =", "type": "assigned_variable", "loc": [456, 456], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L445_C0", "vector": [14, 1, 0.4588, 0.001, 1, 0.06, 0.6, 438, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "moment_cam_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " moment_cam_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L457_C4", "label": "moment_base_list =", "type": "assigned_variable", "loc": [457, 457], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L445_C0", "vector": [14, 1, 0.4598, 0.001, 1, 0.06, 0.6667, 51, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "moment_base_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " moment_base_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L458_C4", "label": "for i", "type": "for", "loc": [458, 463], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L445_C0", "vector": [6, 1, 0.4633, 0.006, 1, 0.06, 0.7333, 826, 3, 0, 0, 0, 0, 0, 5], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(n_forces):\n f,m,m_base = ft_to_camera_3(force_mat[:,i], moment_mat[:,i], hand_rot[i],\n number, return_moment_cam = True)\n force_cam_list.append(f)\n moment_cam_list.append(m)\n moment_base_list.append(m_base)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L459_C8", "label": "f, m, m_base = ft_to_camera_3()", "type": "assigned_variable", "loc": [459, 460], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L458_C4", "vector": [14, 2, 0.4623, 0.002, 2, 0.8, 0.0, 866, 3, 5, 0, 0, 909, 10, 1], "semantic": {"name": "f, m, m_base", "arg_names": [], "import_names": [], "rhs_call_name": "ft_to_camera_3", "annotation": ""}, "snippet": " f,m,m_base = ft_to_camera_3(force_mat[:,i], moment_mat[:,i], hand_rot[i],\n number, return_moment_cam = True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L461_C8", "label": "append()", "type": "expression", "loc": [461, 461], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L458_C4", "vector": [8, 2, 0.4638, 0.001, 2, 0.8, 0.3333, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " force_cam_list.append(f)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L462_C8", "label": "append()", "type": "expression", "loc": [462, 462], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L458_C4", "vector": [8, 2, 0.4648, 0.001, 2, 0.8, 0.6667, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " moment_cam_list.append(m)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L463_C8", "label": "append()", "type": "expression", "loc": [463, 463], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L458_C4", "vector": [8, 2, 0.4658, 0.001, 2, 0.8, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " moment_base_list.append(m_base)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L464_C4", "label": "force_cam = column_stack()", "type": "assigned_variable", "loc": [464, 464], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L445_C0", "vector": [14, 1, 0.4668, 0.001, 1, 0.06, 0.8, 645, 3, 1, 0, 0, 724, 10, 1], "semantic": {"name": "force_cam", "arg_names": [], "import_names": [], "rhs_call_name": "column_stack", "annotation": ""}, "snippet": " force_cam = np.column_stack(force_cam_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L465_C4", "label": "moment_cam = column_stack()", "type": "assigned_variable", "loc": [465, 465], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L445_C0", "vector": [14, 1, 0.4678, 0.001, 1, 0.06, 0.8667, 231, 3, 1, 0, 0, 724, 10, 1], "semantic": {"name": "moment_cam", "arg_names": [], "import_names": [], "rhs_call_name": "column_stack", "annotation": ""}, "snippet": " moment_cam = np.column_stack(moment_cam_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L466_C4", "label": "moment_base = column_stack()", "type": "assigned_variable", "loc": [466, 466], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L445_C0", "vector": [14, 1, 0.4688, 0.001, 1, 0.06, 0.9333, 198, 3, 1, 0, 0, 724, 10, 1], "semantic": {"name": "moment_base", "arg_names": [], "import_names": [], "rhs_call_name": "column_stack", "annotation": ""}, "snippet": " moment_base = np.column_stack(moment_base_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Return_L467_C4", "label": "return", "type": "return", "loc": [467, 467], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L445_C0", "vector": [13, 1, 0.4698, 0.001, 1, 0.06, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return force_cam, moment_cam, moment_base"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L469_C0", "label": "plot_forces", "type": "function", "loc": [469, 483], "level": 0, "parent": null, "vector": [2, 0, 0.4789, 0.0151, 0, 0.66, 0.75, 732, 0, 1, 0, 0, 0, 0, 10], "semantic": {"name": "plot_forces", "arg_names": ["combined_dict"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def plot_forces(combined_dict):\n cd = combined_dict\n hand_mat = np.column_stack(cd['hand_pos_list'])\n hand_rot = cd['hand_rot_list']\n\n mech_mat = np.column_stack(cd['mech_pos_list'])\n mech_rot = cd['mech_rot_list']\n directions_x = (np.row_stack(mech_rot)[:,0]).T.reshape(len(mech_rot), 3).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L470_C4", "label": "cd =", "type": "assigned_variable", "loc": [470, 470], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L469_C0", "vector": [14, 1, 0.4728, 0.001, 1, 0.68, 0.0, 214, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "cd", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cd = combined_dict"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L471_C4", "label": "hand_mat = column_stack()", "type": "assigned_variable", "loc": [471, 471], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L469_C0", "vector": [14, 1, 0.4738, 0.001, 1, 0.68, 0.1, 181, 3, 1, 0, 0, 724, 10, 1], "semantic": {"name": "hand_mat", "arg_names": [], "import_names": [], "rhs_call_name": "column_stack", "annotation": ""}, "snippet": " hand_mat = np.column_stack(cd['hand_pos_list'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L472_C4", "label": "hand_rot =", "type": "assigned_variable", "loc": [472, 472], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L469_C0", "vector": [14, 1, 0.4748, 0.001, 1, 0.68, 0.2, 648, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "hand_rot", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " hand_rot = cd['hand_rot_list']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L474_C4", "label": "mech_mat = column_stack()", "type": "assigned_variable", "loc": [474, 474], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L469_C0", "vector": [14, 1, 0.4769, 0.001, 1, 0.68, 0.3, 240, 3, 1, 0, 0, 724, 10, 1], "semantic": {"name": "mech_mat", "arg_names": [], "import_names": [], "rhs_call_name": "column_stack", "annotation": ""}, "snippet": " mech_mat = np.column_stack(cd['mech_pos_list'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L475_C4", "label": "mech_rot =", "type": "assigned_variable", "loc": [475, 475], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L469_C0", "vector": [14, 1, 0.4779, 0.001, 1, 0.68, 0.4, 682, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "mech_rot", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mech_rot = cd['mech_rot_list']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L476_C4", "label": "directions_x =", "type": "assigned_variable", "loc": [476, 476], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L469_C0", "vector": [14, 1, 0.4789, 0.001, 1, 0.68, 0.5, 755, 7, 0, 0, 0, 0, 0, 3], "semantic": {"name": "directions_x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " directions_x = (np.row_stack(mech_rot)[:,0]).T.reshape(len(mech_rot), 3).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L477_C4", "label": "force_cam, moment_cam, _ = fts_to_camera()", "type": "assigned_variable", "loc": [477, 477], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L469_C0", "vector": [14, 1, 0.4799, 0.001, 1, 0.68, 0.6, 540, 3, 1, 0, 0, 531, 10, 1], "semantic": {"name": "force_cam, moment_cam, _", "arg_names": [], "import_names": [], "rhs_call_name": "fts_to_camera", "annotation": ""}, "snippet": " force_cam, moment_cam, _ = fts_to_camera(combined_dict)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L479_C4", "label": "plot_points()", "type": "expression", "loc": [479, 479], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L469_C0", "vector": [8, 1, 0.4819, 0.001, 1, 0.68, 0.7, 111, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "plot_points", "arg_names": [], "import_names": [], "rhs_call_name": "plot_points", "annotation": ""}, "snippet": " d3m.plot_points(hand_mat, color = (1.,0.,0.), mode='sphere')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L480_C4", "label": "plot_points()", "type": "expression", "loc": [480, 480], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L469_C0", "vector": [8, 1, 0.4829, 0.001, 1, 0.68, 0.8, 111, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "plot_points", "arg_names": [], "import_names": [], "rhs_call_name": "plot_points", "annotation": ""}, "snippet": " d3m.plot_points(mech_mat, color = (0.,0.,1.), mode='sphere')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L481_C4", "label": "plot_normals()", "type": "expression", "loc": [481, 481], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L469_C0", "vector": [8, 1, 0.4839, 0.001, 1, 0.68, 0.9, 568, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "plot_normals", "arg_names": [], "import_names": [], "rhs_call_name": "plot_normals", "annotation": ""}, "snippet": " d3m.plot_normals(mech_mat, directions_x, color=(1.,0,0.))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L483_C4", "label": "plot_normals()", "type": "expression", "loc": [483, 483], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L469_C0", "vector": [8, 1, 0.4859, 0.001, 1, 0.68, 1.0, 568, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "plot_normals", "arg_names": [], "import_names": [], "rhs_call_name": "plot_normals", "annotation": ""}, "snippet": " d3m.plot_normals(mech_mat, force_cam, color=(0.,0,1.))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L485_C0", "label": "plot_trajectories", "type": "function", "loc": [485, 523], "level": 0, "parent": null, "vector": [2, 0, 0.507, 0.0392, 0, 0.66, 0.7812, 173, 0, 1, 0, 0, 0, 0, 31], "semantic": {"name": "plot_trajectories", "arg_names": ["combined_dict"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def plot_trajectories(combined_dict):\n cd = combined_dict\n hand_mat = np.column_stack(cd['hand_pos_list'])\n hand_rot = cd['hand_rot_list']\n directions_x = (np.row_stack(hand_rot)[:,0]).T.reshape(len(hand_rot), 3).T\n directions_y = (np.row_stack(hand_rot)[:,1]).T.reshape(len(hand_rot), 3).T\n directions_z = (np.row_stack(hand_rot)[:,2]).T.reshape(len(hand_rot), 3).T\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L486_C4", "label": "cd =", "type": "assigned_variable", "loc": [486, 486], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L485_C0", "vector": [14, 1, 0.4889, 0.001, 1, 0.58, 0.0, 214, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "cd", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cd = combined_dict"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L487_C4", "label": "hand_mat = column_stack()", "type": "assigned_variable", "loc": [487, 487], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L485_C0", "vector": [14, 1, 0.4899, 0.001, 1, 0.58, 0.0476, 181, 3, 1, 0, 0, 724, 10, 1], "semantic": {"name": "hand_mat", "arg_names": [], "import_names": [], "rhs_call_name": "column_stack", "annotation": ""}, "snippet": " hand_mat = np.column_stack(cd['hand_pos_list'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L488_C4", "label": "hand_rot =", "type": "assigned_variable", "loc": [488, 488], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L485_C0", "vector": [14, 1, 0.4909, 0.001, 1, 0.58, 0.0952, 648, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "hand_rot", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " hand_rot = cd['hand_rot_list']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L489_C4", "label": "directions_x =", "type": "assigned_variable", "loc": [489, 489], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L485_C0", "vector": [14, 1, 0.492, 0.001, 1, 0.58, 0.1429, 755, 7, 0, 0, 0, 0, 0, 3], "semantic": {"name": "directions_x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " directions_x = (np.row_stack(hand_rot)[:,0]).T.reshape(len(hand_rot), 3).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L490_C4", "label": "directions_y =", "type": "assigned_variable", "loc": [490, 490], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L485_C0", "vector": [14, 1, 0.493, 0.001, 1, 0.58, 0.1905, 862, 7, 0, 0, 0, 0, 0, 3], "semantic": {"name": "directions_y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " directions_y = (np.row_stack(hand_rot)[:,1]).T.reshape(len(hand_rot), 3).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L491_C4", "label": "directions_z =", "type": "assigned_variable", "loc": [491, 491], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L485_C0", "vector": [14, 1, 0.494, 0.001, 1, 0.58, 0.2381, 12, 7, 0, 0, 0, 0, 0, 3], "semantic": {"name": "directions_z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " directions_z = (np.row_stack(hand_rot)[:,2]).T.reshape(len(hand_rot), 3).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L495_C4", "label": "plot_points()", "type": "expression", "loc": [495, 496], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L485_C0", "vector": [8, 1, 0.4985, 0.002, 1, 0.58, 0.2857, 111, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "plot_points", "arg_names": [], "import_names": [], "rhs_call_name": "plot_points", "annotation": ""}, "snippet": " d3m.plot_points(hand_mat, color = (1.,0.,0.), mode='sphere',\n scale_factor = 0.005)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L497_C4", "label": "plot_normals()", "type": "expression", "loc": [497, 498], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L485_C0", "vector": [8, 1, 0.5005, 0.002, 1, 0.58, 0.3333, 568, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "plot_normals", "arg_names": [], "import_names": [], "rhs_call_name": "plot_normals", "annotation": ""}, "snippet": " d3m.plot_normals(hand_mat, directions_x, color=(1.,0,0.),\n scale_factor = 0.02)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L499_C4", "label": "plot_normals()", "type": "expression", "loc": [499, 500], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L485_C0", "vector": [8, 1, 0.5025, 0.002, 1, 0.58, 0.381, 568, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "plot_normals", "arg_names": [], "import_names": [], "rhs_call_name": "plot_normals", "annotation": ""}, "snippet": " d3m.plot_normals(hand_mat, directions_y, color=(0.,1,0.),\n scale_factor = 0.02)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L501_C4", "label": "plot_normals()", "type": "expression", "loc": [501, 502], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L485_C0", "vector": [8, 1, 0.5045, 0.002, 1, 0.58, 0.4286, 568, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "plot_normals", "arg_names": [], "import_names": [], "rhs_call_name": "plot_normals", "annotation": ""}, "snippet": " d3m.plot_normals(hand_mat, directions_z, color=(0.,0,1.),\n scale_factor = 0.02)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L504_C4", "label": "mech_mat = column_stack()", "type": "assigned_variable", "loc": [504, 504], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L485_C0", "vector": [14, 1, 0.507, 0.001, 1, 0.58, 0.4762, 240, 3, 1, 0, 0, 724, 10, 1], "semantic": {"name": "mech_mat", "arg_names": [], "import_names": [], "rhs_call_name": "column_stack", "annotation": ""}, "snippet": " mech_mat = np.column_stack(cd['mech_pos_list'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L505_C4", "label": "mech_rot =", "type": "assigned_variable", "loc": [505, 505], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L485_C0", "vector": [14, 1, 0.508, 0.001, 1, 0.58, 0.5238, 682, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "mech_rot", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mech_rot = cd['mech_rot_list']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L506_C4", "label": "directions_x =", "type": "assigned_variable", "loc": [506, 506], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L485_C0", "vector": [14, 1, 0.5091, 0.001, 1, 0.58, 0.5714, 755, 7, 0, 0, 0, 0, 0, 3], "semantic": {"name": "directions_x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " directions_x = (np.row_stack(mech_rot)[:,0]).T.reshape(len(mech_rot), 3).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L507_C4", "label": "directions_y =", "type": "assigned_variable", "loc": [507, 507], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L485_C0", "vector": [14, 1, 0.5101, 0.001, 1, 0.58, 0.619, 862, 7, 0, 0, 0, 0, 0, 3], "semantic": {"name": "directions_y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " directions_y = (np.row_stack(mech_rot)[:,1]).T.reshape(len(hand_rot), 3).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L508_C4", "label": "directions_z =", "type": "assigned_variable", "loc": [508, 508], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L485_C0", "vector": [14, 1, 0.5111, 0.001, 1, 0.58, 0.6667, 12, 7, 0, 0, 0, 0, 0, 3], "semantic": {"name": "directions_z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " directions_z = (np.row_stack(mech_rot)[:,2]).T.reshape(len(mech_rot), 3).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L510_C4", "label": "plot_points()", "type": "expression", "loc": [510, 511], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L485_C0", "vector": [8, 1, 0.5136, 0.002, 1, 0.58, 0.7143, 111, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "plot_points", "arg_names": [], "import_names": [], "rhs_call_name": "plot_points", "annotation": ""}, "snippet": " d3m.plot_points(mech_mat[:,0:1], color = (0.,0.,0.), mode='sphere',\n scale_factor = 0.01)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L512_C4", "label": "plot_points()", "type": "expression", "loc": [512, 513], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L485_C0", "vector": [8, 1, 0.5156, 0.002, 1, 0.58, 0.7619, 111, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "plot_points", "arg_names": [], "import_names": [], "rhs_call_name": "plot_points", "annotation": ""}, "snippet": " d3m.plot_points(mech_mat, color = (0.,0.,1.), mode='sphere',\n scale_factor = 0.005)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L514_C4", "label": "plot_normals()", "type": "expression", "loc": [514, 515], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L485_C0", "vector": [8, 1, 0.5176, 0.002, 1, 0.58, 0.8095, 568, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "plot_normals", "arg_names": [], "import_names": [], "rhs_call_name": "plot_normals", "annotation": ""}, "snippet": " d3m.plot_normals(mech_mat, directions_x, color=(1.,0,0.),\n scale_factor = 0.02)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L516_C4", "label": "plot_normals()", "type": "expression", "loc": [516, 517], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L485_C0", "vector": [8, 1, 0.5196, 0.002, 1, 0.58, 0.8571, 568, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "plot_normals", "arg_names": [], "import_names": [], "rhs_call_name": "plot_normals", "annotation": ""}, "snippet": " d3m.plot_normals(mech_mat, directions_y, color=(0.,1,0.),\n scale_factor = 0.02)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L518_C4", "label": "plot_normals()", "type": "expression", "loc": [518, 519], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L485_C0", "vector": [8, 1, 0.5216, 0.002, 1, 0.58, 0.9048, 568, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "plot_normals", "arg_names": [], "import_names": [], "rhs_call_name": "plot_normals", "annotation": ""}, "snippet": " d3m.plot_normals(mech_mat, directions_z, color=(0.,0,1.),\n scale_factor = 0.02)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L521_C4", "label": "m = mean()", "type": "assigned_variable", "loc": [521, 521], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L485_C0", "vector": [14, 1, 0.5241, 0.001, 1, 0.58, 0.9524, 711, 3, 2, 0, 0, 856, 10, 1], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "mean", "annotation": ""}, "snippet": " m = np.mean(mech_mat, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L522_C4", "label": "view()", "type": "expression", "loc": [522, 523], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L485_C0", "vector": [8, 1, 0.5257, 0.002, 1, 0.58, 1.0, 781, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "view", "arg_names": [], "import_names": [], "rhs_call_name": "view", "annotation": ""}, "snippet": " d3m.mlab.view(azimuth=-120, elevation=60, distance=1.60,\n focalpoint=(m[0,0], m[1,0], m[2,0]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L527_C0", "label": "compute_hook_tip_trajectory", "type": "function", "loc": [527, 542], "level": 0, "parent": null, "vector": [2, 0, 0.5377, 0.0161, 0, 0.66, 0.8125, 585, 0, 1, 1, 0, 0, 0, 13], "semantic": {"name": "compute_hook_tip_trajectory", "arg_names": ["combined_dict"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def compute_hook_tip_trajectory(combined_dict):\n cd = combined_dict\n hand_mat = np.column_stack(cd['hand_pos_list'])\n hand_rot_l = cd['hand_rot_list']\n directions_x = (np.row_stack(hand_rot_l)[:,0]).T.reshape(len(hand_rot_l), 3).T\n directions_y = (np.row_stack(hand_rot_l)[:,1]).T.reshape(len(hand_rot_l), 3).T\n directions_z = (np.row_stack(hand_rot_l)[:,2]).T.reshape(len(hand_rot_l), 3).T\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L528_C4", "label": "cd =", "type": "assigned_variable", "loc": [528, 528], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L527_C0", "vector": [14, 1, 0.5312, 0.001, 1, 0.04, 0.0, 214, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "cd", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cd = combined_dict"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L529_C4", "label": "hand_mat = column_stack()", "type": "assigned_variable", "loc": [529, 529], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L527_C0", "vector": [14, 1, 0.5322, 0.001, 1, 0.04, 0.1111, 181, 3, 1, 0, 0, 724, 10, 1], "semantic": {"name": "hand_mat", "arg_names": [], "import_names": [], "rhs_call_name": "column_stack", "annotation": ""}, "snippet": " hand_mat = np.column_stack(cd['hand_pos_list'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L530_C4", "label": "hand_rot_l =", "type": "assigned_variable", "loc": [530, 530], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L527_C0", "vector": [14, 1, 0.5332, 0.001, 1, 0.04, 0.2222, 256, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "hand_rot_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " hand_rot_l = cd['hand_rot_list']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L531_C4", "label": "directions_x =", "type": "assigned_variable", "loc": [531, 531], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L527_C0", "vector": [14, 1, 0.5342, 0.001, 1, 0.04, 0.3333, 755, 7, 0, 0, 0, 0, 0, 3], "semantic": {"name": "directions_x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " directions_x = (np.row_stack(hand_rot_l)[:,0]).T.reshape(len(hand_rot_l), 3).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L532_C4", "label": "directions_y =", "type": "assigned_variable", "loc": [532, 532], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L527_C0", "vector": [14, 1, 0.5352, 0.001, 1, 0.04, 0.4444, 862, 7, 0, 0, 0, 0, 0, 3], "semantic": {"name": "directions_y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " directions_y = (np.row_stack(hand_rot_l)[:,1]).T.reshape(len(hand_rot_l), 3).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L533_C4", "label": "directions_z =", "type": "assigned_variable", "loc": [533, 533], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L527_C0", "vector": [14, 1, 0.5362, 0.001, 1, 0.04, 0.5556, 12, 7, 0, 0, 0, 0, 0, 3], "semantic": {"name": "directions_z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " directions_z = (np.row_stack(hand_rot_l)[:,2]).T.reshape(len(hand_rot_l), 3).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L535_C4", "label": "hand_pos_list =", "type": "assigned_variable", "loc": [535, 535], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L527_C0", "vector": [14, 1, 0.5382, 0.001, 1, 0.04, 0.6667, 254, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "hand_pos_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " hand_pos_list = cd['hand_pos_list']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L536_C4", "label": "hook_tip_l =", "type": "assigned_variable", "loc": [536, 536], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L527_C0", "vector": [14, 1, 0.5392, 0.001, 1, 0.04, 0.7778, 521, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "hook_tip_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " hook_tip_l = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L537_C4", "label": "for i, p", "type": "for", "loc": [537, 540], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L527_C0", "vector": [6, 1, 0.5418, 0.004, 1, 0.04, 0.8889, 816, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "i, p", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i,p in enumerate(hand_pos_list): # p - hook checker origin in camera coordinates.\n hc_P_hc_hooktip = np.matrix([0.035, -0.0864, 0.09]).T # vector from hook checkerboard origin to the tip of the hook in hook checker coordinates.\n cam_P_hc_hooktip = hand_rot_l[i] * hc_P_hc_hooktip\n hook_tip_l.append(p + cam_P_hc_hooktip)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L538_C8", "label": "hc_P_hc_hooktip =", "type": "assigned_variable", "loc": [538, 538], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L537_C4", "vector": [14, 2, 0.5412, 0.001, 2, 0.48, 0.0, 812, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "hc_P_hc_hooktip", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " hc_P_hc_hooktip = np.matrix([0.035, -0.0864, 0.09]).T # vector from hook checkerboard origin to the tip of the hook in hook checker coordinates."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L539_C8", "label": "cam_P_hc_hooktip =", "type": "assigned_variable", "loc": [539, 539], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L537_C4", "vector": [14, 2, 0.5423, 0.001, 2, 0.48, 0.5, 890, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "cam_P_hc_hooktip", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cam_P_hc_hooktip = hand_rot_l[i] * hc_P_hc_hooktip"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L540_C8", "label": "append()", "type": "expression", "loc": [540, 540], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L537_C4", "vector": [8, 2, 0.5433, 0.001, 2, 0.48, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " hook_tip_l.append(p + cam_P_hc_hooktip)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Return_L542_C4", "label": "return", "type": "return", "loc": [542, 542], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L527_C0", "vector": [13, 1, 0.5453, 0.001, 1, 0.04, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return hook_tip_l"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L547_C0", "label": "split_open_close", "type": "function", "loc": [547, 588], "level": 0, "parent": null, "vector": [2, 0, 0.5709, 0.0423, 0, 0.66, 0.8438, 747, 0, 8, 0, 0, 0, 0, 13], "semantic": {"name": "split_open_close", "arg_names": ["rad", "tan", "ang", "typ", "mech_radius", "time_list", "moment_axis", "moment_tip"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def split_open_close(rad, tan, ang, typ, mech_radius, time_list,\n moment_axis, moment_tip):\n ang = np.array(ang)\n incr = ang[1:] - ang[:-1]\n n_pts = ang.shape[0] - 2 #ignoring first and last readings.\n rad_l, tan_l, ang_l = [], [], []\n for i in range(n_pts):\n if typ == 'rotary':"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L549_C4", "label": "ang = array()", "type": "assigned_variable", "loc": [549, 549], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L547_C0", "vector": [14, 1, 0.5523, 0.001, 1, 0.65, 0.0, 762, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "ang", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " ang = np.array(ang)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L550_C4", "label": "incr =", "type": "assigned_variable", "loc": [550, 550], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L547_C0", "vector": [14, 1, 0.5533, 0.001, 1, 0.65, 0.0833, 621, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "incr", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " incr = ang[1:] - ang[:-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L551_C4", "label": "n_pts =", "type": "assigned_variable", "loc": [551, 551], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L547_C0", "vector": [14, 1, 0.5543, 0.001, 1, 0.65, 0.1667, 156, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "n_pts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " n_pts = ang.shape[0] - 2 #ignoring first and last readings."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L552_C4", "label": "rad_l, tan_l, ang_l =", "type": "assigned_variable", "loc": [552, 552], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L547_C0", "vector": [14, 1, 0.5553, 0.001, 1, 0.65, 0.25, 275, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "rad_l, tan_l, ang_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rad_l, tan_l, ang_l = [], [], []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L553_C4", "label": "for i", "type": "for", "loc": [553, 566], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L547_C0", "vector": [6, 1, 0.5629, 0.0141, 1, 0.65, 0.3333, 826, 3, 0, 0, 0, 0, 0, 9], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(n_pts):\n if typ == 'rotary':\n sgn = incr[i] * incr[i+1]\n mag = abs(incr[i] - incr[i+1])\n if sgn < 0 and mag > math.radians(10):\n continue\n rad_l.append(rad[i+1])\n tan_l.append(tan[i+1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L554_C8", "label": "if", "type": "if", "loc": [554, 566], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L553_C4", "vector": [4, 2, 0.5634, 0.0131, 2, 0.04, 0.0, 0, 0, 0, 0, 0, 0, 0, 8], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if typ == 'rotary':\n sgn = incr[i] * incr[i+1]\n mag = abs(incr[i] - incr[i+1])\n if sgn < 0 and mag > math.radians(10):\n continue\n rad_l.append(rad[i+1])\n tan_l.append(tan[i+1])\n ang_l.append(ang[i+1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L555_C12", "label": "sgn =", "type": "assigned_variable", "loc": [555, 555], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L554_C8", "vector": [14, 3, 0.5584, 0.001, 3, 0.89, 0.0, 994, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "sgn", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " sgn = incr[i] * incr[i+1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L556_C12", "label": "mag = abs()", "type": "assigned_variable", "loc": [556, 556], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L554_C8", "vector": [14, 3, 0.5594, 0.001, 3, 0.89, 0.125, 533, 3, 1, 0, 0, 799, 10, 1], "semantic": {"name": "mag", "arg_names": [], "import_names": [], "rhs_call_name": "abs", "annotation": ""}, "snippet": " mag = abs(incr[i] - incr[i+1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L557_C12", "label": "if", "type": "if", "loc": [557, 558], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L554_C8", "vector": [4, 3, 0.5609, 0.002, 3, 0.89, 0.25, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if sgn < 0 and mag > math.radians(10):\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L559_C12", "label": "append()", "type": "expression", "loc": [559, 559], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L554_C8", "vector": [8, 3, 0.5624, 0.001, 3, 0.89, 0.375, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " rad_l.append(rad[i+1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L560_C12", "label": "append()", "type": "expression", "loc": [560, 560], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L554_C8", "vector": [8, 3, 0.5634, 0.001, 3, 0.89, 0.5, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " tan_l.append(tan[i+1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L561_C12", "label": "append()", "type": "expression", "loc": [561, 561], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L554_C8", "vector": [8, 3, 0.5644, 0.001, 3, 0.89, 0.625, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " ang_l.append(ang[i+1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L564_C12", "label": "append()", "type": "expression", "loc": [564, 564], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L554_C8", "vector": [8, 3, 0.5674, 0.001, 3, 0.89, 0.75, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " rad_l.append(rad[i+1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L565_C12", "label": "append()", "type": "expression", "loc": [565, 565], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L554_C8", "vector": [8, 3, 0.5684, 0.001, 3, 0.89, 0.875, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " tan_l.append(tan[i+1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L566_C12", "label": "append()", "type": "expression", "loc": [566, 566], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L554_C8", "vector": [8, 3, 0.5694, 0.001, 3, 0.89, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " ang_l.append(ang[i+1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L568_C4", "label": "rad, tan, ang =", "type": "assigned_variable", "loc": [568, 568], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L547_C0", "vector": [14, 1, 0.5714, 0.001, 1, 0.65, 0.4167, 75, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "rad, tan, ang", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rad, tan, ang = rad_l, tan_l, ang_l"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L569_C4", "label": "max_idx = argmax()", "type": "assigned_variable", "loc": [569, 569], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L547_C0", "vector": [14, 1, 0.5724, 0.001, 1, 0.65, 0.5, 910, 3, 1, 0, 0, 593, 10, 1], "semantic": {"name": "max_idx", "arg_names": [], "import_names": [], "rhs_call_name": "argmax", "annotation": ""}, "snippet": " max_idx = np.argmax(ang)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L570_C4", "label": "d_open =", "type": "assigned_variable", "loc": [570, 574], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L547_C0", "vector": [14, 1, 0.5755, 0.005, 1, 0.65, 0.5833, 823, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "d_open", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " d_open = {'force_rad_list': rad[:max_idx+1],\n 'force_tan_list': tan[:max_idx+1],\n 'mechanism_x': ang[:max_idx+1], 'mech_type': typ,\n 'radius': mech_radius,\n 'time_list': time_list[:max_idx+1]}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L575_C4", "label": "if", "type": "if", "loc": [575, 577], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L547_C0", "vector": [4, 1, 0.5795, 0.003, 1, 0.65, 0.6667, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if moment_tip != None:\n d_open['moment_tip_list'] = moment_tip[:max_idx+1]\n d_open['moment_list'] = moment_axis[:max_idx+1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L576_C8", "label": "assign", "type": "assigned_variable", "loc": [576, 576], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L575_C4", "vector": [14, 2, 0.5795, 0.001, 2, 0.41, 0.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " d_open['moment_tip_list'] = moment_tip[:max_idx+1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L577_C8", "label": "assign", "type": "assigned_variable", "loc": [577, 577], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L575_C4", "vector": [14, 2, 0.5805, 0.001, 2, 0.41, 1.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " d_open['moment_list'] = moment_axis[:max_idx+1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L578_C4", "label": "save_pickle()", "type": "expression", "loc": [578, 578], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L547_C0", "vector": [8, 1, 0.5815, 0.001, 1, 0.65, 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": " ut.save_pickle(d_open, opt.dir + '/open_mechanism_trajectories_handhook.pkl')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L580_C4", "label": "d_close =", "type": "assigned_variable", "loc": [580, 584], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L547_C0", "vector": [14, 1, 0.5855, 0.005, 1, 0.65, 0.8333, 493, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "d_close", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " d_close = {'force_rad_list': rad[max_idx+1:],\n 'force_tan_list': tan[max_idx+1:],\n 'mechanism_x': ang[max_idx+1:], 'mech_type': typ,\n 'radius': mech_radius,\n 'time_list': time_list[max_idx+1:]}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L585_C4", "label": "if", "type": "if", "loc": [585, 587], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L547_C0", "vector": [4, 1, 0.5895, 0.003, 1, 0.65, 0.9167, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if moment_tip != None:\n d_open['moment_tip_list'] = moment_tip[max_idx+1:]\n d_open['moment_list'] = moment_axis[max_idx+1:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L586_C8", "label": "assign", "type": "assigned_variable", "loc": [586, 586], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L585_C4", "vector": [14, 2, 0.5895, 0.001, 2, 0.21, 0.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " d_open['moment_tip_list'] = moment_tip[max_idx+1:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L587_C8", "label": "assign", "type": "assigned_variable", "loc": [587, 587], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L585_C4", "vector": [14, 2, 0.5905, 0.001, 2, 0.21, 1.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " d_open['moment_list'] = moment_axis[max_idx+1:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L588_C4", "label": "save_pickle()", "type": "expression", "loc": [588, 588], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L547_C0", "vector": [8, 1, 0.5915, 0.001, 1, 0.65, 1.0, 390, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "save_pickle", "arg_names": [], "import_names": [], "rhs_call_name": "save_pickle", "annotation": ""}, "snippet": " ut.save_pickle(d_close, opt.dir + '/close_mechanism_trajectories_handhook.pkl')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L591_C0", "label": "plot_hooktip_trajectory_and_force", "type": "function", "loc": [591, 606], "level": 0, "parent": null, "vector": [2, 0, 0.6021, 0.0161, 0, 0.66, 0.875, 366, 0, 1, 0, 0, 0, 0, 5], "semantic": {"name": "plot_hooktip_trajectory_and_force", "arg_names": ["cd"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def plot_hooktip_trajectory_and_force(cd):\n hook_tip_l = compute_hook_tip_trajectory(cd)\n\n # plot trajectory in 3D.\n d3m.white_bg()\n d3m.plot_points(np.column_stack(hook_tip_l), color = (1.,0.,0.), mode='sphere',\n scale_factor = 0.005)\n# d3m.plot_points(mech_proj[:,0:1], color = (0.,0.,0.), mode='sphere',"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L592_C4", "label": "hook_tip_l = compute_hook_tip_trajectory()", "type": "assigned_variable", "loc": [592, 592], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L591_C0", "vector": [14, 1, 0.5956, 0.001, 1, 0.06, 0.0, 521, 3, 1, 0, 0, 585, 10, 1], "semantic": {"name": "hook_tip_l", "arg_names": [], "import_names": [], "rhs_call_name": "compute_hook_tip_trajectory", "annotation": ""}, "snippet": " hook_tip_l = compute_hook_tip_trajectory(cd)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L595_C4", "label": "white_bg()", "type": "expression", "loc": [595, 595], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L591_C0", "vector": [8, 1, 0.5986, 0.001, 1, 0.06, 0.3333, 652, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "white_bg", "arg_names": [], "import_names": [], "rhs_call_name": "white_bg", "annotation": ""}, "snippet": " d3m.white_bg()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L596_C4", "label": "plot_points()", "type": "expression", "loc": [596, 597], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L591_C0", "vector": [8, 1, 0.6001, 0.002, 1, 0.06, 0.6667, 111, 3, 4, 0, 0, 0, 0, 2], "semantic": {"name": "plot_points", "arg_names": [], "import_names": [], "rhs_call_name": "plot_points", "annotation": ""}, "snippet": " d3m.plot_points(np.column_stack(hook_tip_l), color = (1.,0.,0.), mode='sphere',\n scale_factor = 0.005)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L606_C4", "label": "show()", "type": "expression", "loc": [606, 606], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L591_C0", "vector": [8, 1, 0.6097, 0.001, 1, 0.06, 1.0, 497, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "show", "arg_names": [], "import_names": [], "rhs_call_name": "show", "annotation": ""}, "snippet": " d3m.show()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L617_C0", "label": "compare_tip_mechanism_trajectories", "type": "function", "loc": [617, 664], "level": 0, "parent": null, "vector": [2, 0, 0.6444, 0.0483, 0, 0.66, 0.9062, 225, 0, 2, 0, 0, 0, 0, 28], "semantic": {"name": "compare_tip_mechanism_trajectories", "arg_names": ["mech_mat", "hand_mat"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def compare_tip_mechanism_trajectories(mech_mat, hand_mat):\n# hand_proj, nrm_hand = project_points_plane(hand_mat)\n# mech_proj, nrm_mech = project_points_plane(mech_mat)\n hand_proj = hand_mat\n mech_proj = mech_mat\n\n kin_dict = ke.fit(hand_proj, tup)\n print('kin_dict from hook tip:', kin_dict)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L620_C4", "label": "hand_proj =", "type": "assigned_variable", "loc": [620, 620], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L617_C0", "vector": [14, 1, 0.6237, 0.001, 1, 0.9, 0.0, 720, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "hand_proj", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " hand_proj = hand_mat"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L621_C4", "label": "mech_proj =", "type": "assigned_variable", "loc": [621, 621], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L617_C0", "vector": [14, 1, 0.6247, 0.001, 1, 0.9, 0.037, 254, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "mech_proj", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mech_proj = mech_mat"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L623_C4", "label": "kin_dict = fit()", "type": "assigned_variable", "loc": [623, 623], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L617_C0", "vector": [14, 1, 0.6268, 0.001, 1, 0.9, 0.0741, 775, 3, 2, 0, 0, 828, 10, 1], "semantic": {"name": "kin_dict", "arg_names": [], "import_names": [], "rhs_call_name": "fit", "annotation": ""}, "snippet": " kin_dict = ke.fit(hand_proj, tup)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L624_C4", "label": "print()", "type": "expression", "loc": [624, 624], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L617_C0", "vector": [8, 1, 0.6278, 0.001, 1, 0.9, 0.1111, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('kin_dict from hook tip:', kin_dict)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L625_C4", "label": "print()", "type": "expression", "loc": [625, 625], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L617_C0", "vector": [8, 1, 0.6288, 0.001, 1, 0.9, 0.1481, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('measured radius:', cd['radius'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L626_C4", "label": "center_hand =", "type": "assigned_variable", "loc": [626, 627], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L617_C0", "vector": [14, 1, 0.6303, 0.002, 1, 0.9, 0.1852, 453, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "center_hand", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " center_hand = np.matrix((kin_dict['cx'], kin_dict['cy'],\n kin_dict['cz'])).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L629_C4", "label": "kin_dict = fit()", "type": "assigned_variable", "loc": [629, 629], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L617_C0", "vector": [14, 1, 0.6328, 0.001, 1, 0.9, 0.2222, 775, 3, 2, 0, 0, 828, 10, 1], "semantic": {"name": "kin_dict", "arg_names": [], "import_names": [], "rhs_call_name": "fit", "annotation": ""}, "snippet": " kin_dict = ke.fit(mech_proj, tup)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L630_C4", "label": "print()", "type": "expression", "loc": [630, 630], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L617_C0", "vector": [8, 1, 0.6338, 0.001, 1, 0.9, 0.2593, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('kin_dict from mechanism:', kin_dict)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L631_C4", "label": "center_mech =", "type": "assigned_variable", "loc": [631, 632], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L617_C0", "vector": [14, 1, 0.6353, 0.002, 1, 0.9, 0.2963, 493, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "center_mech", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " center_mech = np.matrix((kin_dict['cx'], kin_dict['cy'],\n kin_dict['cz'])).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L635_C4", "label": "directions_hand =", "type": "assigned_variable", "loc": [635, 635], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L617_C0", "vector": [14, 1, 0.6388, 0.001, 1, 0.9, 0.3333, 156, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "directions_hand", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " directions_hand = hand_proj - center_hand"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L636_C4", "label": "directions_hand =", "type": "assigned_variable", "loc": [636, 636], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L617_C0", "vector": [14, 1, 0.6398, 0.001, 1, 0.9, 0.3704, 156, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "directions_hand", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " directions_hand = directions_hand / ut.norm(directions_hand)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L637_C4", "label": "directions_mech =", "type": "assigned_variable", "loc": [637, 637], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L617_C0", "vector": [14, 1, 0.6408, 0.001, 1, 0.9, 0.4074, 113, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "directions_mech", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " directions_mech = mech_proj - center_mech"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L638_C4", "label": "directions_mech =", "type": "assigned_variable", "loc": [638, 638], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L617_C0", "vector": [14, 1, 0.6419, 0.001, 1, 0.9, 0.4444, 113, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "directions_mech", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " directions_mech = directions_mech / ut.norm(directions_mech)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L640_C4", "label": "start_normal =", "type": "assigned_variable", "loc": [640, 640], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L617_C0", "vector": [14, 1, 0.6439, 0.001, 1, 0.9, 0.4815, 759, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "start_normal", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " start_normal = directions_mech[:,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L641_C4", "label": "print()", "type": "expression", "loc": [641, 641], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L617_C0", "vector": [8, 1, 0.6449, 0.001, 1, 0.9, 0.5185, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('directions_mech[:,0]', directions_mech[:,0].A1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L642_C4", "label": "print()", "type": "expression", "loc": [642, 642], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L617_C0", "vector": [8, 1, 0.6459, 0.001, 1, 0.9, 0.5556, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('directions_hand[:,0]', directions_hand[:,0].A1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L643_C4", "label": "ct =", "type": "assigned_variable", "loc": [643, 643], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L617_C0", "vector": [14, 1, 0.6469, 0.001, 1, 0.9, 0.5926, 147, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ct", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ct = (start_normal.T * directions_hand).A1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L644_C4", "label": "st =", "type": "assigned_variable", "loc": [644, 644], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L617_C0", "vector": [14, 1, 0.6479, 0.001, 1, 0.9, 0.6296, 93, 7, 0, 0, 0, 0, 0, 3], "semantic": {"name": "st", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " st = ut.norm(np.matrix(np.cross(start_normal.A1, directions_hand.T.A)).T).A1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L646_C4", "label": "mech_angle = tolist()", "type": "assigned_variable", "loc": [646, 646], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L617_C0", "vector": [14, 1, 0.6499, 0.001, 1, 0.9, 0.6667, 945, 3, 0, 0, 0, 185, 10, 2], "semantic": {"name": "mech_angle", "arg_names": [], "import_names": [], "rhs_call_name": "tolist", "annotation": ""}, "snippet": " mech_angle = np.arctan2(st, ct).tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L649_C4", "label": "plot_yx()", "type": "expression", "loc": [649, 649], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L617_C0", "vector": [8, 1, 0.6529, 0.001, 1, 0.9, 0.7037, 112, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "plot_yx", "arg_names": [], "import_names": [], "rhs_call_name": "plot_yx", "annotation": ""}, "snippet": " mpu.plot_yx(np.degrees(mech_angle))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L650_C4", "label": "show()", "type": "expression", "loc": [650, 650], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L617_C0", "vector": [8, 1, 0.6539, 0.001, 1, 0.9, 0.7407, 497, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "show", "arg_names": [], "import_names": [], "rhs_call_name": "show", "annotation": ""}, "snippet": " mpu.show()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L653_C4", "label": "white_bg()", "type": "expression", "loc": [653, 653], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L617_C0", "vector": [8, 1, 0.6569, 0.001, 1, 0.9, 0.7778, 652, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "white_bg", "arg_names": [], "import_names": [], "rhs_call_name": "white_bg", "annotation": ""}, "snippet": " d3m.white_bg()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L654_C4", "label": "plot_points()", "type": "expression", "loc": [654, 655], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L617_C0", "vector": [8, 1, 0.6585, 0.002, 1, 0.9, 0.8148, 111, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "plot_points", "arg_names": [], "import_names": [], "rhs_call_name": "plot_points", "annotation": ""}, "snippet": " d3m.plot_points(hand_proj, color = (1.,0.,0.), mode='sphere',\n scale_factor = 0.005)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L656_C4", "label": "plot_points()", "type": "expression", "loc": [656, 657], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L617_C0", "vector": [8, 1, 0.6605, 0.002, 1, 0.9, 0.8519, 111, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "plot_points", "arg_names": [], "import_names": [], "rhs_call_name": "plot_points", "annotation": ""}, "snippet": " d3m.plot_points(mech_proj[:,0:1], color = (0.,0.,0.), mode='sphere',\n scale_factor = 0.01)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L658_C4", "label": "plot_points()", "type": "expression", "loc": [658, 659], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L617_C0", "vector": [8, 1, 0.6625, 0.002, 1, 0.9, 0.8889, 111, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "plot_points", "arg_names": [], "import_names": [], "rhs_call_name": "plot_points", "annotation": ""}, "snippet": " d3m.plot_points(mech_proj, color = (0.,0.,1.), mode='sphere',\n scale_factor = 0.005)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L660_C4", "label": "plot()", "type": "expression", "loc": [660, 661], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L617_C0", "vector": [8, 1, 0.6645, 0.002, 1, 0.9, 0.9259, 929, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "plot", "arg_names": [], "import_names": [], "rhs_call_name": "plot", "annotation": ""}, "snippet": " d3m.plot(np.column_stack((mech_proj[:,-1],center_mech, mech_proj[:,0])),\n color = (0.,0.,1.))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L662_C4", "label": "plot()", "type": "expression", "loc": [662, 663], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L617_C0", "vector": [8, 1, 0.6665, 0.002, 1, 0.9, 0.963, 929, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "plot", "arg_names": [], "import_names": [], "rhs_call_name": "plot", "annotation": ""}, "snippet": " d3m.plot(np.column_stack((hand_proj[:,-1],center_hand, hand_proj[:,0])),\n color = (1.,0.,0.))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L664_C4", "label": "show()", "type": "expression", "loc": [664, 664], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L617_C0", "vector": [8, 1, 0.668, 0.001, 1, 0.9, 1.0, 497, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "show", "arg_names": [], "import_names": [], "rhs_call_name": "show", "annotation": ""}, "snippet": " d3m.show()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L666_C0", "label": "angle_between_hooktip_mechanism_radial_vectors", "type": "function", "loc": [666, 688], "level": 0, "parent": null, "vector": [2, 0, 0.6811, 0.0231, 0, 0.66, 0.9375, 771, 0, 2, 0, 0, 0, 0, 16], "semantic": {"name": "angle_between_hooktip_mechanism_radial_vectors", "arg_names": ["mech_mat", "hand_mat"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def angle_between_hooktip_mechanism_radial_vectors(mech_mat, hand_mat):\n kin_dict = ke.fit(hand_mat, tup)\n print('kin_dict from hook tip:', kin_dict)\n print('measured radius:', cd['radius'])\n center_hand = np.matrix((kin_dict['cx'], kin_dict['cy'],\n kin_dict['cz'])).T\n\n kin_dict = ke.fit(mech_mat, tup)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L667_C4", "label": "kin_dict = fit()", "type": "assigned_variable", "loc": [667, 667], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L666_C0", "vector": [14, 1, 0.671, 0.001, 1, 0.01, 0.0, 775, 3, 2, 0, 0, 828, 10, 1], "semantic": {"name": "kin_dict", "arg_names": [], "import_names": [], "rhs_call_name": "fit", "annotation": ""}, "snippet": " kin_dict = ke.fit(hand_mat, tup)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L668_C4", "label": "print()", "type": "expression", "loc": [668, 668], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L666_C0", "vector": [8, 1, 0.672, 0.001, 1, 0.01, 0.0714, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('kin_dict from hook tip:', kin_dict)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L669_C4", "label": "print()", "type": "expression", "loc": [669, 669], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L666_C0", "vector": [8, 1, 0.673, 0.001, 1, 0.01, 0.1429, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('measured radius:', cd['radius'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L670_C4", "label": "center_hand =", "type": "assigned_variable", "loc": [670, 671], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L666_C0", "vector": [14, 1, 0.6745, 0.002, 1, 0.01, 0.2143, 453, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "center_hand", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " center_hand = np.matrix((kin_dict['cx'], kin_dict['cy'],\n kin_dict['cz'])).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L673_C4", "label": "kin_dict = fit()", "type": "assigned_variable", "loc": [673, 673], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L666_C0", "vector": [14, 1, 0.6771, 0.001, 1, 0.01, 0.2857, 775, 3, 2, 0, 0, 828, 10, 1], "semantic": {"name": "kin_dict", "arg_names": [], "import_names": [], "rhs_call_name": "fit", "annotation": ""}, "snippet": " kin_dict = ke.fit(mech_mat, tup)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L674_C4", "label": "print()", "type": "expression", "loc": [674, 674], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L666_C0", "vector": [8, 1, 0.6781, 0.001, 1, 0.01, 0.3571, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('kin_dict from mechanism:', kin_dict)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L675_C4", "label": "center_mech =", "type": "assigned_variable", "loc": [675, 676], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L666_C0", "vector": [14, 1, 0.6796, 0.002, 1, 0.01, 0.4286, 493, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "center_mech", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " center_mech = np.matrix((kin_dict['cx'], kin_dict['cy'],\n kin_dict['cz'])).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L679_C4", "label": "directions_hand =", "type": "assigned_variable", "loc": [679, 679], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L666_C0", "vector": [14, 1, 0.6831, 0.001, 1, 0.01, 0.5, 156, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "directions_hand", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " directions_hand = hand_mat - center_hand"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L680_C4", "label": "directions_hand =", "type": "assigned_variable", "loc": [680, 680], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L666_C0", "vector": [14, 1, 0.6841, 0.001, 1, 0.01, 0.5714, 156, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "directions_hand", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " directions_hand = directions_hand / ut.norm(directions_hand)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L681_C4", "label": "directions_mech =", "type": "assigned_variable", "loc": [681, 681], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L666_C0", "vector": [14, 1, 0.6851, 0.001, 1, 0.01, 0.6429, 113, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "directions_mech", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " directions_mech = mech_mat - center_mech"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L682_C4", "label": "directions_mech =", "type": "assigned_variable", "loc": [682, 682], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L666_C0", "vector": [14, 1, 0.6861, 0.001, 1, 0.01, 0.7143, 113, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "directions_mech", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " directions_mech = directions_mech / ut.norm(directions_mech)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L685_C4", "label": "ang =", "type": "assigned_variable", "loc": [685, 685], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L666_C0", "vector": [14, 1, 0.6891, 0.001, 1, 0.01, 0.7857, 762, 7, 0, 0, 0, 0, 0, 4], "semantic": {"name": "ang", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ang = np.degrees(np.arccos(np.sum(np.multiply(directions_mech, directions_hand), 0))).A1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L686_C4", "label": "plot_yx()", "type": "expression", "loc": [686, 686], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L666_C0", "vector": [8, 1, 0.6901, 0.001, 1, 0.01, 0.8571, 112, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "plot_yx", "arg_names": [], "import_names": [], "rhs_call_name": "plot_yx", "annotation": ""}, "snippet": " mpu.plot_yx(ang, label = 'angle between hooktip-radial and mechanism radial')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L687_C4", "label": "legend()", "type": "expression", "loc": [687, 687], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L666_C0", "vector": [8, 1, 0.6911, 0.001, 1, 0.01, 0.9286, 880, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "legend", "arg_names": [], "import_names": [], "rhs_call_name": "legend", "annotation": ""}, "snippet": " mpu.legend()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L688_C4", "label": "show()", "type": "expression", "loc": [688, 688], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L666_C0", "vector": [8, 1, 0.6922, 0.001, 1, 0.01, 1.0, 497, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "show", "arg_names": [], "import_names": [], "rhs_call_name": "show", "annotation": ""}, "snippet": " mpu.show()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L690_C0", "label": "split_forces_hooktip_test", "type": "function", "loc": [690, 760], "level": 0, "parent": null, "vector": [2, 0, 0.7294, 0.0714, 0, 0.66, 0.9688, 399, 0, 1, 0, 0, 0, 0, 34], "semantic": {"name": "split_forces_hooktip_test", "arg_names": ["hand_mat"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def split_forces_hooktip_test(hand_mat):\n kin_dict = ke.fit(hand_mat, tup)\n center_hand = np.matrix((kin_dict['cx'], kin_dict['cy'],\n kin_dict['cz'])).T\n\n print('kin_dict:', kin_dict)\n # radial vectors.\n radial_mat = hand_mat - center_hand"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L691_C4", "label": "kin_dict = fit()", "type": "assigned_variable", "loc": [691, 691], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L690_C0", "vector": [14, 1, 0.6952, 0.001, 1, 0.21, 0.0, 775, 3, 2, 0, 0, 828, 10, 1], "semantic": {"name": "kin_dict", "arg_names": [], "import_names": [], "rhs_call_name": "fit", "annotation": ""}, "snippet": " kin_dict = ke.fit(hand_mat, tup)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L692_C4", "label": "center_hand =", "type": "assigned_variable", "loc": [692, 693], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L690_C0", "vector": [14, 1, 0.6967, 0.002, 1, 0.21, 0.0323, 453, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "center_hand", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " center_hand = np.matrix((kin_dict['cx'], kin_dict['cy'],\n kin_dict['cz'])).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L695_C4", "label": "print()", "type": "expression", "loc": [695, 695], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L690_C0", "vector": [8, 1, 0.6992, 0.001, 1, 0.21, 0.0645, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('kin_dict:', kin_dict)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L697_C4", "label": "radial_mat =", "type": "assigned_variable", "loc": [697, 697], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L690_C0", "vector": [14, 1, 0.7012, 0.001, 1, 0.21, 0.0968, 516, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "radial_mat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " radial_mat = hand_mat - center_hand"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L698_C4", "label": "radial_mat =", "type": "assigned_variable", "loc": [698, 698], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L690_C0", "vector": [14, 1, 0.7022, 0.001, 1, 0.21, 0.129, 516, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "radial_mat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " radial_mat = radial_mat / ut.norm(radial_mat)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L709_C4", "label": "_, nrm_hand = project_points_plane()", "type": "assigned_variable", "loc": [709, 709], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L690_C0", "vector": [14, 1, 0.7133, 0.001, 1, 0.21, 0.1613, 699, 3, 1, 0, 0, 771, 10, 1], "semantic": {"name": "_, nrm_hand", "arg_names": [], "import_names": [], "rhs_call_name": "project_points_plane", "annotation": ""}, "snippet": " _, nrm_hand = project_points_plane(hand_mat)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L710_C4", "label": "print()", "type": "expression", "loc": [710, 710], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L690_C0", "vector": [8, 1, 0.7143, 0.001, 1, 0.21, 0.1935, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('nrm_hand:', nrm_hand.A1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L712_C4", "label": "f_cam_l =", "type": "assigned_variable", "loc": [712, 712], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L690_C0", "vector": [14, 1, 0.7163, 0.001, 1, 0.21, 0.2258, 946, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "f_cam_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " f_cam_l = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L713_C4", "label": "m_cam_l =", "type": "assigned_variable", "loc": [713, 713], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L690_C0", "vector": [14, 1, 0.7173, 0.001, 1, 0.21, 0.2581, 93, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "m_cam_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " m_cam_l = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L714_C4", "label": "m_base_l =", "type": "assigned_variable", "loc": [714, 714], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L690_C0", "vector": [14, 1, 0.7183, 0.001, 1, 0.21, 0.2903, 853, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "m_base_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " m_base_l = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L715_C4", "label": "frad_l =", "type": "assigned_variable", "loc": [715, 715], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L690_C0", "vector": [14, 1, 0.7193, 0.001, 1, 0.21, 0.3226, 863, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "frad_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " frad_l = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L716_C4", "label": "ftan_l =", "type": "assigned_variable", "loc": [716, 716], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L690_C0", "vector": [14, 1, 0.7203, 0.001, 1, 0.21, 0.3548, 989, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "ftan_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ftan_l = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L717_C4", "label": "hook_num =", "type": "assigned_variable", "loc": [717, 717], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L690_C0", "vector": [14, 1, 0.7213, 0.001, 1, 0.21, 0.3871, 148, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "hook_num", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " hook_num = cd['hook_checker_number']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L718_C4", "label": "print()", "type": "expression", "loc": [718, 718], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L690_C0", "vector": [8, 1, 0.7223, 0.001, 1, 0.21, 0.4194, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('hook_num:', hook_num)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L719_C4", "label": "for i, f", "type": "for", "loc": [719, 735], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L690_C0", "vector": [6, 1, 0.7314, 0.0171, 1, 0.21, 0.4516, 291, 3, 0, 0, 0, 0, 0, 12], "semantic": {"name": "i, f", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i, f in enumerate(force_mat.T):\n f = f.T\n m = moment_mat[:,i]\n f_cam, m_cam, m_base = ft_to_camera_3(f, m, hook_rot_l[i], hook_num,\n return_moment_cam = True)\n f_cam_l.append(f_cam)\n m_cam_l.append(abs((m_cam.T*nrm_hand)[0,0]))\n m_base_l.append(abs((m_base.T*nrm_hand)[0,0]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L720_C8", "label": "f =", "type": "assigned_variable", "loc": [720, 720], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L719_C4", "vector": [14, 2, 0.7243, 0.001, 2, 0.82, 0.0, 899, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " f = f.T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L721_C8", "label": "m =", "type": "assigned_variable", "loc": [721, 721], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L719_C4", "vector": [14, 2, 0.7254, 0.001, 2, 0.82, 0.1, 711, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " m = moment_mat[:,i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L722_C8", "label": "f_cam, m_cam, m_base = ft_to_camera_3()", "type": "assigned_variable", "loc": [722, 723], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L719_C4", "vector": [14, 2, 0.7269, 0.002, 2, 0.82, 0.2, 37, 3, 5, 0, 0, 909, 10, 1], "semantic": {"name": "f_cam, m_cam, m_base", "arg_names": [], "import_names": [], "rhs_call_name": "ft_to_camera_3", "annotation": ""}, "snippet": " f_cam, m_cam, m_base = ft_to_camera_3(f, m, hook_rot_l[i], hook_num,\n return_moment_cam = True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L724_C8", "label": "append()", "type": "expression", "loc": [724, 724], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L719_C4", "vector": [8, 2, 0.7284, 0.001, 2, 0.82, 0.3, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " f_cam_l.append(f_cam)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L725_C8", "label": "append()", "type": "expression", "loc": [725, 725], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L719_C4", "vector": [8, 2, 0.7294, 0.001, 2, 0.82, 0.4, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " m_cam_l.append(abs((m_cam.T*nrm_hand)[0,0]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L726_C8", "label": "append()", "type": "expression", "loc": [726, 726], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L719_C4", "vector": [8, 2, 0.7304, 0.001, 2, 0.82, 0.5, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " m_base_l.append(abs((m_base.T*nrm_hand)[0,0]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L729_C8", "label": "tangential_vec =", "type": "assigned_variable", "loc": [729, 729], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L719_C4", "vector": [14, 2, 0.7334, 0.001, 2, 0.82, 0.6, 367, 7, 0, 0, 0, 0, 0, 2], "semantic": {"name": "tangential_vec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tangential_vec = np.matrix(np.cross(radial_mat[:,i].A1, nrm_hand.A1)).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L730_C8", "label": "ftan =", "type": "assigned_variable", "loc": [730, 730], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L719_C4", "vector": [14, 2, 0.7344, 0.001, 2, 0.82, 0.7, 771, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ftan", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ftan = (f_cam.T * tangential_vec)[0,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L731_C8", "label": "append()", "type": "expression", "loc": [731, 731], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L719_C4", "vector": [8, 2, 0.7354, 0.001, 2, 0.82, 0.8, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " ftan_l.append(ftan)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L734_C8", "label": "frad =", "type": "assigned_variable", "loc": [734, 734], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L719_C4", "vector": [14, 2, 0.7384, 0.001, 2, 0.82, 0.9, 209, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "frad", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " frad = (f_cam.T*radial_mat[:,i])[0,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L735_C8", "label": "append()", "type": "expression", "loc": [735, 735], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L719_C4", "vector": [8, 2, 0.7394, 0.001, 2, 0.82, 1.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " frad_l.append(abs(frad))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L738_C4", "label": "fig1 = figure()", "type": "assigned_variable", "loc": [738, 738], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L690_C0", "vector": [14, 1, 0.7425, 0.001, 1, 0.21, 0.4839, 605, 3, 0, 0, 0, 789, 10, 1], "semantic": {"name": "fig1", "arg_names": [], "import_names": [], "rhs_call_name": "figure", "annotation": ""}, "snippet": " fig1 = mpu.figure()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L739_C4", "label": "mech_ang_deg = degrees()", "type": "assigned_variable", "loc": [739, 739], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L690_C0", "vector": [14, 1, 0.7435, 0.001, 1, 0.21, 0.5161, 31, 3, 1, 0, 0, 633, 10, 1], "semantic": {"name": "mech_ang_deg", "arg_names": [], "import_names": [], "rhs_call_name": "degrees", "annotation": ""}, "snippet": " mech_ang_deg = np.degrees(mech_angle_l)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L740_C4", "label": "plot_yx()", "type": "expression", "loc": [740, 740], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L690_C0", "vector": [8, 1, 0.7445, 0.001, 1, 0.21, 0.5484, 112, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "plot_yx", "arg_names": [], "import_names": [], "rhs_call_name": "plot_yx", "annotation": ""}, "snippet": " mpu.plot_yx(ftan_l, mech_ang_deg, label='Tangential Force (hook tip)', color='b')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L741_C4", "label": "plot_yx()", "type": "expression", "loc": [741, 741], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L690_C0", "vector": [8, 1, 0.7455, 0.001, 1, 0.21, 0.5806, 112, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "plot_yx", "arg_names": [], "import_names": [], "rhs_call_name": "plot_yx", "annotation": ""}, "snippet": " mpu.plot_yx(frad_l, mech_ang_deg, label='Radial Force (hook tip)', color='y')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L743_C4", "label": "mech_pkl_name =", "type": "assigned_variable", "loc": [743, 743], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L690_C0", "vector": [14, 1, 0.7475, 0.001, 1, 0.21, 0.6129, 139, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "mech_pkl_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mech_pkl_name = glob.glob(opt.dir + '/open_mechanism_trajectories_*.pkl')[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L744_C4", "label": "md = load_pickle()", "type": "assigned_variable", "loc": [744, 744], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L690_C0", "vector": [14, 1, 0.7485, 0.001, 1, 0.21, 0.6452, 769, 3, 1, 0, 0, 65, 10, 1], "semantic": {"name": "md", "arg_names": [], "import_names": [], "rhs_call_name": "load_pickle", "annotation": ""}, "snippet": " md = ut.load_pickle(mech_pkl_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L745_C4", "label": "radial_mech =", "type": "assigned_variable", "loc": [745, 745], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L690_C0", "vector": [14, 1, 0.7495, 0.001, 1, 0.21, 0.6774, 852, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "radial_mech", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " radial_mech = md['force_rad_list']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L746_C4", "label": "tangential_mech =", "type": "assigned_variable", "loc": [746, 746], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L690_C0", "vector": [14, 1, 0.7505, 0.001, 1, 0.21, 0.7097, 528, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "tangential_mech", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tangential_mech = md['force_tan_list']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L747_C4", "label": "mech_x = degrees()", "type": "assigned_variable", "loc": [747, 747], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L690_C0", "vector": [14, 1, 0.7515, 0.001, 1, 0.21, 0.7419, 712, 3, 1, 0, 0, 633, 10, 1], "semantic": {"name": "mech_x", "arg_names": [], "import_names": [], "rhs_call_name": "degrees", "annotation": ""}, "snippet": " mech_x = np.degrees(md['mechanism_x'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L748_C4", "label": "plot_yx()", "type": "expression", "loc": [748, 748], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L690_C0", "vector": [8, 1, 0.7525, 0.001, 1, 0.21, 0.7742, 112, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "plot_yx", "arg_names": [], "import_names": [], "rhs_call_name": "plot_yx", "annotation": ""}, "snippet": " mpu.plot_yx(tangential_mech, mech_x, label='Tangential Force (mechanism checker)', color='g')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L749_C4", "label": "plot_yx()", "type": "expression", "loc": [749, 749], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L690_C0", "vector": [8, 1, 0.7535, 0.001, 1, 0.21, 0.8065, 112, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "plot_yx", "arg_names": [], "import_names": [], "rhs_call_name": "plot_yx", "annotation": ""}, "snippet": " mpu.plot_yx(radial_mech, mech_x, label='Radial Force (mechanism checker)', color='r')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L752_C4", "label": "legend()", "type": "expression", "loc": [752, 752], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L690_C0", "vector": [8, 1, 0.7565, 0.001, 1, 0.21, 0.8387, 880, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "legend", "arg_names": [], "import_names": [], "rhs_call_name": "legend", "annotation": ""}, "snippet": " mpu.legend()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L754_C4", "label": "fig2 = figure()", "type": "assigned_variable", "loc": [754, 754], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L690_C0", "vector": [14, 1, 0.7586, 0.001, 1, 0.21, 0.871, 278, 3, 0, 0, 0, 789, 10, 1], "semantic": {"name": "fig2", "arg_names": [], "import_names": [], "rhs_call_name": "figure", "annotation": ""}, "snippet": " fig2 = mpu.figure()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L755_C4", "label": "plot_yx()", "type": "expression", "loc": [755, 755], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L690_C0", "vector": [8, 1, 0.7596, 0.001, 1, 0.21, 0.9032, 112, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "plot_yx", "arg_names": [], "import_names": [], "rhs_call_name": "plot_yx", "annotation": ""}, "snippet": " mpu.plot_yx(m_cam_l, mech_ang_deg, label='\\huge{$m_{axis}$}')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L756_C4", "label": "plot_yx()", "type": "expression", "loc": [756, 757], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L690_C0", "vector": [8, 1, 0.7611, 0.002, 1, 0.21, 0.9355, 112, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "plot_yx", "arg_names": [], "import_names": [], "rhs_call_name": "plot_yx", "annotation": ""}, "snippet": " mpu.plot_yx(m_base_l, mech_ang_deg, label='\\huge{$m^s$}',\n color = 'r')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L759_C4", "label": "legend()", "type": "expression", "loc": [759, 759], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L690_C0", "vector": [8, 1, 0.7636, 0.001, 1, 0.21, 0.9677, 880, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "legend", "arg_names": [], "import_names": [], "rhs_call_name": "legend", "annotation": ""}, "snippet": " mpu.legend()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L760_C4", "label": "show()", "type": "expression", "loc": [760, 760], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L690_C0", "vector": [8, 1, 0.7646, 0.001, 1, 0.21, 1.0, 497, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "show", "arg_names": [], "import_names": [], "rhs_call_name": "show", "annotation": ""}, "snippet": " mpu.show()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L763_C0", "label": "if", "type": "if", "loc": [763, 986], "level": 0, "parent": null, "vector": [4, 0, 0.8798, 0.2254, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 99], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n\n import optparse\n p = optparse.OptionParser()\n p.add_option('-d', '--dir', action='store', default='',\n type='string', dest='dir', help='directory with logged data')\n p.add_option('-t', '--time_check', action='store_true', dest='tc',\n help='plot to check the consistency of time stamps')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Import_L765_C4", "label": "optparse import optparse", "type": "import", "loc": [765, 765], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L763_C0", "vector": [1, 1, 0.7696, 0.001, 1, 0.2, 0.0, 323, 0, 1, 0, 0, 323, 0, 0], "semantic": {"name": "optparse", "arg_names": [], "import_names": ["optparse"], "rhs_call_name": "", "annotation": ""}, "snippet": " import optparse"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L766_C4", "label": "p = OptionParser()", "type": "assigned_variable", "loc": [766, 766], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L763_C0", "vector": [14, 1, 0.7706, 0.001, 1, 0.2, 0.0333, 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_99535:Expr_L767_C4", "label": "add_option()", "type": "expression", "loc": [767, 768], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L763_C0", "vector": [8, 1, 0.7721, 0.002, 1, 0.2, 0.0667, 176, 3, 7, 0, 0, 0, 0, 1], "semantic": {"name": "add_option", "arg_names": [], "import_names": [], "rhs_call_name": "add_option", "annotation": ""}, "snippet": " p.add_option('-d', '--dir', action='store', default='',\n type='string', dest='dir', help='directory with logged data')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L769_C4", "label": "add_option()", "type": "expression", "loc": [769, 770], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L763_C0", "vector": [8, 1, 0.7741, 0.002, 1, 0.2, 0.1, 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', '--time_check', action='store_true', dest='tc',\n help='plot to check the consistency of time stamps')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L771_C4", "label": "add_option()", "type": "expression", "loc": [771, 772], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L763_C0", "vector": [8, 1, 0.7762, 0.002, 1, 0.2, 0.1333, 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('-s', '--sync', action='store_true', dest='sync',\n help='time synchronize poses, forces etc.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L773_C4", "label": "add_option()", "type": "expression", "loc": [773, 774], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L763_C0", "vector": [8, 1, 0.7782, 0.002, 1, 0.2, 0.1667, 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('--split', action='store_true', dest='split_forces',\n help='split forces into radial and tangential and save in a pickle')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L775_C4", "label": "add_option()", "type": "expression", "loc": [775, 776], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L763_C0", "vector": [8, 1, 0.7802, 0.002, 1, 0.2, 0.2, 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('--savefig', action='store_true', dest='savefig',\n help='save the plot instead of showing it.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L777_C4", "label": "add_option()", "type": "expression", "loc": [777, 778], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L763_C0", "vector": [8, 1, 0.7822, 0.002, 1, 0.2, 0.2333, 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', '--cd', action='store_true', dest='cd',\n help='work with the combined dict')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L779_C4", "label": "add_option()", "type": "expression", "loc": [779, 780], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L763_C0", "vector": [8, 1, 0.7842, 0.002, 1, 0.2, 0.2667, 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', action='store_true', dest='force',\n help='plot radial and tangential force')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L781_C4", "label": "add_option()", "type": "expression", "loc": [781, 783], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L763_C0", "vector": [8, 1, 0.7867, 0.003, 1, 0.2, 0.3, 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('--mech_prop_ros', action='store_true',\n dest='mech_prop_ros',\n help='plot radial and tangential force')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L784_C4", "label": "add_option()", "type": "expression", "loc": [784, 786], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L763_C0", "vector": [8, 1, 0.7897, 0.003, 1, 0.2, 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('--moment_test', action='store_true',\n dest='moment_test',\n help='trying to compute moment about the joint axis.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L787_C4", "label": "add_option()", "type": "expression", "loc": [787, 789], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L763_C0", "vector": [8, 1, 0.7928, 0.003, 1, 0.2, 0.3667, 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('--hook_tip_test', action='store_true',\n dest='hook_tip_test',\n help='plot trajectory of hook tip for debugging etc.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L791_C4", "label": "opt, args = parse_args()", "type": "assigned_variable", "loc": [791, 791], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L763_C0", "vector": [14, 1, 0.7958, 0.001, 1, 0.2, 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_99535:If_L793_C4", "label": "if", "type": "if", "loc": [793, 794], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L763_C0", "vector": [4, 1, 0.7983, 0.002, 1, 0.2, 0.4333, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if opt.dir == '':\n raise RuntimeError('Need a directory to work with (-d or --dir)')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L796_C4", "label": "if", "type": "if", "loc": [796, 799], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L763_C0", "vector": [4, 1, 0.8023, 0.004, 1, 0.2, 0.4667, 0, 7, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if opt.force:\n mech_pkl_name = glob.glob(opt.dir + '/open_mechanism_trajectories_*.pkl')[0]\n md = ut.load_pickle(mech_pkl_name)\n plot_radial_tangential(md, opt.savefig, 'open')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L797_C8", "label": "mech_pkl_name =", "type": "assigned_variable", "loc": [797, 797], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L796_C4", "vector": [14, 2, 0.8018, 0.001, 2, 0.81, 0.0, 139, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "mech_pkl_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mech_pkl_name = glob.glob(opt.dir + '/open_mechanism_trajectories_*.pkl')[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L798_C8", "label": "md = load_pickle()", "type": "assigned_variable", "loc": [798, 798], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L796_C4", "vector": [14, 2, 0.8028, 0.001, 2, 0.81, 0.5, 769, 3, 1, 0, 0, 65, 10, 1], "semantic": {"name": "md", "arg_names": [], "import_names": [], "rhs_call_name": "load_pickle", "annotation": ""}, "snippet": " md = ut.load_pickle(mech_pkl_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L799_C8", "label": "plot_radial_tangential()", "type": "expression", "loc": [799, 799], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L796_C4", "vector": [8, 2, 0.8038, 0.001, 2, 0.81, 1.0, 73, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "plot_radial_tangential", "arg_names": [], "import_names": [], "rhs_call_name": "plot_radial_tangential", "annotation": ""}, "snippet": " plot_radial_tangential(md, opt.savefig, 'open')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L804_C4", "label": "ft_pkl =", "type": "assigned_variable", "loc": [804, 804], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L763_C0", "vector": [14, 1, 0.8089, 0.001, 1, 0.2, 0.5, 671, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "ft_pkl", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ft_pkl = glob.glob(opt.dir + '/ft_log*.pkl')[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L805_C4", "label": "poses_pkl =", "type": "assigned_variable", "loc": [805, 805], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L763_C0", "vector": [14, 1, 0.8099, 0.001, 1, 0.2, 0.5333, 291, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "poses_pkl", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " poses_pkl = glob.glob(opt.dir + '/poses_dict*.pkl')[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L807_C4", "label": "ft_dict = load_pickle()", "type": "assigned_variable", "loc": [807, 807], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L763_C0", "vector": [14, 1, 0.8119, 0.001, 1, 0.2, 0.5667, 401, 3, 1, 0, 0, 65, 10, 1], "semantic": {"name": "ft_dict", "arg_names": [], "import_names": [], "rhs_call_name": "load_pickle", "annotation": ""}, "snippet": " ft_dict = ut.load_pickle(ft_pkl)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L808_C4", "label": "poses_dict = load_pickle()", "type": "assigned_variable", "loc": [808, 808], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L763_C0", "vector": [14, 1, 0.8129, 0.001, 1, 0.2, 0.6, 986, 3, 1, 0, 0, 65, 10, 1], "semantic": {"name": "poses_dict", "arg_names": [], "import_names": [], "rhs_call_name": "load_pickle", "annotation": ""}, "snippet": " poses_dict = ut.load_pickle(poses_pkl)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L809_C4", "label": "mechanism_dict =", "type": "assigned_variable", "loc": [809, 809], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L763_C0", "vector": [14, 1, 0.8139, 0.001, 1, 0.2, 0.6333, 148, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "mechanism_dict", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mechanism_dict = poses_dict['mechanism']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L810_C4", "label": "hand_dict =", "type": "assigned_variable", "loc": [810, 810], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L763_C0", "vector": [14, 1, 0.8149, 0.001, 1, 0.2, 0.6667, 788, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "hand_dict", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " hand_dict = poses_dict['hand']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L813_C4", "label": "ft_time_list =", "type": "assigned_variable", "loc": [813, 813], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L763_C0", "vector": [14, 1, 0.8179, 0.001, 1, 0.2, 0.7, 177, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ft_time_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ft_time_list = ft_dict['time_list']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L814_C4", "label": "mechanism_time_list =", "type": "assigned_variable", "loc": [814, 814], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L763_C0", "vector": [14, 1, 0.8189, 0.001, 1, 0.2, 0.7333, 154, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "mechanism_time_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mechanism_time_list = mechanism_dict['time_list']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L815_C4", "label": "hand_time_list =", "type": "assigned_variable", "loc": [815, 815], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L763_C0", "vector": [14, 1, 0.8199, 0.001, 1, 0.2, 0.7667, 748, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "hand_time_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " hand_time_list = hand_dict['time_list']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L817_C4", "label": "if", "type": "if", "loc": [817, 822], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L763_C0", "vector": [4, 1, 0.8244, 0.006, 1, 0.2, 0.8, 0, 7, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if opt.tc:\n check_time_sync(ft_time_list, mechanism_time_list, hand_time_list)\n if opt.savefig:\n mpu.savefig(opt.dir+'/time_check.png')\n else:\n mpu.show()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L818_C8", "label": "check_time_sync()", "type": "expression", "loc": [818, 818], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L817_C4", "vector": [8, 2, 0.8229, 0.001, 2, 0.17, 0.0, 181, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "check_time_sync", "arg_names": [], "import_names": [], "rhs_call_name": "check_time_sync", "annotation": ""}, "snippet": " check_time_sync(ft_time_list, mechanism_time_list, hand_time_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L819_C8", "label": "if", "type": "if", "loc": [819, 822], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L817_C4", "vector": [4, 2, 0.8255, 0.004, 2, 0.17, 1.0, 0, 7, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if opt.savefig:\n mpu.savefig(opt.dir+'/time_check.png')\n else:\n mpu.show()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L820_C12", "label": "savefig()", "type": "expression", "loc": [820, 820], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L819_C8", "vector": [8, 3, 0.8249, 0.001, 3, 0.67, 0.0, 677, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "savefig", "arg_names": [], "import_names": [], "rhs_call_name": "savefig", "annotation": ""}, "snippet": " mpu.savefig(opt.dir+'/time_check.png')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L822_C12", "label": "show()", "type": "expression", "loc": [822, 822], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L819_C8", "vector": [8, 3, 0.827, 0.001, 3, 0.67, 1.0, 497, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "show", "arg_names": [], "import_names": [], "rhs_call_name": "show", "annotation": ""}, "snippet": " mpu.show()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L824_C4", "label": "if", "type": "if", "loc": [824, 830], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L763_C0", "vector": [4, 1, 0.832, 0.007, 1, 0.2, 0.8333, 0, 7, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if opt.sync:\n print('Begin synchronize')\n d = synchronize(ft_dict, mechanism_dict, hand_dict)\n print('End synchronize')\n #ut.save_pickle(d, opt.dir+'/combined_log'+ut.formatted_time()+'.pkl')\n ut.save_pickle(d, opt.dir+'/combined_log.pkl')\n print('Saved pickle')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L825_C8", "label": "print()", "type": "expression", "loc": [825, 825], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L824_C4", "vector": [8, 2, 0.83, 0.001, 2, 0.82, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Begin synchronize')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L826_C8", "label": "d = synchronize()", "type": "assigned_variable", "loc": [826, 826], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L824_C4", "vector": [14, 2, 0.831, 0.001, 2, 0.82, 0.25, 355, 3, 3, 0, 0, 267, 10, 1], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "synchronize", "annotation": ""}, "snippet": " d = synchronize(ft_dict, mechanism_dict, hand_dict)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L827_C8", "label": "print()", "type": "expression", "loc": [827, 827], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L824_C4", "vector": [8, 2, 0.832, 0.001, 2, 0.82, 0.5, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('End synchronize')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L829_C8", "label": "save_pickle()", "type": "expression", "loc": [829, 829], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L824_C4", "vector": [8, 2, 0.834, 0.001, 2, 0.82, 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": " ut.save_pickle(d, opt.dir+'/combined_log.pkl')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L830_C8", "label": "print()", "type": "expression", "loc": [830, 830], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L824_C4", "vector": [8, 2, 0.835, 0.001, 2, 0.82, 1.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Saved pickle')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L832_C4", "label": "if", "type": "if", "loc": [832, 834], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L763_C0", "vector": [4, 1, 0.838, 0.003, 1, 0.2, 0.8667, 0, 7, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if opt.cd:\n cd = ut.load_pickle(glob.glob(opt.dir + '/combined_log*.pkl')[0])\n plot(cd, opt.savefig)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L833_C8", "label": "cd = load_pickle()", "type": "assigned_variable", "loc": [833, 833], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L832_C4", "vector": [14, 2, 0.838, 0.001, 2, 0.11, 0.0, 214, 3, 1, 0, 0, 65, 10, 2], "semantic": {"name": "cd", "arg_names": [], "import_names": [], "rhs_call_name": "load_pickle", "annotation": ""}, "snippet": " cd = ut.load_pickle(glob.glob(opt.dir + '/combined_log*.pkl')[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L834_C8", "label": "plot()", "type": "expression", "loc": [834, 834], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L832_C4", "vector": [8, 2, 0.839, 0.001, 2, 0.11, 1.0, 929, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "plot", "arg_names": [], "import_names": [], "rhs_call_name": "plot", "annotation": ""}, "snippet": " plot(cd, opt.savefig)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L836_C4", "label": "if", "type": "if", "loc": [836, 881], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L763_C0", "vector": [4, 1, 0.8637, 0.0463, 1, 0.2, 0.9, 0, 7, 0, 0, 0, 0, 0, 29], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if opt.mech_prop_ros:\n import mechanism_analyse as ma\n\n cd = ut.load_pickle(glob.glob(opt.dir + '/combined_log*.pkl')[0])\n\n tup = ke.init_ros_node()\n\n ma2 = compute_mech_angle_2(cd, tup, project_plane=False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Import_L837_C8", "label": "mechanism_analyse import ma", "type": "import", "loc": [837, 837], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L836_C4", "vector": [1, 2, 0.8421, 0.001, 2, 0.35, 0.0, 855, 0, 1, 0, 0, 855, 0, 0], "semantic": {"name": "mechanism_analyse", "arg_names": [], "import_names": ["ma"], "rhs_call_name": "", "annotation": ""}, "snippet": " import mechanism_analyse as ma"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L839_C8", "label": "cd = load_pickle()", "type": "assigned_variable", "loc": [839, 839], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L836_C4", "vector": [14, 2, 0.8441, 0.001, 2, 0.35, 0.0455, 214, 3, 1, 0, 0, 65, 10, 2], "semantic": {"name": "cd", "arg_names": [], "import_names": [], "rhs_call_name": "load_pickle", "annotation": ""}, "snippet": " cd = ut.load_pickle(glob.glob(opt.dir + '/combined_log*.pkl')[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L841_C8", "label": "tup = init_ros_node()", "type": "assigned_variable", "loc": [841, 841], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L836_C4", "vector": [14, 2, 0.8461, 0.001, 2, 0.35, 0.0909, 218, 3, 0, 0, 0, 465, 10, 1], "semantic": {"name": "tup", "arg_names": [], "import_names": [], "rhs_call_name": "init_ros_node", "annotation": ""}, "snippet": " tup = ke.init_ros_node()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L843_C8", "label": "ma2 = compute_mech_angle_2()", "type": "assigned_variable", "loc": [843, 843], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L836_C4", "vector": [14, 2, 0.8481, 0.001, 2, 0.35, 0.1364, 644, 3, 3, 0, 0, 910, 10, 1], "semantic": {"name": "ma2", "arg_names": [], "import_names": [], "rhs_call_name": "compute_mech_angle_2", "annotation": ""}, "snippet": " ma2 = compute_mech_angle_2(cd, tup, project_plane=False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L844_C8", "label": "ma1 = compute_mech_angle_1()", "type": "assigned_variable", "loc": [844, 844], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L836_C4", "vector": [14, 2, 0.8491, 0.001, 2, 0.35, 0.1818, 547, 3, 1, 0, 0, 466, 10, 1], "semantic": {"name": "ma1", "arg_names": [], "import_names": [], "rhs_call_name": "compute_mech_angle_1", "annotation": ""}, "snippet": " ma1 = compute_mech_angle_1(cd)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L845_C8", "label": "ma3 = compute_mech_angle_2()", "type": "assigned_variable", "loc": [845, 845], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L836_C4", "vector": [14, 2, 0.8501, 0.001, 2, 0.35, 0.2273, 769, 3, 3, 0, 0, 910, 10, 1], "semantic": {"name": "ma3", "arg_names": [], "import_names": [], "rhs_call_name": "compute_mech_angle_2", "annotation": ""}, "snippet": " ma3 = compute_mech_angle_2(cd, tup, project_plane=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L849_C8", "label": "lab1 =", "type": "assigned_variable", "loc": [849, 849], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L836_C4", "vector": [14, 2, 0.8541, 0.001, 2, 0.35, 0.2727, 509, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "lab1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " lab1 = 'orientation only'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L850_C8", "label": "lab2 =", "type": "assigned_variable", "loc": [850, 850], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L836_C4", "vector": [14, 2, 0.8551, 0.001, 2, 0.35, 0.3182, 693, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "lab2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " lab2 = 'checker origin position + circle fit'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L851_C8", "label": "lab3 =", "type": "assigned_variable", "loc": [851, 851], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L836_C4", "vector": [14, 2, 0.8561, 0.001, 2, 0.35, 0.3636, 607, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "lab3", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " lab3 = 'checker origin position + PCA projection + circle fit'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L854_C8", "label": "figure()", "type": "expression", "loc": [854, 854], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L836_C4", "vector": [8, 2, 0.8592, 0.001, 2, 0.35, 0.4091, 789, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "figure", "arg_names": [], "import_names": [], "rhs_call_name": "figure", "annotation": ""}, "snippet": " mpu.figure()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L855_C8", "label": "plot_yx()", "type": "expression", "loc": [855, 856], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L836_C4", "vector": [8, 2, 0.8607, 0.002, 2, 0.35, 0.4545, 112, 3, 5, 0, 0, 0, 0, 2], "semantic": {"name": "plot_yx", "arg_names": [], "import_names": [], "rhs_call_name": "plot_yx", "annotation": ""}, "snippet": " mpu.plot_yx(np.degrees(ma3), color='r', label=lab3,\n linewidth = 1, scatter_size = 5)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L857_C8", "label": "plot_yx()", "type": "expression", "loc": [857, 858], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L836_C4", "vector": [8, 2, 0.8627, 0.002, 2, 0.35, 0.5, 112, 3, 5, 0, 0, 0, 0, 2], "semantic": {"name": "plot_yx", "arg_names": [], "import_names": [], "rhs_call_name": "plot_yx", "annotation": ""}, "snippet": " mpu.plot_yx(np.degrees(ma2), color='b', label=lab2,\n linewidth = 1, scatter_size = 5)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L859_C8", "label": "plot_yx()", "type": "expression", "loc": [859, 860], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L836_C4", "vector": [8, 2, 0.8647, 0.002, 2, 0.35, 0.5455, 112, 3, 5, 0, 0, 0, 0, 2], "semantic": {"name": "plot_yx", "arg_names": [], "import_names": [], "rhs_call_name": "plot_yx", "annotation": ""}, "snippet": " mpu.plot_yx(np.degrees(ma1), color='y', label=lab1,\n linewidth = 1, scatter_size = 5)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L861_C8", "label": "legend()", "type": "expression", "loc": [861, 861], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L836_C4", "vector": [8, 2, 0.8662, 0.001, 2, 0.35, 0.5909, 880, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "legend", "arg_names": [], "import_names": [], "rhs_call_name": "legend", "annotation": ""}, "snippet": " mpu.legend()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L863_C8", "label": "vel3 = compute_velocity()", "type": "assigned_variable", "loc": [863, 863], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L836_C4", "vector": [14, 2, 0.8682, 0.001, 2, 0.35, 0.6364, 214, 3, 3, 0, 0, 707, 10, 1], "semantic": {"name": "vel3", "arg_names": [], "import_names": [], "rhs_call_name": "compute_velocity", "annotation": ""}, "snippet": " vel3 = ma.compute_velocity(ma3, cd['time_list'], 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L864_C8", "label": "vel2 = compute_velocity()", "type": "assigned_variable", "loc": [864, 864], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L836_C4", "vector": [14, 2, 0.8692, 0.001, 2, 0.35, 0.6818, 700, 3, 3, 0, 0, 707, 10, 1], "semantic": {"name": "vel2", "arg_names": [], "import_names": [], "rhs_call_name": "compute_velocity", "annotation": ""}, "snippet": " vel2 = ma.compute_velocity(ma2, cd['time_list'], 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L865_C8", "label": "vel1 = compute_velocity()", "type": "assigned_variable", "loc": [865, 865], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L836_C4", "vector": [14, 2, 0.8702, 0.001, 2, 0.35, 0.7273, 691, 3, 3, 0, 0, 707, 10, 1], "semantic": {"name": "vel1", "arg_names": [], "import_names": [], "rhs_call_name": "compute_velocity", "annotation": ""}, "snippet": " vel1 = ma.compute_velocity(ma1, cd['time_list'], 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L866_C8", "label": "figure()", "type": "expression", "loc": [866, 866], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L836_C4", "vector": [8, 2, 0.8712, 0.001, 2, 0.35, 0.7727, 789, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "figure", "arg_names": [], "import_names": [], "rhs_call_name": "figure", "annotation": ""}, "snippet": " mpu.figure()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L867_C8", "label": "plot_yx()", "type": "expression", "loc": [867, 868], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L836_C4", "vector": [8, 2, 0.8727, 0.002, 2, 0.35, 0.8182, 112, 3, 6, 0, 0, 0, 0, 3], "semantic": {"name": "plot_yx", "arg_names": [], "import_names": [], "rhs_call_name": "plot_yx", "annotation": ""}, "snippet": " mpu.plot_yx(np.degrees(vel3), np.degrees(ma3), color='r',\n label=lab3, linewidth = 1, scatter_size = 5)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L869_C8", "label": "plot_yx()", "type": "expression", "loc": [869, 870], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L836_C4", "vector": [8, 2, 0.8747, 0.002, 2, 0.35, 0.8636, 112, 3, 6, 0, 0, 0, 0, 3], "semantic": {"name": "plot_yx", "arg_names": [], "import_names": [], "rhs_call_name": "plot_yx", "annotation": ""}, "snippet": " mpu.plot_yx(np.degrees(vel2), np.degrees(ma2), color='b',\n label=lab2, linewidth = 1, scatter_size = 5)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L871_C8", "label": "plot_yx()", "type": "expression", "loc": [871, 872], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L836_C4", "vector": [8, 2, 0.8768, 0.002, 2, 0.35, 0.9091, 112, 3, 6, 0, 0, 0, 0, 3], "semantic": {"name": "plot_yx", "arg_names": [], "import_names": [], "rhs_call_name": "plot_yx", "annotation": ""}, "snippet": " mpu.plot_yx(np.degrees(vel1), np.degrees(ma1), color='y',\n label=lab1, linewidth = 1, scatter_size = 5)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L873_C8", "label": "legend()", "type": "expression", "loc": [873, 873], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L836_C4", "vector": [8, 2, 0.8783, 0.001, 2, 0.35, 0.9545, 880, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "legend", "arg_names": [], "import_names": [], "rhs_call_name": "legend", "annotation": ""}, "snippet": " mpu.legend()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L881_C8", "label": "show()", "type": "expression", "loc": [881, 881], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L836_C4", "vector": [8, 2, 0.8863, 0.001, 2, 0.35, 1.0, 497, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "show", "arg_names": [], "import_names": [], "rhs_call_name": "show", "annotation": ""}, "snippet": " mpu.show()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L883_C4", "label": "if", "type": "if", "loc": [883, 896], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L763_C0", "vector": [4, 1, 0.8949, 0.0141, 1, 0.2, 0.9333, 0, 7, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if opt.split_forces:\n tup = ke.init_ros_node()\n pkl_name = glob.glob(opt.dir + '/combined_log*.pkl')[0]\n mech_pkl_name = glob.glob(opt.dir + '/mechanism_info*.pkl')[0]\n\n md = ut.load_pickle(mech_pkl_name)\n cd = ut.load_pickle(pkl_name)\n cd['hook_checker_number'] = md['checkerboard_number']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L884_C8", "label": "tup = init_ros_node()", "type": "assigned_variable", "loc": [884, 884], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L883_C4", "vector": [14, 2, 0.8893, 0.001, 2, 0.28, 0.0, 218, 3, 0, 0, 0, 465, 10, 1], "semantic": {"name": "tup", "arg_names": [], "import_names": [], "rhs_call_name": "init_ros_node", "annotation": ""}, "snippet": " tup = ke.init_ros_node()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L885_C8", "label": "pkl_name =", "type": "assigned_variable", "loc": [885, 885], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L883_C4", "vector": [14, 2, 0.8903, 0.001, 2, 0.28, 0.125, 780, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "pkl_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pkl_name = glob.glob(opt.dir + '/combined_log*.pkl')[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L886_C8", "label": "mech_pkl_name =", "type": "assigned_variable", "loc": [886, 886], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L883_C4", "vector": [14, 2, 0.8913, 0.001, 2, 0.28, 0.25, 139, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "mech_pkl_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mech_pkl_name = glob.glob(opt.dir + '/mechanism_info*.pkl')[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L888_C8", "label": "md = load_pickle()", "type": "assigned_variable", "loc": [888, 888], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L883_C4", "vector": [14, 2, 0.8934, 0.001, 2, 0.28, 0.375, 769, 3, 1, 0, 0, 65, 10, 1], "semantic": {"name": "md", "arg_names": [], "import_names": [], "rhs_call_name": "load_pickle", "annotation": ""}, "snippet": " md = ut.load_pickle(mech_pkl_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L889_C8", "label": "cd = load_pickle()", "type": "assigned_variable", "loc": [889, 889], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L883_C4", "vector": [14, 2, 0.8944, 0.001, 2, 0.28, 0.5, 214, 3, 1, 0, 0, 65, 10, 1], "semantic": {"name": "cd", "arg_names": [], "import_names": [], "rhs_call_name": "load_pickle", "annotation": ""}, "snippet": " cd = ut.load_pickle(pkl_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L890_C8", "label": "assign", "type": "assigned_variable", "loc": [890, 890], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L883_C4", "vector": [14, 2, 0.8954, 0.001, 2, 0.28, 0.625, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cd['hook_checker_number'] = md['checkerboard_number']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L891_C8", "label": "assign", "type": "assigned_variable", "loc": [891, 891], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L883_C4", "vector": [14, 2, 0.8964, 0.001, 2, 0.28, 0.75, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cd['radius'] = md['radius']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L892_C8", "label": "rad, tan, ang, typ, moment_axis, moment_tip = compute_mechanism_properties()", "type": "assigned_variable", "loc": [892, 894], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L883_C4", "vector": [14, 2, 0.8984, 0.003, 2, 0.28, 0.875, 163, 3, 4, 0, 0, 143, 10, 1], "semantic": {"name": "rad, tan, ang, typ, moment_axis, moment_tip", "arg_names": [], "import_names": [], "rhs_call_name": "compute_mechanism_properties", "annotation": ""}, "snippet": " rad, tan, ang, typ, moment_axis, moment_tip = compute_mechanism_properties(cd,\n bias_ft=True, tup=tup,\n cd_pkl_name = pkl_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L895_C8", "label": "split_open_close()", "type": "expression", "loc": [895, 896], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L883_C4", "vector": [8, 2, 0.9009, 0.002, 2, 0.28, 1.0, 747, 3, 8, 0, 0, 0, 0, 1], "semantic": {"name": "split_open_close", "arg_names": [], "import_names": [], "rhs_call_name": "split_open_close", "annotation": ""}, "snippet": " split_open_close(rad, tan, ang, typ, md['radius'],\n cd['time_list'], moment_axis, moment_tip)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L898_C4", "label": "if", "type": "if", "loc": [898, 945], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L763_C0", "vector": [4, 1, 0.9271, 0.0483, 1, 0.2, 0.9667, 0, 7, 0, 0, 0, 0, 0, 31], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if opt.moment_test:\n tup = ke.init_ros_node()\n pkl_name = glob.glob(opt.dir + '/combined_log*.pkl')[0]\n mech_pkl_name = glob.glob(opt.dir + '/mechanism_info*.pkl')[0]\n\n md = ut.load_pickle(mech_pkl_name)\n cd = ut.load_pickle(pkl_name)\n cd['hook_checker_number'] = md['checkerboard_number']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L899_C8", "label": "tup = init_ros_node()", "type": "assigned_variable", "loc": [899, 899], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L898_C4", "vector": [14, 2, 0.9044, 0.001, 2, 0.36, 0.0, 218, 3, 0, 0, 0, 465, 10, 1], "semantic": {"name": "tup", "arg_names": [], "import_names": [], "rhs_call_name": "init_ros_node", "annotation": ""}, "snippet": " tup = ke.init_ros_node()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L900_C8", "label": "pkl_name =", "type": "assigned_variable", "loc": [900, 900], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L898_C4", "vector": [14, 2, 0.9054, 0.001, 2, 0.36, 0.04, 780, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "pkl_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pkl_name = glob.glob(opt.dir + '/combined_log*.pkl')[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L901_C8", "label": "mech_pkl_name =", "type": "assigned_variable", "loc": [901, 901], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L898_C4", "vector": [14, 2, 0.9064, 0.001, 2, 0.36, 0.08, 139, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "mech_pkl_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mech_pkl_name = glob.glob(opt.dir + '/mechanism_info*.pkl')[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L903_C8", "label": "md = load_pickle()", "type": "assigned_variable", "loc": [903, 903], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L898_C4", "vector": [14, 2, 0.9085, 0.001, 2, 0.36, 0.12, 769, 3, 1, 0, 0, 65, 10, 1], "semantic": {"name": "md", "arg_names": [], "import_names": [], "rhs_call_name": "load_pickle", "annotation": ""}, "snippet": " md = ut.load_pickle(mech_pkl_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L904_C8", "label": "cd = load_pickle()", "type": "assigned_variable", "loc": [904, 904], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L898_C4", "vector": [14, 2, 0.9095, 0.001, 2, 0.36, 0.16, 214, 3, 1, 0, 0, 65, 10, 1], "semantic": {"name": "cd", "arg_names": [], "import_names": [], "rhs_call_name": "load_pickle", "annotation": ""}, "snippet": " cd = ut.load_pickle(pkl_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L905_C8", "label": "assign", "type": "assigned_variable", "loc": [905, 905], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L898_C4", "vector": [14, 2, 0.9105, 0.001, 2, 0.36, 0.2, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cd['hook_checker_number'] = md['checkerboard_number']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L906_C8", "label": "assign", "type": "assigned_variable", "loc": [906, 906], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L898_C4", "vector": [14, 2, 0.9115, 0.001, 2, 0.36, 0.24, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cd['radius'] = md['radius']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L907_C8", "label": "rad, tan, ang, typ, moment_axis, moment_tip = compute_mechanism_properties()", "type": "assigned_variable", "loc": [907, 909], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L898_C4", "vector": [14, 2, 0.9135, 0.003, 2, 0.36, 0.28, 163, 3, 4, 0, 0, 143, 10, 1], "semantic": {"name": "rad, tan, ang, typ, moment_axis, moment_tip", "arg_names": [], "import_names": [], "rhs_call_name": "compute_mechanism_properties", "annotation": ""}, "snippet": " rad, tan, ang, typ, moment_axis, moment_tip = compute_mechanism_properties(cd,\n bias_ft=True, tup=tup,\n cd_pkl_name = pkl_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L910_C8", "label": "ang = array()", "type": "assigned_variable", "loc": [910, 910], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L898_C4", "vector": [14, 2, 0.9155, 0.001, 2, 0.36, 0.32, 762, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "ang", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " ang = np.array(ang)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L911_C8", "label": "incr =", "type": "assigned_variable", "loc": [911, 911], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L898_C4", "vector": [14, 2, 0.9165, 0.001, 2, 0.36, 0.36, 621, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "incr", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " incr = ang[1:] - ang[:-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L912_C8", "label": "n_pts =", "type": "assigned_variable", "loc": [912, 912], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L898_C4", "vector": [14, 2, 0.9175, 0.001, 2, 0.36, 0.4, 156, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "n_pts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " n_pts = ang.shape[0] - 2 #ignoring first and last readings."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L913_C8", "label": "rad_l, tan_l, ang_l =", "type": "assigned_variable", "loc": [913, 913], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L898_C4", "vector": [14, 2, 0.9185, 0.001, 2, 0.36, 0.44, 275, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "rad_l, tan_l, ang_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rad_l, tan_l, ang_l = [], [], []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L914_C8", "label": "for i", "type": "for", "loc": [914, 927], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L898_C4", "vector": [6, 2, 0.9261, 0.0141, 2, 0.36, 0.48, 826, 3, 0, 0, 0, 0, 0, 9], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(n_pts):\n if typ == 'rotary':\n sgn = incr[i] * incr[i+1]\n mag = abs(incr[i] - incr[i+1])\n if sgn < 0 and mag > math.radians(10):\n continue\n rad_l.append(rad[i+1])\n tan_l.append(tan[i+1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L915_C12", "label": "if", "type": "if", "loc": [915, 927], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L914_C8", "vector": [4, 3, 0.9266, 0.0131, 3, 0.51, 0.0, 0, 0, 0, 0, 0, 0, 0, 8], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if typ == 'rotary':\n sgn = incr[i] * incr[i+1]\n mag = abs(incr[i] - incr[i+1])\n if sgn < 0 and mag > math.radians(10):\n continue\n rad_l.append(rad[i+1])\n tan_l.append(tan[i+1])\n ang_l.append(ang[i+1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L916_C16", "label": "sgn =", "type": "assigned_variable", "loc": [916, 916], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L915_C12", "vector": [14, 4, 0.9215, 0.001, 4, 0.39, 0.0, 994, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "sgn", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " sgn = incr[i] * incr[i+1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L917_C16", "label": "mag = abs()", "type": "assigned_variable", "loc": [917, 917], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L915_C12", "vector": [14, 4, 0.9225, 0.001, 4, 0.39, 0.125, 533, 3, 1, 0, 0, 799, 10, 1], "semantic": {"name": "mag", "arg_names": [], "import_names": [], "rhs_call_name": "abs", "annotation": ""}, "snippet": " mag = abs(incr[i] - incr[i+1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L918_C16", "label": "if", "type": "if", "loc": [918, 919], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L915_C12", "vector": [4, 4, 0.924, 0.002, 4, 0.39, 0.25, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if sgn < 0 and mag > math.radians(10):\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L920_C16", "label": "append()", "type": "expression", "loc": [920, 920], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L915_C12", "vector": [8, 4, 0.9256, 0.001, 4, 0.39, 0.375, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " rad_l.append(rad[i+1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L921_C16", "label": "append()", "type": "expression", "loc": [921, 921], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L915_C12", "vector": [8, 4, 0.9266, 0.001, 4, 0.39, 0.5, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " tan_l.append(tan[i+1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L922_C16", "label": "append()", "type": "expression", "loc": [922, 922], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L915_C12", "vector": [8, 4, 0.9276, 0.001, 4, 0.39, 0.625, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " ang_l.append(ang[i+1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L925_C16", "label": "append()", "type": "expression", "loc": [925, 925], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L915_C12", "vector": [8, 4, 0.9306, 0.001, 4, 0.39, 0.75, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " rad_l.append(rad[i+1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L926_C16", "label": "append()", "type": "expression", "loc": [926, 926], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L915_C12", "vector": [8, 4, 0.9316, 0.001, 4, 0.39, 0.875, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " tan_l.append(tan[i+1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L927_C16", "label": "append()", "type": "expression", "loc": [927, 927], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L915_C12", "vector": [8, 4, 0.9326, 0.001, 4, 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": " ang_l.append(ang[i+1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L929_C8", "label": "rad, tan, ang =", "type": "assigned_variable", "loc": [929, 929], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L898_C4", "vector": [14, 2, 0.9346, 0.001, 2, 0.36, 0.52, 75, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "rad, tan, ang", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rad, tan, ang = rad_l, tan_l, ang_l"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L930_C8", "label": "max_idx = argmax()", "type": "assigned_variable", "loc": [930, 930], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L898_C4", "vector": [14, 2, 0.9356, 0.001, 2, 0.36, 0.56, 910, 3, 1, 0, 0, 593, 10, 1], "semantic": {"name": "max_idx", "arg_names": [], "import_names": [], "rhs_call_name": "argmax", "annotation": ""}, "snippet": " max_idx = np.argmax(ang)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L931_C8", "label": "rad = array()", "type": "assigned_variable", "loc": [931, 931], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L898_C4", "vector": [14, 2, 0.9366, 0.001, 2, 0.36, 0.6, 439, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "rad", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " rad = np.array(rad[:max_idx+1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L932_C8", "label": "tan = array()", "type": "assigned_variable", "loc": [932, 932], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L898_C4", "vector": [14, 2, 0.9376, 0.001, 2, 0.36, 0.64, 311, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "tan", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " tan = np.array(tan[:max_idx+1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L933_C8", "label": "ang = array()", "type": "assigned_variable", "loc": [933, 933], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L898_C4", "vector": [14, 2, 0.9386, 0.001, 2, 0.36, 0.68, 762, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "ang", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " ang = np.array(ang[:max_idx+1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L934_C8", "label": "moment_axis = array()", "type": "assigned_variable", "loc": [934, 934], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L898_C4", "vector": [14, 2, 0.9396, 0.001, 2, 0.36, 0.72, 630, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "moment_axis", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " moment_axis = np.array(moment_axis[:max_idx+1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L935_C8", "label": "moment_tip = array()", "type": "assigned_variable", "loc": [935, 935], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L898_C4", "vector": [14, 2, 0.9406, 0.001, 2, 0.36, 0.76, 341, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "moment_tip", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " moment_tip = np.array(moment_tip[:max_idx+1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L937_C8", "label": "fig1 = figure()", "type": "assigned_variable", "loc": [937, 937], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L898_C4", "vector": [14, 2, 0.9427, 0.001, 2, 0.36, 0.8, 605, 3, 0, 0, 0, 789, 10, 1], "semantic": {"name": "fig1", "arg_names": [], "import_names": [], "rhs_call_name": "figure", "annotation": ""}, "snippet": " fig1 = mpu.figure()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L938_C8", "label": "plot_yx()", "type": "expression", "loc": [938, 939], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L898_C4", "vector": [8, 2, 0.9442, 0.002, 2, 0.36, 0.84, 112, 3, 4, 0, 0, 0, 0, 2], "semantic": {"name": "plot_yx", "arg_names": [], "import_names": [], "rhs_call_name": "plot_yx", "annotation": ""}, "snippet": " mpu.plot_yx(tan * cd['radius'], np.degrees(ang), label = 'Moment from Tangential Force',\n color = 'b')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L940_C8", "label": "plot_yx()", "type": "expression", "loc": [940, 941], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L898_C4", "vector": [8, 2, 0.9462, 0.002, 2, 0.36, 0.88, 112, 3, 4, 0, 0, 0, 0, 2], "semantic": {"name": "plot_yx", "arg_names": [], "import_names": [], "rhs_call_name": "plot_yx", "annotation": ""}, "snippet": " mpu.plot_yx(moment_axis, np.degrees(ang), label = 'Computed Moment',\n color = 'g')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L942_C8", "label": "plot_yx()", "type": "expression", "loc": [942, 943], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L898_C4", "vector": [8, 2, 0.9482, 0.002, 2, 0.36, 0.92, 112, 3, 4, 0, 0, 0, 0, 2], "semantic": {"name": "plot_yx", "arg_names": [], "import_names": [], "rhs_call_name": "plot_yx", "annotation": ""}, "snippet": " mpu.plot_yx(moment_tip, np.degrees(ang), label = 'Computed Moment using tip model',\n color = 'y')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L944_C8", "label": "legend()", "type": "expression", "loc": [944, 944], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L898_C4", "vector": [8, 2, 0.9497, 0.001, 2, 0.36, 0.96, 880, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "legend", "arg_names": [], "import_names": [], "rhs_call_name": "legend", "annotation": ""}, "snippet": " mpu.legend()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L945_C8", "label": "show()", "type": "expression", "loc": [945, 945], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L898_C4", "vector": [8, 2, 0.9507, 0.001, 2, 0.36, 1.0, 497, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "show", "arg_names": [], "import_names": [], "rhs_call_name": "show", "annotation": ""}, "snippet": " mpu.show()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L947_C4", "label": "if", "type": "if", "loc": [947, 986], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L763_C0", "vector": [4, 1, 0.9723, 0.0402, 1, 0.2, 1.0, 0, 7, 0, 0, 0, 0, 0, 15], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if opt.hook_tip_test:\n tup = ke.init_ros_node()\n pkl_name = glob.glob(opt.dir + '/combined_log*.pkl')[0]\n mech_pkl_name = glob.glob(opt.dir + '/mechanism_info*.pkl')[0]\n\n md = ut.load_pickle(mech_pkl_name)\n cd = ut.load_pickle(pkl_name)\n cd['hook_checker_number'] = md['checkerboard_number']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L948_C8", "label": "tup = init_ros_node()", "type": "assigned_variable", "loc": [948, 948], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L947_C4", "vector": [14, 2, 0.9537, 0.001, 2, 0.8, 0.0, 218, 3, 0, 0, 0, 465, 10, 1], "semantic": {"name": "tup", "arg_names": [], "import_names": [], "rhs_call_name": "init_ros_node", "annotation": ""}, "snippet": " tup = ke.init_ros_node()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L949_C8", "label": "pkl_name =", "type": "assigned_variable", "loc": [949, 949], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L947_C4", "vector": [14, 2, 0.9547, 0.001, 2, 0.8, 0.0435, 780, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "pkl_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pkl_name = glob.glob(opt.dir + '/combined_log*.pkl')[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L950_C8", "label": "mech_pkl_name =", "type": "assigned_variable", "loc": [950, 950], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L947_C4", "vector": [14, 2, 0.9557, 0.001, 2, 0.8, 0.087, 139, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "mech_pkl_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mech_pkl_name = glob.glob(opt.dir + '/mechanism_info*.pkl')[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L952_C8", "label": "md = load_pickle()", "type": "assigned_variable", "loc": [952, 952], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L947_C4", "vector": [14, 2, 0.9577, 0.001, 2, 0.8, 0.1304, 769, 3, 1, 0, 0, 65, 10, 1], "semantic": {"name": "md", "arg_names": [], "import_names": [], "rhs_call_name": "load_pickle", "annotation": ""}, "snippet": " md = ut.load_pickle(mech_pkl_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L953_C8", "label": "cd = load_pickle()", "type": "assigned_variable", "loc": [953, 953], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L947_C4", "vector": [14, 2, 0.9588, 0.001, 2, 0.8, 0.1739, 214, 3, 1, 0, 0, 65, 10, 1], "semantic": {"name": "cd", "arg_names": [], "import_names": [], "rhs_call_name": "load_pickle", "annotation": ""}, "snippet": " cd = ut.load_pickle(pkl_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L954_C8", "label": "assign", "type": "assigned_variable", "loc": [954, 954], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L947_C4", "vector": [14, 2, 0.9598, 0.001, 2, 0.8, 0.2174, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cd['hook_checker_number'] = md['checkerboard_number']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L955_C8", "label": "assign", "type": "assigned_variable", "loc": [955, 955], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L947_C4", "vector": [14, 2, 0.9608, 0.001, 2, 0.8, 0.2609, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cd['radius'] = md['radius']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L957_C8", "label": "hook_tip_l = compute_hook_tip_trajectory()", "type": "assigned_variable", "loc": [957, 957], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L947_C4", "vector": [14, 2, 0.9628, 0.001, 2, 0.8, 0.3043, 521, 3, 1, 0, 0, 585, 10, 1], "semantic": {"name": "hook_tip_l", "arg_names": [], "import_names": [], "rhs_call_name": "compute_hook_tip_trajectory", "annotation": ""}, "snippet": " hook_tip_l = compute_hook_tip_trajectory(cd)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L958_C8", "label": "hook_rot_l =", "type": "assigned_variable", "loc": [958, 958], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L947_C4", "vector": [14, 2, 0.9638, 0.001, 2, 0.8, 0.3478, 697, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "hook_rot_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " hook_rot_l = cd['hand_rot_list']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L960_C8", "label": "mech_mat = column_stack()", "type": "assigned_variable", "loc": [960, 960], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L947_C4", "vector": [14, 2, 0.9658, 0.001, 2, 0.8, 0.3913, 240, 3, 1, 0, 0, 724, 10, 1], "semantic": {"name": "mech_mat", "arg_names": [], "import_names": [], "rhs_call_name": "column_stack", "annotation": ""}, "snippet": " mech_mat = np.column_stack(cd['mech_pos_list'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L961_C8", "label": "hand_mat = column_stack()", "type": "assigned_variable", "loc": [961, 961], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L947_C4", "vector": [14, 2, 0.9668, 0.001, 2, 0.8, 0.4348, 181, 3, 1, 0, 0, 724, 10, 1], "semantic": {"name": "hand_mat", "arg_names": [], "import_names": [], "rhs_call_name": "column_stack", "annotation": ""}, "snippet": " hand_mat = np.column_stack(hook_tip_l)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L963_C8", "label": "ft_mat =", "type": "assigned_variable", "loc": [963, 963], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L947_C4", "vector": [14, 2, 0.9688, 0.001, 2, 0.8, 0.4783, 624, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "ft_mat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ft_mat = np.matrix(cd['ft_list']).T # 6xN np matrix"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L964_C8", "label": "force_mat =", "type": "assigned_variable", "loc": [964, 964], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L947_C4", "vector": [14, 2, 0.9698, 0.001, 2, 0.8, 0.5217, 156, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "force_mat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " force_mat = ft_mat[0:3, :]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L967_C8", "label": "moment_mat =", "type": "assigned_variable", "loc": [967, 967], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L947_C4", "vector": [14, 2, 0.9728, 0.001, 2, 0.8, 0.5652, 931, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "moment_mat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " moment_mat = ft_mat[3:6, :]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L970_C8", "label": "for i, f", "type": "for", "loc": [970, 974], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L947_C4", "vector": [6, 2, 0.9779, 0.005, 2, 0.8, 0.6087, 291, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "i, f", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i,f in enumerate(force_mat.T):\n fmag = np.linalg.norm(f)\n if fmag > 1.0:\n print('i:', i)\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L971_C12", "label": "fmag = norm()", "type": "assigned_variable", "loc": [971, 971], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L970_C8", "vector": [14, 3, 0.9769, 0.001, 3, 0.44, 0.0, 470, 3, 1, 0, 0, 902, 10, 1], "semantic": {"name": "fmag", "arg_names": [], "import_names": [], "rhs_call_name": "norm", "annotation": ""}, "snippet": " fmag = np.linalg.norm(f)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L972_C12", "label": "if", "type": "if", "loc": [972, 974], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L970_C8", "vector": [4, 3, 0.9789, 0.003, 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 fmag > 1.0:\n print('i:', i)\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L973_C16", "label": "print()", "type": "expression", "loc": [973, 973], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L972_C12", "vector": [8, 4, 0.9789, 0.001, 4, 0.5, 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:', i)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L976_C8", "label": "mech_angle_l = compute_mech_angle_2()", "type": "assigned_variable", "loc": [976, 976], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L947_C4", "vector": [14, 2, 0.9819, 0.001, 2, 0.8, 0.6522, 684, 3, 3, 0, 0, 910, 10, 1], "semantic": {"name": "mech_angle_l", "arg_names": [], "import_names": [], "rhs_call_name": "compute_mech_angle_2", "annotation": ""}, "snippet": " mech_angle_l = compute_mech_angle_2(cd, tup, project_plane=False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L977_C8", "label": "end_idx = argmax()", "type": "assigned_variable", "loc": [977, 977], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L947_C4", "vector": [14, 2, 0.9829, 0.001, 2, 0.8, 0.6957, 539, 3, 1, 0, 0, 593, 10, 1], "semantic": {"name": "end_idx", "arg_names": [], "import_names": [], "rhs_call_name": "argmax", "annotation": ""}, "snippet": " end_idx = np.argmax(mech_angle_l)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L979_C8", "label": "hand_mat =", "type": "assigned_variable", "loc": [979, 979], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L947_C4", "vector": [14, 2, 0.9849, 0.001, 2, 0.8, 0.7391, 181, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "hand_mat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " hand_mat = hand_mat[:,i:end_idx]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L980_C8", "label": "mech_mat =", "type": "assigned_variable", "loc": [980, 980], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L947_C4", "vector": [14, 2, 0.9859, 0.001, 2, 0.8, 0.7826, 240, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "mech_mat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mech_mat = mech_mat[:,i:end_idx]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L981_C8", "label": "force_mat =", "type": "assigned_variable", "loc": [981, 981], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L947_C4", "vector": [14, 2, 0.9869, 0.001, 2, 0.8, 0.8261, 156, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "force_mat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " force_mat = force_mat[:,i:end_idx]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L982_C8", "label": "moment_mat =", "type": "assigned_variable", "loc": [982, 982], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L947_C4", "vector": [14, 2, 0.9879, 0.001, 2, 0.8, 0.8696, 931, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "moment_mat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " moment_mat = moment_mat[:,i:end_idx]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L983_C8", "label": "hook_rot_l =", "type": "assigned_variable", "loc": [983, 983], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L947_C4", "vector": [14, 2, 0.9889, 0.001, 2, 0.8, 0.913, 697, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "hook_rot_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " hook_rot_l = hook_rot_l[i:end_idx]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L984_C8", "label": "mech_angle_l =", "type": "assigned_variable", "loc": [984, 984], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L947_C4", "vector": [14, 2, 0.9899, 0.001, 2, 0.8, 0.9565, 684, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "mech_angle_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mech_angle_l = mech_angle_l[i:end_idx]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L986_C8", "label": "compare_tip_mechanism_trajectories()", "type": "expression", "loc": [986, 986], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L947_C4", "vector": [8, 2, 0.992, 0.001, 2, 0.8, 1.0, 225, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "compare_tip_mechanism_trajectories", "arg_names": [], "import_names": [], "rhs_call_name": "compare_tip_mechanism_trajectories", "annotation": ""}, "snippet": " compare_tip_mechanism_trajectories(mech_mat[:,i:], hand_mat[:,i:])"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L40_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L41_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L44_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L45_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L46_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L48_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L50_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L53_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L55_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L59_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L60_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L61_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:While_L62_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:While_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L63_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L63_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L64_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L63_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L67_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:While_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L71_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L73_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L74_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L75_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L76_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L77_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L78_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L81_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L82_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L83_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L85_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L86_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L86_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L87_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L86_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L88_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L90_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L90_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L91_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L92_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L94_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L95_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L97_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L98_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L100_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L102_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L104_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L106_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L107_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L108_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L109_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L111_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L114_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L114_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L115_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L114_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L116_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L116_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L118_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L116_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L119_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L121_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L122_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L123_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L123_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L124_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Return_L126_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L137_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L139_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L137_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:While_L141_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:While_L141_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L142_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:While_L141_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L143_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L137_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L145_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L137_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L146_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L137_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L149_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L137_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L151_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L137_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L152_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L137_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L153_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L137_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L154_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L137_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Return_L156_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L160_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L163_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L160_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:While_L165_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:While_L165_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L166_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:While_L165_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L167_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L160_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L169_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L160_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L170_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L160_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L171_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L160_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L174_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L160_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L175_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L160_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L176_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L160_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L177_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L160_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L178_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L160_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L183_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L183_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Return_L184_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L183_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Return_L186_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L188_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L189_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L188_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L196_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L188_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L197_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L188_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L198_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L188_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L199_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L188_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L200_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L211_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L219_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L211_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L220_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L211_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L221_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L211_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L222_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L222_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L223_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L211_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L224_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L211_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L225_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L211_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Return_L226_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L232_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L233_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L232_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L234_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L232_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L235_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L235_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L236_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L235_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L238_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L232_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L239_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L232_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L240_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L232_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Return_L241_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L248_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L249_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L248_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L250_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L250_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L251_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L250_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L252_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L248_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L254_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L248_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L255_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L248_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L257_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L248_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L258_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L248_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L259_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L248_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L262_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L248_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L263_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L248_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L264_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L248_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Return_L265_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L267_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L268_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L267_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L269_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L267_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L270_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L267_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L271_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L267_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L273_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L267_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L274_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L274_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L275_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L274_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L276_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L267_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L278_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L278_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L279_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L267_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L281_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L267_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L282_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L267_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L285_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L267_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L286_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L267_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L288_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L267_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L289_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L267_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L290_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L267_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L291_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L267_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L292_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L292_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L293_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L292_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L294_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L267_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L296_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L267_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L297_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L297_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L298_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L297_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L299_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L297_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L300_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L297_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L301_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L297_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L302_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L267_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Return_L305_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L311_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L313_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L311_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L314_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L311_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L315_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L311_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L316_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L316_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L317_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L316_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L318_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L316_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L319_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L311_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L321_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L321_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L322_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L322_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L323_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L322_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L325_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L322_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L327_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L322_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L328_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L322_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L330_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L322_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L331_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L322_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L332_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L332_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L333_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L332_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L334_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L322_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L336_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L322_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L337_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L322_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L339_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L322_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L340_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L322_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L342_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L322_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L344_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L322_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L345_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L322_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L346_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L322_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L347_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L347_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L348_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L347_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L349_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L322_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L352_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L322_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L353_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L322_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L354_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L322_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L355_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L355_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L356_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L322_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L357_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L357_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L358_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L322_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L360_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L322_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L361_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L322_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L362_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L322_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L363_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L363_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L364_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L363_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L365_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L363_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L366_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L363_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L367_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L363_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L368_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L363_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L369_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L363_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L371_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L363_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L373_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L321_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L375_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L321_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L378_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L321_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L379_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L321_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L381_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L321_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L382_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L321_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L384_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L321_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L385_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L321_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L386_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L321_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L387_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L321_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L388_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L321_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L389_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L389_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L390_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L389_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L391_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L389_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L392_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L389_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L393_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L389_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L395_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L389_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L397_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L389_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L398_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L311_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L400_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L311_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Return_L402_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L405_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L406_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L405_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L407_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L405_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L408_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L405_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L409_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L405_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L410_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L410_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L411_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L410_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L412_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L410_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L414_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L410_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L415_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L405_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L416_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L405_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L417_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L405_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L419_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L405_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L421_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L405_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L423_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L423_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L424_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L423_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L425_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L423_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L426_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L423_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L427_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L423_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L428_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L423_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L431_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L423_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L434_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L405_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L437_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L437_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L438_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L437_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L440_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L445_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L446_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L445_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L447_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L445_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L448_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L445_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L449_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L445_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L450_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L445_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L451_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L445_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L452_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L445_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L454_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L445_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L455_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L445_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L456_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L445_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L457_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L445_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L458_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L458_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L459_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L458_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L461_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L458_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L462_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L458_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L463_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L445_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L464_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L445_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L465_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L445_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L466_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L445_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Return_L467_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L469_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L470_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L469_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L471_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L469_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L472_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L469_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L474_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L469_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L475_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L469_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L476_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L469_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L477_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L469_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L479_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L469_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L480_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L469_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L481_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L469_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L483_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L485_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L486_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L485_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L487_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L485_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L488_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L485_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L489_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L485_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L490_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L485_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L491_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L485_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L495_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L485_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L497_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L485_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L499_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L485_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L501_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L485_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L504_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L485_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L505_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L485_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L506_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L485_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L507_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L485_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L508_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L485_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L510_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L485_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L512_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L485_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L514_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L485_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L516_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L485_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L518_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L485_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L521_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L485_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L522_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L527_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L528_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L527_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L529_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L527_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L530_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L527_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L531_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L527_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L532_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L527_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L533_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L527_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L535_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L527_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L536_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L527_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L537_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L537_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L538_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L537_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L539_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L537_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L540_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L527_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Return_L542_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L547_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L549_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L547_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L550_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L547_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L551_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L547_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L552_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L547_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L553_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L553_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L554_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L554_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L555_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L554_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L556_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L554_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L557_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L554_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L559_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L554_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L560_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L554_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L561_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L554_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L564_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L554_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L565_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L554_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L566_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L547_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L568_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L547_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L569_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L547_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L570_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L547_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L575_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L575_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L576_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L575_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L577_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L547_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L578_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L547_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L580_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L547_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L585_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L585_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L586_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L585_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L587_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L547_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L588_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L591_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L592_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L591_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L595_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L591_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L596_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L591_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L606_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L617_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L620_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L617_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L621_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L617_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L623_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L617_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L624_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L617_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L625_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L617_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L626_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L617_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L629_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L617_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L630_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L617_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L631_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L617_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L635_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L617_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L636_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L617_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L637_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L617_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L638_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L617_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L640_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L617_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L641_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L617_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L642_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L617_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L643_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L617_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L644_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L617_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L646_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L617_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L649_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L617_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L650_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L617_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L653_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L617_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L654_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L617_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L656_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L617_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L658_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L617_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L660_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L617_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L662_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L617_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L664_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L666_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L667_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L666_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L668_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L666_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L669_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L666_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L670_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L666_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L673_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L666_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L674_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L666_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L675_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L666_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L679_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L666_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L680_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L666_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L681_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L666_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L682_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L666_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L685_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L666_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L686_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L666_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L687_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L666_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L688_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L690_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L691_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L690_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L692_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L690_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L695_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L690_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L697_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L690_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L698_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L690_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L709_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L690_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L710_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L690_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L712_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L690_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L713_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L690_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L714_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L690_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L715_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L690_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L716_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L690_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L717_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L690_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L718_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L690_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L719_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L719_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L720_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L719_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L721_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L719_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L722_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L719_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L724_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L719_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L725_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L719_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L726_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L719_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L729_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L719_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L730_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L719_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L731_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L719_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L734_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L719_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L735_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L690_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L738_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L690_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L739_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L690_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L740_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L690_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L741_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L690_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L743_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L690_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L744_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L690_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L745_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L690_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L746_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L690_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L747_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L690_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L748_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L690_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L749_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L690_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L752_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L690_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L754_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L690_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L755_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L690_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L756_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L690_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L759_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:FunctionDef_L690_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L760_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L763_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Import_L765_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L763_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L766_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L763_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L767_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L763_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L769_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L763_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L771_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L763_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L773_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L763_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L775_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L763_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L777_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L763_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L779_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L763_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L781_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L763_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L784_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L763_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L787_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L763_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L791_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L763_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L793_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L763_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L796_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L796_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L797_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L796_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L798_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L796_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L799_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L763_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L804_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L763_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L805_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L763_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L807_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L763_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L808_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L763_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L809_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L763_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L810_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L763_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L813_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L763_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L814_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L763_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L815_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L763_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L817_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L817_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L818_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L817_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L819_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L819_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L820_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L819_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L822_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L763_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L824_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L824_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L825_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L824_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L826_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L824_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L827_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L824_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L829_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L824_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L830_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L763_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L832_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L832_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L833_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L832_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L834_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L763_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L836_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L836_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Import_L837_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L836_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L839_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L836_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L841_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L836_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L843_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L836_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L844_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L836_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L845_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L836_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L849_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L836_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L850_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L836_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L851_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L836_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L854_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L836_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L855_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L836_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L857_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L836_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L859_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L836_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L861_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L836_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L863_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L836_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L864_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L836_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L865_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L836_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L866_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L836_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L867_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L836_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L869_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L836_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L871_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L836_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L873_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L836_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L881_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L763_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L883_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L883_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L884_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L883_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L885_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L883_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L886_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L883_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L888_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L883_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L889_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L883_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L890_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L883_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L891_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L883_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L892_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L883_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L895_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L763_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L898_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L898_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L899_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L898_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L900_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L898_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L901_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L898_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L903_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L898_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L904_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L898_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L905_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L898_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L906_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L898_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L907_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L898_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L910_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L898_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L911_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L898_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L912_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L898_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L913_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L898_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L914_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L914_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L915_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L915_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L916_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L915_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L917_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L915_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L918_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L915_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L920_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L915_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L921_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L915_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L922_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L915_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L925_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L915_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L926_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L915_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L927_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L898_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L929_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L898_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L930_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L898_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L931_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L898_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L932_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L898_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L933_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L898_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L934_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L898_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L935_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L898_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L937_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L898_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L938_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L898_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L940_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L898_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L942_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L898_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L944_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L898_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L945_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L763_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L947_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L947_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L948_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L947_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L949_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L947_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L950_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L947_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L952_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L947_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L953_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L947_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L954_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L947_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L955_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L947_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L957_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L947_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L958_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L947_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L960_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L947_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L961_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L947_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L963_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L947_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L964_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L947_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L967_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L947_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L970_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L970_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L971_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:For_L970_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L972_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L972_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L973_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L947_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L976_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L947_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L977_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L947_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L979_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L947_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L980_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L947_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L981_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L947_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L982_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L947_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L983_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L947_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Assign_L984_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99535:If_L947_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99535:Expr_L986_C8"}]
# # Subscribe to ObjectDetection message and convert a pickle. # # # import roslib; roslib.load_manifest('modeling_forces') import rospy from checkerboard_detector.msg import ObjectDetection import hrl_lib.util as ut import hrl_lib.transforms as tr from std_msgs.msg import Empty import numpy as np import time def pose_cb(data, d): global t_pose_cb t_pose_cb = time.time() for obj in data.objects: p = obj.pose.position pos = np.matrix([p.x, p.y, p.z]).T q = obj.pose.orientation rot = tr.quaternion_to_matrix([q.x, q.y, q.z, q.w]) t = data.header.stamp.to_sec() d[obj.type]['pos_list'].append(pos) d[obj.type]['rot_list'].append(rot) d[obj.type]['time_list'].append(t) print '>>>>>>>>>>>>>>>>>>>>>>>>>>>>' print 'pos:', pos.T print 'rot:', rot def got_trigger_cb(data, d): d['flag'] = True if __name__ == '__main__': print 'Hello World.' rospy.init_node('checkerboard_poses_to_pickle', anonymous=False) topic_name = '/checkerdetector/ObjectDetection' d = {'mechanism': {}, 'hand': {}} d['mechanism'] = {'pos_list': [], 'rot_list': [], 'time_list': []} d['hand'] = {'pos_list': [], 'rot_list': [], 'time_list': []} rospy.Subscriber(topic_name, ObjectDetection, pose_cb, d) got_trigger_dict = {'flag': False} rospy.Subscriber('/checker_to_poses/trigger', Empty, got_trigger_cb, got_trigger_dict) global t_pose_cb t_pose_cb = time.time() while got_trigger_dict['flag'] == False: time.sleep(0.05) if (time.time() - t_pose_cb) > 60.: raise RuntimeError('haven\'t received a pose_cb in 60 secs') # rospy.spin() print 'Number of poses:', len(d['mechanism']['time_list']) #ut.save_pickle(d, 'poses_dict_'+ut.formatted_time()+'.pkl') ut.save_pickle(d, 'poses_dict.pkl')
ajibawa-2023/Python-Code-Large/train/row_99536
41
73
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99536:Import_L8_C0", "label": "roslib import roslib", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.1096, 0.0137, 0, 0.66, 0.0, 796, 0, 1, 0, 0, 796, 0, 0], "semantic": {"name": "roslib", "arg_names": [], "import_names": ["roslib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('modeling_forces')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99536:Expr_L8_C15", "label": "load_manifest()", "type": "expression", "loc": [8, 8], "level": 0, "parent": null, "vector": [8, 0, 0.1096, 0.0137, 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('modeling_forces')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99536:Import_L9_C0", "label": "rospy import rospy", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.1233, 0.0137, 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_99536:ImportFrom_L11_C0", "label": "from checkerboard_detector.msg import ObjectDetection", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.1507, 0.0137, 0, 0.66, 0.2727, 857, 0, 1, 0, 0, 857, 0, 0], "semantic": {"name": "checkerboard_detector.msg", "arg_names": [], "import_names": ["ObjectDetection"], "rhs_call_name": "", "annotation": ""}, "snippet": "from checkerboard_detector.msg import ObjectDetection"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99536:Import_L12_C0", "label": "hrl_lib.util import ut", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.1644, 0.0137, 0, 0.66, 0.3636, 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_99536:Import_L13_C0", "label": "hrl_lib.transforms import tr", "type": "import", "loc": [13, 13], "level": 0, "parent": null, "vector": [1, 0, 0.1781, 0.0137, 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_99536:ImportFrom_L14_C0", "label": "from std_msgs.msg import Empty", "type": "import", "loc": [14, 14], "level": 0, "parent": null, "vector": [1, 0, 0.1918, 0.0137, 0, 0.66, 0.5455, 366, 0, 1, 0, 0, 366, 0, 0], "semantic": {"name": "std_msgs.msg", "arg_names": [], "import_names": ["Empty"], "rhs_call_name": "", "annotation": ""}, "snippet": "from std_msgs.msg import Empty"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99536:Import_L16_C0", "label": "numpy import np", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.2192, 0.0137, 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_99536:Import_L17_C0", "label": "time import time", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.2329, 0.0137, 0, 0.66, 0.7273, 654, 0, 1, 0, 0, 654, 0, 0], "semantic": {"name": "time", "arg_names": [], "import_names": ["time"], "rhs_call_name": "", "annotation": ""}, "snippet": "import time"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99536:FunctionDef_L19_C0", "label": "pose_cb", "type": "function", "loc": [19, 37], "level": 0, "parent": null, "vector": [2, 0, 0.3836, 0.2603, 0, 0.66, 0.8182, 686, 0, 2, 0, 0, 0, 0, 10], "semantic": {"name": "pose_cb", "arg_names": ["data", "d"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def pose_cb(data, d):\n global t_pose_cb\n t_pose_cb = time.time()\n\n for obj in data.objects:\n p = obj.pose.position\n pos = np.matrix([p.x, p.y, p.z]).T\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99536:Assign_L21_C4", "label": "t_pose_cb = time()", "type": "assigned_variable", "loc": [21, 21], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99536:FunctionDef_L19_C0", "vector": [14, 1, 0.2877, 0.0137, 1, 0.2, 0.0, 376, 3, 0, 0, 0, 654, 10, 1], "semantic": {"name": "t_pose_cb", "arg_names": [], "import_names": [], "rhs_call_name": "time", "annotation": ""}, "snippet": " t_pose_cb = time.time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99536:For_L23_C4", "label": "for obj", "type": "for", "loc": [23, 37], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99536:FunctionDef_L19_C0", "vector": [6, 1, 0.411, 0.2055, 1, 0.2, 1.0, 505, 7, 0, 0, 0, 0, 0, 9], "semantic": {"name": "obj", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for obj in data.objects:\n p = obj.pose.position\n pos = np.matrix([p.x, p.y, p.z]).T\n\n q = obj.pose.orientation\n rot = tr.quaternion_to_matrix([q.x, q.y, q.z, q.w])\n t = data.header.stamp.to_sec()\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99536:Assign_L24_C8", "label": "p =", "type": "assigned_variable", "loc": [24, 24], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99536:For_L23_C4", "vector": [14, 2, 0.3288, 0.0137, 2, 0.07, 0.0, 491, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p = obj.pose.position"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99536:Assign_L25_C8", "label": "pos =", "type": "assigned_variable", "loc": [25, 25], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99536:For_L23_C4", "vector": [14, 2, 0.3425, 0.0137, 2, 0.07, 0.1, 627, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "pos", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pos = np.matrix([p.x, p.y, p.z]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99536:Assign_L27_C8", "label": "q =", "type": "assigned_variable", "loc": [27, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99536:For_L23_C4", "vector": [14, 2, 0.3699, 0.0137, 2, 0.07, 0.2, 516, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "q", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " q = obj.pose.orientation"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99536:Assign_L28_C8", "label": "rot = quaternion_to_matrix()", "type": "assigned_variable", "loc": [28, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99536:For_L23_C4", "vector": [14, 2, 0.3836, 0.0137, 2, 0.07, 0.3, 812, 3, 1, 0, 0, 149, 10, 1], "semantic": {"name": "rot", "arg_names": [], "import_names": [], "rhs_call_name": "quaternion_to_matrix", "annotation": ""}, "snippet": " rot = tr.quaternion_to_matrix([q.x, q.y, q.z, q.w])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99536:Assign_L29_C8", "label": "t = to_sec()", "type": "assigned_variable", "loc": [29, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99536:For_L23_C4", "vector": [14, 2, 0.3973, 0.0137, 2, 0.07, 0.4, 15, 3, 0, 0, 0, 750, 10, 1], "semantic": {"name": "t", "arg_names": [], "import_names": [], "rhs_call_name": "to_sec", "annotation": ""}, "snippet": " t = data.header.stamp.to_sec()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99536:Expr_L31_C8", "label": "append()", "type": "expression", "loc": [31, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99536:For_L23_C4", "vector": [8, 2, 0.4247, 0.0137, 2, 0.07, 0.5, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " d[obj.type]['pos_list'].append(pos)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99536:Expr_L32_C8", "label": "append()", "type": "expression", "loc": [32, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99536:For_L23_C4", "vector": [8, 2, 0.4384, 0.0137, 2, 0.07, 0.6, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " d[obj.type]['rot_list'].append(rot)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99536:Expr_L33_C8", "label": "append()", "type": "expression", "loc": [33, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99536:For_L23_C4", "vector": [8, 2, 0.4521, 0.0137, 2, 0.07, 0.7, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " d[obj.type]['time_list'].append(t)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99536:Expr_L35_C8", "label": "print()", "type": "expression", "loc": [35, 35], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99536:For_L23_C4", "vector": [8, 2, 0.4795, 0.0137, 2, 0.07, 0.8, 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_99536:Expr_L36_C8", "label": "print()", "type": "expression", "loc": [36, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99536:For_L23_C4", "vector": [8, 2, 0.4932, 0.0137, 2, 0.07, 0.9, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('pos:', pos.T)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99536:Expr_L37_C8", "label": "print()", "type": "expression", "loc": [37, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99536:For_L23_C4", "vector": [8, 2, 0.5068, 0.0137, 2, 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('rot:', rot)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99536:FunctionDef_L39_C0", "label": "got_trigger_cb", "type": "function", "loc": [39, 40], "level": 0, "parent": null, "vector": [2, 0, 0.5411, 0.0274, 0, 0.66, 0.9091, 483, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "got_trigger_cb", "arg_names": ["data", "d"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def got_trigger_cb(data, d):\n d['flag'] = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99536:Assign_L40_C4", "label": "assign", "type": "assigned_variable", "loc": [40, 40], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99536:FunctionDef_L39_C0", "vector": [14, 1, 0.5479, 0.0137, 1, 0.33, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " d['flag'] = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99536:If_L43_C0", "label": "if", "type": "if", "loc": [43, 70], "level": 0, "parent": null, "vector": [4, 0, 0.774, 0.3836, 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 \n print('Hello World.')\n rospy.init_node('checkerboard_poses_to_pickle', anonymous=False)\n\n topic_name = '/checkerdetector/ObjectDetection'\n d = {'mechanism': {}, 'hand': {}}\n d['mechanism'] = {'pos_list': [], 'rot_list': [], 'time_list': []}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99536:Expr_L45_C4", "label": "print()", "type": "expression", "loc": [45, 45], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99536:If_L43_C0", "vector": [8, 1, 0.6164, 0.0137, 1, 0.55, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Hello World.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99536:Expr_L46_C4", "label": "init_node()", "type": "expression", "loc": [46, 46], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99536:If_L43_C0", "vector": [8, 1, 0.6301, 0.0137, 1, 0.55, 0.0833, 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('checkerboard_poses_to_pickle', anonymous=False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99536:Assign_L48_C4", "label": "topic_name =", "type": "assigned_variable", "loc": [48, 48], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99536:If_L43_C0", "vector": [14, 1, 0.6575, 0.0137, 1, 0.55, 0.1667, 854, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "topic_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " topic_name = '/checkerdetector/ObjectDetection'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99536:Assign_L49_C4", "label": "d =", "type": "assigned_variable", "loc": [49, 49], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99536:If_L43_C0", "vector": [14, 1, 0.6712, 0.0137, 1, 0.55, 0.25, 355, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " d = {'mechanism': {}, 'hand': {}}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99536:Assign_L50_C4", "label": "assign", "type": "assigned_variable", "loc": [50, 50], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99536:If_L43_C0", "vector": [14, 1, 0.6849, 0.0137, 1, 0.55, 0.3333, 0, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " d['mechanism'] = {'pos_list': [], 'rot_list': [], 'time_list': []}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99536:Assign_L51_C4", "label": "assign", "type": "assigned_variable", "loc": [51, 51], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99536:If_L43_C0", "vector": [14, 1, 0.6986, 0.0137, 1, 0.55, 0.4167, 0, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " d['hand'] = {'pos_list': [], 'rot_list': [], 'time_list': []}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99536:Expr_L53_C4", "label": "Subscriber()", "type": "expression", "loc": [53, 53], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99536:If_L43_C0", "vector": [8, 1, 0.726, 0.0137, 1, 0.55, 0.5, 455, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "Subscriber", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " rospy.Subscriber(topic_name, ObjectDetection, pose_cb, d)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99536:Assign_L55_C4", "label": "got_trigger_dict =", "type": "assigned_variable", "loc": [55, 55], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99536:If_L43_C0", "vector": [14, 1, 0.7534, 0.0137, 1, 0.55, 0.5833, 681, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "got_trigger_dict", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " got_trigger_dict = {'flag': False}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99536:Expr_L56_C4", "label": "Subscriber()", "type": "expression", "loc": [56, 57], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99536:If_L43_C0", "vector": [8, 1, 0.774, 0.0274, 1, 0.55, 0.6667, 455, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "Subscriber", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " rospy.Subscriber('/checker_to_poses/trigger', Empty, got_trigger_cb,\n got_trigger_dict)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99536:Assign_L61_C4", "label": "t_pose_cb = time()", "type": "assigned_variable", "loc": [61, 61], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99536:If_L43_C0", "vector": [14, 1, 0.8356, 0.0137, 1, 0.55, 0.75, 376, 3, 0, 0, 0, 654, 10, 1], "semantic": {"name": "t_pose_cb", "arg_names": [], "import_names": [], "rhs_call_name": "time", "annotation": ""}, "snippet": " t_pose_cb = time.time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99536:While_L62_C4", "label": "while", "type": "while", "loc": [62, 65], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99536:If_L43_C0", "vector": [5, 1, 0.8699, 0.0548, 1, 0.55, 0.8333, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while got_trigger_dict['flag'] == False:\n time.sleep(0.05)\n if (time.time() - t_pose_cb) > 60.:\n raise RuntimeError('haven\\'t received a pose_cb in 60 secs')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99536:Expr_L63_C8", "label": "sleep()", "type": "expression", "loc": [63, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99536:While_L62_C4", "vector": [8, 2, 0.863, 0.0137, 2, 0.57, 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.05)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99536:If_L64_C8", "label": "if", "type": "if", "loc": [64, 65], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99536:While_L62_C4", "vector": [4, 2, 0.8836, 0.0274, 2, 0.57, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (time.time() - t_pose_cb) > 60.:\n raise RuntimeError('haven\\'t received a pose_cb in 60 secs')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99536:Expr_L68_C4", "label": "print()", "type": "expression", "loc": [68, 68], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99536:If_L43_C0", "vector": [8, 1, 0.9315, 0.0137, 1, 0.55, 0.9167, 535, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Number of poses:', len(d['mechanism']['time_list']))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99536:Expr_L70_C4", "label": "save_pickle()", "type": "expression", "loc": [70, 70], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99536:If_L43_C0", "vector": [8, 1, 0.9589, 0.0137, 1, 0.55, 1.0, 390, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "save_pickle", "arg_names": [], "import_names": [], "rhs_call_name": "save_pickle", "annotation": ""}, "snippet": " ut.save_pickle(d, 'poses_dict.pkl')"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99536:FunctionDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99536:Assign_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99536:FunctionDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99536:For_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99536:For_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99536:Assign_L24_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99536:For_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99536:Assign_L25_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99536:For_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99536:Assign_L27_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99536:For_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99536:Assign_L28_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99536:For_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99536:Assign_L29_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99536:For_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99536:Expr_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99536:For_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99536:Expr_L32_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99536:For_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99536:Expr_L33_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99536:For_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99536:Expr_L35_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99536:For_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99536:Expr_L36_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99536:For_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99536:Expr_L37_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99536:FunctionDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99536:Assign_L40_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99536:If_L43_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99536:Expr_L45_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99536:If_L43_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99536:Expr_L46_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99536:If_L43_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99536:Assign_L48_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99536:If_L43_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99536:Assign_L49_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99536:If_L43_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99536:Assign_L50_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99536:If_L43_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99536:Assign_L51_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99536:If_L43_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99536:Expr_L53_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99536:If_L43_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99536:Assign_L55_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99536:If_L43_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99536:Expr_L56_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99536:If_L43_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99536:Assign_L61_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99536:If_L43_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99536:While_L62_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99536:While_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99536:Expr_L63_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99536:While_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99536:If_L64_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99536:If_L43_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99536:Expr_L68_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99536:If_L43_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99536:Expr_L70_C4"}]
import roslib; roslib.load_manifest('modeling_forces') import rospy from geometry_msgs.msg import Point32 from articulation_msgs.msg import ModelMsg from articulation_msgs.msg import TrackMsg from geometry_msgs.msg import Pose, Point, Quaternion from threading import RLock import numpy as np import time def model_cb(data, kin_dict): print 'model_cb called' if data.name == 'rotational': for p in data.params: if p.name == 'rot_center.x': cx = p.value if p.name == 'rot_center.y': cy = p.value if p.name == 'rot_center.z': cz = p.value if p.name == 'rot_radius': r = p.value kin_dict['typ'] = 'rotational' kin_dict['cx'] = cx kin_dict['cy'] = cy kin_dict['cz'] = cz kin_dict['r'] = r if data.name == 'prismatic': for p in data.params: if p.name == 'prismatic_dir.x': dx = p.value if p.name == 'prismatic_dir.y': dy = p.value if p.name == 'prismatic_dir.z': dz = p.value kin_dict['typ'] = 'prismatic' kin_dict['direc'] = [dx, dy, dz] kin_dict['got_model'] = True ## # fit either a circle or a linear model. # @param pts - 3xN np matrix of points. # @return dictionary with kinematic params. (see model_cb) def fit(pts, tup): kin_dict, track_pub = tup track_msg = TrackMsg() track_msg.header.stamp = rospy.get_rostime() track_msg.header.frame_id = '/' track_msg.track_type = TrackMsg.TRACK_POSITION_ONLY kin_dict['got_model'] = False for pt in pts.T: p = pt.A1.tolist() pose = Pose(Point(0, 0, 0), Quaternion(0, 0, 0, 1)) pose.position.x = p[0] pose.position.y = p[1] pose.position.z = p[2] track_msg.pose.append(pose) rospy.sleep(0.1) track_pub.publish(track_msg) while kin_dict['got_model'] == False: rospy.sleep(0.01) return kin_dict def init_ros_node(): rospy.init_node('kinematics_estimation_sturm') track_pub = rospy.Publisher('track', TrackMsg) kin_dict = {} track_msg = TrackMsg() rospy.Subscriber('model', ModelMsg, model_cb, kin_dict) return kin_dict, track_pub if __name__ == '__main__': init_ros_node() rospy.spin()
ajibawa-2023/Python-Code-Large/train/row_99537
67
84
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99537:Import_L2_C0", "label": "roslib import roslib", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0238, 0.0119, 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('modeling_forces')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99537:Expr_L2_C15", "label": "load_manifest()", "type": "expression", "loc": [2, 2], "level": 0, "parent": null, "vector": [8, 0, 0.0238, 0.0119, 0, 0.66, 0.0769, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('modeling_forces')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99537:Import_L3_C0", "label": "rospy import rospy", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0357, 0.0119, 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_99537:ImportFrom_L5_C0", "label": "from geometry_msgs.msg import Point32", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0595, 0.0119, 0, 0.66, 0.2308, 951, 0, 1, 0, 0, 951, 0, 0], "semantic": {"name": "geometry_msgs.msg", "arg_names": [], "import_names": ["Point32"], "rhs_call_name": "", "annotation": ""}, "snippet": "from geometry_msgs.msg import Point32"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99537:ImportFrom_L6_C0", "label": "from articulation_msgs.msg import ModelMsg", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0714, 0.0119, 0, 0.66, 0.3077, 696, 0, 1, 0, 0, 696, 0, 0], "semantic": {"name": "articulation_msgs.msg", "arg_names": [], "import_names": ["ModelMsg"], "rhs_call_name": "", "annotation": ""}, "snippet": "from articulation_msgs.msg import ModelMsg"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99537:ImportFrom_L7_C0", "label": "from articulation_msgs.msg import TrackMsg", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.0833, 0.0119, 0, 0.66, 0.3846, 696, 0, 1, 0, 0, 696, 0, 0], "semantic": {"name": "articulation_msgs.msg", "arg_names": [], "import_names": ["TrackMsg"], "rhs_call_name": "", "annotation": ""}, "snippet": "from articulation_msgs.msg import TrackMsg"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99537:ImportFrom_L8_C0", "label": "from geometry_msgs.msg import Pose, Point, Quaternion", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.0952, 0.0119, 0, 0.66, 0.4615, 951, 0, 3, 0, 0, 951, 0, 0], "semantic": {"name": "geometry_msgs.msg", "arg_names": [], "import_names": ["Pose", "Point", "Quaternion"], "rhs_call_name": "", "annotation": ""}, "snippet": "from geometry_msgs.msg import Pose, Point, Quaternion"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99537:ImportFrom_L10_C0", "label": "from threading import RLock", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.119, 0.0119, 0, 0.66, 0.5385, 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_99537:Import_L11_C0", "label": "numpy import np", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.131, 0.0119, 0, 0.66, 0.6154, 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_99537:Import_L12_C0", "label": "time import time", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.1429, 0.0119, 0, 0.66, 0.6923, 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_99537:FunctionDef_L14_C0", "label": "model_cb", "type": "function", "loc": [14, 43], "level": 0, "parent": null, "vector": [2, 0, 0.3393, 0.3571, 0, 0.66, 0.7692, 924, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "model_cb", "arg_names": ["data", "kin_dict"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def model_cb(data, kin_dict):\n print('model_cb called')\n if data.name == 'rotational':\n for p in data.params:\n if p.name == 'rot_center.x':\n cx = p.value\n if p.name == 'rot_center.y':\n cy = p.value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99537:Expr_L15_C4", "label": "print()", "type": "expression", "loc": [15, 15], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99537:FunctionDef_L14_C0", "vector": [8, 1, 0.1786, 0.0119, 1, 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('model_cb called')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99537:If_L16_C4", "label": "if", "type": "if", "loc": [16, 30], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99537:FunctionDef_L14_C0", "vector": [4, 1, 0.2738, 0.1786, 1, 0.89, 0.3333, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if data.name == 'rotational':\n for p in data.params:\n if p.name == 'rot_center.x':\n cx = p.value\n if p.name == 'rot_center.y':\n cy = p.value\n if p.name == 'rot_center.z':\n cz = p.value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99537:For_L17_C8", "label": "for p", "type": "for", "loc": [17, 25], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99537:If_L16_C4", "vector": [6, 2, 0.25, 0.1071, 2, 0.77, 0.0, 491, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for p in data.params:\n if p.name == 'rot_center.x':\n cx = p.value\n if p.name == 'rot_center.y':\n cy = p.value\n if p.name == 'rot_center.z':\n cz = p.value\n if p.name == 'rot_radius':"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99537:If_L18_C12", "label": "if", "type": "if", "loc": [18, 19], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99537:For_L17_C8", "vector": [4, 3, 0.2202, 0.0238, 3, 0.56, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if p.name == 'rot_center.x':\n cx = p.value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99537:Assign_L19_C16", "label": "cx =", "type": "assigned_variable", "loc": [19, 19], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99537:If_L18_C12", "vector": [14, 4, 0.2262, 0.0119, 4, 0.79, 0.0, 425, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "cx", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cx = p.value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99537:If_L20_C12", "label": "if", "type": "if", "loc": [20, 21], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99537:For_L17_C8", "vector": [4, 3, 0.244, 0.0238, 3, 0.56, 0.3333, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if p.name == 'rot_center.y':\n cy = p.value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99537:Assign_L21_C16", "label": "cy =", "type": "assigned_variable", "loc": [21, 21], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99537:If_L20_C12", "vector": [14, 4, 0.25, 0.0119, 4, 0.94, 0.0, 628, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "cy", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cy = p.value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99537:If_L22_C12", "label": "if", "type": "if", "loc": [22, 23], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99537:For_L17_C8", "vector": [4, 3, 0.2679, 0.0238, 3, 0.56, 0.6667, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if p.name == 'rot_center.z':\n cz = p.value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99537:Assign_L23_C16", "label": "cz =", "type": "assigned_variable", "loc": [23, 23], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99537:If_L22_C12", "vector": [14, 4, 0.2738, 0.0119, 4, 0.33, 0.0, 330, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "cz", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cz = p.value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99537:If_L24_C12", "label": "if", "type": "if", "loc": [24, 25], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99537:For_L17_C8", "vector": [4, 3, 0.2917, 0.0238, 3, 0.56, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if p.name == 'rot_radius':\n r = p.value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99537:Assign_L25_C16", "label": "r =", "type": "assigned_variable", "loc": [25, 25], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99537:If_L24_C12", "vector": [14, 4, 0.2976, 0.0119, 4, 0.03, 0.0, 436, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " r = p.value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99537:Assign_L26_C8", "label": "assign", "type": "assigned_variable", "loc": [26, 26], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99537:If_L16_C4", "vector": [14, 2, 0.3095, 0.0119, 2, 0.77, 0.2, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " kin_dict['typ'] = 'rotational'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99537:Assign_L27_C8", "label": "assign", "type": "assigned_variable", "loc": [27, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99537:If_L16_C4", "vector": [14, 2, 0.3214, 0.0119, 2, 0.77, 0.4, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " kin_dict['cx'] = cx"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99537:Assign_L28_C8", "label": "assign", "type": "assigned_variable", "loc": [28, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99537:If_L16_C4", "vector": [14, 2, 0.3333, 0.0119, 2, 0.77, 0.6, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " kin_dict['cy'] = cy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99537:Assign_L29_C8", "label": "assign", "type": "assigned_variable", "loc": [29, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99537:If_L16_C4", "vector": [14, 2, 0.3452, 0.0119, 2, 0.77, 0.8, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " kin_dict['cz'] = cz"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99537:Assign_L30_C8", "label": "assign", "type": "assigned_variable", "loc": [30, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99537:If_L16_C4", "vector": [14, 2, 0.3571, 0.0119, 2, 0.77, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " kin_dict['r'] = r"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99537:If_L32_C4", "label": "if", "type": "if", "loc": [32, 41], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99537:FunctionDef_L14_C0", "vector": [4, 1, 0.4345, 0.119, 1, 0.89, 0.6667, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if data.name == 'prismatic':\n for p in data.params:\n if p.name == 'prismatic_dir.x':\n dx = p.value\n if p.name == 'prismatic_dir.y':\n dy = p.value\n if p.name == 'prismatic_dir.z':\n dz = p.value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99537:For_L33_C8", "label": "for p", "type": "for", "loc": [33, 39], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99537:If_L32_C4", "vector": [6, 2, 0.4286, 0.0833, 2, 0.36, 0.0, 491, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for p in data.params:\n if p.name == 'prismatic_dir.x':\n dx = p.value\n if p.name == 'prismatic_dir.y':\n dy = p.value\n if p.name == 'prismatic_dir.z':\n dz = p.value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99537:If_L34_C12", "label": "if", "type": "if", "loc": [34, 35], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99537:For_L33_C8", "vector": [4, 3, 0.4107, 0.0238, 3, 0.8, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if p.name == 'prismatic_dir.x':\n dx = p.value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99537:Assign_L35_C16", "label": "dx =", "type": "assigned_variable", "loc": [35, 35], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99537:If_L34_C12", "vector": [14, 4, 0.4167, 0.0119, 4, 0.3, 0.0, 870, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "dx", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " dx = p.value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99537:If_L36_C12", "label": "if", "type": "if", "loc": [36, 37], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99537:For_L33_C8", "vector": [4, 3, 0.4345, 0.0238, 3, 0.8, 0.5, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if p.name == 'prismatic_dir.y':\n dy = p.value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99537:Assign_L37_C16", "label": "dy =", "type": "assigned_variable", "loc": [37, 37], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99537:If_L36_C12", "vector": [14, 4, 0.4405, 0.0119, 4, 0.72, 0.0, 477, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "dy", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " dy = p.value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99537:If_L38_C12", "label": "if", "type": "if", "loc": [38, 39], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99537:For_L33_C8", "vector": [4, 3, 0.4583, 0.0238, 3, 0.8, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if p.name == 'prismatic_dir.z':\n dz = p.value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99537:Assign_L39_C16", "label": "dz =", "type": "assigned_variable", "loc": [39, 39], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99537:If_L38_C12", "vector": [14, 4, 0.4643, 0.0119, 4, 0.43, 0.0, 610, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "dz", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " dz = p.value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99537:Assign_L40_C8", "label": "assign", "type": "assigned_variable", "loc": [40, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99537:If_L32_C4", "vector": [14, 2, 0.4762, 0.0119, 2, 0.36, 0.5, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " kin_dict['typ'] = 'prismatic'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99537:Assign_L41_C8", "label": "assign", "type": "assigned_variable", "loc": [41, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99537:If_L32_C4", "vector": [14, 2, 0.4881, 0.0119, 2, 0.36, 1.0, 0, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " kin_dict['direc'] = [dx, dy, dz]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99537:Assign_L43_C4", "label": "assign", "type": "assigned_variable", "loc": [43, 43], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99537:FunctionDef_L14_C0", "vector": [14, 1, 0.5119, 0.0119, 1, 0.89, 1.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " kin_dict['got_model'] = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99537:FunctionDef_L50_C0", "label": "fit", "type": "function", "loc": [50, 69], "level": 0, "parent": null, "vector": [2, 0, 0.7083, 0.2381, 0, 0.66, 0.8462, 828, 0, 2, 1, 0, 0, 0, 10], "semantic": {"name": "fit", "arg_names": ["pts", "tup"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def fit(pts, tup):\n kin_dict, track_pub = tup\n track_msg = TrackMsg()\n track_msg.header.stamp = rospy.get_rostime()\n track_msg.header.frame_id = '/'\n track_msg.track_type = TrackMsg.TRACK_POSITION_ONLY\n kin_dict['got_model'] = False\n for pt in pts.T:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99537:Assign_L51_C4", "label": "kin_dict, track_pub =", "type": "assigned_variable", "loc": [51, 51], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99537:FunctionDef_L50_C0", "vector": [14, 1, 0.6071, 0.0119, 1, 0.55, 0.0, 905, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "kin_dict, track_pub", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " kin_dict, track_pub = tup"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99537:Assign_L52_C4", "label": "track_msg = TrackMsg()", "type": "assigned_variable", "loc": [52, 52], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99537:FunctionDef_L50_C0", "vector": [14, 1, 0.619, 0.0119, 1, 0.55, 0.1, 41, 3, 0, 0, 0, 40, 10, 1], "semantic": {"name": "track_msg", "arg_names": [], "import_names": [], "rhs_call_name": "TrackMsg", "annotation": ""}, "snippet": " track_msg = TrackMsg()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99537:Assign_L53_C4", "label": "track_msg.header.stamp = get_rostime()", "type": "assigned_variable", "loc": [53, 53], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99537:FunctionDef_L50_C0", "vector": [14, 1, 0.631, 0.0119, 1, 0.55, 0.2, 114, 3, 0, 0, 0, 173, 10, 1], "semantic": {"name": "track_msg.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "get_rostime", "annotation": ""}, "snippet": " track_msg.header.stamp = rospy.get_rostime()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99537:Assign_L54_C4", "label": "track_msg.header.frame_id =", "type": "assigned_variable", "loc": [54, 54], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99537:FunctionDef_L50_C0", "vector": [14, 1, 0.6429, 0.0119, 1, 0.55, 0.3, 607, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "track_msg.header.frame_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " track_msg.header.frame_id = '/'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99537:Assign_L55_C4", "label": "track_msg.track_type =", "type": "assigned_variable", "loc": [55, 55], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99537:FunctionDef_L50_C0", "vector": [14, 1, 0.6548, 0.0119, 1, 0.55, 0.4, 342, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "track_msg.track_type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " track_msg.track_type = TrackMsg.TRACK_POSITION_ONLY"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99537:Assign_L56_C4", "label": "assign", "type": "assigned_variable", "loc": [56, 56], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99537:FunctionDef_L50_C0", "vector": [14, 1, 0.6667, 0.0119, 1, 0.55, 0.5, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " kin_dict['got_model'] = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99537:For_L57_C4", "label": "for pt", "type": "for", "loc": [57, 63], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99537:FunctionDef_L50_C0", "vector": [6, 1, 0.7143, 0.0833, 1, 0.55, 0.6, 989, 7, 0, 0, 0, 0, 0, 5], "semantic": {"name": "pt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for pt in pts.T:\n p = pt.A1.tolist()\n pose = Pose(Point(0, 0, 0), Quaternion(0, 0, 0, 1))\n pose.position.x = p[0]\n pose.position.y = p[1]\n pose.position.z = p[2]\n track_msg.pose.append(pose)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99537:Assign_L58_C8", "label": "p = tolist()", "type": "assigned_variable", "loc": [58, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99537:For_L57_C4", "vector": [14, 2, 0.6905, 0.0119, 2, 0.49, 0.0, 491, 3, 0, 0, 0, 185, 10, 1], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "tolist", "annotation": ""}, "snippet": " p = pt.A1.tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99537:Assign_L59_C8", "label": "pose = Pose()", "type": "assigned_variable", "loc": [59, 59], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99537:For_L57_C4", "vector": [14, 2, 0.7024, 0.0119, 2, 0.49, 0.2, 767, 3, 2, 0, 0, 902, 10, 3], "semantic": {"name": "pose", "arg_names": [], "import_names": [], "rhs_call_name": "Pose", "annotation": ""}, "snippet": " pose = Pose(Point(0, 0, 0), Quaternion(0, 0, 0, 1))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99537:Assign_L60_C8", "label": "pose.position.x =", "type": "assigned_variable", "loc": [60, 60], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99537:For_L57_C4", "vector": [14, 2, 0.7143, 0.0119, 2, 0.49, 0.4, 6, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pose.position.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pose.position.x = p[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99537:Assign_L61_C8", "label": "pose.position.y =", "type": "assigned_variable", "loc": [61, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99537:For_L57_C4", "vector": [14, 2, 0.7262, 0.0119, 2, 0.49, 0.6, 554, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pose.position.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pose.position.y = p[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99537:Assign_L62_C8", "label": "pose.position.z =", "type": "assigned_variable", "loc": [62, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99537:For_L57_C4", "vector": [14, 2, 0.7381, 0.0119, 2, 0.49, 0.8, 850, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pose.position.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pose.position.z = p[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99537:Expr_L63_C8", "label": "append()", "type": "expression", "loc": [63, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99537:For_L57_C4", "vector": [8, 2, 0.75, 0.0119, 2, 0.49, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " track_msg.pose.append(pose)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99537:Expr_L65_C4", "label": "sleep()", "type": "expression", "loc": [65, 65], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99537:FunctionDef_L50_C0", "vector": [8, 1, 0.7738, 0.0119, 1, 0.55, 0.7, 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_99537:Expr_L66_C4", "label": "publish()", "type": "expression", "loc": [66, 66], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99537:FunctionDef_L50_C0", "vector": [8, 1, 0.7857, 0.0119, 1, 0.55, 0.8, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " track_pub.publish(track_msg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99537:While_L67_C4", "label": "while", "type": "while", "loc": [67, 68], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99537:FunctionDef_L50_C0", "vector": [5, 1, 0.8036, 0.0238, 1, 0.55, 0.9, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while kin_dict['got_model'] == False:\n rospy.sleep(0.01)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99537:Expr_L68_C8", "label": "sleep()", "type": "expression", "loc": [68, 68], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99537:While_L67_C4", "vector": [8, 2, 0.8095, 0.0119, 2, 0.52, 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_99537:Return_L69_C4", "label": "return", "type": "return", "loc": [69, 69], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99537:FunctionDef_L50_C0", "vector": [13, 1, 0.8214, 0.0119, 1, 0.55, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return kin_dict"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99537:FunctionDef_L71_C0", "label": "init_ros_node", "type": "function", "loc": [71, 78], "level": 0, "parent": null, "vector": [2, 0, 0.8869, 0.0952, 0, 0.66, 0.9231, 465, 0, 0, 1, 0, 0, 0, 4], "semantic": {"name": "init_ros_node", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def init_ros_node():\n rospy.init_node('kinematics_estimation_sturm')\n track_pub = rospy.Publisher('track', TrackMsg)\n kin_dict = {}\n track_msg = TrackMsg()\n rospy.Subscriber('model', ModelMsg, model_cb,\n kin_dict)\n return kin_dict, track_pub"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99537:Expr_L72_C4", "label": "init_node()", "type": "expression", "loc": [72, 72], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99537:FunctionDef_L71_C0", "vector": [8, 1, 0.8571, 0.0119, 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('kinematics_estimation_sturm')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99537:Assign_L73_C4", "label": "track_pub = Publisher()", "type": "assigned_variable", "loc": [73, 73], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99537:FunctionDef_L71_C0", "vector": [14, 1, 0.869, 0.0119, 1, 0.75, 0.2, 222, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "track_pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " track_pub = rospy.Publisher('track', TrackMsg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99537:Assign_L74_C4", "label": "kin_dict =", "type": "assigned_variable", "loc": [74, 74], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99537:FunctionDef_L71_C0", "vector": [14, 1, 0.881, 0.0119, 1, 0.75, 0.4, 775, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "kin_dict", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " kin_dict = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99537:Assign_L75_C4", "label": "track_msg = TrackMsg()", "type": "assigned_variable", "loc": [75, 75], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99537:FunctionDef_L71_C0", "vector": [14, 1, 0.8929, 0.0119, 1, 0.75, 0.6, 41, 3, 0, 0, 0, 40, 10, 1], "semantic": {"name": "track_msg", "arg_names": [], "import_names": [], "rhs_call_name": "TrackMsg", "annotation": ""}, "snippet": " track_msg = TrackMsg()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99537:Expr_L76_C4", "label": "Subscriber()", "type": "expression", "loc": [76, 77], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99537:FunctionDef_L71_C0", "vector": [8, 1, 0.9107, 0.0238, 1, 0.75, 0.8, 455, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "Subscriber", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " rospy.Subscriber('model', ModelMsg, model_cb,\n kin_dict)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99537:Return_L78_C4", "label": "return", "type": "return", "loc": [78, 78], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99537:FunctionDef_L71_C0", "vector": [13, 1, 0.9286, 0.0119, 1, 0.75, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return kin_dict, track_pub"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99537:If_L81_C0", "label": "if", "type": "if", "loc": [81, 83], "level": 0, "parent": null, "vector": [4, 0, 0.9762, 0.0357, 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 init_ros_node()\n rospy.spin()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99537:Expr_L82_C4", "label": "init_ros_node()", "type": "expression", "loc": [82, 82], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99537:If_L81_C0", "vector": [8, 1, 0.9762, 0.0119, 1, 0.23, 0.0, 465, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "init_ros_node", "arg_names": [], "import_names": [], "rhs_call_name": "init_ros_node", "annotation": ""}, "snippet": " init_ros_node()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99537:Expr_L83_C4", "label": "spin()", "type": "expression", "loc": [83, 83], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99537:If_L81_C0", "vector": [8, 1, 0.9881, 0.0119, 1, 0.23, 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_99537:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99537:Expr_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99537:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99537:If_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99537:If_L16_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99537:For_L17_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99537:For_L17_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99537:If_L18_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99537:If_L18_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99537:Assign_L19_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99537:For_L17_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99537:If_L20_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99537:If_L20_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99537:Assign_L21_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99537:For_L17_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99537:If_L22_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99537:If_L22_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99537:Assign_L23_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99537:For_L17_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99537:If_L24_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99537:If_L24_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99537:Assign_L25_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99537:If_L16_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99537:Assign_L26_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99537:If_L16_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99537:Assign_L27_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99537:If_L16_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99537:Assign_L28_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99537:If_L16_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99537:Assign_L29_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99537:If_L16_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99537:Assign_L30_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99537:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99537:If_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99537:If_L32_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99537:For_L33_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99537:For_L33_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99537:If_L34_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99537:If_L34_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99537:Assign_L35_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99537:For_L33_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99537:If_L36_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99537:If_L36_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99537:Assign_L37_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99537:For_L33_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99537:If_L38_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99537:If_L38_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99537:Assign_L39_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99537:If_L32_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99537:Assign_L40_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99537:If_L32_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99537:Assign_L41_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99537:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99537:Assign_L43_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99537:FunctionDef_L50_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99537:Assign_L51_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99537:FunctionDef_L50_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99537:Assign_L52_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99537:FunctionDef_L50_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99537:Assign_L53_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99537:FunctionDef_L50_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99537:Assign_L54_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99537:FunctionDef_L50_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99537:Assign_L55_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99537:FunctionDef_L50_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99537:Assign_L56_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99537:FunctionDef_L50_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99537:For_L57_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99537:For_L57_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99537:Assign_L58_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99537:For_L57_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99537:Assign_L59_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99537:For_L57_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99537:Assign_L60_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99537:For_L57_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99537:Assign_L61_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99537:For_L57_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99537:Assign_L62_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99537:For_L57_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99537:Expr_L63_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99537:FunctionDef_L50_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99537:Expr_L65_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99537:FunctionDef_L50_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99537:Expr_L66_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99537:FunctionDef_L50_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99537:While_L67_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99537:While_L67_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99537:Expr_L68_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99537:FunctionDef_L50_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99537:Return_L69_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99537:FunctionDef_L71_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99537:Expr_L72_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99537:FunctionDef_L71_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99537:Assign_L73_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99537:FunctionDef_L71_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99537:Assign_L74_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99537:FunctionDef_L71_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99537:Assign_L75_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99537:FunctionDef_L71_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99537:Expr_L76_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99537:FunctionDef_L71_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99537:Return_L78_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99537:If_L81_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99537:Expr_L82_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99537:If_L81_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99537:Expr_L83_C4"}]
import math, numpy as np import glob import roslib; roslib.load_manifest('hrl_tilting_hokuyo') import hrl_tilting_hokuyo.display_3d_mayavi as d3m import matplotlib_util.util as mpu import hrl_lib.util as ut if __name__ == '__main__': import optparse p = optparse.OptionParser() p.add_option('-f', '--fname', action='store', default='', type='string', dest='fname', help='pkl with logged data') p.add_option('-d', '--dir', action='store', default='', type='string', dest='dir', help='directory with logged data') opt, args = p.parse_args() if opt.dir != '': poses_pkl = glob.glob(opt.dir + '/poses_dict*.pkl')[0] d = ut.load_pickle(poses_pkl) elif opt.fname != '': d = ut.load_pickle(opt.fname) else: raise RuntimeError('need either -d or -f') hand_list = d['hand']['pos_list'] hand_rot = d['hand']['rot_list'] if hand_list != []: hand_mat = np.column_stack(hand_list) print 'hand_mat.shape', hand_mat.shape d3m.plot_points(hand_mat, color = (1.,0.,0.), mode='sphere') directions_x = (np.row_stack(hand_rot)[:,0]).T.reshape(len(hand_rot), 3).T directions_z = (np.row_stack(hand_rot)[:,2]).T.reshape(len(hand_rot), 3).T #print 'directions.shape', directions_x.shape #print 'hand_mat.shape', hand_mat.shape #mpu.plot_yx(ut.norm(directions).A1, axis=None) #mpu.show() #mpu.plot_yx(ut.norm(hand_mat[:, 1:] - hand_mat[:, :-1]).A1, axis=None) #mpu.show() d3m.plot_normals(hand_mat, directions_x, color=(1.,0,0.)) d3m.plot_normals(hand_mat, directions_z, color=(0.,0,1.)) mechanism_list = d['mechanism']['pos_list'] mechanism_rot = d['mechanism']['rot_list'] #mechanism_list = [] if mechanism_list != []: mechanism_mat = np.column_stack(mechanism_list) print 'mechanism_mat.shape', mechanism_mat.shape d3m.plot_points(mechanism_mat, color = (0.,0.,1.), mode='sphere') #d3m.plot_points(mechanism_mat, color = (0.,0.,1.), mode='sphere') c = np.row_stack(mechanism_rot)[:,2] directions = c.T.reshape(len(mechanism_rot), 3).T print 'directions.shape', directions.shape print 'mechanism_mat.shape', mechanism_mat.shape d3m.plot_normals(mechanism_mat, directions, color=(0,0,1.)) d3m.show() # mpu.plot_yx(pos_mat[0,:].A1, pos_mat[1,:].A1) # mpu.show()
ajibawa-2023/Python-Code-Large/train/row_99538
40
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_99538:Import_L2_C0", "label": "math import math, np", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0286, 0.0143, 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_99538:Import_L3_C0", "label": "glob import glob", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0429, 0.0143, 0, 0.66, 0.1429, 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_99538:Import_L5_C0", "label": "roslib import roslib", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0714, 0.0143, 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('hrl_tilting_hokuyo')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99538:Expr_L5_C15", "label": "load_manifest()", "type": "expression", "loc": [5, 5], "level": 0, "parent": null, "vector": [8, 0, 0.0714, 0.0143, 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('hrl_tilting_hokuyo')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99538:Import_L6_C0", "label": "hrl_tilting_hokuyo.display_3d_mayavi import d3m", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0857, 0.0143, 0, 0.66, 0.5714, 181, 0, 1, 0, 0, 181, 0, 0], "semantic": {"name": "hrl_tilting_hokuyo.display_3d_mayavi", "arg_names": [], "import_names": ["d3m"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_tilting_hokuyo.display_3d_mayavi as d3m"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99538:Import_L8_C0", "label": "matplotlib_util.util import mpu", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.1143, 0.0143, 0, 0.66, 0.7143, 781, 0, 1, 0, 0, 781, 0, 0], "semantic": {"name": "matplotlib_util.util", "arg_names": [], "import_names": ["mpu"], "rhs_call_name": "", "annotation": ""}, "snippet": "import matplotlib_util.util as mpu"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99538:Import_L9_C0", "label": "hrl_lib.util import ut", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.1286, 0.0143, 0, 0.66, 0.8571, 775, 0, 1, 0, 0, 775, 0, 0], "semantic": {"name": "hrl_lib.util", "arg_names": [], "import_names": ["ut"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.util as ut"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99538:If_L12_C0", "label": "if", "type": "if", "loc": [12, 64], "level": 0, "parent": null, "vector": [4, 0, 0.5429, 0.7571, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 29], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n\n import optparse\n p = optparse.OptionParser()\n p.add_option('-f', '--fname', action='store', default='',\n type='string', dest='fname', help='pkl with logged data')\n p.add_option('-d', '--dir', action='store', default='',\n type='string', dest='dir', help='directory with logged data')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99538:Import_L14_C4", "label": "optparse import optparse", "type": "import", "loc": [14, 14], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99538:If_L12_C0", "vector": [1, 1, 0.2, 0.0143, 1, 0.68, 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_99538:Assign_L15_C4", "label": "p = OptionParser()", "type": "assigned_variable", "loc": [15, 15], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99538:If_L12_C0", "vector": [14, 1, 0.2143, 0.0143, 1, 0.68, 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_99538:Expr_L16_C4", "label": "add_option()", "type": "expression", "loc": [16, 17], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99538:If_L12_C0", "vector": [8, 1, 0.2357, 0.0286, 1, 0.68, 0.1667, 176, 3, 7, 0, 0, 0, 0, 1], "semantic": {"name": "add_option", "arg_names": [], "import_names": [], "rhs_call_name": "add_option", "annotation": ""}, "snippet": " p.add_option('-f', '--fname', action='store', default='',\n type='string', dest='fname', help='pkl with logged data')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99538:Expr_L18_C4", "label": "add_option()", "type": "expression", "loc": [18, 19], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99538:If_L12_C0", "vector": [8, 1, 0.2643, 0.0286, 1, 0.68, 0.25, 176, 3, 7, 0, 0, 0, 0, 1], "semantic": {"name": "add_option", "arg_names": [], "import_names": [], "rhs_call_name": "add_option", "annotation": ""}, "snippet": " p.add_option('-d', '--dir', action='store', default='',\n type='string', dest='dir', help='directory with logged data')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99538:Assign_L20_C4", "label": "opt, args = parse_args()", "type": "assigned_variable", "loc": [20, 20], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99538:If_L12_C0", "vector": [14, 1, 0.2857, 0.0143, 1, 0.68, 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_99538:If_L22_C4", "label": "if", "type": "if", "loc": [22, 28], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99538:If_L12_C0", "vector": [4, 1, 0.3571, 0.1, 1, 0.68, 0.4167, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if opt.dir != '':\n poses_pkl = glob.glob(opt.dir + '/poses_dict*.pkl')[0]\n d = ut.load_pickle(poses_pkl)\n elif opt.fname != '':\n d = ut.load_pickle(opt.fname)\n else:\n raise RuntimeError('need either -d or -f')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99538:Assign_L23_C8", "label": "poses_pkl =", "type": "assigned_variable", "loc": [23, 23], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99538:If_L22_C4", "vector": [14, 2, 0.3286, 0.0143, 2, 0.46, 0.0, 291, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "poses_pkl", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " poses_pkl = glob.glob(opt.dir + '/poses_dict*.pkl')[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99538:Assign_L24_C8", "label": "d = load_pickle()", "type": "assigned_variable", "loc": [24, 24], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99538:If_L22_C4", "vector": [14, 2, 0.3429, 0.0143, 2, 0.46, 0.5, 355, 3, 1, 0, 0, 65, 10, 1], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "load_pickle", "annotation": ""}, "snippet": " d = ut.load_pickle(poses_pkl)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99538:If_L25_C4", "label": "if", "type": "if", "loc": [25, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99538:If_L22_C4", "vector": [4, 2, 0.3786, 0.0571, 2, 0.46, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif opt.fname != '':\n d = ut.load_pickle(opt.fname)\n else:\n raise RuntimeError('need either -d or -f')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99538:Assign_L26_C8", "label": "d = load_pickle()", "type": "assigned_variable", "loc": [26, 26], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99538:If_L25_C4", "vector": [14, 3, 0.3714, 0.0143, 3, 0.56, 0.0, 355, 3, 1, 0, 0, 65, 10, 1], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "load_pickle", "annotation": ""}, "snippet": " d = ut.load_pickle(opt.fname)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99538:Assign_L30_C4", "label": "hand_list =", "type": "assigned_variable", "loc": [30, 30], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99538:If_L12_C0", "vector": [14, 1, 0.4286, 0.0143, 1, 0.68, 0.5, 894, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "hand_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " hand_list = d['hand']['pos_list']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99538:Assign_L31_C4", "label": "hand_rot =", "type": "assigned_variable", "loc": [31, 31], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99538:If_L12_C0", "vector": [14, 1, 0.4429, 0.0143, 1, 0.68, 0.5833, 648, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "hand_rot", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " hand_rot = d['hand']['rot_list']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99538:If_L32_C4", "label": "if", "type": "if", "loc": [32, 48], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99538:If_L12_C0", "vector": [4, 1, 0.5714, 0.2429, 1, 0.68, 0.6667, 0, 0, 0, 0, 0, 0, 0, 11], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if hand_list != []:\n hand_mat = np.column_stack(hand_list)\n print('hand_mat.shape', hand_mat.shape)\n d3m.plot_points(hand_mat, color = (1.,0.,0.), mode='sphere')\n\n directions_x = (np.row_stack(hand_rot)[:,0]).T.reshape(len(hand_rot), 3).T\n directions_z = (np.row_stack(hand_rot)[:,2]).T.reshape(len(hand_rot), 3).T\n #print 'directions.shape', directions_x.shape"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99538:Assign_L33_C8", "label": "hand_mat = column_stack()", "type": "assigned_variable", "loc": [33, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99538:If_L32_C4", "vector": [14, 2, 0.4714, 0.0143, 2, 0.51, 0.0, 181, 3, 1, 0, 0, 724, 10, 1], "semantic": {"name": "hand_mat", "arg_names": [], "import_names": [], "rhs_call_name": "column_stack", "annotation": ""}, "snippet": " hand_mat = np.column_stack(hand_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99538:Expr_L34_C8", "label": "print()", "type": "expression", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99538:If_L32_C4", "vector": [8, 2, 0.4857, 0.0143, 2, 0.51, 0.1667, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('hand_mat.shape', hand_mat.shape)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99538:Expr_L35_C8", "label": "plot_points()", "type": "expression", "loc": [35, 35], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99538:If_L32_C4", "vector": [8, 2, 0.5, 0.0143, 2, 0.51, 0.3333, 111, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "plot_points", "arg_names": [], "import_names": [], "rhs_call_name": "plot_points", "annotation": ""}, "snippet": " d3m.plot_points(hand_mat, color = (1.,0.,0.), mode='sphere')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99538:Assign_L37_C8", "label": "directions_x =", "type": "assigned_variable", "loc": [37, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99538:If_L32_C4", "vector": [14, 2, 0.5286, 0.0143, 2, 0.51, 0.5, 755, 7, 0, 0, 0, 0, 0, 3], "semantic": {"name": "directions_x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " directions_x = (np.row_stack(hand_rot)[:,0]).T.reshape(len(hand_rot), 3).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99538:Assign_L38_C8", "label": "directions_z =", "type": "assigned_variable", "loc": [38, 38], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99538:If_L32_C4", "vector": [14, 2, 0.5429, 0.0143, 2, 0.51, 0.6667, 12, 7, 0, 0, 0, 0, 0, 3], "semantic": {"name": "directions_z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " directions_z = (np.row_stack(hand_rot)[:,2]).T.reshape(len(hand_rot), 3).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99538:Expr_L47_C8", "label": "plot_normals()", "type": "expression", "loc": [47, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99538:If_L32_C4", "vector": [8, 2, 0.6714, 0.0143, 2, 0.51, 0.8333, 568, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "plot_normals", "arg_names": [], "import_names": [], "rhs_call_name": "plot_normals", "annotation": ""}, "snippet": " d3m.plot_normals(hand_mat, directions_x, color=(1.,0,0.))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99538:Expr_L48_C8", "label": "plot_normals()", "type": "expression", "loc": [48, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99538:If_L32_C4", "vector": [8, 2, 0.6857, 0.0143, 2, 0.51, 1.0, 568, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "plot_normals", "arg_names": [], "import_names": [], "rhs_call_name": "plot_normals", "annotation": ""}, "snippet": " d3m.plot_normals(hand_mat, directions_z, color=(0.,0,1.))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99538:Assign_L50_C4", "label": "mechanism_list =", "type": "assigned_variable", "loc": [50, 50], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99538:If_L12_C0", "vector": [14, 1, 0.7143, 0.0143, 1, 0.68, 0.75, 64, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "mechanism_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mechanism_list = d['mechanism']['pos_list']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99538:Assign_L51_C4", "label": "mechanism_rot =", "type": "assigned_variable", "loc": [51, 51], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99538:If_L12_C0", "vector": [14, 1, 0.7286, 0.0143, 1, 0.68, 0.8333, 772, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "mechanism_rot", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mechanism_rot = d['mechanism']['rot_list']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99538:If_L53_C4", "label": "if", "type": "if", "loc": [53, 62], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99538:If_L12_C0", "vector": [4, 1, 0.8214, 0.1429, 1, 0.68, 0.9167, 0, 0, 0, 0, 0, 0, 0, 9], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if mechanism_list != []:\n mechanism_mat = np.column_stack(mechanism_list)\n print('mechanism_mat.shape', mechanism_mat.shape)\n d3m.plot_points(mechanism_mat, color = (0.,0.,1.), mode='sphere')\n #d3m.plot_points(mechanism_mat, color = (0.,0.,1.), mode='sphere')\n c = np.row_stack(mechanism_rot)[:,2]\n directions = c.T.reshape(len(mechanism_rot), 3).T\n print('directions.shape', directions.shape)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99538:Assign_L54_C8", "label": "mechanism_mat = column_stack()", "type": "assigned_variable", "loc": [54, 54], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99538:If_L53_C4", "vector": [14, 2, 0.7714, 0.0143, 2, 0.93, 0.0, 733, 3, 1, 0, 0, 724, 10, 1], "semantic": {"name": "mechanism_mat", "arg_names": [], "import_names": [], "rhs_call_name": "column_stack", "annotation": ""}, "snippet": " mechanism_mat = np.column_stack(mechanism_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99538:Expr_L55_C8", "label": "print()", "type": "expression", "loc": [55, 55], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99538:If_L53_C4", "vector": [8, 2, 0.7857, 0.0143, 2, 0.93, 0.1429, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('mechanism_mat.shape', mechanism_mat.shape)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99538:Expr_L56_C8", "label": "plot_points()", "type": "expression", "loc": [56, 56], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99538:If_L53_C4", "vector": [8, 2, 0.8, 0.0143, 2, 0.93, 0.2857, 111, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "plot_points", "arg_names": [], "import_names": [], "rhs_call_name": "plot_points", "annotation": ""}, "snippet": " d3m.plot_points(mechanism_mat, color = (0.,0.,1.), mode='sphere')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99538:Assign_L58_C8", "label": "c =", "type": "assigned_variable", "loc": [58, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99538:If_L53_C4", "vector": [14, 2, 0.8286, 0.0143, 2, 0.93, 0.4286, 411, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "c", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " c = np.row_stack(mechanism_rot)[:,2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99538:Assign_L59_C8", "label": "directions =", "type": "assigned_variable", "loc": [59, 59], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99538:If_L53_C4", "vector": [14, 2, 0.8429, 0.0143, 2, 0.93, 0.5714, 492, 7, 0, 0, 0, 0, 0, 2], "semantic": {"name": "directions", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " directions = c.T.reshape(len(mechanism_rot), 3).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99538:Expr_L60_C8", "label": "print()", "type": "expression", "loc": [60, 60], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99538:If_L53_C4", "vector": [8, 2, 0.8571, 0.0143, 2, 0.93, 0.7143, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('directions.shape', directions.shape)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99538:Expr_L61_C8", "label": "print()", "type": "expression", "loc": [61, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99538:If_L53_C4", "vector": [8, 2, 0.8714, 0.0143, 2, 0.93, 0.8571, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('mechanism_mat.shape', mechanism_mat.shape)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99538:Expr_L62_C8", "label": "plot_normals()", "type": "expression", "loc": [62, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99538:If_L53_C4", "vector": [8, 2, 0.8857, 0.0143, 2, 0.93, 1.0, 568, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "plot_normals", "arg_names": [], "import_names": [], "rhs_call_name": "plot_normals", "annotation": ""}, "snippet": " d3m.plot_normals(mechanism_mat, directions, color=(0,0,1.))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99538:Expr_L64_C4", "label": "show()", "type": "expression", "loc": [64, 64], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99538:If_L12_C0", "vector": [8, 1, 0.9143, 0.0143, 1, 0.68, 1.0, 497, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "show", "arg_names": [], "import_names": [], "rhs_call_name": "show", "annotation": ""}, "snippet": " d3m.show()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99538:If_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99538:Import_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99538:If_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99538:Assign_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99538:If_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99538:Expr_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99538:If_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99538:Expr_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99538:If_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99538:Assign_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99538:If_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99538:If_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99538:If_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99538:Assign_L23_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99538:If_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99538:Assign_L24_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99538:If_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99538:If_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99538:If_L25_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99538:Assign_L26_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99538:If_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99538:Assign_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99538:If_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99538:Assign_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99538:If_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99538:If_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99538:If_L32_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99538:Assign_L33_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99538:If_L32_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99538:Expr_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99538:If_L32_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99538:Expr_L35_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99538:If_L32_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99538:Assign_L37_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99538:If_L32_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99538:Assign_L38_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99538:If_L32_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99538:Expr_L47_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99538:If_L32_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99538:Expr_L48_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99538:If_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99538:Assign_L50_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99538:If_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99538:Assign_L51_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99538:If_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99538:If_L53_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99538:If_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99538:Assign_L54_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99538:If_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99538:Expr_L55_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99538:If_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99538:Expr_L56_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99538:If_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99538:Assign_L58_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99538:If_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99538:Assign_L59_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99538:If_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99538:Expr_L60_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99538:If_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99538:Expr_L61_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99538:If_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99538:Expr_L62_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99538:If_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99538:Expr_L64_C4"}]
import commands import os def aggregate_plots(dir, name_list, extension_list): n = len(name_list) for i in range(n): #for nm in name_list: nm = name_list[i] ex = extension_list[i] pngs_list = commands.getoutput('find %s/0* -name "*%s.%s"'%(dir, nm, ex)) pngs_list = pngs_list.splitlines() st = '%s/%s'%(dir, nm) os.system('rm -rf %s'%st) # remove previously existing directory. os.system('mkdir %s'%st) for p in pngs_list: sp = p.split('/') fname = str.join('_',sp[1:]) print 'saving ', fname os.system('cp %s %s'%(p, st+'/'+fname)) if __name__ == '__main__': import optparse p = optparse.OptionParser() p.add_option('-d', '--dir', action='store', default='', type='string', dest='dir', help='directory with logged data') p.add_option('-a', '--agg', action='store_true', dest='agg', help='aggregate plots from different trials into one folder for comparison') opt, args = p.parse_args() if opt.dir == '': raise RuntimeError('Need a directory to work with (-d or --dir)') if opt.agg: name_list = ['mechanism_trajectories_handhook'] extension_list = ['pkl'] # name_list = ['trajectory_check', 'force_components', # 'mechanism_trajectories_handhook', 'poses_dict'] # extension_list = ['png', 'png', 'pkl', 'pkl'] aggregate_plots(opt.dir, name_list, extension_list)
ajibawa-2023/Python-Code-Large/train/row_99539
28
47
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99539:Import_L2_C0", "label": "commands import commands", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0426, 0.0213, 0, 0.66, 0.0, 760, 0, 1, 0, 0, 760, 0, 0], "semantic": {"name": "commands", "arg_names": [], "import_names": ["commands"], "rhs_call_name": "", "annotation": ""}, "snippet": "import commands"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99539:Import_L3_C0", "label": "os import os", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0638, 0.0213, 0, 0.66, 0.3333, 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_99539:FunctionDef_L6_C0", "label": "aggregate_plots", "type": "function", "loc": [6, 22], "level": 0, "parent": null, "vector": [2, 0, 0.2979, 0.3617, 0, 0.66, 0.6667, 820, 0, 3, 0, 0, 0, 0, 10], "semantic": {"name": "aggregate_plots", "arg_names": ["dir", "name_list", "extension_list"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def aggregate_plots(dir, name_list, extension_list):\n n = len(name_list)\n for i in range(n):\n #for nm in name_list:\n nm = name_list[i]\n ex = extension_list[i]\n pngs_list = commands.getoutput('find %s/0* -name \"*%s.%s\"'%(dir, nm, ex))\n pngs_list = pngs_list.splitlines()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99539:Assign_L7_C4", "label": "n = len()", "type": "assigned_variable", "loc": [7, 7], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99539:FunctionDef_L6_C0", "vector": [14, 1, 0.1489, 0.0213, 1, 0.05, 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(name_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99539:For_L8_C4", "label": "for i", "type": "for", "loc": [8, 22], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99539:FunctionDef_L6_C0", "vector": [6, 1, 0.3191, 0.3191, 1, 0.05, 1.0, 826, 3, 0, 0, 0, 0, 0, 9], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(n):\n #for nm in name_list:\n nm = name_list[i]\n ex = extension_list[i]\n pngs_list = commands.getoutput('find %s/0* -name \"*%s.%s\"'%(dir, nm, ex))\n pngs_list = pngs_list.splitlines()\n\n st = '%s/%s'%(dir, nm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99539:Assign_L10_C8", "label": "nm =", "type": "assigned_variable", "loc": [10, 10], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99539:For_L8_C4", "vector": [14, 2, 0.2128, 0.0213, 2, 0.22, 0.0, 931, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "nm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " nm = name_list[i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99539:Assign_L11_C8", "label": "ex =", "type": "assigned_variable", "loc": [11, 11], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99539:For_L8_C4", "vector": [14, 2, 0.234, 0.0213, 2, 0.22, 0.1429, 212, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ex", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ex = extension_list[i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99539:Assign_L12_C8", "label": "pngs_list = getoutput()", "type": "assigned_variable", "loc": [12, 12], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99539:For_L8_C4", "vector": [14, 2, 0.2553, 0.0213, 2, 0.22, 0.2857, 585, 3, 1, 0, 0, 13, 10, 1], "semantic": {"name": "pngs_list", "arg_names": [], "import_names": [], "rhs_call_name": "getoutput", "annotation": ""}, "snippet": " pngs_list = commands.getoutput('find %s/0* -name \"*%s.%s\"'%(dir, nm, ex))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99539:Assign_L13_C8", "label": "pngs_list = splitlines()", "type": "assigned_variable", "loc": [13, 13], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99539:For_L8_C4", "vector": [14, 2, 0.2766, 0.0213, 2, 0.22, 0.4286, 585, 3, 0, 0, 0, 296, 10, 1], "semantic": {"name": "pngs_list", "arg_names": [], "import_names": [], "rhs_call_name": "splitlines", "annotation": ""}, "snippet": " pngs_list = pngs_list.splitlines()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99539:Assign_L15_C8", "label": "st =", "type": "assigned_variable", "loc": [15, 15], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99539:For_L8_C4", "vector": [14, 2, 0.3191, 0.0213, 2, 0.22, 0.5714, 93, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "st", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " st = '%s/%s'%(dir, nm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99539:Expr_L16_C8", "label": "system()", "type": "expression", "loc": [16, 16], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99539:For_L8_C4", "vector": [8, 2, 0.3404, 0.0213, 2, 0.22, 0.7143, 856, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "system", "arg_names": [], "import_names": [], "rhs_call_name": "system", "annotation": ""}, "snippet": " os.system('rm -rf %s'%st) # remove previously existing directory."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99539:Expr_L17_C8", "label": "system()", "type": "expression", "loc": [17, 17], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99539:For_L8_C4", "vector": [8, 2, 0.3617, 0.0213, 2, 0.22, 0.8571, 856, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "system", "arg_names": [], "import_names": [], "rhs_call_name": "system", "annotation": ""}, "snippet": " os.system('mkdir %s'%st)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99539:For_L18_C8", "label": "for p", "type": "for", "loc": [18, 22], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99539:For_L8_C4", "vector": [6, 2, 0.4255, 0.1064, 2, 0.22, 1.0, 491, 2, 0, 0, 0, 0, 0, 4], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for p in pngs_list:\n sp = p.split('/')\n fname = str.join('_',sp[1:])\n print('saving ', fname)\n os.system('cp %s %s'%(p, st+'/'+fname))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99539:Assign_L19_C12", "label": "sp = split()", "type": "assigned_variable", "loc": [19, 19], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99539:For_L18_C8", "vector": [14, 3, 0.4043, 0.0213, 3, 0.16, 0.0, 140, 3, 1, 0, 0, 908, 10, 1], "semantic": {"name": "sp", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": " sp = p.split('/')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99539:Assign_L20_C12", "label": "fname = join()", "type": "assigned_variable", "loc": [20, 20], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99539:For_L18_C8", "vector": [14, 3, 0.4255, 0.0213, 3, 0.16, 0.3333, 190, 3, 2, 0, 0, 933, 10, 1], "semantic": {"name": "fname", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " fname = str.join('_',sp[1:])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99539:Expr_L21_C12", "label": "print()", "type": "expression", "loc": [21, 21], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99539:For_L18_C8", "vector": [8, 3, 0.4468, 0.0213, 3, 0.16, 0.6667, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('saving ', fname)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99539:Expr_L22_C12", "label": "system()", "type": "expression", "loc": [22, 22], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99539:For_L18_C8", "vector": [8, 3, 0.4681, 0.0213, 3, 0.16, 1.0, 856, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "system", "arg_names": [], "import_names": [], "rhs_call_name": "system", "annotation": ""}, "snippet": " os.system('cp %s %s'%(p, st+'/'+fname))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99539:If_L25_C0", "label": "if", "type": "if", "loc": [25, 45], "level": 0, "parent": null, "vector": [4, 0, 0.7447, 0.4468, 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 import optparse\n p = optparse.OptionParser()\n\n p.add_option('-d', '--dir', action='store', default='',\n type='string', dest='dir', help='directory with logged data')\n p.add_option('-a', '--agg', action='store_true', dest='agg',\n help='aggregate plots from different trials into one folder for comparison')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99539:Import_L26_C4", "label": "optparse import optparse", "type": "import", "loc": [26, 26], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99539:If_L25_C0", "vector": [1, 1, 0.5532, 0.0213, 1, 0.34, 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_99539:Assign_L27_C4", "label": "p = OptionParser()", "type": "assigned_variable", "loc": [27, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99539:If_L25_C0", "vector": [14, 1, 0.5745, 0.0213, 1, 0.34, 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_99539:Expr_L29_C4", "label": "add_option()", "type": "expression", "loc": [29, 30], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99539:If_L25_C0", "vector": [8, 1, 0.6277, 0.0426, 1, 0.34, 0.3333, 176, 3, 7, 0, 0, 0, 0, 1], "semantic": {"name": "add_option", "arg_names": [], "import_names": [], "rhs_call_name": "add_option", "annotation": ""}, "snippet": " p.add_option('-d', '--dir', action='store', default='',\n type='string', dest='dir', help='directory with logged data')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99539:Expr_L31_C4", "label": "add_option()", "type": "expression", "loc": [31, 32], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99539:If_L25_C0", "vector": [8, 1, 0.6702, 0.0426, 1, 0.34, 0.5, 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('-a', '--agg', action='store_true', dest='agg',\n help='aggregate plots from different trials into one folder for comparison')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99539:Assign_L34_C4", "label": "opt, args = parse_args()", "type": "assigned_variable", "loc": [34, 34], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99539:If_L25_C0", "vector": [14, 1, 0.7234, 0.0213, 1, 0.34, 0.6667, 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_99539:If_L36_C4", "label": "if", "type": "if", "loc": [36, 37], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99539:If_L25_C0", "vector": [4, 1, 0.7766, 0.0426, 1, 0.34, 0.8333, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if opt.dir == '':\n raise RuntimeError('Need a directory to work with (-d or --dir)')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99539:If_L39_C4", "label": "if", "type": "if", "loc": [39, 45], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99539:If_L25_C0", "vector": [4, 1, 0.8936, 0.1489, 1, 0.34, 1.0, 0, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if opt.agg:\n name_list = ['mechanism_trajectories_handhook']\n extension_list = ['pkl']\n# name_list = ['trajectory_check', 'force_components',\n# 'mechanism_trajectories_handhook', 'poses_dict']\n# extension_list = ['png', 'png', 'pkl', 'pkl']\n aggregate_plots(opt.dir, name_list, extension_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99539:Assign_L40_C8", "label": "name_list =", "type": "assigned_variable", "loc": [40, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99539:If_L39_C4", "vector": [14, 2, 0.8511, 0.0213, 2, 0.68, 0.0, 689, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "name_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " name_list = ['mechanism_trajectories_handhook']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99539:Assign_L41_C8", "label": "extension_list =", "type": "assigned_variable", "loc": [41, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99539:If_L39_C4", "vector": [14, 2, 0.8723, 0.0213, 2, 0.68, 0.5, 58, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "extension_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " extension_list = ['pkl']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99539:Expr_L45_C8", "label": "aggregate_plots()", "type": "expression", "loc": [45, 45], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99539:If_L39_C4", "vector": [8, 2, 0.9574, 0.0213, 2, 0.68, 1.0, 820, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "aggregate_plots", "arg_names": [], "import_names": [], "rhs_call_name": "aggregate_plots", "annotation": ""}, "snippet": " aggregate_plots(opt.dir, name_list, extension_list)"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99539:FunctionDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99539:Assign_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99539:FunctionDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99539:For_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99539:For_L8_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99539:Assign_L10_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99539:For_L8_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99539:Assign_L11_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99539:For_L8_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99539:Assign_L12_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99539:For_L8_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99539:Assign_L13_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99539:For_L8_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99539:Assign_L15_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99539:For_L8_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99539:Expr_L16_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99539:For_L8_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99539:Expr_L17_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99539:For_L8_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99539:For_L18_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99539:For_L18_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99539:Assign_L19_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99539:For_L18_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99539:Assign_L20_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99539:For_L18_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99539:Expr_L21_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99539:For_L18_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99539:Expr_L22_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99539:If_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99539:Import_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99539:If_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99539:Assign_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99539:If_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99539:Expr_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99539:If_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99539:Expr_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99539:If_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99539:Assign_L34_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99539:If_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99539:If_L36_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99539:If_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99539:If_L39_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99539:If_L39_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99539:Assign_L40_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99539:If_L39_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99539:Assign_L41_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99539:If_L39_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99539:Expr_L45_C8"}]
# print 'Following are the key that you can use:' # print '1. Hit ESC to end' # print '2. Hit - to decrease the size of the image' # print '3. Hit + (without the shift key) to increase the image size' # print '4. Hit c to detect chessboard corners' import sys, time import numpy as np, math import glob, commands import roslib; roslib.load_manifest('modeling_forces') import cv from cv_bridge.cv_bridge import CvBridge, CvBridgeError import hrl_lib.util as ut # call func on the 8 neighbors of x,y and on x,y def call_neighborhood(func,func_params,x,y): func(x+0,y+0,*func_params) func(x+1,y+0,*func_params) func(x+1,y-1,*func_params) func(x+0,y-1,*func_params) func(x-1,y-1,*func_params) func(x-1,y+0,*func_params) func(x-1,y+1,*func_params) func(x-0,y+1,*func_params) func(x+1,y+1,*func_params) def on_mouse(event, x, y, flags, param): im, clicked_list = param[0], param[1] scale_factor = param[2] if event == cv.CV_EVENT_LBUTTONDOWN: #call_neighborhood(cv.SetPixel,(im,(255,0,0)),x,y) clicked_list.append((x/scale_factor, y/scale_factor)) # these are in mm def annotate_image(cv_im, mech_info_dict, dir): #cv_im = cv.LoadImage(sys.argv[1], cv.CV_LOAD_IMAGE_GRAYSCALE) size = cv.GetSize(cv_im) print 'Image size:', size[0], size[1] # col, row wnd = 'Image Annotate' cv.NamedWindow(wnd, cv.CV_WINDOW_AUTOSIZE) disp_im = cv.CloneImage(cv_im) new_size = (size[0]/2, size[1]/2) scale_factor = 1 checker_origin_height = mech_info_dict['height'] # chesscoard corners mat cb_dims = (5, 8) # checkerboard dims. (x, y) sq_sz = 19 # size of checkerboard in real units. cb_offset = 500,500 cb_coords = cv.CreateMat(2, cb_dims[0]*cb_dims[1], cv.CV_64FC1) n = 0 for r in range(cb_dims[1]): for c in range(cb_dims[0]): cb_coords[0,n] = c*sq_sz + cb_offset[0] # x coord cb_coords[1,n] = r*sq_sz + cb_offset[1] # y coord n += 1 clicked_list = [] recreate_image = False mechanism_calc_state = 0 mechanism_calc_dict = {} while True: for p in clicked_list: x,y = p[0]*scale_factor, p[1]*scale_factor cv.Circle(disp_im, (x,y), 3, (255,0,0)) cv.ShowImage(wnd, disp_im) k = cv.WaitKey(10) k = k%256 if k == 27: # ESC break elif k == ord('='): # + key without the shift scale_factor = scale_factor*1.2 recreate_image = True elif k == ord('-'): # - key scale_factor = scale_factor/1.2 recreate_image = True elif k == ord('c'): # find chessboard corners. succ, corners = cv.FindChessboardCorners(disp_im, cb_dims) if succ == 0: print 'Chessboard detection FAILED.' else: # chessboard detection was successful cv.DrawChessboardCorners(disp_im, cb_dims, corners, succ) cb_im = cv.CreateMat(2, cb_dims[0]*cb_dims[1], cv.CV_64FC1) corners_mat = np.array(corners).T n = 0 for r in range(cb_dims[1]): for c in range(cb_dims[0]): cb_im[0,n] = corners_mat[0,n] # x coord cb_im[1,n] = corners_mat[1,n] # y coord n += 1 H = cv.CreateMat(3, 3, cv.CV_64FC1) H1 = cv.FindHomography(cb_im, cb_coords, H) Hnp = np.reshape(np.fromstring(H1.tostring()), (3,3)) print 'Homography:' print Hnp d = cv.CloneImage(disp_im) cv.WarpPerspective(d, disp_im, H1, cv.CV_WARP_FILL_OUTLIERS) cv_im = cv.CloneImage(disp_im) elif k == ord('1'): # calculate width of the mechanism del clicked_list[:] cv.SetMouseCallback(wnd, on_mouse, (disp_im, clicked_list, scale_factor)) recreate_image = True print 'Click on two endpoints to mark the width of the mechanism' mechanism_calc_state = 1 elif k == ord('2'): # distance of handle from the hinge del clicked_list[:] cv.SetMouseCallback(wnd, on_mouse, (disp_im, clicked_list, scale_factor)) recreate_image = True print 'Click on handle and hinge to compute distance of handle from hinge.' mechanism_calc_state = 2 elif k == ord('3'): # height of the handle above the ground del clicked_list[:] cv.SetMouseCallback(wnd, on_mouse, (disp_im, clicked_list, scale_factor)) recreate_image = True print 'Click on handle top and bottom to compute height of handle above the ground.' mechanism_calc_state = 3 elif k == ord('4'): # top and bottom edge of the mechanism del clicked_list[:] cv.SetMouseCallback(wnd, on_mouse, (disp_im, clicked_list, scale_factor)) recreate_image = True print 'Click on top and bottom edges of the mechanism.' mechanism_calc_state = 4 elif k ==ord('d'): # display the calculated values print 'mechanism_calc_dict:', mechanism_calc_dict print 'mech_info_dict:', mech_info_dict elif k == ord('s'): # save the pkl ut.save_pickle(mechanism_calc_dict, dir+'/mechanism_calc_dict.pkl') print 'Saved the pickle' #elif k != -1: elif k != 255: print 'k:', k if recreate_image: new_size = (int(size[0]*scale_factor), int(size[1]*scale_factor)) disp_im = cv.CreateImage(new_size, cv_im.depth, cv_im.nChannels) cv.Resize(cv_im, disp_im) cv.SetMouseCallback(wnd, on_mouse, (disp_im, clicked_list, scale_factor)) recreate_image = False if len(clicked_list) == 2: if mechanism_calc_state == 1: w = abs(clicked_list[0][0] - clicked_list[1][0]) print 'Width in mm:', w mechanism_calc_dict['mech_width'] = w/1000. if mechanism_calc_state == 2: w = abs(clicked_list[0][0] - clicked_list[1][0]) print 'Width in mm:', w mechanism_calc_dict['handle_hinge_dist'] = w/1000. if mechanism_calc_state == 3: p1, p2 = clicked_list[0], clicked_list[1] h1 = (cb_offset[1] - p1[1])/1000. + checker_origin_height h2 = (cb_offset[1] - p2[1])/1000. + checker_origin_height mechanism_calc_dict['handle_top'] = max(h1, h2) mechanism_calc_dict['handle_bottom'] = min(h1, h2) if mechanism_calc_state == 4: p1, p2 = clicked_list[0], clicked_list[1] h1 = (cb_offset[1] - p1[1])/1000. + checker_origin_height h2 = (cb_offset[1] - p2[1])/1000. + checker_origin_height mechanism_calc_dict['mechanism_top'] = max(h1, h2) mechanism_calc_dict['mechanism_bottom'] = min(h1, h2) mechanism_calc_state = 0 if __name__ == '__main__': import optparse p = optparse.OptionParser() p.add_option('-d', '--dir', action='store', default='', type='string', dest='dir', help='mechanism directory') opt, args = p.parse_args() # dir_list = commands.getoutput('ls -d %s/*/'%(opt.dir)).splitlines() # dir_list = dir_list[:] # for direc in dir_list: img_list = glob.glob(opt.dir+'/*.jpg') mech_info_dict = ut.load_pickle(opt.dir+'/mechanism_info.pkl') for img in img_list: cv_im = cv.LoadImage(img) annotate_image(cv_im, mech_info_dict, opt.dir) sys.exit() # cv.DestroyAllWindows() #print 'k:', chr(k)
ajibawa-2023/Python-Code-Large/train/row_99540
145
206
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Import_L7_C0", "label": "sys import sys, time", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.034, 0.0049, 0, 0.66, 0.0, 509, 0, 2, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys", "time"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys, time"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Import_L8_C0", "label": "numpy import np, math", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.0388, 0.0049, 0, 0.66, 0.0909, 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_99540:Import_L9_C0", "label": "glob import glob, commands", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.0437, 0.0049, 0, 0.66, 0.1818, 958, 0, 2, 0, 0, 958, 0, 0], "semantic": {"name": "glob", "arg_names": [], "import_names": ["glob", "commands"], "rhs_call_name": "", "annotation": ""}, "snippet": "import glob, commands"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Import_L11_C0", "label": "roslib import roslib", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.0534, 0.0049, 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('modeling_forces')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Expr_L11_C15", "label": "load_manifest()", "type": "expression", "loc": [11, 11], "level": 0, "parent": null, "vector": [8, 0, 0.0534, 0.0049, 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('modeling_forces')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Import_L12_C0", "label": "cv import cv", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.0583, 0.0049, 0, 0.66, 0.4545, 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_99540:ImportFrom_L13_C0", "label": "from cv_bridge.cv_bridge import CvBridge, CvBridgeError", "type": "import", "loc": [13, 13], "level": 0, "parent": null, "vector": [1, 0, 0.0631, 0.0049, 0, 0.66, 0.5455, 356, 0, 2, 0, 0, 356, 0, 0], "semantic": {"name": "cv_bridge.cv_bridge", "arg_names": [], "import_names": ["CvBridge", "CvBridgeError"], "rhs_call_name": "", "annotation": ""}, "snippet": "from cv_bridge.cv_bridge import CvBridge, CvBridgeError"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Import_L15_C0", "label": "hrl_lib.util import ut", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.0728, 0.0049, 0, 0.66, 0.6364, 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_99540:FunctionDef_L18_C0", "label": "call_neighborhood", "type": "function", "loc": [18, 27], "level": 0, "parent": null, "vector": [2, 0, 0.1092, 0.0485, 0, 0.66, 0.7273, 276, 0, 4, 0, 0, 0, 0, 9], "semantic": {"name": "call_neighborhood", "arg_names": ["func", "func_params", "x", "y"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def call_neighborhood(func,func_params,x,y):\n func(x+0,y+0,*func_params)\n func(x+1,y+0,*func_params)\n func(x+1,y-1,*func_params)\n func(x+0,y-1,*func_params)\n func(x-1,y-1,*func_params)\n func(x-1,y+0,*func_params)\n func(x-1,y+1,*func_params)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Expr_L19_C4", "label": "func()", "type": "expression", "loc": [19, 19], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:FunctionDef_L18_C0", "vector": [8, 1, 0.0922, 0.0049, 1, 0.58, 0.0, 856, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "func", "arg_names": [], "import_names": [], "rhs_call_name": "func", "annotation": ""}, "snippet": " func(x+0,y+0,*func_params)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Expr_L20_C4", "label": "func()", "type": "expression", "loc": [20, 20], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:FunctionDef_L18_C0", "vector": [8, 1, 0.0971, 0.0049, 1, 0.58, 0.125, 856, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "func", "arg_names": [], "import_names": [], "rhs_call_name": "func", "annotation": ""}, "snippet": " func(x+1,y+0,*func_params)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Expr_L21_C4", "label": "func()", "type": "expression", "loc": [21, 21], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:FunctionDef_L18_C0", "vector": [8, 1, 0.1019, 0.0049, 1, 0.58, 0.25, 856, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "func", "arg_names": [], "import_names": [], "rhs_call_name": "func", "annotation": ""}, "snippet": " func(x+1,y-1,*func_params)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Expr_L22_C4", "label": "func()", "type": "expression", "loc": [22, 22], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:FunctionDef_L18_C0", "vector": [8, 1, 0.1068, 0.0049, 1, 0.58, 0.375, 856, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "func", "arg_names": [], "import_names": [], "rhs_call_name": "func", "annotation": ""}, "snippet": " func(x+0,y-1,*func_params)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Expr_L23_C4", "label": "func()", "type": "expression", "loc": [23, 23], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:FunctionDef_L18_C0", "vector": [8, 1, 0.1117, 0.0049, 1, 0.58, 0.5, 856, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "func", "arg_names": [], "import_names": [], "rhs_call_name": "func", "annotation": ""}, "snippet": " func(x-1,y-1,*func_params)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Expr_L24_C4", "label": "func()", "type": "expression", "loc": [24, 24], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:FunctionDef_L18_C0", "vector": [8, 1, 0.1165, 0.0049, 1, 0.58, 0.625, 856, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "func", "arg_names": [], "import_names": [], "rhs_call_name": "func", "annotation": ""}, "snippet": " func(x-1,y+0,*func_params)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Expr_L25_C4", "label": "func()", "type": "expression", "loc": [25, 25], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:FunctionDef_L18_C0", "vector": [8, 1, 0.1214, 0.0049, 1, 0.58, 0.75, 856, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "func", "arg_names": [], "import_names": [], "rhs_call_name": "func", "annotation": ""}, "snippet": " func(x-1,y+1,*func_params)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Expr_L26_C4", "label": "func()", "type": "expression", "loc": [26, 26], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:FunctionDef_L18_C0", "vector": [8, 1, 0.1262, 0.0049, 1, 0.58, 0.875, 856, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "func", "arg_names": [], "import_names": [], "rhs_call_name": "func", "annotation": ""}, "snippet": " func(x-0,y+1,*func_params)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Expr_L27_C4", "label": "func()", "type": "expression", "loc": [27, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:FunctionDef_L18_C0", "vector": [8, 1, 0.1311, 0.0049, 1, 0.58, 1.0, 856, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "func", "arg_names": [], "import_names": [], "rhs_call_name": "func", "annotation": ""}, "snippet": " func(x+1,y+1,*func_params)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:FunctionDef_L30_C0", "label": "on_mouse", "type": "function", "loc": [30, 35], "level": 0, "parent": null, "vector": [2, 0, 0.1578, 0.0291, 0, 0.66, 0.8182, 56, 0, 5, 0, 0, 0, 0, 1], "semantic": {"name": "on_mouse", "arg_names": ["event", "x", "y", "flags", "param"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def on_mouse(event, x, y, flags, param):\n im, clicked_list = param[0], param[1]\n scale_factor = param[2]\n if event == cv.CV_EVENT_LBUTTONDOWN:\n #call_neighborhood(cv.SetPixel,(im,(255,0,0)),x,y)\n clicked_list.append((x/scale_factor, y/scale_factor)) # these are in mm"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L31_C4", "label": "im, clicked_list =", "type": "assigned_variable", "loc": [31, 31], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:FunctionDef_L30_C0", "vector": [14, 1, 0.1505, 0.0049, 1, 0.5, 0.0, 396, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "im, clicked_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " im, clicked_list = param[0], param[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L32_C4", "label": "scale_factor =", "type": "assigned_variable", "loc": [32, 32], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:FunctionDef_L30_C0", "vector": [14, 1, 0.1553, 0.0049, 1, 0.5, 0.5, 286, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "scale_factor", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " scale_factor = param[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L33_C4", "label": "if", "type": "if", "loc": [33, 35], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:FunctionDef_L30_C0", "vector": [4, 1, 0.165, 0.0146, 1, 0.5, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if event == cv.CV_EVENT_LBUTTONDOWN:\n #call_neighborhood(cv.SetPixel,(im,(255,0,0)),x,y)\n clicked_list.append((x/scale_factor, y/scale_factor)) # these are in mm"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Expr_L35_C8", "label": "append()", "type": "expression", "loc": [35, 35], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L33_C4", "vector": [8, 2, 0.1699, 0.0049, 2, 0.35, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " clicked_list.append((x/scale_factor, y/scale_factor)) # these are in mm"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:FunctionDef_L38_C0", "label": "annotate_image", "type": "function", "loc": [38, 179], "level": 0, "parent": null, "vector": [2, 0, 0.5267, 0.6893, 0, 0.66, 0.9091, 461, 0, 3, 0, 0, 0, 0, 62], "semantic": {"name": "annotate_image", "arg_names": ["cv_im", "mech_info_dict", "dir"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def annotate_image(cv_im, mech_info_dict, dir):\n #cv_im = cv.LoadImage(sys.argv[1], cv.CV_LOAD_IMAGE_GRAYSCALE)\n size = cv.GetSize(cv_im)\n\n wnd = 'Image Annotate'\n cv.NamedWindow(wnd, cv.CV_WINDOW_AUTOSIZE)\n disp_im = cv.CloneImage(cv_im)\n new_size = (size[0]/2, size[1]/2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L40_C4", "label": "size = GetSize()", "type": "assigned_variable", "loc": [40, 40], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:FunctionDef_L38_C0", "vector": [14, 1, 0.1942, 0.0049, 1, 0.9, 0.0, 714, 3, 1, 0, 0, 139, 10, 1], "semantic": {"name": "size", "arg_names": [], "import_names": [], "rhs_call_name": "GetSize", "annotation": ""}, "snippet": " size = cv.GetSize(cv_im)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L42_C4", "label": "wnd =", "type": "assigned_variable", "loc": [42, 42], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:FunctionDef_L38_C0", "vector": [14, 1, 0.2039, 0.0049, 1, 0.9, 0.0588, 890, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "wnd", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " wnd = 'Image Annotate'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Expr_L43_C4", "label": "NamedWindow()", "type": "expression", "loc": [43, 43], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:FunctionDef_L38_C0", "vector": [8, 1, 0.2087, 0.0049, 1, 0.9, 0.1176, 60, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "NamedWindow", "arg_names": [], "import_names": [], "rhs_call_name": "NamedWindow", "annotation": ""}, "snippet": " cv.NamedWindow(wnd, cv.CV_WINDOW_AUTOSIZE)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L44_C4", "label": "disp_im = CloneImage()", "type": "assigned_variable", "loc": [44, 44], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:FunctionDef_L38_C0", "vector": [14, 1, 0.2136, 0.0049, 1, 0.9, 0.1765, 191, 3, 1, 0, 0, 436, 10, 1], "semantic": {"name": "disp_im", "arg_names": [], "import_names": [], "rhs_call_name": "CloneImage", "annotation": ""}, "snippet": " disp_im = cv.CloneImage(cv_im)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L45_C4", "label": "new_size =", "type": "assigned_variable", "loc": [45, 45], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:FunctionDef_L38_C0", "vector": [14, 1, 0.2184, 0.0049, 1, 0.9, 0.2353, 27, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "new_size", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " new_size = (size[0]/2, size[1]/2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L46_C4", "label": "scale_factor =", "type": "assigned_variable", "loc": [46, 46], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:FunctionDef_L38_C0", "vector": [14, 1, 0.2233, 0.0049, 1, 0.9, 0.2941, 286, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "scale_factor", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " scale_factor = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L48_C4", "label": "checker_origin_height =", "type": "assigned_variable", "loc": [48, 48], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:FunctionDef_L38_C0", "vector": [14, 1, 0.233, 0.0049, 1, 0.9, 0.3529, 957, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "checker_origin_height", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " checker_origin_height = mech_info_dict['height']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L50_C4", "label": "cb_dims =", "type": "assigned_variable", "loc": [50, 50], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:FunctionDef_L38_C0", "vector": [14, 1, 0.2427, 0.0049, 1, 0.9, 0.4118, 685, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "cb_dims", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cb_dims = (5, 8) # checkerboard dims. (x, y)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L51_C4", "label": "sq_sz =", "type": "assigned_variable", "loc": [51, 51], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:FunctionDef_L38_C0", "vector": [14, 1, 0.2476, 0.0049, 1, 0.9, 0.4706, 650, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "sq_sz", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " sq_sz = 19 # size of checkerboard in real units."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L52_C4", "label": "cb_offset =", "type": "assigned_variable", "loc": [52, 52], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:FunctionDef_L38_C0", "vector": [14, 1, 0.2524, 0.0049, 1, 0.9, 0.5294, 627, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "cb_offset", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cb_offset = 500,500"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L53_C4", "label": "cb_coords = CreateMat()", "type": "assigned_variable", "loc": [53, 53], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:FunctionDef_L38_C0", "vector": [14, 1, 0.2573, 0.0049, 1, 0.9, 0.5882, 883, 3, 3, 0, 0, 892, 10, 1], "semantic": {"name": "cb_coords", "arg_names": [], "import_names": [], "rhs_call_name": "CreateMat", "annotation": ""}, "snippet": " cb_coords = cv.CreateMat(2, cb_dims[0]*cb_dims[1], cv.CV_64FC1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L54_C4", "label": "n =", "type": "assigned_variable", "loc": [54, 54], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:FunctionDef_L38_C0", "vector": [14, 1, 0.2621, 0.0049, 1, 0.9, 0.6471, 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_99540:For_L55_C4", "label": "for r", "type": "for", "loc": [55, 59], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:FunctionDef_L38_C0", "vector": [6, 1, 0.2767, 0.0243, 1, 0.9, 0.7059, 436, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for r in range(cb_dims[1]):\n for c in range(cb_dims[0]):\n cb_coords[0,n] = c*sq_sz + cb_offset[0] # x coord\n cb_coords[1,n] = r*sq_sz + cb_offset[1] # y coord\n n += 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:For_L56_C8", "label": "for c", "type": "for", "loc": [56, 59], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:For_L55_C4", "vector": [6, 2, 0.2791, 0.0194, 2, 0.41, 0.0, 411, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "c", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for c in range(cb_dims[0]):\n cb_coords[0,n] = c*sq_sz + cb_offset[0] # x coord\n cb_coords[1,n] = r*sq_sz + cb_offset[1] # y coord\n n += 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L57_C12", "label": "assign", "type": "assigned_variable", "loc": [57, 57], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:For_L56_C8", "vector": [14, 3, 0.2767, 0.0049, 3, 0.02, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cb_coords[0,n] = c*sq_sz + cb_offset[0] # x coord"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L58_C12", "label": "assign", "type": "assigned_variable", "loc": [58, 58], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:For_L56_C8", "vector": [14, 3, 0.2816, 0.0049, 3, 0.02, 1.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cb_coords[1,n] = r*sq_sz + cb_offset[1] # y coord"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L61_C4", "label": "clicked_list =", "type": "assigned_variable", "loc": [61, 61], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:FunctionDef_L38_C0", "vector": [14, 1, 0.2961, 0.0049, 1, 0.9, 0.7647, 867, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "clicked_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " clicked_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L62_C4", "label": "recreate_image =", "type": "assigned_variable", "loc": [62, 62], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:FunctionDef_L38_C0", "vector": [14, 1, 0.301, 0.0049, 1, 0.9, 0.8235, 644, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "recreate_image", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " recreate_image = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L63_C4", "label": "mechanism_calc_state =", "type": "assigned_variable", "loc": [63, 63], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:FunctionDef_L38_C0", "vector": [14, 1, 0.3058, 0.0049, 1, 0.9, 0.8824, 692, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "mechanism_calc_state", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mechanism_calc_state = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L64_C4", "label": "mechanism_calc_dict =", "type": "assigned_variable", "loc": [64, 64], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:FunctionDef_L38_C0", "vector": [14, 1, 0.3107, 0.0049, 1, 0.9, 0.9412, 886, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "mechanism_calc_dict", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mechanism_calc_dict = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:While_L65_C4", "label": "while", "type": "while", "loc": [65, 179], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:FunctionDef_L38_C0", "vector": [5, 1, 0.5922, 0.5583, 1, 0.9, 1.0, 0, 1, 0, 0, 0, 0, 0, 56], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while True:\n for p in clicked_list:\n x,y = p[0]*scale_factor, p[1]*scale_factor\n cv.Circle(disp_im, (x,y), 3, (255,0,0))\n cv.ShowImage(wnd, disp_im)\n k = cv.WaitKey(10)\n k = k%256\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:For_L66_C8", "label": "for p", "type": "for", "loc": [66, 68], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:While_L65_C4", "vector": [6, 2, 0.3252, 0.0146, 2, 0.8, 0.0, 491, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for p in clicked_list:\n x,y = p[0]*scale_factor, p[1]*scale_factor\n cv.Circle(disp_im, (x,y), 3, (255,0,0))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L67_C12", "label": "x, y =", "type": "assigned_variable", "loc": [67, 67], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:For_L66_C8", "vector": [14, 3, 0.3252, 0.0049, 3, 0.6, 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 = p[0]*scale_factor, p[1]*scale_factor"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Expr_L68_C12", "label": "Circle()", "type": "expression", "loc": [68, 68], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:For_L66_C8", "vector": [8, 3, 0.3301, 0.0049, 3, 0.6, 1.0, 780, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "Circle", "arg_names": [], "import_names": [], "rhs_call_name": "Circle", "annotation": ""}, "snippet": " cv.Circle(disp_im, (x,y), 3, (255,0,0))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Expr_L69_C8", "label": "ShowImage()", "type": "expression", "loc": [69, 69], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:While_L65_C4", "vector": [8, 2, 0.335, 0.0049, 2, 0.8, 0.1667, 896, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "ShowImage", "arg_names": [], "import_names": [], "rhs_call_name": "ShowImage", "annotation": ""}, "snippet": " cv.ShowImage(wnd, disp_im)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L70_C8", "label": "k = WaitKey()", "type": "assigned_variable", "loc": [70, 70], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:While_L65_C4", "vector": [14, 2, 0.3398, 0.0049, 2, 0.8, 0.3333, 954, 3, 1, 0, 0, 885, 10, 1], "semantic": {"name": "k", "arg_names": [], "import_names": [], "rhs_call_name": "WaitKey", "annotation": ""}, "snippet": " k = cv.WaitKey(10)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L71_C8", "label": "k =", "type": "assigned_variable", "loc": [71, 71], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:While_L65_C4", "vector": [14, 2, 0.3447, 0.0049, 2, 0.8, 0.5, 954, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "k", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " k = k%256"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L73_C8", "label": "if", "type": "if", "loc": [73, 147], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:While_L65_C4", "vector": [4, 2, 0.534, 0.3641, 2, 0.8, 0.6667, 0, 0, 0, 0, 0, 0, 0, 39], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if k == 27:\n # ESC\n break\n elif k == ord('='):\n # + key without the shift\n scale_factor = scale_factor*1.2\n recreate_image = True\n elif k == ord('-'):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L76_C8", "label": "if", "type": "if", "loc": [76, 147], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L73_C8", "vector": [4, 3, 0.5413, 0.3495, 3, 0.29, 0.0, 0, 0, 0, 0, 0, 0, 0, 39], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif k == ord('='):\n # + key without the shift\n scale_factor = scale_factor*1.2\n recreate_image = True\n elif k == ord('-'):\n # - key\n scale_factor = scale_factor/1.2\n recreate_image = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L78_C12", "label": "scale_factor =", "type": "assigned_variable", "loc": [78, 78], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L76_C8", "vector": [14, 4, 0.3786, 0.0049, 4, 0.95, 0.0, 286, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "scale_factor", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " scale_factor = scale_factor*1.2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L79_C12", "label": "recreate_image =", "type": "assigned_variable", "loc": [79, 79], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L76_C8", "vector": [14, 4, 0.3835, 0.0049, 4, 0.95, 0.5, 644, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "recreate_image", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " recreate_image = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L80_C8", "label": "if", "type": "if", "loc": [80, 147], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L76_C8", "vector": [4, 4, 0.551, 0.3301, 4, 0.95, 1.0, 0, 0, 0, 0, 0, 0, 0, 38], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif k == ord('-'):\n # - key\n scale_factor = scale_factor/1.2\n recreate_image = True\n elif k == ord('c'):\n # find chessboard corners.\n succ, corners = cv.FindChessboardCorners(disp_im, cb_dims)\n if succ == 0:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L82_C12", "label": "scale_factor =", "type": "assigned_variable", "loc": [82, 82], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L80_C8", "vector": [14, 5, 0.3981, 0.0049, 5, 0.38, 0.0, 286, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "scale_factor", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " scale_factor = scale_factor/1.2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L83_C12", "label": "recreate_image =", "type": "assigned_variable", "loc": [83, 83], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L80_C8", "vector": [14, 5, 0.4029, 0.0049, 5, 0.38, 0.5, 644, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "recreate_image", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " recreate_image = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L84_C8", "label": "if", "type": "if", "loc": [84, 147], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L80_C8", "vector": [4, 5, 0.5607, 0.3107, 5, 0.38, 1.0, 0, 0, 0, 0, 0, 0, 0, 37], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif k == ord('c'):\n # find chessboard corners.\n succ, corners = cv.FindChessboardCorners(disp_im, cb_dims)\n if succ == 0:\n print('Chessboard detection FAILED.')\n else:\n # chessboard detection was successful\n cv.DrawChessboardCorners(disp_im, cb_dims, corners, succ)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L86_C12", "label": "succ, corners = FindChessboardCorners()", "type": "assigned_variable", "loc": [86, 86], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L84_C8", "vector": [14, 6, 0.4175, 0.0049, 6, 0.44, 0.0, 302, 3, 2, 0, 0, 651, 10, 1], "semantic": {"name": "succ, corners", "arg_names": [], "import_names": [], "rhs_call_name": "FindChessboardCorners", "annotation": ""}, "snippet": " succ, corners = cv.FindChessboardCorners(disp_im, cb_dims)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L87_C12", "label": "if", "type": "if", "loc": [87, 108], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L84_C8", "vector": [4, 6, 0.4733, 0.1068, 6, 0.44, 0.5, 0, 0, 0, 0, 0, 0, 0, 16], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if succ == 0:\n print('Chessboard detection FAILED.')\n else:\n # chessboard detection was successful\n cv.DrawChessboardCorners(disp_im, cb_dims, corners, succ)\n cb_im = cv.CreateMat(2, cb_dims[0]*cb_dims[1], cv.CV_64FC1)\n corners_mat = np.array(corners).T\n n = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Expr_L88_C16", "label": "print()", "type": "expression", "loc": [88, 88], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L87_C12", "vector": [8, 7, 0.4272, 0.0049, 7, 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('Chessboard detection FAILED.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Expr_L91_C16", "label": "DrawChessboardCorners()", "type": "expression", "loc": [91, 91], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L87_C12", "vector": [8, 7, 0.4417, 0.0049, 7, 0.25, 0.0769, 825, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "DrawChessboardCorners", "arg_names": [], "import_names": [], "rhs_call_name": "DrawChessboardCorners", "annotation": ""}, "snippet": " cv.DrawChessboardCorners(disp_im, cb_dims, corners, succ)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L92_C16", "label": "cb_im = CreateMat()", "type": "assigned_variable", "loc": [92, 92], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L87_C12", "vector": [14, 7, 0.4466, 0.0049, 7, 0.25, 0.1538, 242, 3, 3, 0, 0, 892, 10, 1], "semantic": {"name": "cb_im", "arg_names": [], "import_names": [], "rhs_call_name": "CreateMat", "annotation": ""}, "snippet": " cb_im = cv.CreateMat(2, cb_dims[0]*cb_dims[1], cv.CV_64FC1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L93_C16", "label": "corners_mat =", "type": "assigned_variable", "loc": [93, 93], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L87_C12", "vector": [14, 7, 0.4515, 0.0049, 7, 0.25, 0.2308, 148, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "corners_mat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " corners_mat = np.array(corners).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L94_C16", "label": "n =", "type": "assigned_variable", "loc": [94, 94], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L87_C12", "vector": [14, 7, 0.4563, 0.0049, 7, 0.25, 0.3077, 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_99540:For_L95_C16", "label": "for r", "type": "for", "loc": [95, 99], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L87_C12", "vector": [6, 7, 0.4709, 0.0243, 7, 0.25, 0.3846, 436, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for r in range(cb_dims[1]):\n for c in range(cb_dims[0]):\n cb_im[0,n] = corners_mat[0,n] # x coord\n cb_im[1,n] = corners_mat[1,n] # y coord\n n += 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:For_L96_C20", "label": "for c", "type": "for", "loc": [96, 99], "level": 8, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:For_L95_C16", "vector": [6, 8, 0.4733, 0.0194, 8, 0.1, 0.0, 411, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "c", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for c in range(cb_dims[0]):\n cb_im[0,n] = corners_mat[0,n] # x coord\n cb_im[1,n] = corners_mat[1,n] # y coord\n n += 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L97_C24", "label": "assign", "type": "assigned_variable", "loc": [97, 97], "level": 9, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:For_L96_C20", "vector": [14, 9, 0.4709, 0.0049, 9, 0.97, 0.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cb_im[0,n] = corners_mat[0,n] # x coord"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L98_C24", "label": "assign", "type": "assigned_variable", "loc": [98, 98], "level": 9, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:For_L96_C20", "vector": [14, 9, 0.4757, 0.0049, 9, 0.97, 1.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cb_im[1,n] = corners_mat[1,n] # y coord"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L100_C16", "label": "H = CreateMat()", "type": "assigned_variable", "loc": [100, 100], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L87_C12", "vector": [14, 7, 0.4854, 0.0049, 7, 0.25, 0.4615, 890, 3, 3, 0, 0, 892, 10, 1], "semantic": {"name": "H", "arg_names": [], "import_names": [], "rhs_call_name": "CreateMat", "annotation": ""}, "snippet": " H = cv.CreateMat(3, 3, cv.CV_64FC1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L101_C16", "label": "H1 = FindHomography()", "type": "assigned_variable", "loc": [101, 101], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L87_C12", "vector": [14, 7, 0.4903, 0.0049, 7, 0.25, 0.5385, 216, 3, 3, 0, 0, 264, 10, 1], "semantic": {"name": "H1", "arg_names": [], "import_names": [], "rhs_call_name": "FindHomography", "annotation": ""}, "snippet": " H1 = cv.FindHomography(cb_im, cb_coords, H)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L102_C16", "label": "Hnp = reshape()", "type": "assigned_variable", "loc": [102, 102], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L87_C12", "vector": [14, 7, 0.4951, 0.0049, 7, 0.25, 0.6154, 856, 3, 2, 0, 0, 276, 10, 3], "semantic": {"name": "Hnp", "arg_names": [], "import_names": [], "rhs_call_name": "reshape", "annotation": ""}, "snippet": " Hnp = np.reshape(np.fromstring(H1.tostring()), (3,3))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Expr_L103_C16", "label": "print()", "type": "expression", "loc": [103, 103], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L87_C12", "vector": [8, 7, 0.5, 0.0049, 7, 0.25, 0.6923, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Homography:')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Expr_L104_C16", "label": "print()", "type": "expression", "loc": [104, 104], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L87_C12", "vector": [8, 7, 0.5049, 0.0049, 7, 0.25, 0.7692, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(Hnp)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L106_C16", "label": "d = CloneImage()", "type": "assigned_variable", "loc": [106, 106], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L87_C12", "vector": [14, 7, 0.5146, 0.0049, 7, 0.25, 0.8462, 355, 3, 1, 0, 0, 436, 10, 1], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "CloneImage", "annotation": ""}, "snippet": " d = cv.CloneImage(disp_im)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Expr_L107_C16", "label": "WarpPerspective()", "type": "expression", "loc": [107, 107], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L87_C12", "vector": [8, 7, 0.5194, 0.0049, 7, 0.25, 0.9231, 280, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "WarpPerspective", "arg_names": [], "import_names": [], "rhs_call_name": "WarpPerspective", "annotation": ""}, "snippet": " cv.WarpPerspective(d, disp_im, H1, cv.CV_WARP_FILL_OUTLIERS)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L108_C16", "label": "cv_im = CloneImage()", "type": "assigned_variable", "loc": [108, 108], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L87_C12", "vector": [14, 7, 0.5243, 0.0049, 7, 0.25, 1.0, 782, 3, 1, 0, 0, 436, 10, 1], "semantic": {"name": "cv_im", "arg_names": [], "import_names": [], "rhs_call_name": "CloneImage", "annotation": ""}, "snippet": " cv_im = cv.CloneImage(disp_im)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L109_C8", "label": "if", "type": "if", "loc": [109, 147], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L84_C8", "vector": [4, 6, 0.6214, 0.1893, 6, 0.44, 1.0, 0, 0, 0, 0, 0, 0, 0, 19], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif k == ord('1'):\n # calculate width of the mechanism\n del clicked_list[:]\n cv.SetMouseCallback(wnd, on_mouse, (disp_im, clicked_list, scale_factor))\n recreate_image = True\n print('Click on two endpoints to mark the width of the mechanism')\n mechanism_calc_state = 1\n elif k == ord('2'):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Expr_L112_C12", "label": "SetMouseCallback()", "type": "expression", "loc": [112, 112], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L109_C8", "vector": [8, 7, 0.5437, 0.0049, 7, 0.88, 0.0, 860, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "SetMouseCallback", "arg_names": [], "import_names": [], "rhs_call_name": "SetMouseCallback", "annotation": ""}, "snippet": " cv.SetMouseCallback(wnd, on_mouse, (disp_im, clicked_list, scale_factor))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L113_C12", "label": "recreate_image =", "type": "assigned_variable", "loc": [113, 113], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L109_C8", "vector": [14, 7, 0.5485, 0.0049, 7, 0.88, 0.25, 644, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "recreate_image", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " recreate_image = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Expr_L114_C12", "label": "print()", "type": "expression", "loc": [114, 114], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L109_C8", "vector": [8, 7, 0.5534, 0.0049, 7, 0.88, 0.5, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Click on two endpoints to mark the width of the mechanism')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L115_C12", "label": "mechanism_calc_state =", "type": "assigned_variable", "loc": [115, 115], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L109_C8", "vector": [14, 7, 0.5583, 0.0049, 7, 0.88, 0.75, 692, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "mechanism_calc_state", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mechanism_calc_state = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L116_C8", "label": "if", "type": "if", "loc": [116, 147], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L109_C8", "vector": [4, 7, 0.6383, 0.1553, 7, 0.88, 1.0, 0, 0, 0, 0, 0, 0, 0, 16], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif k == ord('2'):\n # distance of handle from the hinge\n del clicked_list[:]\n cv.SetMouseCallback(wnd, on_mouse, (disp_im, clicked_list, scale_factor))\n recreate_image = True\n print('Click on handle and hinge to compute distance of handle from hinge.')\n mechanism_calc_state = 2\n elif k == ord('3'):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Expr_L119_C12", "label": "SetMouseCallback()", "type": "expression", "loc": [119, 119], "level": 8, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L116_C8", "vector": [8, 8, 0.5777, 0.0049, 8, 0.23, 0.0, 860, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "SetMouseCallback", "arg_names": [], "import_names": [], "rhs_call_name": "SetMouseCallback", "annotation": ""}, "snippet": " cv.SetMouseCallback(wnd, on_mouse, (disp_im, clicked_list, scale_factor))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L120_C12", "label": "recreate_image =", "type": "assigned_variable", "loc": [120, 120], "level": 8, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L116_C8", "vector": [14, 8, 0.5825, 0.0049, 8, 0.23, 0.25, 644, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "recreate_image", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " recreate_image = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Expr_L121_C12", "label": "print()", "type": "expression", "loc": [121, 121], "level": 8, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L116_C8", "vector": [8, 8, 0.5874, 0.0049, 8, 0.23, 0.5, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Click on handle and hinge to compute distance of handle from hinge.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L122_C12", "label": "mechanism_calc_state =", "type": "assigned_variable", "loc": [122, 122], "level": 8, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L116_C8", "vector": [14, 8, 0.5922, 0.0049, 8, 0.23, 0.75, 692, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "mechanism_calc_state", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mechanism_calc_state = 2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L123_C8", "label": "if", "type": "if", "loc": [123, 147], "level": 8, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L116_C8", "vector": [4, 8, 0.6553, 0.1214, 8, 0.23, 1.0, 0, 0, 0, 0, 0, 0, 0, 13], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif k == ord('3'):\n # height of the handle above the ground\n del clicked_list[:]\n cv.SetMouseCallback(wnd, on_mouse, (disp_im, clicked_list, scale_factor))\n recreate_image = True\n print('Click on handle top and bottom to compute height of handle above the ground.')\n mechanism_calc_state = 3\n elif k == ord('4'):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Expr_L126_C12", "label": "SetMouseCallback()", "type": "expression", "loc": [126, 126], "level": 9, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L123_C8", "vector": [8, 9, 0.6117, 0.0049, 9, 0.18, 0.0, 860, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "SetMouseCallback", "arg_names": [], "import_names": [], "rhs_call_name": "SetMouseCallback", "annotation": ""}, "snippet": " cv.SetMouseCallback(wnd, on_mouse, (disp_im, clicked_list, scale_factor))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L127_C12", "label": "recreate_image =", "type": "assigned_variable", "loc": [127, 127], "level": 9, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L123_C8", "vector": [14, 9, 0.6165, 0.0049, 9, 0.18, 0.25, 644, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "recreate_image", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " recreate_image = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Expr_L128_C12", "label": "print()", "type": "expression", "loc": [128, 128], "level": 9, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L123_C8", "vector": [8, 9, 0.6214, 0.0049, 9, 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('Click on handle top and bottom to compute height of handle above the ground.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L129_C12", "label": "mechanism_calc_state =", "type": "assigned_variable", "loc": [129, 129], "level": 9, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L123_C8", "vector": [14, 9, 0.6262, 0.0049, 9, 0.18, 0.75, 692, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "mechanism_calc_state", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mechanism_calc_state = 3"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L130_C8", "label": "if", "type": "if", "loc": [130, 147], "level": 9, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L123_C8", "vector": [4, 9, 0.6723, 0.0874, 9, 0.18, 1.0, 0, 0, 0, 0, 0, 0, 0, 10], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif k == ord('4'):\n # top and bottom edge of the mechanism\n del clicked_list[:]\n cv.SetMouseCallback(wnd, on_mouse, (disp_im, clicked_list, scale_factor))\n recreate_image = True\n print('Click on top and bottom edges of the mechanism.')\n mechanism_calc_state = 4\n elif k ==ord('d'):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Expr_L133_C12", "label": "SetMouseCallback()", "type": "expression", "loc": [133, 133], "level": 10, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L130_C8", "vector": [8, 10, 0.6456, 0.0049, 10, 0.56, 0.0, 860, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "SetMouseCallback", "arg_names": [], "import_names": [], "rhs_call_name": "SetMouseCallback", "annotation": ""}, "snippet": " cv.SetMouseCallback(wnd, on_mouse, (disp_im, clicked_list, scale_factor))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L134_C12", "label": "recreate_image =", "type": "assigned_variable", "loc": [134, 134], "level": 10, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L130_C8", "vector": [14, 10, 0.6505, 0.0049, 10, 0.56, 0.25, 644, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "recreate_image", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " recreate_image = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Expr_L135_C12", "label": "print()", "type": "expression", "loc": [135, 135], "level": 10, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L130_C8", "vector": [8, 10, 0.6553, 0.0049, 10, 0.56, 0.5, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Click on top and bottom edges of the mechanism.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L136_C12", "label": "mechanism_calc_state =", "type": "assigned_variable", "loc": [136, 136], "level": 10, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L130_C8", "vector": [14, 10, 0.6602, 0.0049, 10, 0.56, 0.75, 692, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "mechanism_calc_state", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mechanism_calc_state = 4"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L137_C8", "label": "if", "type": "if", "loc": [137, 147], "level": 10, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L130_C8", "vector": [4, 10, 0.6893, 0.0534, 10, 0.56, 1.0, 0, 0, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif k ==ord('d'):\n # display the calculated values\n print('mechanism_calc_dict:', mechanism_calc_dict)\n print('mech_info_dict:', mech_info_dict)\n elif k == ord('s'):\n # save the pkl\n ut.save_pickle(mechanism_calc_dict, dir+'/mechanism_calc_dict.pkl')\n print('Saved the pickle')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Expr_L139_C12", "label": "print()", "type": "expression", "loc": [139, 139], "level": 11, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L137_C8", "vector": [8, 11, 0.6748, 0.0049, 11, 0.02, 0.0, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('mechanism_calc_dict:', mechanism_calc_dict)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Expr_L140_C12", "label": "print()", "type": "expression", "loc": [140, 140], "level": 11, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L137_C8", "vector": [8, 11, 0.6796, 0.0049, 11, 0.02, 0.5, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('mech_info_dict:', mech_info_dict)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L141_C8", "label": "if", "type": "if", "loc": [141, 147], "level": 11, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L137_C8", "vector": [4, 11, 0.699, 0.034, 11, 0.02, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif k == ord('s'):\n # save the pkl\n ut.save_pickle(mechanism_calc_dict, dir+'/mechanism_calc_dict.pkl')\n print('Saved the pickle')\n #elif k != -1:\n elif k != 255:\n print('k:', k)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Expr_L143_C12", "label": "save_pickle()", "type": "expression", "loc": [143, 143], "level": 12, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L141_C8", "vector": [8, 12, 0.6942, 0.0049, 12, 0.19, 0.0, 390, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "save_pickle", "arg_names": [], "import_names": [], "rhs_call_name": "save_pickle", "annotation": ""}, "snippet": " ut.save_pickle(mechanism_calc_dict, dir+'/mechanism_calc_dict.pkl')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Expr_L144_C12", "label": "print()", "type": "expression", "loc": [144, 144], "level": 12, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L141_C8", "vector": [8, 12, 0.699, 0.0049, 12, 0.19, 0.5, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Saved the pickle')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L146_C8", "label": "if", "type": "if", "loc": [146, 147], "level": 12, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L141_C8", "vector": [4, 12, 0.7112, 0.0097, 12, 0.19, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif k != 255:\n print('k:', k)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Expr_L147_C12", "label": "print()", "type": "expression", "loc": [147, 147], "level": 13, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L146_C8", "vector": [8, 13, 0.7136, 0.0049, 13, 0.4, 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:', k)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L149_C8", "label": "if", "type": "if", "loc": [149, 155], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:While_L65_C4", "vector": [4, 2, 0.7379, 0.034, 2, 0.8, 0.8333, 0, 2, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if recreate_image:\n new_size = (int(size[0]*scale_factor),\n int(size[1]*scale_factor))\n disp_im = cv.CreateImage(new_size, cv_im.depth, cv_im.nChannels)\n cv.Resize(cv_im, disp_im)\n cv.SetMouseCallback(wnd, on_mouse, (disp_im, clicked_list, scale_factor))\n recreate_image = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L150_C12", "label": "new_size =", "type": "assigned_variable", "loc": [150, 151], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L149_C8", "vector": [14, 3, 0.7306, 0.0097, 3, 0.43, 0.0, 27, 0, 0, 0, 0, 0, 8, 2], "semantic": {"name": "new_size", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " new_size = (int(size[0]*scale_factor),\n int(size[1]*scale_factor))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L152_C12", "label": "disp_im = CreateImage()", "type": "assigned_variable", "loc": [152, 152], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L149_C8", "vector": [14, 3, 0.7379, 0.0049, 3, 0.43, 0.25, 191, 3, 3, 0, 0, 288, 10, 1], "semantic": {"name": "disp_im", "arg_names": [], "import_names": [], "rhs_call_name": "CreateImage", "annotation": ""}, "snippet": " disp_im = cv.CreateImage(new_size, cv_im.depth, cv_im.nChannels)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Expr_L153_C12", "label": "Resize()", "type": "expression", "loc": [153, 153], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L149_C8", "vector": [8, 3, 0.7427, 0.0049, 3, 0.43, 0.5, 430, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "Resize", "arg_names": [], "import_names": [], "rhs_call_name": "Resize", "annotation": ""}, "snippet": " cv.Resize(cv_im, disp_im)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Expr_L154_C12", "label": "SetMouseCallback()", "type": "expression", "loc": [154, 154], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L149_C8", "vector": [8, 3, 0.7476, 0.0049, 3, 0.43, 0.75, 860, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "SetMouseCallback", "arg_names": [], "import_names": [], "rhs_call_name": "SetMouseCallback", "annotation": ""}, "snippet": " cv.SetMouseCallback(wnd, on_mouse, (disp_im, clicked_list, scale_factor))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L155_C12", "label": "recreate_image =", "type": "assigned_variable", "loc": [155, 155], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L149_C8", "vector": [14, 3, 0.7524, 0.0049, 3, 0.43, 1.0, 644, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "recreate_image", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " recreate_image = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L157_C8", "label": "if", "type": "if", "loc": [157, 179], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:While_L65_C4", "vector": [4, 2, 0.8155, 0.1117, 2, 0.8, 1.0, 0, 0, 0, 0, 0, 0, 0, 9], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(clicked_list) == 2:\n if mechanism_calc_state == 1:\n w = abs(clicked_list[0][0] - clicked_list[1][0])\n print('Width in mm:', w)\n mechanism_calc_dict['mech_width'] = w/1000.\n if mechanism_calc_state == 2:\n w = abs(clicked_list[0][0] - clicked_list[1][0])\n print('Width in mm:', w)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L158_C12", "label": "if", "type": "if", "loc": [158, 161], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L157_C8", "vector": [4, 3, 0.7743, 0.0194, 3, 0.01, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if mechanism_calc_state == 1:\n w = abs(clicked_list[0][0] - clicked_list[1][0])\n print('Width in mm:', w)\n mechanism_calc_dict['mech_width'] = w/1000."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L159_C16", "label": "w = abs()", "type": "assigned_variable", "loc": [159, 159], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L158_C12", "vector": [14, 4, 0.7718, 0.0049, 4, 0.1, 0.0, 549, 3, 1, 0, 0, 799, 10, 1], "semantic": {"name": "w", "arg_names": [], "import_names": [], "rhs_call_name": "abs", "annotation": ""}, "snippet": " w = abs(clicked_list[0][0] - clicked_list[1][0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Expr_L160_C16", "label": "print()", "type": "expression", "loc": [160, 160], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L158_C12", "vector": [8, 4, 0.7767, 0.0049, 4, 0.1, 0.5, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Width in mm:', w)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L161_C16", "label": "assign", "type": "assigned_variable", "loc": [161, 161], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L158_C12", "vector": [14, 4, 0.7816, 0.0049, 4, 0.1, 1.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mechanism_calc_dict['mech_width'] = w/1000."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L162_C12", "label": "if", "type": "if", "loc": [162, 165], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L157_C8", "vector": [4, 3, 0.7937, 0.0194, 3, 0.01, 0.25, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if mechanism_calc_state == 2:\n w = abs(clicked_list[0][0] - clicked_list[1][0])\n print('Width in mm:', w)\n mechanism_calc_dict['handle_hinge_dist'] = w/1000."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L163_C16", "label": "w = abs()", "type": "assigned_variable", "loc": [163, 163], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L162_C12", "vector": [14, 4, 0.7913, 0.0049, 4, 0.25, 0.0, 549, 3, 1, 0, 0, 799, 10, 1], "semantic": {"name": "w", "arg_names": [], "import_names": [], "rhs_call_name": "abs", "annotation": ""}, "snippet": " w = abs(clicked_list[0][0] - clicked_list[1][0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Expr_L164_C16", "label": "print()", "type": "expression", "loc": [164, 164], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L162_C12", "vector": [8, 4, 0.7961, 0.0049, 4, 0.25, 0.5, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Width in mm:', w)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L165_C16", "label": "assign", "type": "assigned_variable", "loc": [165, 165], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L162_C12", "vector": [14, 4, 0.801, 0.0049, 4, 0.25, 1.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mechanism_calc_dict['handle_hinge_dist'] = w/1000."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L166_C12", "label": "if", "type": "if", "loc": [166, 171], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L157_C8", "vector": [4, 3, 0.818, 0.0291, 3, 0.01, 0.5, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if mechanism_calc_state == 3:\n p1, p2 = clicked_list[0], clicked_list[1]\n h1 = (cb_offset[1] - p1[1])/1000. + checker_origin_height\n h2 = (cb_offset[1] - p2[1])/1000. + checker_origin_height\n mechanism_calc_dict['handle_top'] = max(h1, h2)\n mechanism_calc_dict['handle_bottom'] = min(h1, h2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L167_C16", "label": "p1, p2 =", "type": "assigned_variable", "loc": [167, 167], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L166_C12", "vector": [14, 4, 0.8107, 0.0049, 4, 0.6, 0.0, 581, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "p1, p2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p1, p2 = clicked_list[0], clicked_list[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L168_C16", "label": "h1 =", "type": "assigned_variable", "loc": [168, 168], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L166_C12", "vector": [14, 4, 0.8155, 0.0049, 4, 0.6, 0.25, 428, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "h1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " h1 = (cb_offset[1] - p1[1])/1000. + checker_origin_height"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L169_C16", "label": "h2 =", "type": "assigned_variable", "loc": [169, 169], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L166_C12", "vector": [14, 4, 0.8204, 0.0049, 4, 0.6, 0.5, 265, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "h2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " h2 = (cb_offset[1] - p2[1])/1000. + checker_origin_height"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L170_C16", "label": " = max()", "type": "assigned_variable", "loc": [170, 170], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L166_C12", "vector": [14, 4, 0.8252, 0.0049, 4, 0.6, 0.75, 0, 3, 2, 0, 0, 442, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "max", "annotation": ""}, "snippet": " mechanism_calc_dict['handle_top'] = max(h1, h2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L171_C16", "label": " = min()", "type": "assigned_variable", "loc": [171, 171], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L166_C12", "vector": [14, 4, 0.8301, 0.0049, 4, 0.6, 1.0, 0, 3, 2, 0, 0, 867, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "min", "annotation": ""}, "snippet": " mechanism_calc_dict['handle_bottom'] = min(h1, h2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L172_C12", "label": "if", "type": "if", "loc": [172, 177], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L157_C8", "vector": [4, 3, 0.8471, 0.0291, 3, 0.01, 0.75, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if mechanism_calc_state == 4:\n p1, p2 = clicked_list[0], clicked_list[1]\n h1 = (cb_offset[1] - p1[1])/1000. + checker_origin_height\n h2 = (cb_offset[1] - p2[1])/1000. + checker_origin_height\n mechanism_calc_dict['mechanism_top'] = max(h1, h2)\n mechanism_calc_dict['mechanism_bottom'] = min(h1, h2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L173_C16", "label": "p1, p2 =", "type": "assigned_variable", "loc": [173, 173], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L172_C12", "vector": [14, 4, 0.8398, 0.0049, 4, 0.0, 0.0, 581, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "p1, p2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p1, p2 = clicked_list[0], clicked_list[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L174_C16", "label": "h1 =", "type": "assigned_variable", "loc": [174, 174], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L172_C12", "vector": [14, 4, 0.8447, 0.0049, 4, 0.0, 0.25, 428, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "h1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " h1 = (cb_offset[1] - p1[1])/1000. + checker_origin_height"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L175_C16", "label": "h2 =", "type": "assigned_variable", "loc": [175, 175], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L172_C12", "vector": [14, 4, 0.8495, 0.0049, 4, 0.0, 0.5, 265, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "h2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " h2 = (cb_offset[1] - p2[1])/1000. + checker_origin_height"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L176_C16", "label": " = max()", "type": "assigned_variable", "loc": [176, 176], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L172_C12", "vector": [14, 4, 0.8544, 0.0049, 4, 0.0, 0.75, 0, 3, 2, 0, 0, 442, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "max", "annotation": ""}, "snippet": " mechanism_calc_dict['mechanism_top'] = max(h1, h2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L177_C16", "label": " = min()", "type": "assigned_variable", "loc": [177, 177], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L172_C12", "vector": [14, 4, 0.8592, 0.0049, 4, 0.0, 1.0, 0, 3, 2, 0, 0, 867, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "min", "annotation": ""}, "snippet": " mechanism_calc_dict['mechanism_bottom'] = min(h1, h2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L179_C12", "label": "mechanism_calc_state =", "type": "assigned_variable", "loc": [179, 179], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L157_C8", "vector": [14, 3, 0.8689, 0.0049, 3, 0.01, 1.0, 692, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "mechanism_calc_state", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mechanism_calc_state = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L184_C0", "label": "if", "type": "if", "loc": [184, 201], "level": 0, "parent": null, "vector": [4, 0, 0.9345, 0.0874, 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\n import optparse\n p = optparse.OptionParser()\n p.add_option('-d', '--dir', action='store', default='',\n type='string', dest='dir', help='mechanism directory')\n opt, args = p.parse_args()\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Import_L186_C4", "label": "optparse import optparse", "type": "import", "loc": [186, 186], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L184_C0", "vector": [1, 1, 0.9029, 0.0049, 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_99540:Assign_L187_C4", "label": "p = OptionParser()", "type": "assigned_variable", "loc": [187, 187], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L184_C0", "vector": [14, 1, 0.9078, 0.0049, 1, 0.94, 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_99540:Expr_L188_C4", "label": "add_option()", "type": "expression", "loc": [188, 189], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L184_C0", "vector": [8, 1, 0.915, 0.0097, 1, 0.94, 0.2857, 176, 3, 7, 0, 0, 0, 0, 1], "semantic": {"name": "add_option", "arg_names": [], "import_names": [], "rhs_call_name": "add_option", "annotation": ""}, "snippet": " p.add_option('-d', '--dir', action='store', default='',\n type='string', dest='dir', help='mechanism directory')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L190_C4", "label": "opt, args = parse_args()", "type": "assigned_variable", "loc": [190, 190], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L184_C0", "vector": [14, 1, 0.9223, 0.0049, 1, 0.94, 0.4286, 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_99540:Assign_L195_C4", "label": "img_list = glob()", "type": "assigned_variable", "loc": [195, 195], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L184_C0", "vector": [14, 1, 0.9466, 0.0049, 1, 0.94, 0.5714, 150, 3, 1, 0, 0, 958, 10, 1], "semantic": {"name": "img_list", "arg_names": [], "import_names": [], "rhs_call_name": "glob", "annotation": ""}, "snippet": " img_list = glob.glob(opt.dir+'/*.jpg')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L196_C4", "label": "mech_info_dict = load_pickle()", "type": "assigned_variable", "loc": [196, 196], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L184_C0", "vector": [14, 1, 0.9515, 0.0049, 1, 0.94, 0.7143, 409, 3, 1, 0, 0, 65, 10, 1], "semantic": {"name": "mech_info_dict", "arg_names": [], "import_names": [], "rhs_call_name": "load_pickle", "annotation": ""}, "snippet": " mech_info_dict = ut.load_pickle(opt.dir+'/mechanism_info.pkl')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:For_L197_C4", "label": "for img", "type": "for", "loc": [197, 199], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L184_C0", "vector": [6, 1, 0.9612, 0.0146, 1, 0.94, 0.8571, 200, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "img", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for img in img_list:\n cv_im = cv.LoadImage(img)\n annotate_image(cv_im, mech_info_dict, opt.dir)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L198_C8", "label": "cv_im = LoadImage()", "type": "assigned_variable", "loc": [198, 198], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:For_L197_C4", "vector": [14, 2, 0.9612, 0.0049, 2, 0.33, 0.0, 782, 3, 1, 0, 0, 512, 10, 1], "semantic": {"name": "cv_im", "arg_names": [], "import_names": [], "rhs_call_name": "LoadImage", "annotation": ""}, "snippet": " cv_im = cv.LoadImage(img)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Expr_L199_C8", "label": "annotate_image()", "type": "expression", "loc": [199, 199], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:For_L197_C4", "vector": [8, 2, 0.966, 0.0049, 2, 0.33, 1.0, 461, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "annotate_image", "arg_names": [], "import_names": [], "rhs_call_name": "annotate_image", "annotation": ""}, "snippet": " annotate_image(cv_im, mech_info_dict, opt.dir)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99540:Expr_L201_C4", "label": "exit()", "type": "expression", "loc": [201, 201], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L184_C0", "vector": [8, 1, 0.9757, 0.0049, 1, 0.94, 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()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99540:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:Expr_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:Expr_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:Expr_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:Expr_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:Expr_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:Expr_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:Expr_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:Expr_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:Expr_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:FunctionDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:FunctionDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:FunctionDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L33_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:Expr_L35_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:FunctionDef_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L40_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:FunctionDef_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:FunctionDef_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:Expr_L43_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:FunctionDef_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L44_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:FunctionDef_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L45_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:FunctionDef_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L46_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:FunctionDef_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L48_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:FunctionDef_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L50_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:FunctionDef_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L51_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:FunctionDef_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L52_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:FunctionDef_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L53_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:FunctionDef_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L54_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:FunctionDef_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:For_L55_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:For_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:For_L56_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:For_L56_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L57_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:For_L56_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L58_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:FunctionDef_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L61_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:FunctionDef_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L62_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:FunctionDef_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L63_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:FunctionDef_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L64_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:FunctionDef_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:While_L65_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:While_L65_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:For_L66_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:For_L66_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L67_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:For_L66_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:Expr_L68_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:While_L65_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:Expr_L69_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:While_L65_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:While_L65_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L71_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:While_L65_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L73_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L73_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L76_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L76_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L78_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L76_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L79_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L76_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L80_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L80_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L82_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L80_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L83_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L80_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L84_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L84_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L86_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L84_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L87_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L87_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:Expr_L88_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L87_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:Expr_L91_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L87_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L92_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L87_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L93_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L87_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L94_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L87_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:For_L95_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:For_L95_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:For_L96_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:For_L96_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L97_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:For_L96_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L98_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L87_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L100_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L87_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L101_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L87_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L102_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L87_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:Expr_L103_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L87_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:Expr_L104_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L87_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L106_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L87_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:Expr_L107_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L87_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L108_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L84_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L109_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L109_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:Expr_L112_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L109_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L113_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L109_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:Expr_L114_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L109_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L115_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L109_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L116_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L116_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:Expr_L119_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L116_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L120_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L116_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:Expr_L121_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L116_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L122_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L116_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L123_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L123_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:Expr_L126_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L123_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L127_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L123_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:Expr_L128_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L123_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L129_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L123_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L130_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L130_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:Expr_L133_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L130_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L134_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L130_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:Expr_L135_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L130_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L136_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L130_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L137_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L137_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:Expr_L139_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L137_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:Expr_L140_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L137_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L141_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L141_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:Expr_L143_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L141_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:Expr_L144_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L141_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L146_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L146_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:Expr_L147_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:While_L65_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L149_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L149_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L150_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L149_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L152_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L149_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:Expr_L153_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L149_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:Expr_L154_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L149_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L155_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:While_L65_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L157_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L157_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L158_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L158_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L159_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L158_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:Expr_L160_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L158_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L161_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L157_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L162_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L162_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L163_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L162_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:Expr_L164_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L162_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L165_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L157_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L166_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L166_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L167_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L166_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L168_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L166_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L169_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L166_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L170_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L166_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L171_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L157_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L172_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L172_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L173_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L172_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L174_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L172_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L175_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L172_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L176_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L172_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L177_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L157_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L179_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L184_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:Import_L186_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L184_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L187_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L184_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:Expr_L188_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L184_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L190_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L184_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L195_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L184_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L196_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L184_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:For_L197_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:For_L197_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:Assign_L198_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:For_L197_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:Expr_L199_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99540:If_L184_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99540:Expr_L201_C4"}]
import csv import numpy as np import pylab as pb import matplotlib_util.util as mpu def load_data(): mk = csv.reader(open('Mechanism Kinematics.csv', 'U')) data = [] for r in mk: data.append(r) return data ## # Deal with repetition def expand(data, keys): repetition_idx = np.where(np.array(keys) == 'repetition')[0] data[repetition_idx] = [int(e) for e in data[repetition_idx]] repeated_data = [] for i in range(len(data)): repeated_data.append([]) for current_instance in range(len(data[0])): if data[repetition_idx][current_instance] > 1: for rep in range(1, data[repetition_idx][current_instance]): for l, rl in zip(data, repeated_data): rl.append(l[current_instance]) for l, rl in zip(data, repeated_data): l += rl data.pop(repetition_idx) keys.pop(repetition_idx) return data def test_expand(): data = [['a', 'b', 'c'], ['A', 'B', 'C'], [1, 4, 10]] keys = ['letters', 'LETTERS', 'repetition'] new_data = expand(data, keys) print new_data def extract_keys(csv_data, keys): format = csv_data[1] indices = [] llists = [] for k in keys: indices.append(np.where(np.array(format) == k)[0]) llists.append([]) for i in range(2, len(csv_data)): if len(csv_data[i]) == 0: break if len(csv_data[i][indices[0]]) > 0: for lidx, data_idx in enumerate(indices): llists[lidx].append(csv_data[i][data_idx]) return llists def plot_radii(csv_data, color='#3366FF'): keys = ['radius', 'type', 'name', 'repetition'] llists = expand(extract_keys(csv_data, keys), keys) rad_list = np.array([float(r) for r in llists[0]]) / 100.0 types = llists[1] names = np.array(llists[2]) all_types = set(types) print 'Radii types', all_types types_arr = np.array(types) # np.where(types_arr == 'C') cabinet_rad_list = rad_list[np.where(types_arr == 'C')[0]] others_rad_list = rad_list[np.where(types_arr != 'C')[0]] other_names = names[np.where(types_arr != 'C')[0]] print '>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>' print 'radii other names' for i, n in enumerate(other_names): print n, others_rad_list[i] print '>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>' rad_lists = [rad_list, cabinet_rad_list, others_rad_list] titles = ['Radii of Rotary Mechanisms', 'Radii of Cabinets', 'Radii of Other Mechanisms'] bin_width = 0.05 max_radius = np.max(rad_list) print 'MIN RADIUS', np.min(rad_list) print 'MAX RADIUS', max_radius mpu.set_figure_size(5.,5.) for idx, radii in enumerate(rad_lists): f = pb.figure() f.set_facecolor('w') bins = np.arange(0.-bin_width/2., max_radius+2*bin_width, bin_width) hist, bin_edges = np.histogram(radii, bins) h = mpu.plot_histogram(bin_edges[:-1]+bin_width/2., hist, width=0.8*bin_width, xlabel='Radius (meters)', ylabel='\# of mechanisms', plot_title=titles[idx], color=color, label='All') pb.xlim(.1, 1.) pb.ylim(0, 55) mpu.legend(display_mode = 'less_space', handlelength=1.) #-- different classes in different colors in the same histogram. f = pb.figure() f.set_facecolor('w') bins = np.arange(0.-bin_width/2., max_radius+2*bin_width, bin_width) hist, bin_edges = np.histogram(rad_lists[0], bins) h = mpu.plot_histogram(bin_edges[:-1]+bin_width/2., hist, width=0.8*bin_width, xlabel='Radius (meters)', ylabel='\# of mechanisms', plot_title=titles[1], color='g', label='Cabinets') hist, bin_edges = np.histogram(rad_lists[2], bins) h = mpu.plot_histogram(bin_edges[:-1]+bin_width/2., hist, width=0.8*bin_width, xlabel='Radius (meters)', ylabel='\# of mechanisms', plot_title='Cabinets and Other Mechanisms', color='y', label='Other') pb.xlim(.1, 1.) pb.ylim(0, 55) mpu.legend(display_mode = 'less_space', handlelength=1.) color_list = ['g', 'b', 'r'] marker_list = ['s', '^', 'v'] label_list = ['All', 'Cabinets', 'Other'] scatter_size_list = [8, 5, 5] mpu.set_figure_size(5.,5.) mpu.figure() for idx, radii in enumerate(rad_lists): bins = np.arange(0.-bin_width/2., max_radius+2*bin_width, bin_width) hist, bin_edges = np.histogram(radii, bins) bin_midpoints = np.arange(0., max_radius+bin_width, bin_width) mpu.plot_yx(hist, bin_midpoints, color = color_list[idx], alpha = 0.6, marker = marker_list[idx], scatter_size = scatter_size_list[idx], xlabel='Radius (meters)', ylabel='\# of mechanisms', label = label_list[idx]) mpu.legend(display_mode = 'less_space') def plot_opening(csv_data): keys = ['distance', 'type', 'repetition'] llists = expand(extract_keys(csv_data, keys), keys) dists = np.array([float(f) for f in llists[0]])/100. types = llists[1] types_arr = np.array(types) drawer_dists = dists[np.where(types_arr == 'R')[0]] other_dists = dists[np.where(types_arr != 'R')[0]] print 'Opening distances types', set(types) bin_width = 0.02 bins = np.arange(-bin_width/2., np.max(dists)+2*bin_width, bin_width) dists_list = [dists]#, drawer_dists, other_dists] titles = ['Opening Distances of Drawers']#, 'drawer', 'other'] # print 'Total number of drawers:', len(dists) mpu.set_figure_size(5.,4.) for idx, d in enumerate(dists_list): f = pb.figure() f.set_facecolor('w') hist, bin_edges = np.histogram(d, bins) #import pdb; pdb.set_trace() mpu.plot_histogram(bin_edges[:-1]+bin_width/2., hist, width=0.8*bin_width, xlabel='Opening Distance (meters)', ylabel='\# of Mechanisms', plot_title=titles[idx], color='#3366FF') # pb.xticks(bins[np.where(bins > np.min(dists))[0][0]-2:-1]) # pb.yticks(range(0, 26, 5)) # pb.ylim(0, 25) def handle_height_histogram(mean_height_list, plot_title='', color='#3366FF', max_height=2.5, bin_width=.1, ymax=35): bins = np.arange(0.-bin_width/2., max_height+2*bin_width, bin_width) hist, bin_edges = np.histogram(np.array(mean_height_list), bins) f = pb.figure() f.set_facecolor('w') f.subplots_adjust(bottom=.16, top=.86) mpu.plot_histogram(bin_edges[:-1]+bin_width/2., hist, width=bin_width*0.8, plot_title=plot_title, xlabel='Height (meters)', ylabel='\# of mechanisms', color=color) pb.xlim(0, max_height) pb.ylim(0, ymax) def handle_height_histogram_advait(mean_height_list, plot_title='', color='#3366FF', max_height=2.2, bin_width=.1, ymax=35, new_figure = True, label = '__no_legend__'): if new_figure: mpu.set_figure_size(5.,4.) # f = mpu.figure() # f.subplots_adjust(bottom=.25, top=.99, right=0.99, left=0.12) bins = np.arange(0.-bin_width/2., max_height+2*bin_width, bin_width) hist, bin_edges = np.histogram(np.array(mean_height_list), bins) h = mpu.plot_histogram(bin_edges[:-1]+bin_width/2., hist, width=bin_width*0.8, plot_title=plot_title, xlabel='Height (meters)', ylabel='\# of mechanisms', color=color, label = label) pb.xlim(0, max_height) pb.ylim(0, ymax) return h def plot_rotary_heights(csv_data): keys = ['radius', 'bottom', 'top', 'type', 'name', 'repetition'] llists = expand(extract_keys(csv_data, keys), keys) types = llists[3] names = np.array(llists[4]) print 'Handle bottom edge types', set(types) bottom_pts = np.array([float(f) for f in llists[1]])/100. top_pts = [] for i,f in enumerate(llists[2]): if f == '': f = llists[1][i] top_pts.append(float(f)/100.) top_pts = np.array(top_pts) print 'total number of doors:', len(top_pts) mid_pts = (bottom_pts + top_pts)/2. types_arr = np.array(types) cabinet_mid_pts = mid_pts[np.where(types_arr == 'C')[0]] other_mid_pts = mid_pts[np.where(types_arr != 'C')[0]] other_names = names[np.where(types_arr != 'C')[0]] print 'other names', other_names # Hai, Advait apologizes for changing code without making a copy. # He didn't realise. He'll make a copy from an earlier revision in # subversion soon. ymax = 85 handle_height_histogram_advait(mid_pts, plot_title='Handle Heights', ymax=ymax, label = 'All') mpu.legend(display_mode = 'less_space', handlelength=1.) handle_height_histogram_advait(mid_pts, plot_title='Handle Heights', ymax=ymax, color = 'g', label = 'Cabinets') handle_height_histogram_advait(other_mid_pts, plot_title='Handle Heights', ymax=ymax, color = 'y', new_figure = False, label = 'Other') mpu.legend(display_mode = 'less_space', handlelength=1.) def plot_prismatic_heights(csv_data): keys = ['distance', 'bottom', 'top', 'type', 'name', 'home', 'repetition'] llists = expand(extract_keys(csv_data, keys), keys) types = llists[3] names = np.array(llists[4]) home = np.array(llists[5]) print 'Handle bottom edge types', set(types) bottom_pts = np.array([float(f) for f in llists[1]])/100. top_pts = [] for i,f in enumerate(llists[2]): if f == '': f = llists[1][i] top_pts.append(float(f)/100.) top_pts = np.array(top_pts) mid_pts = (bottom_pts + top_pts)/2. types_arr = np.array(types) max_height = np.max(bottom_pts) sort_order = np.argsort(bottom_pts) names = names[sort_order] bottom_pts = bottom_pts[sort_order] home = home[sort_order] for i, name in enumerate(names): print home[i], name, bottom_pts[i] handle_height_histogram(bottom_pts, plot_title='Heights of Handle Lower Edge (Drawers)', max_height = max_height) max_height = np.max(mid_pts) handle_height_histogram_advait(mid_pts, plot_title='Handle Heights', max_height = max_height+0.1, ymax=43) #test_expand() csv_data = load_data() plot_prismatic_heights(csv_data) #plot_radii(csv_data) plot_rotary_heights(csv_data) #plot_opening(csv_data) pb.show()
ajibawa-2023/Python-Code-Large/train/row_99541
191
269
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Import_L1_C0", "label": "csv import csv", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0037, 0.0037, 0, 0.66, 0.0, 312, 0, 1, 0, 0, 312, 0, 0], "semantic": {"name": "csv", "arg_names": [], "import_names": ["csv"], "rhs_call_name": "", "annotation": ""}, "snippet": "import csv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Import_L2_C0", "label": "numpy import np", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0074, 0.0037, 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_99541:Import_L3_C0", "label": "pylab import pb", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0112, 0.0037, 0, 0.66, 0.1176, 735, 0, 1, 0, 0, 735, 0, 0], "semantic": {"name": "pylab", "arg_names": [], "import_names": ["pb"], "rhs_call_name": "", "annotation": ""}, "snippet": "import pylab as pb"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Import_L4_C0", "label": "matplotlib_util.util import mpu", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0149, 0.0037, 0, 0.66, 0.1765, 781, 0, 1, 0, 0, 781, 0, 0], "semantic": {"name": "matplotlib_util.util", "arg_names": [], "import_names": ["mpu"], "rhs_call_name": "", "annotation": ""}, "snippet": "import matplotlib_util.util as mpu"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L6_C0", "label": "load_data", "type": "function", "loc": [6, 12], "level": 0, "parent": null, "vector": [2, 0, 0.0335, 0.026, 0, 0.66, 0.2353, 477, 0, 0, 1, 0, 0, 0, 3], "semantic": {"name": "load_data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def load_data():\n mk = csv.reader(open('Mechanism Kinematics.csv', 'U'))\n data = []\n for r in mk:\n data.append(r)\n\n return data"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L7_C4", "label": "mk = reader()", "type": "assigned_variable", "loc": [7, 7], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L6_C0", "vector": [14, 1, 0.026, 0.0037, 1, 0.13, 0.0, 141, 3, 1, 0, 0, 548, 10, 2], "semantic": {"name": "mk", "arg_names": [], "import_names": [], "rhs_call_name": "reader", "annotation": ""}, "snippet": " mk = csv.reader(open('Mechanism Kinematics.csv', 'U'))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L8_C4", "label": "data =", "type": "assigned_variable", "loc": [8, 8], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L6_C0", "vector": [14, 1, 0.0297, 0.0037, 1, 0.13, 0.3333, 929, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " data = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:For_L9_C4", "label": "for r", "type": "for", "loc": [9, 10], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L6_C0", "vector": [6, 1, 0.0353, 0.0074, 1, 0.13, 0.6667, 436, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for r in mk:\n data.append(r)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L10_C8", "label": "append()", "type": "expression", "loc": [10, 10], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:For_L9_C4", "vector": [8, 2, 0.0372, 0.0037, 2, 0.28, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " data.append(r)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Return_L12_C4", "label": "return", "type": "return", "loc": [12, 12], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L6_C0", "vector": [13, 1, 0.0446, 0.0037, 1, 0.13, 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_99541:FunctionDef_L16_C0", "label": "expand", "type": "function", "loc": [16, 34], "level": 0, "parent": null, "vector": [2, 0, 0.0929, 0.0706, 0, 0.66, 0.2941, 174, 0, 2, 1, 0, 0, 0, 14], "semantic": {"name": "expand", "arg_names": ["data", "keys"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def expand(data, keys):\n repetition_idx = np.where(np.array(keys) == 'repetition')[0]\n data[repetition_idx] = [int(e) for e in data[repetition_idx]]\n repeated_data = []\n\n for i in range(len(data)):\n repeated_data.append([])\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L17_C4", "label": "repetition_idx =", "type": "assigned_variable", "loc": [17, 17], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L16_C0", "vector": [14, 1, 0.0632, 0.0037, 1, 0.65, 0.0, 129, 6, 0, 0, 0, 0, 0, 2], "semantic": {"name": "repetition_idx", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " repetition_idx = np.where(np.array(keys) == 'repetition')[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L18_C4", "label": "assign", "type": "assigned_variable", "loc": [18, 18], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L16_C0", "vector": [14, 1, 0.0669, 0.0037, 1, 0.65, 0.125, 0, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " data[repetition_idx] = [int(e) for e in data[repetition_idx]]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L19_C4", "label": "repeated_data =", "type": "assigned_variable", "loc": [19, 19], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L16_C0", "vector": [14, 1, 0.0706, 0.0037, 1, 0.65, 0.25, 561, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "repeated_data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " repeated_data = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:For_L21_C4", "label": "for i", "type": "for", "loc": [21, 22], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L16_C0", "vector": [6, 1, 0.0799, 0.0074, 1, 0.65, 0.375, 826, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(len(data)):\n repeated_data.append([])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L22_C8", "label": "append()", "type": "expression", "loc": [22, 22], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:For_L21_C4", "vector": [8, 2, 0.0818, 0.0037, 2, 0.97, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " repeated_data.append([])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:For_L24_C4", "label": "for current_instance", "type": "for", "loc": [24, 28], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L16_C0", "vector": [6, 1, 0.0967, 0.0186, 1, 0.65, 0.5, 416, 3, 0, 0, 0, 0, 0, 5], "semantic": {"name": "current_instance", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for current_instance in range(len(data[0])):\n if data[repetition_idx][current_instance] > 1:\n for rep in range(1, data[repetition_idx][current_instance]):\n for l, rl in zip(data, repeated_data):\n rl.append(l[current_instance])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:If_L25_C8", "label": "if", "type": "if", "loc": [25, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:For_L24_C4", "vector": [4, 2, 0.0985, 0.0149, 2, 0.09, 0.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if data[repetition_idx][current_instance] > 1:\n for rep in range(1, data[repetition_idx][current_instance]):\n for l, rl in zip(data, repeated_data):\n rl.append(l[current_instance])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:For_L26_C12", "label": "for rep", "type": "for", "loc": [26, 28], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:If_L25_C8", "vector": [6, 3, 0.1004, 0.0112, 3, 0.63, 0.0, 315, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "rep", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for rep in range(1, data[repetition_idx][current_instance]):\n for l, rl in zip(data, repeated_data):\n rl.append(l[current_instance])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:For_L27_C16", "label": "for l, rl", "type": "for", "loc": [27, 28], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:For_L26_C12", "vector": [6, 4, 0.1022, 0.0074, 4, 0.86, 0.0, 710, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "l, rl", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for l, rl in zip(data, repeated_data):\n rl.append(l[current_instance])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L28_C20", "label": "append()", "type": "expression", "loc": [28, 28], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:For_L27_C16", "vector": [8, 5, 0.1041, 0.0037, 5, 0.27, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " rl.append(l[current_instance])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:For_L29_C4", "label": "for l, rl", "type": "for", "loc": [29, 30], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L16_C0", "vector": [6, 1, 0.1097, 0.0074, 1, 0.65, 0.625, 710, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "l, rl", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for l, rl in zip(data, repeated_data):\n l += rl"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L32_C4", "label": "pop()", "type": "expression", "loc": [32, 32], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L16_C0", "vector": [8, 1, 0.119, 0.0037, 1, 0.65, 0.75, 969, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "pop", "arg_names": [], "import_names": [], "rhs_call_name": "pop", "annotation": ""}, "snippet": " data.pop(repetition_idx)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L33_C4", "label": "pop()", "type": "expression", "loc": [33, 33], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L16_C0", "vector": [8, 1, 0.1227, 0.0037, 1, 0.65, 0.875, 969, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "pop", "arg_names": [], "import_names": [], "rhs_call_name": "pop", "annotation": ""}, "snippet": " keys.pop(repetition_idx)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Return_L34_C4", "label": "return", "type": "return", "loc": [34, 34], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L16_C0", "vector": [13, 1, 0.1264, 0.0037, 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 data"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L36_C0", "label": "test_expand", "type": "function", "loc": [36, 40], "level": 0, "parent": null, "vector": [2, 0, 0.1413, 0.0186, 0, 0.66, 0.3529, 765, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "test_expand", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def test_expand():\n data = [['a', 'b', 'c'], ['A', 'B', 'C'], [1, 4, 10]]\n keys = ['letters', 'LETTERS', 'repetition']\n new_data = expand(data, keys)\n print(new_data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L37_C4", "label": "data =", "type": "assigned_variable", "loc": [37, 37], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L36_C0", "vector": [14, 1, 0.1375, 0.0037, 1, 0.95, 0.0, 929, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " data = [['a', 'b', 'c'], ['A', 'B', 'C'], [1, 4, 10]]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L38_C4", "label": "keys =", "type": "assigned_variable", "loc": [38, 38], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L36_C0", "vector": [14, 1, 0.1413, 0.0037, 1, 0.95, 0.3333, 204, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "keys", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " keys = ['letters', 'LETTERS', 'repetition']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L39_C4", "label": "new_data = expand()", "type": "assigned_variable", "loc": [39, 39], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L36_C0", "vector": [14, 1, 0.145, 0.0037, 1, 0.95, 0.6667, 524, 3, 2, 0, 0, 174, 10, 1], "semantic": {"name": "new_data", "arg_names": [], "import_names": [], "rhs_call_name": "expand", "annotation": ""}, "snippet": " new_data = expand(data, keys)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L40_C4", "label": "print()", "type": "expression", "loc": [40, 40], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L36_C0", "vector": [8, 1, 0.1487, 0.0037, 1, 0.95, 1.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(new_data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L42_C0", "label": "extract_keys", "type": "function", "loc": [42, 56], "level": 0, "parent": null, "vector": [2, 0, 0.1822, 0.0558, 0, 0.66, 0.4118, 330, 0, 2, 1, 0, 0, 0, 10], "semantic": {"name": "extract_keys", "arg_names": ["csv_data", "keys"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def extract_keys(csv_data, keys):\n format = csv_data[1]\n indices = []\n llists = []\n for k in keys:\n indices.append(np.where(np.array(format) == k)[0])\n llists.append([])\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L43_C4", "label": "format =", "type": "assigned_variable", "loc": [43, 43], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L42_C0", "vector": [14, 1, 0.1599, 0.0037, 1, 0.09, 0.0, 293, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "format", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " format = csv_data[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L44_C4", "label": "indices =", "type": "assigned_variable", "loc": [44, 44], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L42_C0", "vector": [14, 1, 0.1636, 0.0037, 1, 0.09, 0.2, 478, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "indices", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " indices = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L45_C4", "label": "llists =", "type": "assigned_variable", "loc": [45, 45], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L42_C0", "vector": [14, 1, 0.1673, 0.0037, 1, 0.09, 0.4, 615, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "llists", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " llists = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:For_L46_C4", "label": "for k", "type": "for", "loc": [46, 48], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L42_C0", "vector": [6, 1, 0.1747, 0.0112, 1, 0.09, 0.6, 954, 2, 0, 0, 0, 0, 0, 4], "semantic": {"name": "k", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for k in keys:\n indices.append(np.where(np.array(format) == k)[0])\n llists.append([])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L47_C8", "label": "append()", "type": "expression", "loc": [47, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:For_L46_C4", "vector": [8, 2, 0.1747, 0.0037, 2, 0.68, 0.0, 243, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " indices.append(np.where(np.array(format) == k)[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L48_C8", "label": "append()", "type": "expression", "loc": [48, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:For_L46_C4", "vector": [8, 2, 0.1784, 0.0037, 2, 0.68, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " llists.append([])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:For_L50_C4", "label": "for i", "type": "for", "loc": [50, 55], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L42_C0", "vector": [6, 1, 0.1952, 0.0223, 1, 0.09, 0.8, 826, 3, 0, 0, 0, 0, 0, 6], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(2, len(csv_data)):\n if len(csv_data[i]) == 0:\n break\n if len(csv_data[i][indices[0]]) > 0:\n for lidx, data_idx in enumerate(indices):\n llists[lidx].append(csv_data[i][data_idx])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:If_L51_C8", "label": "if", "type": "if", "loc": [51, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:For_L50_C4", "vector": [4, 2, 0.1914, 0.0074, 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 len(csv_data[i]) == 0:\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:If_L53_C8", "label": "if", "type": "if", "loc": [53, 55], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:For_L50_C4", "vector": [4, 2, 0.2007, 0.0112, 2, 0.56, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(csv_data[i][indices[0]]) > 0:\n for lidx, data_idx in enumerate(indices):\n llists[lidx].append(csv_data[i][data_idx])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:For_L54_C12", "label": "for lidx, data_idx", "type": "for", "loc": [54, 55], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:If_L53_C8", "vector": [6, 3, 0.2026, 0.0074, 3, 0.97, 0.0, 129, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "lidx, data_idx", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for lidx, data_idx in enumerate(indices):\n llists[lidx].append(csv_data[i][data_idx])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L55_C16", "label": "append()", "type": "expression", "loc": [55, 55], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:For_L54_C12", "vector": [8, 4, 0.2045, 0.0037, 4, 0.98, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " llists[lidx].append(csv_data[i][data_idx])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Return_L56_C4", "label": "return", "type": "return", "loc": [56, 56], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L42_C0", "vector": [13, 1, 0.2082, 0.0037, 1, 0.09, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return llists"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L58_C0", "label": "plot_radii", "type": "function", "loc": [58, 134], "level": 0, "parent": null, "vector": [2, 0, 0.3569, 0.2862, 0, 0.66, 0.4706, 459, 0, 2, 0, 0, 0, 0, 48], "semantic": {"name": "plot_radii", "arg_names": ["csv_data", "color"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def plot_radii(csv_data, color='#3366FF'):\n keys = ['radius', 'type', 'name', 'repetition']\n llists = expand(extract_keys(csv_data, keys), keys)\n rad_list = np.array([float(r) for r in llists[0]]) / 100.0\n types = llists[1]\n names = np.array(llists[2])\n all_types = set(types)\n print('Radii types', all_types)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L59_C4", "label": "keys =", "type": "assigned_variable", "loc": [59, 59], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L58_C0", "vector": [14, 1, 0.2193, 0.0037, 1, 0.99, 0.0, 204, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "keys", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " keys = ['radius', 'type', 'name', 'repetition']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L60_C4", "label": "llists = expand()", "type": "assigned_variable", "loc": [60, 60], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L58_C0", "vector": [14, 1, 0.223, 0.0037, 1, 0.99, 0.025, 615, 3, 2, 0, 0, 174, 10, 2], "semantic": {"name": "llists", "arg_names": [], "import_names": [], "rhs_call_name": "expand", "annotation": ""}, "snippet": " llists = expand(extract_keys(csv_data, keys), keys)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L61_C4", "label": "rad_list =", "type": "assigned_variable", "loc": [61, 61], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L58_C0", "vector": [14, 1, 0.2268, 0.0037, 1, 0.99, 0.05, 124, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "rad_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rad_list = np.array([float(r) for r in llists[0]]) / 100.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L62_C4", "label": "types =", "type": "assigned_variable", "loc": [62, 62], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L58_C0", "vector": [14, 1, 0.2305, 0.0037, 1, 0.99, 0.075, 209, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "types", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " types = llists[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L63_C4", "label": "names = array()", "type": "assigned_variable", "loc": [63, 63], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L58_C0", "vector": [14, 1, 0.2342, 0.0037, 1, 0.99, 0.1, 382, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "names", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " names = np.array(llists[2])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L64_C4", "label": "all_types = set()", "type": "assigned_variable", "loc": [64, 64], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L58_C0", "vector": [14, 1, 0.2379, 0.0037, 1, 0.99, 0.125, 581, 3, 1, 0, 0, 21, 10, 1], "semantic": {"name": "all_types", "arg_names": [], "import_names": [], "rhs_call_name": "set", "annotation": ""}, "snippet": " all_types = set(types)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L65_C4", "label": "print()", "type": "expression", "loc": [65, 65], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L58_C0", "vector": [8, 1, 0.2416, 0.0037, 1, 0.99, 0.15, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Radii types', all_types)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L67_C4", "label": "types_arr = array()", "type": "assigned_variable", "loc": [67, 67], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L58_C0", "vector": [14, 1, 0.2491, 0.0037, 1, 0.99, 0.175, 473, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "types_arr", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " types_arr = np.array(types)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L69_C4", "label": "cabinet_rad_list =", "type": "assigned_variable", "loc": [69, 69], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L58_C0", "vector": [14, 1, 0.2565, 0.0037, 1, 0.99, 0.2, 83, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "cabinet_rad_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cabinet_rad_list = rad_list[np.where(types_arr == 'C')[0]]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L70_C4", "label": "others_rad_list =", "type": "assigned_variable", "loc": [70, 70], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L58_C0", "vector": [14, 1, 0.2602, 0.0037, 1, 0.99, 0.225, 432, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "others_rad_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " others_rad_list = rad_list[np.where(types_arr != 'C')[0]]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L71_C4", "label": "other_names =", "type": "assigned_variable", "loc": [71, 71], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L58_C0", "vector": [14, 1, 0.2639, 0.0037, 1, 0.99, 0.25, 748, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "other_names", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " other_names = names[np.where(types_arr != 'C')[0]]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L72_C4", "label": "print()", "type": "expression", "loc": [72, 72], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L58_C0", "vector": [8, 1, 0.2677, 0.0037, 1, 0.99, 0.275, 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_99541:Expr_L73_C4", "label": "print()", "type": "expression", "loc": [73, 73], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L58_C0", "vector": [8, 1, 0.2714, 0.0037, 1, 0.99, 0.3, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('radii other names')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:For_L74_C4", "label": "for i, n", "type": "for", "loc": [74, 75], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L58_C0", "vector": [6, 1, 0.277, 0.0074, 1, 0.99, 0.325, 217, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "i, n", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i, n in enumerate(other_names):\n print(n, others_rad_list[i])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L75_C8", "label": "print()", "type": "expression", "loc": [75, 75], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:For_L74_C4", "vector": [8, 2, 0.2788, 0.0037, 2, 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(n, others_rad_list[i])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L76_C4", "label": "print()", "type": "expression", "loc": [76, 76], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L58_C0", "vector": [8, 1, 0.2825, 0.0037, 1, 0.99, 0.35, 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_99541:Assign_L78_C4", "label": "rad_lists =", "type": "assigned_variable", "loc": [78, 78], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L58_C0", "vector": [14, 1, 0.29, 0.0037, 1, 0.99, 0.375, 462, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "rad_lists", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rad_lists = [rad_list, cabinet_rad_list, others_rad_list]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L79_C4", "label": "titles =", "type": "assigned_variable", "loc": [79, 79], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L58_C0", "vector": [14, 1, 0.2937, 0.0037, 1, 0.99, 0.4, 829, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "titles", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " titles = ['Radii of Rotary Mechanisms', 'Radii of Cabinets', 'Radii of Other Mechanisms']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L80_C4", "label": "bin_width =", "type": "assigned_variable", "loc": [80, 80], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L58_C0", "vector": [14, 1, 0.2974, 0.0037, 1, 0.99, 0.425, 331, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "bin_width", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " bin_width = 0.05"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L81_C4", "label": "max_radius = max()", "type": "assigned_variable", "loc": [81, 81], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L58_C0", "vector": [14, 1, 0.3011, 0.0037, 1, 0.99, 0.45, 202, 3, 1, 0, 0, 442, 10, 1], "semantic": {"name": "max_radius", "arg_names": [], "import_names": [], "rhs_call_name": "max", "annotation": ""}, "snippet": " max_radius = np.max(rad_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L82_C4", "label": "print()", "type": "expression", "loc": [82, 82], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L58_C0", "vector": [8, 1, 0.3048, 0.0037, 1, 0.99, 0.475, 535, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('MIN RADIUS', np.min(rad_list))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L83_C4", "label": "print()", "type": "expression", "loc": [83, 83], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L58_C0", "vector": [8, 1, 0.3086, 0.0037, 1, 0.99, 0.5, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('MAX RADIUS', max_radius)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L85_C4", "label": "set_figure_size()", "type": "expression", "loc": [85, 85], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L58_C0", "vector": [8, 1, 0.316, 0.0037, 1, 0.99, 0.525, 342, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "set_figure_size", "arg_names": [], "import_names": [], "rhs_call_name": "set_figure_size", "annotation": ""}, "snippet": " mpu.set_figure_size(5.,5.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:For_L86_C4", "label": "for idx, radii", "type": "for", "loc": [86, 98], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L58_C0", "vector": [6, 1, 0.342, 0.0483, 1, 0.99, 0.55, 551, 3, 0, 0, 0, 0, 0, 9], "semantic": {"name": "idx, radii", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for idx, radii in enumerate(rad_lists):\n f = pb.figure()\n f.set_facecolor('w')\n bins = np.arange(0.-bin_width/2., max_radius+2*bin_width, bin_width)\n hist, bin_edges = np.histogram(radii, bins)\n h = mpu.plot_histogram(bin_edges[:-1]+bin_width/2., hist,\n width=0.8*bin_width, xlabel='Radius (meters)',\n ylabel='\\# of mechanisms',"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L87_C8", "label": "f = figure()", "type": "assigned_variable", "loc": [87, 87], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:For_L86_C4", "vector": [14, 2, 0.3234, 0.0037, 2, 0.25, 0.0, 899, 3, 0, 0, 0, 789, 10, 1], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "figure", "annotation": ""}, "snippet": " f = pb.figure()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L88_C8", "label": "set_facecolor()", "type": "expression", "loc": [88, 88], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:For_L86_C4", "vector": [8, 2, 0.3271, 0.0037, 2, 0.25, 0.1429, 308, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_facecolor", "arg_names": [], "import_names": [], "rhs_call_name": "set_facecolor", "annotation": ""}, "snippet": " f.set_facecolor('w')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L89_C8", "label": "bins = arange()", "type": "assigned_variable", "loc": [89, 89], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:For_L86_C4", "vector": [14, 2, 0.3309, 0.0037, 2, 0.25, 0.2857, 792, 3, 3, 0, 0, 489, 10, 1], "semantic": {"name": "bins", "arg_names": [], "import_names": [], "rhs_call_name": "arange", "annotation": ""}, "snippet": " bins = np.arange(0.-bin_width/2., max_radius+2*bin_width, bin_width)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L90_C8", "label": "hist, bin_edges = histogram()", "type": "assigned_variable", "loc": [90, 90], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:For_L86_C4", "vector": [14, 2, 0.3346, 0.0037, 2, 0.25, 0.4286, 217, 3, 2, 0, 0, 428, 10, 1], "semantic": {"name": "hist, bin_edges", "arg_names": [], "import_names": [], "rhs_call_name": "histogram", "annotation": ""}, "snippet": " hist, bin_edges = np.histogram(radii, bins)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L91_C8", "label": "h = plot_histogram()", "type": "assigned_variable", "loc": [91, 95], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:For_L86_C4", "vector": [14, 2, 0.3457, 0.0186, 2, 0.25, 0.5714, 686, 3, 8, 0, 0, 34, 10, 1], "semantic": {"name": "h", "arg_names": [], "import_names": [], "rhs_call_name": "plot_histogram", "annotation": ""}, "snippet": " h = mpu.plot_histogram(bin_edges[:-1]+bin_width/2., hist,\n width=0.8*bin_width, xlabel='Radius (meters)',\n ylabel='\\# of mechanisms',\n plot_title=titles[idx],\n color=color, label='All')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L96_C8", "label": "xlim()", "type": "expression", "loc": [96, 96], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:For_L86_C4", "vector": [8, 2, 0.3569, 0.0037, 2, 0.25, 0.7143, 907, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "xlim", "arg_names": [], "import_names": [], "rhs_call_name": "xlim", "annotation": ""}, "snippet": " pb.xlim(.1, 1.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L97_C8", "label": "ylim()", "type": "expression", "loc": [97, 97], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:For_L86_C4", "vector": [8, 2, 0.3606, 0.0037, 2, 0.25, 0.8571, 247, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "ylim", "arg_names": [], "import_names": [], "rhs_call_name": "ylim", "annotation": ""}, "snippet": " pb.ylim(0, 55)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L98_C8", "label": "legend()", "type": "expression", "loc": [98, 98], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:For_L86_C4", "vector": [8, 2, 0.3643, 0.0037, 2, 0.25, 1.0, 880, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "legend", "arg_names": [], "import_names": [], "rhs_call_name": "legend", "annotation": ""}, "snippet": " mpu.legend(display_mode = 'less_space', handlelength=1.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L101_C4", "label": "f = figure()", "type": "assigned_variable", "loc": [101, 101], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L58_C0", "vector": [14, 1, 0.3755, 0.0037, 1, 0.99, 0.575, 899, 3, 0, 0, 0, 789, 10, 1], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "figure", "annotation": ""}, "snippet": " f = pb.figure()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L102_C4", "label": "set_facecolor()", "type": "expression", "loc": [102, 102], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L58_C0", "vector": [8, 1, 0.3792, 0.0037, 1, 0.99, 0.6, 308, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_facecolor", "arg_names": [], "import_names": [], "rhs_call_name": "set_facecolor", "annotation": ""}, "snippet": " f.set_facecolor('w')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L103_C4", "label": "bins = arange()", "type": "assigned_variable", "loc": [103, 103], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L58_C0", "vector": [14, 1, 0.3829, 0.0037, 1, 0.99, 0.625, 792, 3, 3, 0, 0, 489, 10, 1], "semantic": {"name": "bins", "arg_names": [], "import_names": [], "rhs_call_name": "arange", "annotation": ""}, "snippet": " bins = np.arange(0.-bin_width/2., max_radius+2*bin_width, bin_width)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L104_C4", "label": "hist, bin_edges = histogram()", "type": "assigned_variable", "loc": [104, 104], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L58_C0", "vector": [14, 1, 0.3866, 0.0037, 1, 0.99, 0.65, 217, 3, 2, 0, 0, 428, 10, 1], "semantic": {"name": "hist, bin_edges", "arg_names": [], "import_names": [], "rhs_call_name": "histogram", "annotation": ""}, "snippet": " hist, bin_edges = np.histogram(rad_lists[0], bins)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L105_C4", "label": "h = plot_histogram()", "type": "assigned_variable", "loc": [105, 109], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L58_C0", "vector": [14, 1, 0.3978, 0.0186, 1, 0.99, 0.675, 686, 3, 8, 0, 0, 34, 10, 1], "semantic": {"name": "h", "arg_names": [], "import_names": [], "rhs_call_name": "plot_histogram", "annotation": ""}, "snippet": " h = mpu.plot_histogram(bin_edges[:-1]+bin_width/2., hist,\n width=0.8*bin_width, xlabel='Radius (meters)',\n ylabel='\\# of mechanisms',\n plot_title=titles[1],\n color='g', label='Cabinets')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L110_C4", "label": "hist, bin_edges = histogram()", "type": "assigned_variable", "loc": [110, 110], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L58_C0", "vector": [14, 1, 0.4089, 0.0037, 1, 0.99, 0.7, 217, 3, 2, 0, 0, 428, 10, 1], "semantic": {"name": "hist, bin_edges", "arg_names": [], "import_names": [], "rhs_call_name": "histogram", "annotation": ""}, "snippet": " hist, bin_edges = np.histogram(rad_lists[2], bins)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L111_C4", "label": "h = plot_histogram()", "type": "assigned_variable", "loc": [111, 115], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L58_C0", "vector": [14, 1, 0.4201, 0.0186, 1, 0.99, 0.725, 686, 3, 8, 0, 0, 34, 10, 1], "semantic": {"name": "h", "arg_names": [], "import_names": [], "rhs_call_name": "plot_histogram", "annotation": ""}, "snippet": " h = mpu.plot_histogram(bin_edges[:-1]+bin_width/2., hist,\n width=0.8*bin_width, xlabel='Radius (meters)',\n ylabel='\\# of mechanisms',\n plot_title='Cabinets and Other Mechanisms',\n color='y', label='Other')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L116_C4", "label": "xlim()", "type": "expression", "loc": [116, 116], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L58_C0", "vector": [8, 1, 0.4312, 0.0037, 1, 0.99, 0.75, 907, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "xlim", "arg_names": [], "import_names": [], "rhs_call_name": "xlim", "annotation": ""}, "snippet": " pb.xlim(.1, 1.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L117_C4", "label": "ylim()", "type": "expression", "loc": [117, 117], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L58_C0", "vector": [8, 1, 0.4349, 0.0037, 1, 0.99, 0.775, 247, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "ylim", "arg_names": [], "import_names": [], "rhs_call_name": "ylim", "annotation": ""}, "snippet": " pb.ylim(0, 55)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L118_C4", "label": "legend()", "type": "expression", "loc": [118, 118], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L58_C0", "vector": [8, 1, 0.4387, 0.0037, 1, 0.99, 0.8, 880, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "legend", "arg_names": [], "import_names": [], "rhs_call_name": "legend", "annotation": ""}, "snippet": " mpu.legend(display_mode = 'less_space', handlelength=1.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L120_C4", "label": "color_list =", "type": "assigned_variable", "loc": [120, 120], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L58_C0", "vector": [14, 1, 0.4461, 0.0037, 1, 0.99, 0.825, 570, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "color_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " color_list = ['g', 'b', 'r']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L121_C4", "label": "marker_list =", "type": "assigned_variable", "loc": [121, 121], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L58_C0", "vector": [14, 1, 0.4498, 0.0037, 1, 0.99, 0.85, 305, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "marker_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker_list = ['s', '^', 'v']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L122_C4", "label": "label_list =", "type": "assigned_variable", "loc": [122, 122], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L58_C0", "vector": [14, 1, 0.4535, 0.0037, 1, 0.99, 0.875, 887, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "label_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " label_list = ['All', 'Cabinets', 'Other']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L123_C4", "label": "scatter_size_list =", "type": "assigned_variable", "loc": [123, 123], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L58_C0", "vector": [14, 1, 0.4572, 0.0037, 1, 0.99, 0.9, 122, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "scatter_size_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " scatter_size_list = [8, 5, 5]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L124_C4", "label": "set_figure_size()", "type": "expression", "loc": [124, 124], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L58_C0", "vector": [8, 1, 0.461, 0.0037, 1, 0.99, 0.925, 342, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "set_figure_size", "arg_names": [], "import_names": [], "rhs_call_name": "set_figure_size", "annotation": ""}, "snippet": " mpu.set_figure_size(5.,5.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L125_C4", "label": "figure()", "type": "expression", "loc": [125, 125], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L58_C0", "vector": [8, 1, 0.4647, 0.0037, 1, 0.99, 0.95, 789, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "figure", "arg_names": [], "import_names": [], "rhs_call_name": "figure", "annotation": ""}, "snippet": " mpu.figure()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:For_L126_C4", "label": "for idx, radii", "type": "for", "loc": [126, 133], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L58_C0", "vector": [6, 1, 0.4814, 0.0297, 1, 0.99, 0.975, 551, 3, 0, 0, 0, 0, 0, 5], "semantic": {"name": "idx, radii", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for idx, radii in enumerate(rad_lists):\n bins = np.arange(0.-bin_width/2., max_radius+2*bin_width, bin_width)\n hist, bin_edges = np.histogram(radii, bins)\n bin_midpoints = np.arange(0., max_radius+bin_width, bin_width)\n mpu.plot_yx(hist, bin_midpoints, color = color_list[idx],\n alpha = 0.6, marker = marker_list[idx],\n scatter_size = scatter_size_list[idx], xlabel='Radius (meters)',\n ylabel='\\# of mechanisms', label = label_list[idx])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L127_C8", "label": "bins = arange()", "type": "assigned_variable", "loc": [127, 127], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:For_L126_C4", "vector": [14, 2, 0.4721, 0.0037, 2, 0.0, 0.0, 792, 3, 3, 0, 0, 489, 10, 1], "semantic": {"name": "bins", "arg_names": [], "import_names": [], "rhs_call_name": "arange", "annotation": ""}, "snippet": " bins = np.arange(0.-bin_width/2., max_radius+2*bin_width, bin_width)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L128_C8", "label": "hist, bin_edges = histogram()", "type": "assigned_variable", "loc": [128, 128], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:For_L126_C4", "vector": [14, 2, 0.4758, 0.0037, 2, 0.0, 0.3333, 217, 3, 2, 0, 0, 428, 10, 1], "semantic": {"name": "hist, bin_edges", "arg_names": [], "import_names": [], "rhs_call_name": "histogram", "annotation": ""}, "snippet": " hist, bin_edges = np.histogram(radii, bins)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L129_C8", "label": "bin_midpoints = arange()", "type": "assigned_variable", "loc": [129, 129], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:For_L126_C4", "vector": [14, 2, 0.4796, 0.0037, 2, 0.0, 0.6667, 530, 3, 3, 0, 0, 489, 10, 1], "semantic": {"name": "bin_midpoints", "arg_names": [], "import_names": [], "rhs_call_name": "arange", "annotation": ""}, "snippet": " bin_midpoints = np.arange(0., max_radius+bin_width, bin_width)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L130_C8", "label": "plot_yx()", "type": "expression", "loc": [130, 133], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:For_L126_C4", "vector": [8, 2, 0.4888, 0.0149, 2, 0.0, 1.0, 112, 3, 9, 0, 0, 0, 0, 1], "semantic": {"name": "plot_yx", "arg_names": [], "import_names": [], "rhs_call_name": "plot_yx", "annotation": ""}, "snippet": " mpu.plot_yx(hist, bin_midpoints, color = color_list[idx],\n alpha = 0.6, marker = marker_list[idx],\n scatter_size = scatter_size_list[idx], xlabel='Radius (meters)',\n ylabel='\\# of mechanisms', label = label_list[idx])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L134_C4", "label": "legend()", "type": "expression", "loc": [134, 134], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L58_C0", "vector": [8, 1, 0.4981, 0.0037, 1, 0.99, 1.0, 880, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "legend", "arg_names": [], "import_names": [], "rhs_call_name": "legend", "annotation": ""}, "snippet": " mpu.legend(display_mode = 'less_space')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L136_C0", "label": "plot_opening", "type": "function", "loc": [136, 162], "level": 0, "parent": null, "vector": [2, 0, 0.5539, 0.1004, 0, 0.66, 0.5294, 48, 0, 1, 0, 0, 0, 0, 17], "semantic": {"name": "plot_opening", "arg_names": ["csv_data"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def plot_opening(csv_data):\n keys = ['distance', 'type', 'repetition']\n llists = expand(extract_keys(csv_data, keys), keys)\n dists = np.array([float(f) for f in llists[0]])/100.\n types = llists[1]\n\n types_arr = np.array(types)\n drawer_dists = dists[np.where(types_arr == 'R')[0]]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L137_C4", "label": "keys =", "type": "assigned_variable", "loc": [137, 137], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L136_C0", "vector": [14, 1, 0.5093, 0.0037, 1, 0.4, 0.0, 204, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "keys", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " keys = ['distance', 'type', 'repetition']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L138_C4", "label": "llists = expand()", "type": "assigned_variable", "loc": [138, 138], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L136_C0", "vector": [14, 1, 0.513, 0.0037, 1, 0.4, 0.0769, 615, 3, 2, 0, 0, 174, 10, 2], "semantic": {"name": "llists", "arg_names": [], "import_names": [], "rhs_call_name": "expand", "annotation": ""}, "snippet": " llists = expand(extract_keys(csv_data, keys), keys)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L139_C4", "label": "dists =", "type": "assigned_variable", "loc": [139, 139], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L136_C0", "vector": [14, 1, 0.5167, 0.0037, 1, 0.4, 0.1538, 975, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "dists", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " dists = np.array([float(f) for f in llists[0]])/100."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L140_C4", "label": "types =", "type": "assigned_variable", "loc": [140, 140], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L136_C0", "vector": [14, 1, 0.5204, 0.0037, 1, 0.4, 0.2308, 209, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "types", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " types = llists[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L142_C4", "label": "types_arr = array()", "type": "assigned_variable", "loc": [142, 142], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L136_C0", "vector": [14, 1, 0.5279, 0.0037, 1, 0.4, 0.3077, 473, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "types_arr", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " types_arr = np.array(types)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L143_C4", "label": "drawer_dists =", "type": "assigned_variable", "loc": [143, 143], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L136_C0", "vector": [14, 1, 0.5316, 0.0037, 1, 0.4, 0.3846, 146, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "drawer_dists", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " drawer_dists = dists[np.where(types_arr == 'R')[0]]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L144_C4", "label": "other_dists =", "type": "assigned_variable", "loc": [144, 144], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L136_C0", "vector": [14, 1, 0.5353, 0.0037, 1, 0.4, 0.4615, 72, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "other_dists", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " other_dists = dists[np.where(types_arr != 'R')[0]]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L146_C4", "label": "print()", "type": "expression", "loc": [146, 146], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L136_C0", "vector": [8, 1, 0.5428, 0.0037, 1, 0.4, 0.5385, 535, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Opening distances types', set(types))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L147_C4", "label": "bin_width =", "type": "assigned_variable", "loc": [147, 147], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L136_C0", "vector": [14, 1, 0.5465, 0.0037, 1, 0.4, 0.6154, 331, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "bin_width", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " bin_width = 0.02"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L148_C4", "label": "bins = arange()", "type": "assigned_variable", "loc": [148, 148], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L136_C0", "vector": [14, 1, 0.5502, 0.0037, 1, 0.4, 0.6923, 792, 3, 3, 0, 0, 489, 10, 2], "semantic": {"name": "bins", "arg_names": [], "import_names": [], "rhs_call_name": "arange", "annotation": ""}, "snippet": " bins = np.arange(-bin_width/2., np.max(dists)+2*bin_width, bin_width)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L149_C4", "label": "dists_list =", "type": "assigned_variable", "loc": [149, 149], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L136_C0", "vector": [14, 1, 0.5539, 0.0037, 1, 0.4, 0.7692, 363, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "dists_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " dists_list = [dists]#, drawer_dists, other_dists]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L150_C4", "label": "titles =", "type": "assigned_variable", "loc": [150, 150], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L136_C0", "vector": [14, 1, 0.5576, 0.0037, 1, 0.4, 0.8462, 829, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "titles", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " titles = ['Opening Distances of Drawers']#, 'drawer', 'other']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L153_C4", "label": "set_figure_size()", "type": "expression", "loc": [153, 153], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L136_C0", "vector": [8, 1, 0.5688, 0.0037, 1, 0.4, 0.9231, 342, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "set_figure_size", "arg_names": [], "import_names": [], "rhs_call_name": "set_figure_size", "annotation": ""}, "snippet": " mpu.set_figure_size(5.,4.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:For_L154_C4", "label": "for idx, d", "type": "for", "loc": [154, 162], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L136_C0", "vector": [6, 1, 0.5874, 0.0335, 1, 0.4, 1.0, 779, 3, 0, 0, 0, 0, 0, 5], "semantic": {"name": "idx, d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for idx, d in enumerate(dists_list):\n f = pb.figure()\n f.set_facecolor('w')\n hist, bin_edges = np.histogram(d, bins)\n #import pdb; pdb.set_trace()\n mpu.plot_histogram(bin_edges[:-1]+bin_width/2., hist,\n width=0.8*bin_width, xlabel='Opening Distance (meters)',\n ylabel='\\# of Mechanisms',"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L155_C8", "label": "f = figure()", "type": "assigned_variable", "loc": [155, 155], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:For_L154_C4", "vector": [14, 2, 0.5762, 0.0037, 2, 0.69, 0.0, 899, 3, 0, 0, 0, 789, 10, 1], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "figure", "annotation": ""}, "snippet": " f = pb.figure()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L156_C8", "label": "set_facecolor()", "type": "expression", "loc": [156, 156], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:For_L154_C4", "vector": [8, 2, 0.5799, 0.0037, 2, 0.69, 0.3333, 308, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_facecolor", "arg_names": [], "import_names": [], "rhs_call_name": "set_facecolor", "annotation": ""}, "snippet": " f.set_facecolor('w')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L157_C8", "label": "hist, bin_edges = histogram()", "type": "assigned_variable", "loc": [157, 157], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:For_L154_C4", "vector": [14, 2, 0.5836, 0.0037, 2, 0.69, 0.6667, 217, 3, 2, 0, 0, 428, 10, 1], "semantic": {"name": "hist, bin_edges", "arg_names": [], "import_names": [], "rhs_call_name": "histogram", "annotation": ""}, "snippet": " hist, bin_edges = np.histogram(d, bins)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L159_C8", "label": "plot_histogram()", "type": "expression", "loc": [159, 162], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:For_L154_C4", "vector": [8, 2, 0.5967, 0.0149, 2, 0.69, 1.0, 34, 3, 7, 0, 0, 0, 0, 1], "semantic": {"name": "plot_histogram", "arg_names": [], "import_names": [], "rhs_call_name": "plot_histogram", "annotation": ""}, "snippet": " mpu.plot_histogram(bin_edges[:-1]+bin_width/2., hist,\n width=0.8*bin_width, xlabel='Opening Distance (meters)',\n ylabel='\\# of Mechanisms',\n plot_title=titles[idx], color='#3366FF')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L168_C0", "label": "handle_height_histogram", "type": "function", "loc": [168, 178], "level": 0, "parent": null, "vector": [2, 0, 0.6431, 0.0409, 0, 0.66, 0.5882, 456, 0, 6, 0, 0, 0, 0, 9], "semantic": {"name": "handle_height_histogram", "arg_names": ["mean_height_list", "plot_title", "color", "max_height", "bin_width", "ymax"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def handle_height_histogram(mean_height_list, plot_title='', color='#3366FF', max_height=2.5, bin_width=.1, ymax=35):\n bins = np.arange(0.-bin_width/2., max_height+2*bin_width, bin_width)\n hist, bin_edges = np.histogram(np.array(mean_height_list), bins)\n f = pb.figure()\n f.set_facecolor('w')\n f.subplots_adjust(bottom=.16, top=.86)\n mpu.plot_histogram(bin_edges[:-1]+bin_width/2., hist,\n width=bin_width*0.8, plot_title=plot_title,"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L169_C4", "label": "bins = arange()", "type": "assigned_variable", "loc": [169, 169], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L168_C0", "vector": [14, 1, 0.6283, 0.0037, 1, 0.69, 0.0, 792, 3, 3, 0, 0, 489, 10, 1], "semantic": {"name": "bins", "arg_names": [], "import_names": [], "rhs_call_name": "arange", "annotation": ""}, "snippet": " bins = np.arange(0.-bin_width/2., max_height+2*bin_width, bin_width)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L170_C4", "label": "hist, bin_edges = histogram()", "type": "assigned_variable", "loc": [170, 170], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L168_C0", "vector": [14, 1, 0.632, 0.0037, 1, 0.69, 0.1429, 217, 3, 2, 0, 0, 428, 10, 2], "semantic": {"name": "hist, bin_edges", "arg_names": [], "import_names": [], "rhs_call_name": "histogram", "annotation": ""}, "snippet": " hist, bin_edges = np.histogram(np.array(mean_height_list), bins)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L171_C4", "label": "f = figure()", "type": "assigned_variable", "loc": [171, 171], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L168_C0", "vector": [14, 1, 0.6357, 0.0037, 1, 0.69, 0.2857, 899, 3, 0, 0, 0, 789, 10, 1], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "figure", "annotation": ""}, "snippet": " f = pb.figure()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L172_C4", "label": "set_facecolor()", "type": "expression", "loc": [172, 172], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L168_C0", "vector": [8, 1, 0.6394, 0.0037, 1, 0.69, 0.4286, 308, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_facecolor", "arg_names": [], "import_names": [], "rhs_call_name": "set_facecolor", "annotation": ""}, "snippet": " f.set_facecolor('w')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L173_C4", "label": "subplots_adjust()", "type": "expression", "loc": [173, 173], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L168_C0", "vector": [8, 1, 0.6431, 0.0037, 1, 0.69, 0.5714, 907, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "subplots_adjust", "arg_names": [], "import_names": [], "rhs_call_name": "subplots_adjust", "annotation": ""}, "snippet": " f.subplots_adjust(bottom=.16, top=.86)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L174_C4", "label": "plot_histogram()", "type": "expression", "loc": [174, 176], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L168_C0", "vector": [8, 1, 0.6506, 0.0112, 1, 0.69, 0.7143, 34, 3, 7, 0, 0, 0, 0, 1], "semantic": {"name": "plot_histogram", "arg_names": [], "import_names": [], "rhs_call_name": "plot_histogram", "annotation": ""}, "snippet": " mpu.plot_histogram(bin_edges[:-1]+bin_width/2., hist,\n width=bin_width*0.8, plot_title=plot_title,\n xlabel='Height (meters)', ylabel='\\# of mechanisms', color=color)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L177_C4", "label": "xlim()", "type": "expression", "loc": [177, 177], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L168_C0", "vector": [8, 1, 0.658, 0.0037, 1, 0.69, 0.8571, 907, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "xlim", "arg_names": [], "import_names": [], "rhs_call_name": "xlim", "annotation": ""}, "snippet": " pb.xlim(0, max_height)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L178_C4", "label": "ylim()", "type": "expression", "loc": [178, 178], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L168_C0", "vector": [8, 1, 0.6617, 0.0037, 1, 0.69, 1.0, 247, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "ylim", "arg_names": [], "import_names": [], "rhs_call_name": "ylim", "annotation": ""}, "snippet": " pb.ylim(0, ymax)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L180_C0", "label": "handle_height_histogram_advait", "type": "function", "loc": [180, 194], "level": 0, "parent": null, "vector": [2, 0, 0.6952, 0.0558, 0, 0.66, 0.6471, 453, 0, 8, 1, 0, 0, 0, 7], "semantic": {"name": "handle_height_histogram_advait", "arg_names": ["mean_height_list", "plot_title", "color", "max_height", "bin_width", "ymax", "new_figure", "label"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def handle_height_histogram_advait(mean_height_list, plot_title='',\n color='#3366FF', max_height=2.2, bin_width=.1, ymax=35,\n new_figure = True, label = '__no_legend__'):\n if new_figure:\n mpu.set_figure_size(5.,4.)\n# f = mpu.figure()\n# f.subplots_adjust(bottom=.25, top=.99, right=0.99, left=0.12)\n bins = np.arange(0.-bin_width/2., max_height+2*bin_width, bin_width)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:If_L183_C4", "label": "if", "type": "if", "loc": [183, 184], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L180_C0", "vector": [4, 1, 0.6822, 0.0074, 1, 0.51, 0.0, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if new_figure:\n mpu.set_figure_size(5.,4.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L184_C8", "label": "set_figure_size()", "type": "expression", "loc": [184, 184], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:If_L183_C4", "vector": [8, 2, 0.684, 0.0037, 2, 0.11, 0.0, 342, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "set_figure_size", "arg_names": [], "import_names": [], "rhs_call_name": "set_figure_size", "annotation": ""}, "snippet": " mpu.set_figure_size(5.,4.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L187_C4", "label": "bins = arange()", "type": "assigned_variable", "loc": [187, 187], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L180_C0", "vector": [14, 1, 0.6952, 0.0037, 1, 0.51, 0.1667, 792, 3, 3, 0, 0, 489, 10, 1], "semantic": {"name": "bins", "arg_names": [], "import_names": [], "rhs_call_name": "arange", "annotation": ""}, "snippet": " bins = np.arange(0.-bin_width/2., max_height+2*bin_width, bin_width)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L188_C4", "label": "hist, bin_edges = histogram()", "type": "assigned_variable", "loc": [188, 188], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L180_C0", "vector": [14, 1, 0.6989, 0.0037, 1, 0.51, 0.3333, 217, 3, 2, 0, 0, 428, 10, 2], "semantic": {"name": "hist, bin_edges", "arg_names": [], "import_names": [], "rhs_call_name": "histogram", "annotation": ""}, "snippet": " hist, bin_edges = np.histogram(np.array(mean_height_list), bins)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L189_C4", "label": "h = plot_histogram()", "type": "assigned_variable", "loc": [189, 191], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L180_C0", "vector": [14, 1, 0.7063, 0.0112, 1, 0.51, 0.5, 686, 3, 8, 0, 0, 34, 10, 1], "semantic": {"name": "h", "arg_names": [], "import_names": [], "rhs_call_name": "plot_histogram", "annotation": ""}, "snippet": " h = mpu.plot_histogram(bin_edges[:-1]+bin_width/2., hist,\n width=bin_width*0.8, plot_title=plot_title,\n xlabel='Height (meters)', ylabel='\\# of mechanisms', color=color, label = label)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L192_C4", "label": "xlim()", "type": "expression", "loc": [192, 192], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L180_C0", "vector": [8, 1, 0.7138, 0.0037, 1, 0.51, 0.6667, 907, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "xlim", "arg_names": [], "import_names": [], "rhs_call_name": "xlim", "annotation": ""}, "snippet": " pb.xlim(0, max_height)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L193_C4", "label": "ylim()", "type": "expression", "loc": [193, 193], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L180_C0", "vector": [8, 1, 0.7175, 0.0037, 1, 0.51, 0.8333, 247, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "ylim", "arg_names": [], "import_names": [], "rhs_call_name": "ylim", "annotation": ""}, "snippet": " pb.ylim(0, ymax)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Return_L194_C4", "label": "return", "type": "return", "loc": [194, 194], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L180_C0", "vector": [13, 1, 0.7212, 0.0037, 1, 0.51, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return h"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L196_C0", "label": "plot_rotary_heights", "type": "function", "loc": [196, 227], "level": 0, "parent": null, "vector": [2, 0, 0.7862, 0.119, 0, 0.66, 0.7059, 441, 0, 1, 0, 0, 0, 0, 23], "semantic": {"name": "plot_rotary_heights", "arg_names": ["csv_data"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def plot_rotary_heights(csv_data):\n keys = ['radius', 'bottom', 'top', 'type', 'name', 'repetition']\n llists = expand(extract_keys(csv_data, keys), keys)\n types = llists[3]\n names = np.array(llists[4])\n print('Handle bottom edge types', set(types))\n bottom_pts = np.array([float(f) for f in llists[1]])/100.\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L197_C4", "label": "keys =", "type": "assigned_variable", "loc": [197, 197], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L196_C0", "vector": [14, 1, 0.7323, 0.0037, 1, 0.63, 0.0, 204, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "keys", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " keys = ['radius', 'bottom', 'top', 'type', 'name', 'repetition']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L198_C4", "label": "llists = expand()", "type": "assigned_variable", "loc": [198, 198], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L196_C0", "vector": [14, 1, 0.7361, 0.0037, 1, 0.63, 0.0476, 615, 3, 2, 0, 0, 174, 10, 2], "semantic": {"name": "llists", "arg_names": [], "import_names": [], "rhs_call_name": "expand", "annotation": ""}, "snippet": " llists = expand(extract_keys(csv_data, keys), keys)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L199_C4", "label": "types =", "type": "assigned_variable", "loc": [199, 199], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L196_C0", "vector": [14, 1, 0.7398, 0.0037, 1, 0.63, 0.0952, 209, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "types", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " types = llists[3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L200_C4", "label": "names = array()", "type": "assigned_variable", "loc": [200, 200], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L196_C0", "vector": [14, 1, 0.7435, 0.0037, 1, 0.63, 0.1429, 382, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "names", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " names = np.array(llists[4])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L201_C4", "label": "print()", "type": "expression", "loc": [201, 201], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L196_C0", "vector": [8, 1, 0.7472, 0.0037, 1, 0.63, 0.1905, 535, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Handle bottom edge types', set(types))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L202_C4", "label": "bottom_pts =", "type": "assigned_variable", "loc": [202, 202], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L196_C0", "vector": [14, 1, 0.7509, 0.0037, 1, 0.63, 0.2381, 986, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "bottom_pts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " bottom_pts = np.array([float(f) for f in llists[1]])/100."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L204_C4", "label": "top_pts =", "type": "assigned_variable", "loc": [204, 204], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L196_C0", "vector": [14, 1, 0.7584, 0.0037, 1, 0.63, 0.2857, 475, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "top_pts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " top_pts = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:For_L205_C4", "label": "for i, f", "type": "for", "loc": [205, 208], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L196_C0", "vector": [6, 1, 0.7677, 0.0149, 1, 0.63, 0.3333, 291, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "i, f", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i,f in enumerate(llists[2]):\n if f == '':\n f = llists[1][i]\n top_pts.append(float(f)/100.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:If_L206_C8", "label": "if", "type": "if", "loc": [206, 207], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:For_L205_C4", "vector": [4, 2, 0.7677, 0.0074, 2, 0.07, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if f == '':\n f = llists[1][i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L207_C12", "label": "f =", "type": "assigned_variable", "loc": [207, 207], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:If_L206_C8", "vector": [14, 3, 0.7695, 0.0037, 3, 0.77, 0.0, 899, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " f = llists[1][i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L208_C8", "label": "append()", "type": "expression", "loc": [208, 208], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:For_L205_C4", "vector": [8, 2, 0.7732, 0.0037, 2, 0.07, 1.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " top_pts.append(float(f)/100.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L209_C4", "label": "top_pts = array()", "type": "assigned_variable", "loc": [209, 209], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L196_C0", "vector": [14, 1, 0.777, 0.0037, 1, 0.63, 0.381, 475, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "top_pts", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " top_pts = np.array(top_pts)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L210_C4", "label": "print()", "type": "expression", "loc": [210, 210], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L196_C0", "vector": [8, 1, 0.7807, 0.0037, 1, 0.63, 0.4286, 535, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('total number of doors:', len(top_pts))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L211_C4", "label": "mid_pts =", "type": "assigned_variable", "loc": [211, 211], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L196_C0", "vector": [14, 1, 0.7844, 0.0037, 1, 0.63, 0.4762, 217, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "mid_pts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mid_pts = (bottom_pts + top_pts)/2."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L213_C4", "label": "types_arr = array()", "type": "assigned_variable", "loc": [213, 213], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L196_C0", "vector": [14, 1, 0.7918, 0.0037, 1, 0.63, 0.5238, 473, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "types_arr", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " types_arr = np.array(types)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L214_C4", "label": "cabinet_mid_pts =", "type": "assigned_variable", "loc": [214, 214], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L196_C0", "vector": [14, 1, 0.7955, 0.0037, 1, 0.63, 0.5714, 130, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "cabinet_mid_pts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cabinet_mid_pts = mid_pts[np.where(types_arr == 'C')[0]]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L215_C4", "label": "other_mid_pts =", "type": "assigned_variable", "loc": [215, 215], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L196_C0", "vector": [14, 1, 0.7993, 0.0037, 1, 0.63, 0.619, 398, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "other_mid_pts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " other_mid_pts = mid_pts[np.where(types_arr != 'C')[0]]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L216_C4", "label": "other_names =", "type": "assigned_variable", "loc": [216, 216], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L196_C0", "vector": [14, 1, 0.803, 0.0037, 1, 0.63, 0.6667, 748, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "other_names", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " other_names = names[np.where(types_arr != 'C')[0]]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L218_C4", "label": "print()", "type": "expression", "loc": [218, 218], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L196_C0", "vector": [8, 1, 0.8104, 0.0037, 1, 0.63, 0.7143, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('other names', other_names)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L222_C4", "label": "ymax =", "type": "assigned_variable", "loc": [222, 222], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L196_C0", "vector": [14, 1, 0.8253, 0.0037, 1, 0.63, 0.7619, 111, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "ymax", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ymax = 85"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L223_C4", "label": "handle_height_histogram_advait()", "type": "expression", "loc": [223, 223], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L196_C0", "vector": [8, 1, 0.829, 0.0037, 1, 0.63, 0.8095, 453, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "handle_height_histogram_advait", "arg_names": [], "import_names": [], "rhs_call_name": "handle_height_histogram_advait", "annotation": ""}, "snippet": " handle_height_histogram_advait(mid_pts, plot_title='Handle Heights', ymax=ymax, label = 'All')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L224_C4", "label": "legend()", "type": "expression", "loc": [224, 224], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L196_C0", "vector": [8, 1, 0.8327, 0.0037, 1, 0.63, 0.8571, 880, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "legend", "arg_names": [], "import_names": [], "rhs_call_name": "legend", "annotation": ""}, "snippet": " mpu.legend(display_mode = 'less_space', handlelength=1.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L225_C4", "label": "handle_height_histogram_advait()", "type": "expression", "loc": [225, 225], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L196_C0", "vector": [8, 1, 0.8364, 0.0037, 1, 0.63, 0.9048, 453, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "handle_height_histogram_advait", "arg_names": [], "import_names": [], "rhs_call_name": "handle_height_histogram_advait", "annotation": ""}, "snippet": " handle_height_histogram_advait(mid_pts, plot_title='Handle Heights', ymax=ymax, color = 'g', label = 'Cabinets')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L226_C4", "label": "handle_height_histogram_advait()", "type": "expression", "loc": [226, 226], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L196_C0", "vector": [8, 1, 0.8401, 0.0037, 1, 0.63, 0.9524, 453, 3, 6, 0, 0, 0, 0, 1], "semantic": {"name": "handle_height_histogram_advait", "arg_names": [], "import_names": [], "rhs_call_name": "handle_height_histogram_advait", "annotation": ""}, "snippet": " handle_height_histogram_advait(other_mid_pts, plot_title='Handle Heights', ymax=ymax, color = 'y', new_figure = False, label = 'Other')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L227_C4", "label": "legend()", "type": "expression", "loc": [227, 227], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L196_C0", "vector": [8, 1, 0.8439, 0.0037, 1, 0.63, 1.0, 880, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "legend", "arg_names": [], "import_names": [], "rhs_call_name": "legend", "annotation": ""}, "snippet": " mpu.legend(display_mode = 'less_space', handlelength=1.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L229_C0", "label": "plot_prismatic_heights", "type": "function", "loc": [229, 259], "level": 0, "parent": null, "vector": [2, 0, 0.9071, 0.1152, 0, 0.66, 0.7647, 301, 0, 1, 0, 0, 0, 0, 20], "semantic": {"name": "plot_prismatic_heights", "arg_names": ["csv_data"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def plot_prismatic_heights(csv_data):\n keys = ['distance', 'bottom', 'top', 'type', 'name', 'home', 'repetition']\n llists = expand(extract_keys(csv_data, keys), keys)\n types = llists[3]\n names = np.array(llists[4])\n home = np.array(llists[5])\n print('Handle bottom edge types', set(types))\n bottom_pts = np.array([float(f) for f in llists[1]])/100."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L230_C4", "label": "keys =", "type": "assigned_variable", "loc": [230, 230], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L229_C0", "vector": [14, 1, 0.855, 0.0037, 1, 0.64, 0.0, 204, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "keys", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " keys = ['distance', 'bottom', 'top', 'type', 'name', 'home', 'repetition']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L231_C4", "label": "llists = expand()", "type": "assigned_variable", "loc": [231, 231], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L229_C0", "vector": [14, 1, 0.8587, 0.0037, 1, 0.64, 0.05, 615, 3, 2, 0, 0, 174, 10, 2], "semantic": {"name": "llists", "arg_names": [], "import_names": [], "rhs_call_name": "expand", "annotation": ""}, "snippet": " llists = expand(extract_keys(csv_data, keys), keys)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L232_C4", "label": "types =", "type": "assigned_variable", "loc": [232, 232], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L229_C0", "vector": [14, 1, 0.8625, 0.0037, 1, 0.64, 0.1, 209, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "types", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " types = llists[3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L233_C4", "label": "names = array()", "type": "assigned_variable", "loc": [233, 233], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L229_C0", "vector": [14, 1, 0.8662, 0.0037, 1, 0.64, 0.15, 382, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "names", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " names = np.array(llists[4])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L234_C4", "label": "home = array()", "type": "assigned_variable", "loc": [234, 234], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L229_C0", "vector": [14, 1, 0.8699, 0.0037, 1, 0.64, 0.2, 475, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "home", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " home = np.array(llists[5])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L235_C4", "label": "print()", "type": "expression", "loc": [235, 235], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L229_C0", "vector": [8, 1, 0.8736, 0.0037, 1, 0.64, 0.25, 535, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Handle bottom edge types', set(types))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L236_C4", "label": "bottom_pts =", "type": "assigned_variable", "loc": [236, 236], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L229_C0", "vector": [14, 1, 0.8773, 0.0037, 1, 0.64, 0.3, 986, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "bottom_pts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " bottom_pts = np.array([float(f) for f in llists[1]])/100."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L237_C4", "label": "top_pts =", "type": "assigned_variable", "loc": [237, 237], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L229_C0", "vector": [14, 1, 0.881, 0.0037, 1, 0.64, 0.35, 475, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "top_pts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " top_pts = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:For_L238_C4", "label": "for i, f", "type": "for", "loc": [238, 241], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L229_C0", "vector": [6, 1, 0.8903, 0.0149, 1, 0.64, 0.4, 291, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "i, f", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i,f in enumerate(llists[2]):\n if f == '':\n f = llists[1][i]\n top_pts.append(float(f)/100.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:If_L239_C8", "label": "if", "type": "if", "loc": [239, 240], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:For_L238_C4", "vector": [4, 2, 0.8903, 0.0074, 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 f == '':\n f = llists[1][i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L240_C12", "label": "f =", "type": "assigned_variable", "loc": [240, 240], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:If_L239_C8", "vector": [14, 3, 0.8922, 0.0037, 3, 0.89, 0.0, 899, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " f = llists[1][i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L241_C8", "label": "append()", "type": "expression", "loc": [241, 241], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:For_L238_C4", "vector": [8, 2, 0.8959, 0.0037, 2, 0.92, 1.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " top_pts.append(float(f)/100.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L242_C4", "label": "top_pts = array()", "type": "assigned_variable", "loc": [242, 242], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L229_C0", "vector": [14, 1, 0.8996, 0.0037, 1, 0.64, 0.45, 475, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "top_pts", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " top_pts = np.array(top_pts)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L243_C4", "label": "mid_pts =", "type": "assigned_variable", "loc": [243, 243], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L229_C0", "vector": [14, 1, 0.9033, 0.0037, 1, 0.64, 0.5, 217, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "mid_pts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mid_pts = (bottom_pts + top_pts)/2."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L245_C4", "label": "types_arr = array()", "type": "assigned_variable", "loc": [245, 245], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L229_C0", "vector": [14, 1, 0.9108, 0.0037, 1, 0.64, 0.55, 473, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "types_arr", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " types_arr = np.array(types)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L246_C4", "label": "max_height = max()", "type": "assigned_variable", "loc": [246, 246], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L229_C0", "vector": [14, 1, 0.9145, 0.0037, 1, 0.64, 0.6, 648, 3, 1, 0, 0, 442, 10, 1], "semantic": {"name": "max_height", "arg_names": [], "import_names": [], "rhs_call_name": "max", "annotation": ""}, "snippet": " max_height = np.max(bottom_pts)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L248_C4", "label": "sort_order = argsort()", "type": "assigned_variable", "loc": [248, 248], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L229_C0", "vector": [14, 1, 0.9219, 0.0037, 1, 0.64, 0.65, 116, 3, 1, 0, 0, 237, 10, 1], "semantic": {"name": "sort_order", "arg_names": [], "import_names": [], "rhs_call_name": "argsort", "annotation": ""}, "snippet": " sort_order = np.argsort(bottom_pts)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L249_C4", "label": "names =", "type": "assigned_variable", "loc": [249, 249], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L229_C0", "vector": [14, 1, 0.9257, 0.0037, 1, 0.64, 0.7, 382, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "names", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " names = names[sort_order]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L250_C4", "label": "bottom_pts =", "type": "assigned_variable", "loc": [250, 250], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L229_C0", "vector": [14, 1, 0.9294, 0.0037, 1, 0.64, 0.75, 986, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "bottom_pts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " bottom_pts = bottom_pts[sort_order]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L251_C4", "label": "home =", "type": "assigned_variable", "loc": [251, 251], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L229_C0", "vector": [14, 1, 0.9331, 0.0037, 1, 0.64, 0.8, 475, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "home", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " home = home[sort_order]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:For_L252_C4", "label": "for i, name", "type": "for", "loc": [252, 253], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L229_C0", "vector": [6, 1, 0.9387, 0.0074, 1, 0.64, 0.85, 14, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "i, name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i, name in enumerate(names):\n print(home[i], name, bottom_pts[i])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L253_C8", "label": "print()", "type": "expression", "loc": [253, 253], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:For_L252_C4", "vector": [8, 2, 0.9405, 0.0037, 2, 0.06, 0.0, 535, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(home[i], name, bottom_pts[i])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L256_C4", "label": "handle_height_histogram()", "type": "expression", "loc": [256, 256], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L229_C0", "vector": [8, 1, 0.9517, 0.0037, 1, 0.64, 0.9, 456, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "handle_height_histogram", "arg_names": [], "import_names": [], "rhs_call_name": "handle_height_histogram", "annotation": ""}, "snippet": " handle_height_histogram(bottom_pts, plot_title='Heights of Handle Lower Edge (Drawers)', max_height = max_height)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L258_C4", "label": "max_height = max()", "type": "assigned_variable", "loc": [258, 258], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L229_C0", "vector": [14, 1, 0.9591, 0.0037, 1, 0.64, 0.95, 648, 3, 1, 0, 0, 442, 10, 1], "semantic": {"name": "max_height", "arg_names": [], "import_names": [], "rhs_call_name": "max", "annotation": ""}, "snippet": " max_height = np.max(mid_pts)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L259_C4", "label": "handle_height_histogram_advait()", "type": "expression", "loc": [259, 259], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L229_C0", "vector": [8, 1, 0.9628, 0.0037, 1, 0.64, 1.0, 453, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "handle_height_histogram_advait", "arg_names": [], "import_names": [], "rhs_call_name": "handle_height_histogram_advait", "annotation": ""}, "snippet": " handle_height_histogram_advait(mid_pts, plot_title='Handle Heights', max_height = max_height+0.1, ymax=43)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L262_C0", "label": "csv_data = load_data()", "type": "assigned_variable", "loc": [262, 262], "level": 0, "parent": null, "vector": [14, 0, 0.974, 0.0037, 0, 0.66, 0.8235, 809, 3, 0, 0, 0, 477, 10, 1], "semantic": {"name": "csv_data", "arg_names": [], "import_names": [], "rhs_call_name": "load_data", "annotation": ""}, "snippet": "csv_data = load_data()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L263_C0", "label": "plot_prismatic_heights()", "type": "expression", "loc": [263, 263], "level": 0, "parent": null, "vector": [8, 0, 0.9777, 0.0037, 0, 0.66, 0.8824, 301, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "plot_prismatic_heights", "arg_names": [], "import_names": [], "rhs_call_name": "plot_prismatic_heights", "annotation": ""}, "snippet": "plot_prismatic_heights(csv_data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L265_C0", "label": "plot_rotary_heights()", "type": "expression", "loc": [265, 265], "level": 0, "parent": null, "vector": [8, 0, 0.9851, 0.0037, 0, 0.66, 0.9412, 441, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "plot_rotary_heights", "arg_names": [], "import_names": [], "rhs_call_name": "plot_rotary_heights", "annotation": ""}, "snippet": "plot_rotary_heights(csv_data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L267_C0", "label": "show()", "type": "expression", "loc": [267, 267], "level": 0, "parent": null, "vector": [8, 0, 0.9926, 0.0037, 0, 0.66, 1.0, 497, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "show", "arg_names": [], "import_names": [], "rhs_call_name": "show", "annotation": ""}, "snippet": "pb.show()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:For_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:For_L9_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L10_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Return_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:For_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:For_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L22_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:For_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:For_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:If_L25_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:If_L25_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:For_L26_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:For_L26_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:For_L27_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:For_L27_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L28_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:For_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L33_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Return_L34_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L36_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L37_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L36_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L38_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L36_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L39_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L36_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L40_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L42_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L43_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L42_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L44_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L42_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L45_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L42_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:For_L46_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:For_L46_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L47_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:For_L46_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L48_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L42_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:For_L50_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:For_L50_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:If_L51_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:For_L50_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:If_L53_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:If_L53_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:For_L54_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:For_L54_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L55_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L42_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Return_L56_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L58_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L59_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L58_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L60_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L58_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L61_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L58_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L62_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L58_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L63_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L58_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L64_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L58_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L65_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L58_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L67_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L58_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L69_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L58_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L70_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L58_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L71_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L58_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L72_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L58_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L73_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L58_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:For_L74_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:For_L74_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L75_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L58_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L76_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L58_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L78_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L58_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L79_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L58_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L80_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L58_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L81_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L58_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L82_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L58_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L83_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L58_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L85_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L58_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:For_L86_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:For_L86_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L87_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:For_L86_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L88_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:For_L86_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L89_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:For_L86_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L90_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:For_L86_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L91_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:For_L86_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L96_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:For_L86_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L97_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:For_L86_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L98_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L58_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L101_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L58_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L102_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L58_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L103_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L58_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L104_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L58_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L105_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L58_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L110_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L58_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L111_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L58_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L116_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L58_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L117_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L58_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L118_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L58_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L120_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L58_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L121_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L58_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L122_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L58_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L123_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L58_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L124_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L58_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L125_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L58_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:For_L126_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:For_L126_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L127_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:For_L126_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L128_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:For_L126_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L129_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:For_L126_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L130_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L58_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L134_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L136_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L137_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L136_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L138_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L136_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L139_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L136_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L140_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L136_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L142_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L136_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L143_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L136_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L144_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L136_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L146_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L136_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L147_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L136_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L148_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L136_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L149_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L136_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L150_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L136_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L153_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L136_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:For_L154_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:For_L154_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L155_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:For_L154_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L156_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:For_L154_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L157_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:For_L154_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L159_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L168_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L169_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L168_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L170_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L168_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L171_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L168_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L172_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L168_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L173_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L168_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L174_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L168_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L177_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L168_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L178_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L180_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:If_L183_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:If_L183_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L184_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L180_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L187_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L180_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L188_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L180_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L189_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L180_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L192_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L180_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L193_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L180_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Return_L194_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L196_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L197_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L196_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L198_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L196_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L199_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L196_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L200_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L196_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L201_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L196_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L202_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L196_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L204_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L196_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:For_L205_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:For_L205_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:If_L206_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:If_L206_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L207_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:For_L205_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L208_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L196_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L209_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L196_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L210_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L196_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L211_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L196_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L213_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L196_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L214_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L196_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L215_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L196_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L216_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L196_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L218_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L196_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L222_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L196_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L223_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L196_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L224_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L196_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L225_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L196_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L226_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L196_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L227_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L229_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L230_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L229_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L231_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L229_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L232_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L229_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L233_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L229_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L234_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L229_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L235_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L229_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L236_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L229_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L237_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L229_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:For_L238_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:For_L238_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:If_L239_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:If_L239_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L240_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:For_L238_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L241_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L229_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L242_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L229_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L243_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L229_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L245_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L229_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L246_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L229_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L248_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L229_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L249_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L229_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L250_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L229_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L251_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L229_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:For_L252_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:For_L252_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L253_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L229_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L256_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L229_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Assign_L258_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99541:FunctionDef_L229_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99541:Expr_L259_C4"}]
#!/usr/bin/python import roslib; roslib.load_manifest('modeling_forces') import rospy import force_torque.FTClient as ftc import hrl_lib.util as ut from std_msgs.msg import Empty import time import numpy as np import glob ## # make an appropriate plot. # @param d - dictionary saved in the pkl def plot_ft(d): ft_list = d['ft_list'] time_list = d['time_list'] ft_mat = np.matrix(ft_list).T # 6xN np matrix force_mat = ft_mat[0:3, :] tarray = np.array(time_list) print 'average rate', 1. / np.mean(tarray[1:] - tarray[:-1]) time_list = (tarray - tarray[0]).tolist() print len(time_list) force_mag_l = ut.norm(force_mat).A1.tolist() #for i,f in enumerate(force_mag_l): # if f > 15: # break #force_mag_l = force_mag_l[i:] #time_list = time_list[i:] mpu.plot_yx(force_mag_l, time_list, axis=None, label='Force Magnitude', xlabel='Time(seconds)', ylabel='Force Magnitude (N)', color = mpu.random_color()) def got_trigger_cb(data, d): d['flag'] = True if __name__ == '__main__': import optparse p = optparse.OptionParser() p.add_option('-l', '--log', action='store_true', dest='log', help='log FT data') p.add_option('-p', '--plot', action='store_true', dest='plot', help='plot FT data') p.add_option('-r', '--ros', action='store_true', dest='ros', help='start and stop logging messages over ROS.') p.add_option('-a', '--all', action='store_true', dest='all', help='plot all the pkls in a single plot') p.add_option('-f', '--fname', action='store', default='', type='string', dest='fname', help='pkl with logged data') opt, args = p.parse_args() if opt.log: client = ftc.FTClient('/force_torque_ft2') l = [] time_list = [] if opt.ros: topic_name_cb = '/ftlogger/trigger' got_trigger_dict = {'flag': False} rospy.Subscriber(topic_name_cb, Empty, got_trigger_cb, got_trigger_dict) while got_trigger_dict['flag'] == False: time.sleep(0.05) got_trigger_dict['flag'] = False while not rospy.is_shutdown(): ft, t_msg = client.read(fresh=True, with_time_stamp=True) if ft != None: l.append(ft.A1.tolist()) time_list.append(t_msg) if got_trigger_dict['flag'] == True: break time.sleep(1/1000.0) else: print 'Sleeping for 5 seconds.' time.sleep(5.) print '>>>>>>>>>>>>>>>>>>>>>>>>>>>>' print 'BEGIN' print '>>>>>>>>>>>>>>>>>>>>>>>>>>>>' client.bias() t_start = time.time() t_now = time.time() logging_time = 5. while (t_now - t_start) < logging_time: ft, t_msg = client.read(fresh=True, with_time_stamp=True) t_now = time.time() if ft != None: l.append(ft.A1.tolist()) time_list.append(t_msg) time.sleep(1/1000.0) print 'saving the pickle' d = {} d['ft_list'] = l d['time_list'] = time_list fname = 'ft_log_'+ut.formatted_time()+'.pkl' ut.save_pickle(d, fname) if opt.plot: import matplotlib_util.util as mpu if opt.fname == '' and (not opt.all): raise RuntimeError('need a pkl name (-f or --fname) or --all') if opt.all: fname_list = glob.glob('ft_log*.pkl') else: fname_list = [opt.fname] for fname in fname_list: d = ut.load_pickle(fname) plot_ft(d) mpu.legend() mpu.show()
ajibawa-2023/Python-Code-Large/train/row_99542
82
129
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99542:Import_L3_C0", "label": "roslib import roslib", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0233, 0.0078, 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('modeling_forces')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99542:Expr_L3_C15", "label": "load_manifest()", "type": "expression", "loc": [3, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0233, 0.0078, 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('modeling_forces')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99542:Import_L4_C0", "label": "rospy import rospy", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.031, 0.0078, 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_99542:Import_L5_C0", "label": "force_torque.FTClient import ftc", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0388, 0.0078, 0, 0.66, 0.2727, 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_99542:Import_L6_C0", "label": "hrl_lib.util import ut", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0465, 0.0078, 0, 0.66, 0.3636, 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_99542:ImportFrom_L8_C0", "label": "from std_msgs.msg import Empty", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.062, 0.0078, 0, 0.66, 0.4545, 366, 0, 1, 0, 0, 366, 0, 0], "semantic": {"name": "std_msgs.msg", "arg_names": [], "import_names": ["Empty"], "rhs_call_name": "", "annotation": ""}, "snippet": "from std_msgs.msg import Empty"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99542:Import_L10_C0", "label": "time import time", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.0775, 0.0078, 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_99542:Import_L11_C0", "label": "numpy import np", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.0853, 0.0078, 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_99542:Import_L12_C0", "label": "glob import glob", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.093, 0.0078, 0, 0.66, 0.7273, 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_99542:FunctionDef_L18_C0", "label": "plot_ft", "type": "function", "loc": [18, 38], "level": 0, "parent": null, "vector": [2, 0, 0.2171, 0.1628, 0, 0.66, 0.8182, 194, 0, 1, 0, 0, 0, 0, 11], "semantic": {"name": "plot_ft", "arg_names": ["d"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def plot_ft(d):\n ft_list = d['ft_list']\n time_list = d['time_list']\n ft_mat = np.matrix(ft_list).T # 6xN np matrix\n force_mat = ft_mat[0:3, :]\n\n tarray = np.array(time_list)\n print('average rate', 1. / np.mean(tarray[1:] - tarray[:-1]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99542:Assign_L19_C4", "label": "ft_list =", "type": "assigned_variable", "loc": [19, 19], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99542:FunctionDef_L18_C0", "vector": [14, 1, 0.1473, 0.0078, 1, 0.65, 0.0, 147, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ft_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ft_list = d['ft_list']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99542:Assign_L20_C4", "label": "time_list =", "type": "assigned_variable", "loc": [20, 20], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99542:FunctionDef_L18_C0", "vector": [14, 1, 0.155, 0.0078, 1, 0.65, 0.1111, 941, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "time_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " time_list = d['time_list']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99542:Assign_L21_C4", "label": "ft_mat =", "type": "assigned_variable", "loc": [21, 21], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99542:FunctionDef_L18_C0", "vector": [14, 1, 0.1628, 0.0078, 1, 0.65, 0.2222, 624, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "ft_mat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ft_mat = np.matrix(ft_list).T # 6xN np matrix"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99542:Assign_L22_C4", "label": "force_mat =", "type": "assigned_variable", "loc": [22, 22], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99542:FunctionDef_L18_C0", "vector": [14, 1, 0.1705, 0.0078, 1, 0.65, 0.3333, 156, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "force_mat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " force_mat = ft_mat[0:3, :]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99542:Assign_L24_C4", "label": "tarray = array()", "type": "assigned_variable", "loc": [24, 24], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99542:FunctionDef_L18_C0", "vector": [14, 1, 0.186, 0.0078, 1, 0.65, 0.4444, 467, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "tarray", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " tarray = np.array(time_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99542:Expr_L25_C4", "label": "print()", "type": "expression", "loc": [25, 25], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99542:FunctionDef_L18_C0", "vector": [8, 1, 0.1938, 0.0078, 1, 0.65, 0.5556, 535, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('average rate', 1. / np.mean(tarray[1:] - tarray[:-1]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99542:Assign_L26_C4", "label": "time_list = tolist()", "type": "assigned_variable", "loc": [26, 26], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99542:FunctionDef_L18_C0", "vector": [14, 1, 0.2016, 0.0078, 1, 0.65, 0.6667, 941, 3, 0, 0, 0, 185, 10, 1], "semantic": {"name": "time_list", "arg_names": [], "import_names": [], "rhs_call_name": "tolist", "annotation": ""}, "snippet": " time_list = (tarray - tarray[0]).tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99542:Expr_L27_C4", "label": "print()", "type": "expression", "loc": [27, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99542:FunctionDef_L18_C0", "vector": [8, 1, 0.2093, 0.0078, 1, 0.65, 0.7778, 535, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(len(time_list))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99542:Assign_L29_C4", "label": "force_mag_l = tolist()", "type": "assigned_variable", "loc": [29, 29], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99542:FunctionDef_L18_C0", "vector": [14, 1, 0.2248, 0.0078, 1, 0.65, 0.8889, 228, 3, 0, 0, 0, 185, 10, 2], "semantic": {"name": "force_mag_l", "arg_names": [], "import_names": [], "rhs_call_name": "tolist", "annotation": ""}, "snippet": " force_mag_l = ut.norm(force_mat).A1.tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99542:Expr_L36_C4", "label": "plot_yx()", "type": "expression", "loc": [36, 38], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99542:FunctionDef_L18_C0", "vector": [8, 1, 0.2868, 0.0233, 1, 0.65, 1.0, 112, 3, 7, 0, 0, 0, 0, 2], "semantic": {"name": "plot_yx", "arg_names": [], "import_names": [], "rhs_call_name": "plot_yx", "annotation": ""}, "snippet": " mpu.plot_yx(force_mag_l, time_list, axis=None, label='Force Magnitude',\n xlabel='Time(seconds)', ylabel='Force Magnitude (N)',\n color = mpu.random_color())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99542:FunctionDef_L40_C0", "label": "got_trigger_cb", "type": "function", "loc": [40, 41], "level": 0, "parent": null, "vector": [2, 0, 0.314, 0.0155, 0, 0.66, 0.9091, 483, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "got_trigger_cb", "arg_names": ["data", "d"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def got_trigger_cb(data, d):\n d['flag'] = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99542:Assign_L41_C4", "label": "assign", "type": "assigned_variable", "loc": [41, 41], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99542:FunctionDef_L40_C0", "vector": [14, 1, 0.3178, 0.0078, 1, 0.2, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " d['flag'] = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L44_C0", "label": "if", "type": "if", "loc": [44, 127], "level": 0, "parent": null, "vector": [4, 0, 0.6628, 0.6512, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 39], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n\n import optparse\n p = optparse.OptionParser()\n p.add_option('-l', '--log', action='store_true', dest='log', help='log FT data')\n p.add_option('-p', '--plot', action='store_true', dest='plot', help='plot FT data')\n p.add_option('-r', '--ros', action='store_true', dest='ros',\n help='start and stop logging messages over ROS.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99542:Import_L46_C4", "label": "optparse import optparse", "type": "import", "loc": [46, 46], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L44_C0", "vector": [1, 1, 0.3566, 0.0078, 1, 0.15, 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_99542:Assign_L47_C4", "label": "p = OptionParser()", "type": "assigned_variable", "loc": [47, 47], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L44_C0", "vector": [14, 1, 0.3643, 0.0078, 1, 0.15, 0.1111, 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_99542:Expr_L48_C4", "label": "add_option()", "type": "expression", "loc": [48, 48], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L44_C0", "vector": [8, 1, 0.3721, 0.0078, 1, 0.15, 0.2222, 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('-l', '--log', action='store_true', dest='log', help='log FT data')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99542:Expr_L49_C4", "label": "add_option()", "type": "expression", "loc": [49, 49], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L44_C0", "vector": [8, 1, 0.3798, 0.0078, 1, 0.15, 0.3333, 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('-p', '--plot', action='store_true', dest='plot', help='plot FT data')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99542:Expr_L50_C4", "label": "add_option()", "type": "expression", "loc": [50, 51], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L44_C0", "vector": [8, 1, 0.3915, 0.0155, 1, 0.15, 0.4444, 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('-r', '--ros', action='store_true', dest='ros',\n help='start and stop logging messages over ROS.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99542:Expr_L52_C4", "label": "add_option()", "type": "expression", "loc": [52, 53], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L44_C0", "vector": [8, 1, 0.407, 0.0155, 1, 0.15, 0.5556, 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('-a', '--all', action='store_true', dest='all',\n help='plot all the pkls in a single plot')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99542:Expr_L54_C4", "label": "add_option()", "type": "expression", "loc": [54, 55], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L44_C0", "vector": [8, 1, 0.4225, 0.0155, 1, 0.15, 0.6667, 176, 3, 7, 0, 0, 0, 0, 1], "semantic": {"name": "add_option", "arg_names": [], "import_names": [], "rhs_call_name": "add_option", "annotation": ""}, "snippet": " p.add_option('-f', '--fname', action='store', default='',\n type='string', dest='fname', help='pkl with logged data')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99542:Assign_L57_C4", "label": "opt, args = parse_args()", "type": "assigned_variable", "loc": [57, 57], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L44_C0", "vector": [14, 1, 0.4419, 0.0078, 1, 0.15, 0.7778, 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_99542:If_L59_C4", "label": "if", "type": "if", "loc": [59, 108], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L44_C0", "vector": [4, 1, 0.6473, 0.3876, 1, 0.15, 0.8889, 0, 7, 0, 0, 0, 0, 0, 26], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if opt.log:\n client = ftc.FTClient('/force_torque_ft2')\n l = []\n time_list = []\n\n if opt.ros:\n topic_name_cb = '/ftlogger/trigger'\n got_trigger_dict = {'flag': False}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99542:Assign_L60_C8", "label": "client = FTClient()", "type": "assigned_variable", "loc": [60, 60], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L59_C4", "vector": [14, 2, 0.4651, 0.0078, 2, 0.96, 0.0, 608, 3, 1, 0, 0, 78, 10, 1], "semantic": {"name": "client", "arg_names": [], "import_names": [], "rhs_call_name": "FTClient", "annotation": ""}, "snippet": " client = ftc.FTClient('/force_torque_ft2')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99542:Assign_L61_C8", "label": "l =", "type": "assigned_variable", "loc": [61, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L59_C4", "vector": [14, 2, 0.4729, 0.0078, 2, 0.96, 0.1111, 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_99542:Assign_L62_C8", "label": "time_list =", "type": "assigned_variable", "loc": [62, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L59_C4", "vector": [14, 2, 0.4806, 0.0078, 2, 0.96, 0.2222, 941, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "time_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " time_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L64_C8", "label": "if", "type": "if", "loc": [64, 100], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L59_C4", "vector": [4, 2, 0.6357, 0.2868, 2, 0.96, 0.3333, 0, 7, 0, 0, 0, 0, 0, 22], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if opt.ros:\n topic_name_cb = '/ftlogger/trigger'\n got_trigger_dict = {'flag': False}\n rospy.Subscriber(topic_name_cb, Empty, got_trigger_cb,\n got_trigger_dict)\n\n while got_trigger_dict['flag'] == False:\n time.sleep(0.05)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99542:Assign_L65_C12", "label": "topic_name_cb =", "type": "assigned_variable", "loc": [65, 65], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L64_C8", "vector": [14, 3, 0.5039, 0.0078, 3, 0.34, 0.0, 728, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "topic_name_cb", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " topic_name_cb = '/ftlogger/trigger'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99542:Assign_L66_C12", "label": "got_trigger_dict =", "type": "assigned_variable", "loc": [66, 66], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L64_C8", "vector": [14, 3, 0.5116, 0.0078, 3, 0.34, 0.0667, 681, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "got_trigger_dict", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " got_trigger_dict = {'flag': False}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99542:Expr_L67_C12", "label": "Subscriber()", "type": "expression", "loc": [67, 68], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L64_C8", "vector": [8, 3, 0.5233, 0.0155, 3, 0.34, 0.1333, 455, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "Subscriber", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " rospy.Subscriber(topic_name_cb, Empty, got_trigger_cb,\n got_trigger_dict)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99542:While_L70_C12", "label": "while", "type": "while", "loc": [70, 71], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L64_C8", "vector": [5, 3, 0.5465, 0.0155, 3, 0.34, 0.2, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while got_trigger_dict['flag'] == False:\n time.sleep(0.05)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99542:Expr_L71_C16", "label": "sleep()", "type": "expression", "loc": [71, 71], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99542:While_L70_C12", "vector": [8, 4, 0.5504, 0.0078, 4, 0.84, 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.05)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99542:Assign_L73_C12", "label": "assign", "type": "assigned_variable", "loc": [73, 73], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L64_C8", "vector": [14, 3, 0.5659, 0.0078, 3, 0.34, 0.2667, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " got_trigger_dict['flag'] = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99542:While_L74_C12", "label": "while", "type": "while", "loc": [74, 81], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L64_C8", "vector": [5, 3, 0.6008, 0.062, 3, 0.34, 0.3333, 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 ft, t_msg = client.read(fresh=True, with_time_stamp=True)\n if ft != None:\n l.append(ft.A1.tolist())\n time_list.append(t_msg)\n if got_trigger_dict['flag'] == True:\n break\n time.sleep(1/1000.0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99542:Assign_L75_C16", "label": "ft, t_msg = read()", "type": "assigned_variable", "loc": [75, 75], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99542:While_L74_C12", "vector": [14, 4, 0.5814, 0.0078, 4, 0.79, 0.0, 283, 3, 2, 0, 0, 453, 10, 1], "semantic": {"name": "ft, t_msg", "arg_names": [], "import_names": [], "rhs_call_name": "read", "annotation": ""}, "snippet": " ft, t_msg = client.read(fresh=True, with_time_stamp=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L76_C16", "label": "if", "type": "if", "loc": [76, 78], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99542:While_L74_C12", "vector": [4, 4, 0.5969, 0.0233, 4, 0.79, 0.3333, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if ft != None:\n l.append(ft.A1.tolist())\n time_list.append(t_msg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99542:Expr_L77_C20", "label": "append()", "type": "expression", "loc": [77, 77], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L76_C16", "vector": [8, 5, 0.5969, 0.0078, 5, 0.63, 0.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " l.append(ft.A1.tolist())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99542:Expr_L78_C20", "label": "append()", "type": "expression", "loc": [78, 78], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L76_C16", "vector": [8, 5, 0.6047, 0.0078, 5, 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": " time_list.append(t_msg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L79_C16", "label": "if", "type": "if", "loc": [79, 80], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99542:While_L74_C12", "vector": [4, 4, 0.6163, 0.0155, 4, 0.79, 0.6667, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if got_trigger_dict['flag'] == True:\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99542:Expr_L81_C16", "label": "sleep()", "type": "expression", "loc": [81, 81], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99542:While_L74_C12", "vector": [8, 4, 0.6279, 0.0078, 4, 0.79, 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(1/1000.0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99542:Expr_L83_C12", "label": "print()", "type": "expression", "loc": [83, 83], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L64_C8", "vector": [8, 3, 0.6434, 0.0078, 3, 0.34, 0.4, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Sleeping for 5 seconds.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99542:Expr_L84_C12", "label": "sleep()", "type": "expression", "loc": [84, 84], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L64_C8", "vector": [8, 3, 0.6512, 0.0078, 3, 0.34, 0.4667, 476, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " time.sleep(5.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99542:Expr_L85_C12", "label": "print()", "type": "expression", "loc": [85, 85], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L64_C8", "vector": [8, 3, 0.6589, 0.0078, 3, 0.34, 0.5333, 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_99542:Expr_L86_C12", "label": "print()", "type": "expression", "loc": [86, 86], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L64_C8", "vector": [8, 3, 0.6667, 0.0078, 3, 0.34, 0.6, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('BEGIN')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99542:Expr_L87_C12", "label": "print()", "type": "expression", "loc": [87, 87], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L64_C8", "vector": [8, 3, 0.6744, 0.0078, 3, 0.34, 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_99542:Expr_L88_C12", "label": "bias()", "type": "expression", "loc": [88, 88], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L64_C8", "vector": [8, 3, 0.6822, 0.0078, 3, 0.34, 0.7333, 354, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "bias", "arg_names": [], "import_names": [], "rhs_call_name": "bias", "annotation": ""}, "snippet": " client.bias()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99542:Assign_L90_C12", "label": "t_start = time()", "type": "assigned_variable", "loc": [90, 90], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L64_C8", "vector": [14, 3, 0.6977, 0.0078, 3, 0.34, 0.8, 88, 3, 0, 0, 0, 654, 10, 1], "semantic": {"name": "t_start", "arg_names": [], "import_names": [], "rhs_call_name": "time", "annotation": ""}, "snippet": " t_start = time.time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99542:Assign_L91_C12", "label": "t_now = time()", "type": "assigned_variable", "loc": [91, 91], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L64_C8", "vector": [14, 3, 0.7054, 0.0078, 3, 0.34, 0.8667, 23, 3, 0, 0, 0, 654, 10, 1], "semantic": {"name": "t_now", "arg_names": [], "import_names": [], "rhs_call_name": "time", "annotation": ""}, "snippet": " t_now = time.time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99542:Assign_L92_C12", "label": "logging_time =", "type": "assigned_variable", "loc": [92, 92], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L64_C8", "vector": [14, 3, 0.7132, 0.0078, 3, 0.34, 0.9333, 545, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "logging_time", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " logging_time = 5."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99542:While_L94_C12", "label": "while", "type": "while", "loc": [94, 100], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L64_C8", "vector": [5, 3, 0.7519, 0.0543, 3, 0.34, 1.0, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while (t_now - t_start) < logging_time:\n ft, t_msg = client.read(fresh=True, with_time_stamp=True)\n t_now = time.time()\n if ft != None:\n l.append(ft.A1.tolist())\n time_list.append(t_msg)\n time.sleep(1/1000.0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99542:Assign_L95_C16", "label": "ft, t_msg = read()", "type": "assigned_variable", "loc": [95, 95], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99542:While_L94_C12", "vector": [14, 4, 0.7364, 0.0078, 4, 0.92, 0.0, 283, 3, 2, 0, 0, 453, 10, 1], "semantic": {"name": "ft, t_msg", "arg_names": [], "import_names": [], "rhs_call_name": "read", "annotation": ""}, "snippet": " ft, t_msg = client.read(fresh=True, with_time_stamp=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99542:Assign_L96_C16", "label": "t_now = time()", "type": "assigned_variable", "loc": [96, 96], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99542:While_L94_C12", "vector": [14, 4, 0.7442, 0.0078, 4, 0.92, 0.3333, 23, 3, 0, 0, 0, 654, 10, 1], "semantic": {"name": "t_now", "arg_names": [], "import_names": [], "rhs_call_name": "time", "annotation": ""}, "snippet": " t_now = time.time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L97_C16", "label": "if", "type": "if", "loc": [97, 99], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99542:While_L94_C12", "vector": [4, 4, 0.7597, 0.0233, 4, 0.92, 0.6667, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if ft != None:\n l.append(ft.A1.tolist())\n time_list.append(t_msg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99542:Expr_L98_C20", "label": "append()", "type": "expression", "loc": [98, 98], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L97_C16", "vector": [8, 5, 0.7597, 0.0078, 5, 0.29, 0.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " l.append(ft.A1.tolist())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99542:Expr_L99_C20", "label": "append()", "type": "expression", "loc": [99, 99], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L97_C16", "vector": [8, 5, 0.7674, 0.0078, 5, 0.29, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " time_list.append(t_msg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99542:Expr_L100_C16", "label": "sleep()", "type": "expression", "loc": [100, 100], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99542:While_L94_C12", "vector": [8, 4, 0.7752, 0.0078, 4, 0.92, 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(1/1000.0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99542:Expr_L102_C8", "label": "print()", "type": "expression", "loc": [102, 102], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L59_C4", "vector": [8, 2, 0.7907, 0.0078, 2, 0.96, 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 the pickle')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99542:Assign_L103_C8", "label": "d =", "type": "assigned_variable", "loc": [103, 103], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L59_C4", "vector": [14, 2, 0.7984, 0.0078, 2, 0.96, 0.5556, 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_99542:Assign_L104_C8", "label": "assign", "type": "assigned_variable", "loc": [104, 104], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L59_C4", "vector": [14, 2, 0.8062, 0.0078, 2, 0.96, 0.6667, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " d['ft_list'] = l"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99542:Assign_L105_C8", "label": "assign", "type": "assigned_variable", "loc": [105, 105], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L59_C4", "vector": [14, 2, 0.814, 0.0078, 2, 0.96, 0.7778, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " d['time_list'] = time_list"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99542:Assign_L107_C8", "label": "fname =", "type": "assigned_variable", "loc": [107, 107], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L59_C4", "vector": [14, 2, 0.8295, 0.0078, 2, 0.96, 0.8889, 190, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "fname", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " fname = 'ft_log_'+ut.formatted_time()+'.pkl'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99542:Expr_L108_C8", "label": "save_pickle()", "type": "expression", "loc": [108, 108], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L59_C4", "vector": [8, 2, 0.8372, 0.0078, 2, 0.96, 1.0, 390, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "save_pickle", "arg_names": [], "import_names": [], "rhs_call_name": "save_pickle", "annotation": ""}, "snippet": " ut.save_pickle(d, fname)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L111_C4", "label": "if", "type": "if", "loc": [111, 127], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L44_C0", "vector": [4, 1, 0.9225, 0.1318, 1, 0.15, 1.0, 0, 7, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if opt.plot:\n import matplotlib_util.util as mpu\n\n if opt.fname == '' and (not opt.all):\n raise RuntimeError('need a pkl name (-f or --fname) or --all')\n\n if opt.all:\n fname_list = glob.glob('ft_log*.pkl')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99542:Import_L112_C8", "label": "matplotlib_util.util import mpu", "type": "import", "loc": [112, 112], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L111_C4", "vector": [1, 2, 0.8682, 0.0078, 2, 0.97, 0.0, 781, 0, 1, 0, 0, 781, 0, 0], "semantic": {"name": "matplotlib_util.util", "arg_names": [], "import_names": ["mpu"], "rhs_call_name": "", "annotation": ""}, "snippet": " import matplotlib_util.util as mpu"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L114_C8", "label": "if", "type": "if", "loc": [114, 115], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L111_C4", "vector": [4, 2, 0.8876, 0.0155, 2, 0.97, 0.2, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if opt.fname == '' and (not opt.all):\n raise RuntimeError('need a pkl name (-f or --fname) or --all')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L117_C8", "label": "if", "type": "if", "loc": [117, 120], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L111_C4", "vector": [4, 2, 0.9186, 0.031, 2, 0.97, 0.4, 0, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if opt.all:\n fname_list = glob.glob('ft_log*.pkl')\n else:\n fname_list = [opt.fname]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99542:Assign_L118_C12", "label": "fname_list = glob()", "type": "assigned_variable", "loc": [118, 118], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L117_C8", "vector": [14, 3, 0.9147, 0.0078, 3, 0.35, 0.0, 847, 3, 1, 0, 0, 958, 10, 1], "semantic": {"name": "fname_list", "arg_names": [], "import_names": [], "rhs_call_name": "glob", "annotation": ""}, "snippet": " fname_list = glob.glob('ft_log*.pkl')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99542:Assign_L120_C12", "label": "fname_list =", "type": "assigned_variable", "loc": [120, 120], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L117_C8", "vector": [14, 3, 0.9302, 0.0078, 3, 0.35, 1.0, 847, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "fname_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " fname_list = [opt.fname]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99542:For_L122_C8", "label": "for fname", "type": "for", "loc": [122, 124], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L111_C4", "vector": [6, 2, 0.9535, 0.0233, 2, 0.97, 0.6, 190, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "fname", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for fname in fname_list:\n d = ut.load_pickle(fname)\n plot_ft(d)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99542:Assign_L123_C12", "label": "d = load_pickle()", "type": "assigned_variable", "loc": [123, 123], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99542:For_L122_C8", "vector": [14, 3, 0.9535, 0.0078, 3, 0.98, 0.0, 355, 3, 1, 0, 0, 65, 10, 1], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "load_pickle", "annotation": ""}, "snippet": " d = ut.load_pickle(fname)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99542:Expr_L124_C12", "label": "plot_ft()", "type": "expression", "loc": [124, 124], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99542:For_L122_C8", "vector": [8, 3, 0.9612, 0.0078, 3, 0.98, 1.0, 194, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "plot_ft", "arg_names": [], "import_names": [], "rhs_call_name": "plot_ft", "annotation": ""}, "snippet": " plot_ft(d)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99542:Expr_L126_C8", "label": "legend()", "type": "expression", "loc": [126, 126], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L111_C4", "vector": [8, 2, 0.9767, 0.0078, 2, 0.97, 0.8, 880, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "legend", "arg_names": [], "import_names": [], "rhs_call_name": "legend", "annotation": ""}, "snippet": " mpu.legend()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99542:Expr_L127_C8", "label": "show()", "type": "expression", "loc": [127, 127], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L111_C4", "vector": [8, 2, 0.9845, 0.0078, 2, 0.97, 1.0, 497, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "show", "arg_names": [], "import_names": [], "rhs_call_name": "show", "annotation": ""}, "snippet": " mpu.show()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99542:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99542:Assign_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99542:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99542:Assign_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99542:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99542:Assign_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99542:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99542:Assign_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99542:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99542:Assign_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99542:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99542:Expr_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99542:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99542:Assign_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99542:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99542:Expr_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99542:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99542:Assign_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99542:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99542:Expr_L36_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99542:FunctionDef_L40_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99542:Assign_L41_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99542:Import_L46_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99542:Assign_L47_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99542:Expr_L48_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99542:Expr_L49_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99542:Expr_L50_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99542:Expr_L52_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99542:Expr_L54_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99542:Assign_L57_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L59_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99542:Assign_L60_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99542:Assign_L61_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99542:Assign_L62_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L64_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L64_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99542:Assign_L65_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L64_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99542:Assign_L66_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L64_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99542:Expr_L67_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L64_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99542:While_L70_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99542:While_L70_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99542:Expr_L71_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L64_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99542:Assign_L73_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L64_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99542:While_L74_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99542:While_L74_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99542:Assign_L75_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99542:While_L74_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L76_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L76_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99542:Expr_L77_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L76_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99542:Expr_L78_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99542:While_L74_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L79_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99542:While_L74_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99542:Expr_L81_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L64_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99542:Expr_L83_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L64_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99542:Expr_L84_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L64_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99542:Expr_L85_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L64_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99542:Expr_L86_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L64_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99542:Expr_L87_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L64_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99542:Expr_L88_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L64_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99542:Assign_L90_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L64_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99542:Assign_L91_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L64_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99542:Assign_L92_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L64_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99542:While_L94_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99542:While_L94_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99542:Assign_L95_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99542:While_L94_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99542:Assign_L96_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99542:While_L94_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L97_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L97_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99542:Expr_L98_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L97_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99542:Expr_L99_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99542:While_L94_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99542:Expr_L100_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99542:Expr_L102_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99542:Assign_L103_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99542:Assign_L104_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99542:Assign_L105_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99542:Assign_L107_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99542:Expr_L108_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L111_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L111_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99542:Import_L112_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L111_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L114_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L111_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L117_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L117_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99542:Assign_L118_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L117_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99542:Assign_L120_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L111_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99542:For_L122_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99542:For_L122_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99542:Assign_L123_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99542:For_L122_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99542:Expr_L124_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L111_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99542:Expr_L126_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99542:If_L111_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99542:Expr_L127_C8"}]
import commands import sys, os import glob l1 = glob.glob('data_1tb/*/mechanism_info.pkl') l2 = [] for d in l1: l2.append('/'.join(['aggregated_pkls_Feb11']+d.split('/')[1:])) for d1,d2 in zip(l1,l2): os.system('cp %s %s'%(d1, d2))
ajibawa-2023/Python-Code-Large/train/row_99544
9
13
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99544:Import_L2_C0", "label": "commands import commands", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.1538, 0.0769, 0, 0.66, 0.0, 760, 0, 1, 0, 0, 760, 0, 0], "semantic": {"name": "commands", "arg_names": [], "import_names": ["commands"], "rhs_call_name": "", "annotation": ""}, "snippet": "import commands"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99544:Import_L3_C0", "label": "sys import sys, os", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.2308, 0.0769, 0, 0.66, 0.1667, 509, 0, 2, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys", "os"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys, os"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99544:Import_L4_C0", "label": "glob import glob", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.3077, 0.0769, 0, 0.66, 0.3333, 958, 0, 1, 0, 0, 958, 0, 0], "semantic": {"name": "glob", "arg_names": [], "import_names": ["glob"], "rhs_call_name": "", "annotation": ""}, "snippet": "import glob"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99544:Assign_L6_C0", "label": "l1 = glob()", "type": "assigned_variable", "loc": [6, 6], "level": 0, "parent": null, "vector": [14, 0, 0.4615, 0.0769, 0, 0.66, 0.5, 888, 3, 1, 0, 0, 958, 10, 1], "semantic": {"name": "l1", "arg_names": [], "import_names": [], "rhs_call_name": "glob", "annotation": ""}, "snippet": "l1 = glob.glob('data_1tb/*/mechanism_info.pkl')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99544:Assign_L7_C0", "label": "l2 =", "type": "assigned_variable", "loc": [7, 7], "level": 0, "parent": null, "vector": [14, 0, 0.5385, 0.0769, 0, 0.66, 0.6667, 40, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "l2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "l2 = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99544:For_L8_C0", "label": "for d", "type": "for", "loc": [8, 9], "level": 0, "parent": null, "vector": [6, 0, 0.6538, 0.1538, 0, 0.66, 0.8333, 355, 2, 0, 0, 0, 0, 0, 3], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "for d in l1:\n l2.append('/'.join(['aggregated_pkls_Feb11']+d.split('/')[1:]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99544:Expr_L9_C4", "label": "append()", "type": "expression", "loc": [9, 9], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99544:For_L8_C0", "vector": [8, 1, 0.6923, 0.0769, 1, 0.96, 0.0, 243, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " l2.append('/'.join(['aggregated_pkls_Feb11']+d.split('/')[1:]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99544:For_L11_C0", "label": "for d1, d2", "type": "for", "loc": [11, 12], "level": 0, "parent": null, "vector": [6, 0, 0.8846, 0.1538, 0, 0.66, 1.0, 915, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "d1, d2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "for d1,d2 in zip(l1,l2):\n os.system('cp %s %s'%(d1, d2))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99544:Expr_L12_C4", "label": "system()", "type": "expression", "loc": [12, 12], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99544:For_L11_C0", "vector": [8, 1, 0.9231, 0.0769, 1, 0.82, 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('cp %s %s'%(d1, d2))"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99544:For_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99544:Expr_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99544:For_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99544:Expr_L12_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 roslib; roslib.load_manifest('2009_humanoids_epc_pull') import scipy.optimize as so import math, numpy as np import pylab as pl import sys, optparse, time import copy from enthought.mayavi import mlab import mekabot.hrl_robot as hr #import util as ut import hrl_lib.util as ut, hrl_lib.transforms as tr import matplotlib_util.util as mpu import hrl_tilting_hokuyo.display_3d_mayavi as d3m #import shapely.geometry as sg class JointTrajectory(): ''' class to store joint trajectories. data only - use for pickling. ''' def __init__(self): self.time_list = [] # time in seconds self.q_list = [] #each element is a list of 7 joint angles. self.qdot_list = [] #each element is a list of 7 joint angles. class CartesianTajectory(): ''' class to store trajectory of cartesian points. data only - use for pickling ''' def __init__(self): self.time_list = [] # time in seconds self.p_list = [] #each element is a list of 3 coordinates class ForceTrajectory(): ''' class to store time evolution of the force at the end effector. data only - use for pickling ''' def __init__(self): self.time_list = [] # time in seconds self.f_list = [] #each element is a list of 3 coordinates def joint_to_cartesian(traj): ''' traj - JointTrajectory returns CartesianTajectory after performing FK on traj. ''' firenze = hr.M3HrlRobot(connect=False) pts = [] for q in traj.q_list: p = firenze.FK('right_arm',q) pts.append(p.A1.tolist()) ct = CartesianTajectory() ct.time_list = copy.copy(traj.time_list) ct.p_list = copy.copy(pts) #return np.matrix(pts).T return ct def plot_forces_quiver(pos_traj,force_traj,color='k'): import arm_trajectories as at #if traj.__class__ == at.JointTrajectory: if isinstance(pos_traj,at.JointTrajectory): pos_traj = joint_to_cartesian(pos_traj) pts = np.matrix(pos_traj.p_list).T label_list = ['X coord (m)', 'Y coord (m)', 'Z coord (m)'] x = pts[0,:].A1.tolist() y = pts[1,:].A1.tolist() forces = np.matrix(force_traj.f_list).T u = (-1*forces[0,:]).A1.tolist() v = (-1*forces[1,:]).A1.tolist() pl.quiver(x,y,u,v,width=0.002,color=color,scale=100.0) # pl.quiver(x,y,u,v,width=0.002,color=color) pl.axis('equal') def plot_cartesian(traj,xaxis=None,yaxis=None,zaxis=None,color='b',label='_nolegend_', linewidth=2,scatter_size=20): ''' xaxis - x axis for the graph (0,1 or 2) zaxis - for a 3d plot. not implemented. ''' import arm_trajectories as at #if traj.__class__ == at.JointTrajectory: if isinstance(traj,at.JointTrajectory): traj = joint_to_cartesian(traj) pts = np.matrix(traj.p_list).T label_list = ['X coord (m)', 'Y coord (m)', 'Z coord (m)'] x = pts[xaxis,:].A1.tolist() y = pts[yaxis,:].A1.tolist() if zaxis == None: pl.plot(x,y,c=color,linewidth=linewidth,label=label) pl.scatter(x,y,c=color,s=scatter_size,label='_nolegend_', linewidths=0) pl.xlabel(label_list[xaxis]) pl.ylabel(label_list[yaxis]) pl.legend(loc='best') pl.axis('equal') else: from numpy import array from enthought.mayavi.api import Engine engine = Engine() engine.start() if len(engine.scenes) == 0: engine.new_scene() z = pts[zaxis,:].A1.tolist() time_list = [t-traj.time_list[0] for t in traj.time_list] mlab.plot3d(x,y,z,time_list,tube_radius=None,line_width=4) mlab.axes() mlab.xlabel(label_list[xaxis]) mlab.ylabel(label_list[yaxis]) mlab.zlabel(label_list[zaxis]) mlab.colorbar(title='Time') # ------------------------------------------- axes = engine.scenes[0].children[0].children[0].children[1] axes.axes.position = array([ 0., 0.]) axes.axes.label_format = '%-#6.2g' axes.title_text_property.font_size=4 ## compute the force that the arm would apply given the stiffness matrix # @param q_actual_traj - Joint Trajectory (actual angles.) # @param q_eq_traj - Joint Trajectory (equilibrium point angles.) # @param torque_traj - JointTrajectory (torques measured at the joints.) # @param rel_stiffness_list - list of 5 elements (stiffness numbers for the joints.) # @return lots of things, look at the code. def compute_forces(q_actual_traj,q_eq_traj,torque_traj,rel_stiffness_list): firenze = hr.M3HrlRobot(connect=False) d_gains_list_mN_deg_sec = [-100,-120,-15,-25,-1.25] d_gains_list = [180./1000.*s/math.pi for s in d_gains_list_mN_deg_sec] stiff_list_mNm_deg = [1800,1300,350,600,60] stiff_list_Nm_rad = [180./1000.*s/math.pi for s in stiff_list_mNm_deg] # stiffness_settings = [0.15,0.7,0.8,0.8,0.8] # dia = np.array(stiffness_settings) * np.array(stiff_list_Nm_rad) dia = np.array(rel_stiffness_list) * np.array(stiff_list_Nm_rad) k_q = np.matrix(np.diag(dia)) dia_inv = 1./dia k_q_inv = np.matrix(np.diag(dia_inv)) actual_cart = joint_to_cartesian(q_actual_traj) eq_cart = joint_to_cartesian(q_eq_traj) force_traj_jacinv = ForceTrajectory() force_traj_stiff = ForceTrajectory() force_traj_torque = ForceTrajectory() k_cart_list = [] for q_actual,q_dot,q_eq,actual_pos,eq_pos,t,tau_m in zip(q_actual_traj.q_list,q_actual_traj.qdot_list,q_eq_traj.q_list,actual_cart.p_list,eq_cart.p_list,q_actual_traj.time_list,torque_traj.q_list): q_eq = firenze.clamp_to_physical_joint_limits('right_arm',q_eq) q_delta = np.matrix(q_actual).T - np.matrix(q_eq).T tau = k_q * q_delta[0:5,0] - np.matrix(np.array(d_gains_list)*np.array(q_dot)[0:5]).T x_delta = np.matrix(actual_pos).T - np.matrix(eq_pos).T jac_full = firenze.Jac('right_arm',q_actual) jac = jac_full[0:3,0:5] jac_full_eq = firenze.Jac('right_arm',q_eq) jac_eq = jac_full_eq[0:3,0:5] k_cart = np.linalg.inv((jac_eq*k_q_inv*jac_eq.T)) # calculating stiff matrix using Jacobian for eq pt. k_cart_list.append(k_cart) pseudo_inv_jac = np.linalg.inv(jac_full*jac_full.T)*jac_full tau_full = np.row_stack((tau,np.matrix(tau_m[5:7]).T)) #force = (-1*pseudo_inv_jac*tau_full)[0:3] force = -1*pseudo_inv_jac[0:3,0:5]*tau force_traj_jacinv.f_list.append(force.A1.tolist()) force_traj_stiff.f_list.append((k_cart*x_delta).A1.tolist()) force_traj_torque.f_list.append((pseudo_inv_jac*np.matrix(tau_m).T)[0:3].A1.tolist()) return force_traj_jacinv,force_traj_stiff,force_traj_torque,k_cart_list ## return two lists containing the radial and tangential components of the forces. # @param f_list - list of forces. (each force is a list of 2 or 3 floats) # @param p_list - list of positions. (each position is a list of 2 or 3 floats) # @param cx - x coord of the center of the circle. # @param cy - y coord of the center of the circle. # @return list of magnitude of radial component, list of magnitude tangential component. def compute_radial_tangential_forces(f_list,p_list,cx,cy): f_rad_l,f_tan_l = [],[] for f,p in zip(f_list,p_list): rad_vec = np.array([p[0]-cx,p[1]-cy]) rad_vec = rad_vec/np.linalg.norm(rad_vec) f_vec = np.array([f[0],f[1]]) f_rad_mag = np.dot(f_vec,rad_vec) f_tan_mag = np.linalg.norm(f_vec-rad_vec*f_rad_mag) f_rad_mag = abs(f_rad_mag) f_rad_l.append(f_rad_mag) f_tan_l.append(f_tan_mag) return f_rad_l,f_tan_l def plot_error_forces(measured_list,calc_list): err_x, err_y = [],[] err_rel_x, err_rel_y = [],[] mag_x, mag_y = [],[] for m,c in zip(measured_list,calc_list): err_x.append(abs(m[0]-c[0])) err_rel_x.append(abs(m[0]-c[0])/abs(m[0])*100) #err_rel_x.append(ut.bound(abs(m[0]-c[0])/abs(m[0])*100,100,0)) mag_x.append(abs(m[0])) err_y.append(abs(m[1]-c[1])) err_rel_y.append(abs(m[1]-c[1])/abs(m[1])*100) #err_rel_y.append(ut.bound(abs(m[1]-c[1])/abs(m[1])*100,100,0)) mag_y.append(abs(m[1])) x_idx = range(len(err_x)) zero = [0 for i in x_idx] fig = pl.figure() ax1 = fig.add_subplot(111) ax2 = ax1.twinx() ax1.plot(zero,c='k',linewidth=1,label='_nolegend_') l1 = ax1.plot(err_x,c='b',linewidth=1,label='absolute error') ax1.scatter(x_idx,err_x,c='b',s=10,label='_nolegend_', linewidths=0) l2 = ax1.plot(mag_x,c='g',linewidth=1,label='magnitude') ax1.scatter(x_idx,mag_x,c='g',s=10,label='_nolegend_', linewidths=0) l3 = ax2.plot(err_rel_x,c='r',linewidth=1,label='relative error %') ax1.set_ylim(0,15) ax2.set_ylim(0,100) ax1.set_xlabel('measurement number') ax1.set_ylabel('x component of force (N)') ax2.set_ylabel('percentage error') ax1.yaxis.set_label_coords(-0.3,0.5) ax2.yaxis.set_label_coords(-0.3,0.5) leg = pl.legend([l1,l2,l3],['absolute error','magnitude','rel error %'],loc='upper left', handletextsep=0.015,handlelen=0.003,labelspacing=0.003) fig = pl.figure() ax1 = fig.add_subplot(111) ax2 = ax1.twinx() ax1.plot(zero,c='k',linewidth=1) l1 = ax1.plot(err_y,c='b',linewidth=1) ax1.scatter(x_idx,err_y,c='b',s=10, linewidths=0) l2 = ax1.plot(mag_y,c='g',linewidth=1) ax1.scatter(x_idx,mag_y,c='g',s=10,linewidths=0) l3 = ax2.plot(err_rel_y,c='r',linewidth=1) ax1.set_ylim(0,15) ax2.set_ylim(0,100) ax1.yaxis.set_label_coords(-0.3,0.5) ax2.yaxis.set_label_coords(-0.3,0.5) ax1.set_xlabel('measurement number') ax1.set_ylabel('y component of force (N)') ax2.set_ylabel('percentage error') #pl.legend(loc='best') leg = pl.legend([l1,l2,l3],['absolute error','magnitude','rel error %'],loc='upper left', handletextsep=0.015,handlelen=0.003,labelspacing=0.003) # pl.figure() # pl.plot(zero,c='k',linewidth=0.5,label='_nolegend_') # pl.plot(err_y,c='b',linewidth=1,label='error') # pl.plot(err_rel_y,c='r',linewidth=1,label='relative error %') # pl.scatter(x_idx,err_y,c='b',s=10,label='_nolegend_', linewidths=0) # pl.plot(mag_y,c='g',linewidth=1,label='magnitude') # pl.scatter(x_idx,mag_y,c='g',s=10,label='_nolegend_', linewidths=0) # # pl.xlabel('measurement number') # pl.ylabel('y component of force (N)') # pl.legend(loc='best') # pl.axis('equal') def plot_stiff_ellipses(k_cart_list,pos_traj,skip=10,subplotnum=111): import arm_trajectories as at if isinstance(pos_traj,at.JointTrajectory): pos_traj = joint_to_cartesian(pos_traj) pts = np.matrix(pos_traj.p_list).T x_l = pts[0,:].A1.tolist() y_l = pts[1,:].A1.tolist() from pylab import figure, show, rand from matplotlib.patches import Ellipse ells = [] scale = 25000. ratio_list = [] for k_c,x,y in zip(k_cart_list[::skip],x_l[::skip],y_l[::skip]): w,v = np.linalg.eig(k_c[0:2,0:2]) w_abs = np.abs(w) major_axis = np.max(w_abs) minor_axis = np.min(w_abs) print 'major, minor:',major_axis,minor_axis # print 'k_c:', k_c ratio_list.append(major_axis/minor_axis) ells.append(Ellipse(np.array([x,y]),width=w[0]/scale,height=w[1]/scale,angle=math.degrees(math.atan2(v[1,0],v[0,0])))) ells[-1].set_lw(2) #fig = pl.figure() #ax = fig.add_subplot(111, aspect='equal') ax = pl.subplot(subplotnum, aspect='equal') for e in ells: ax.add_artist(e) #e.set_clip_box(ax.bbox) #e.set_alpha(1.) e.set_facecolor(np.array([1,1,1])) plot_cartesian(pos_traj,xaxis=0,yaxis=1,color='b', linewidth=0.0,scatter_size=0) # plot_cartesian(pos_traj,xaxis=0,yaxis=1,color='b',label='Eq Point', # linewidth=1.5,scatter_size=0) # plot_cartesian(d['actual'],xaxis=0,yaxis=1,color='b',label='FK', # linewidth=1.5,scatter_size=0) # plot_cartesian(d['eq_pt'], xaxis=0,yaxis=1,color='g',label='Eq Point', # linewidth=1.5,scatter_size=0) mean_ratio = np.mean(np.array(ratio_list)) std_ratio = np.std(np.array(ratio_list)) return mean_ratio,std_ratio # plot the force field in the xy plane for the stiffness matrix k_cart. ## @param k_cart: 3x3 cartesian space stiffness matrix. def plot_stiffness_field(k_cart,plottitle=''): n_points = 20 ang_step = math.radians(360)/n_points x_list = [] y_list = [] u_list = [] v_list = [] k_cart = k_cart[0:2,0:2] for i in range(n_points): ang = i*ang_step for r in [0.5,1.,1.5]: dx = r*math.cos(ang) dy = r*math.sin(ang) dtau = -k_cart*np.matrix([dx,dy]).T x_list.append(dx) y_list.append(dy) u_list.append(dtau[0,0]) v_list.append(dtau[1,0]) pl.figure() # mpu.plot_circle(0,0,1.0,0.,math.radians(360)) mpu.plot_radii(0,0,1.5,0.,math.radians(360),interval=ang_step,color='r') pl.quiver(x_list,y_list,u_list,v_list,width=0.002,color='k',scale=None) pl.axis('equal') pl.title(plottitle) def plot_stiff_ellipse_map(stiffness_list,num): firenze = hr.M3HrlRobot(connect=False) hook_3dprint_angle = math.radians(20-2.54) rot_mat = tr.Rz(0.-hook_3dprint_angle)*tr.Ry(math.radians(-90)) d_gains_list_mN_deg_sec = [-100,-120,-15,-25,-1.25] d_gains_list = [180./1000.*s/math.pi for s in d_gains_list_mN_deg_sec] stiff_list_mNm_deg = [1800,1300,350,600,60] stiff_list_Nm_rad = [180./1000.*s/math.pi for s in stiff_list_mNm_deg] dia = np.array(stiffness_list) * np.array(stiff_list_Nm_rad) k_q = np.matrix(np.diag(dia)) dia_inv = 1./dia k_q_inv = np.matrix(np.diag(dia_inv)) s0,s1,s2,s3 = stiffness_list[0],stiffness_list[1],stiffness_list[2],stiffness_list[3] i=0 #for z in np.arange(-0.1,-0.36,-0.05): for z in np.arange(-0.23,-0.27,-0.05): pl.figure() k_cart_list = [] pos_traj = CartesianTajectory() for x in np.arange(0.25,0.56,0.05): for y in np.arange(-0.15,-0.56,-0.05): if math.sqrt(x**2+y**2)>0.55: continue q = firenze.IK('right_arm',np.matrix([x,y,z]).T,rot_mat) if q == None: continue jac_full = firenze.Jac('right_arm',q) jac = jac_full[0:3,0:5] k_cart = np.linalg.inv((jac*k_q_inv*jac.T)) k_cart_list.append(k_cart) pos_traj.p_list.append([x,y,z]) pos_traj.time_list.append(0.1) if len(pos_traj.p_list)>0: ret = plot_stiff_ellipses(k_cart_list,pos_traj,skip=1) pl.axis('equal') pl.legend(loc='best') title_string = 'z: %.2f stiff:[%.1f,%.1f,%.1f,%.1f]'%(z,s0,s1,s2,s3) pl.title(title_string) i+=1 pl.savefig('ellipses_%03d_%03d.png'%(num,i)) return ret def compute_workspace(z,plot=False,wrist_roll_angle=math.radians(0),subplotnum=None,title=''): firenze = hr.M3HrlRobot(connect=False) # hook_3dprint_angle = math.radians(20-2.54) # rot_mat = tr.Rz(math.radians(-90.)-hook_3dprint_angle)*tr.Ry(math.radians(-90)) rot_mat = tr.Rz(wrist_roll_angle)*tr.Ry(math.radians(-90)) x_list,y_list = [],[] for x in np.arange(0.15,0.65,0.02): for y in np.arange(-0.05,-0.65,-0.02): q = firenze.IK('right_arm',np.matrix([x,y,z]).T,rot_mat) if q != None: x_list.append(x) y_list.append(y) if len(x_list) > 2: multipoint = sg.Point(x_list[0],y_list[0]) for x,y in zip(x_list[1:],y_list[1:]): multipoint = multipoint.union(sg.Point(x,y)) hull = multipoint.convex_hull if plot: coords_seq = hull.boundary.coords hull_x_list,hull_y_list = [],[] for c in coords_seq: hull_x_list.append(c[0]) hull_y_list.append(c[1]) mpu.plot_yx(y_list,x_list,linewidth=0,subplotnum=subplotnum,axis='equal', plot_title=title) mpu.plot_yx(hull_y_list,hull_x_list,linewidth=2,subplotnum=subplotnum,axis='equal') return hull,len(x_list) else: return None,None def diff_roll_angles(): pl.subplot(211,aspect='equal') # search along z coord and make a histogram of the areas def compute_workspace_z(): n_points_list,area_list,z_list = [],[],[] #for z in np.arange(-0.1,-0.36,-0.02): #for z in np.arange(-0.05,-0.35,-0.01): for z in np.arange(-0.15,-0.155,-0.01): pl.figure() hull,n_points = compute_workspace(z,plot=True) pl.title('z: %.2f'%(z)) pl.savefig('z_%.2f.png'%(z)) # hull,n_points = compute_workspace(z,plot=False) if hull != None: area_list.append(hull.area) z_list.append(z) n_points_list.append(n_points) coords_seq = hull.boundary.coords hull_x_list,hull_y_list = [],[] for c in coords_seq: hull_x_list.append(c[0]) hull_y_list.append(c[1]) pl.figure() mpu.plot_yx(area_list,z_list,linewidth=2,label='area') pl.savefig('hist_area.png') pl.figure() mpu.plot_yx(n_points_list,z_list,linewidth=2,color='g',label='n_points') # pl.legend(loc='best') pl.xlabel('Z coordinate (m)') pl.ylabel('# points') pl.savefig('hist_points.png') ## find the x and y coord of the center of the circle of given radius that # best matches the data. # @param rad - radius of the circle (not optimized) # @param x_guess - guess for x coord of center # @param y_guess - guess for y coord of center. # @param pts - 2xN np matrix of points. # @return x,y (x and y coord of the center of the circle) def fit_rotary_joint(rad,x_guess,y_guess,pts): def error_function(params): center = np.matrix((params[0],params[1])).T #print 'pts.shape', pts.shape #print 'center.shape', center.shape #print 'ut.norm(pts-center).shape',ut.norm(pts-center).shape err = ut.norm(pts-center).A1 - rad res = np.dot(err,err) return res params_1 = [x_guess,y_guess] r = so.fmin_bfgs(error_function,params_1,full_output=1) opt_params_1,f_opt_1 = r[0],r[1] params_2 = [x_guess,y_guess+2*rad] r = so.fmin_bfgs(error_function,params_2,full_output=1) opt_params_2,f_opt_2 = r[0],r[1] if f_opt_2<f_opt_1: return opt_params_2[0],opt_params_2[1] else: return opt_params_1[0],opt_params_1[1] ## find the x and y coord of the center of the circle and the radius that # best matches the data. # @param rad_guess - guess for the radius of the circle # @param x_guess - guess for x coord of center # @param y_guess - guess for y coord of center. # @param pts - 2xN np matrix of points. # @param method - optimization method. ('fmin' or 'fmin_bfgs') # @param verbose - passed onto the scipy optimize functions. whether to print out the convergence info. # @return r,x,y (radius, x and y coord of the center of the circle) def fit_circle(rad_guess,x_guess,y_guess,pts,method,verbose=True): def error_function(params): center = np.matrix((params[0],params[1])).T rad = params[2] #print 'pts.shape', pts.shape #print 'center.shape', center.shape #print 'ut.norm(pts-center).shape',ut.norm(pts-center).shape err = ut.norm(pts-center).A1 - rad res = np.dot(err,err) return res params_1 = [x_guess,y_guess,rad_guess] if method == 'fmin': r = so.fmin(error_function,params_1,xtol=0.0002,ftol=0.000001,full_output=1,disp=verbose) opt_params_1,fopt_1 = r[0],r[1] elif method == 'fmin_bfgs': r = so.fmin_bfgs(error_function,params_1,full_output=1,disp=verbose) opt_params_1,fopt_1 = r[0],r[1] else: raise RuntimeError('unknown method: '+method) params_2 = [x_guess,y_guess+2*rad_guess,rad_guess] if method == 'fmin': r = so.fmin(error_function,params_2,xtol=0.0002,ftol=0.000001,full_output=1,disp=verbose) opt_params_2,fopt_2 = r[0],r[1] elif method == 'fmin_bfgs': r = so.fmin_bfgs(error_function,params_2,full_output=1,disp=verbose) opt_params_2,fopt_2 = r[0],r[1] else: raise RuntimeError('unknown method: '+method) if fopt_2<fopt_1: return opt_params_2[2],opt_params_2[0],opt_params_2[1] else: return opt_params_1[2],opt_params_1[0],opt_params_1[1] if __name__ == '__main__': p = optparse.OptionParser() p.add_option('-f', action='store', type='string', dest='fname', help='pkl file to use.', default='') p.add_option('--xy', action='store_true', dest='xy', help='plot the x and y coordinates of the end effector.') p.add_option('--yz', action='store_true', dest='yz', help='plot the y and z coordinates of the end effector.') p.add_option('--xz', action='store_true', dest='xz', help='plot the x and z coordinates of the end effector.') p.add_option('--plot_ellipses', action='store_true', dest='plot_ellipses', help='plot the stiffness ellipse in the x-y plane') p.add_option('--pfc', action='store_true', dest='pfc', help='plot the radial and tangential components of the force.') p.add_option('--pmf', action='store_true', dest='pmf', help='plot things with the mechanism alinged with the axes.') p.add_option('--pff', action='store_true', dest='pff', help='plot the force field corresponding to a stiffness ellipse.') p.add_option('--pev', action='store_true', dest='pev', help='plot the stiffness ellipses for different combinations of the rel stiffnesses.') p.add_option('--plot_forces', action='store_true', dest='plot_forces', help='plot the force in the x-y plane') p.add_option('--plot_forces_error', action='store_true', dest='plot_forces_error', help='plot the error between the computed and measured (ATI) forces in the x-y plane') p.add_option('--xyz', action='store_true', dest='xyz', help='plot in 3d the coordinates of the end effector.') p.add_option('-r', action='store', type='float', dest='rad', help='radius of the joint.', default=None) p.add_option('--rad_fix', action='store_true', dest='rad_fix', help='do not optimize for the radius.') p.add_option('--noshow', action='store_true', dest='noshow', help='do not display the figure (use while saving figures to disk)') p.add_option('--exptplot', action='store_true', dest='exptplot', help='put all the graphs of an experiment as subplots.') p.add_option('--pwf', action='store_true', dest='pwf', help='plot the workspace at some z coord.') opt, args = p.parse_args() fname = opt.fname xy_flag = opt.xy yz_flag = opt.yz xz_flag = opt.xz plot_forces_flag = opt.plot_forces plot_ellipses_flag = opt.plot_ellipses plot_forces_error_flag = opt.plot_forces_error plot_force_components_flag = opt.pfc plot_force_field_flag = opt.pff plot_mechanism_frame = opt.pmf xyz_flag = opt.xyz rad = opt.rad show_fig = not(opt.noshow) plot_ellipses_vary_flag = opt.pev expt_plot = opt.exptplot rad_fix = opt.rad_fix plot_workspace_flag = opt.pwf if plot_workspace_flag: compute_workspace_z() # hull = compute_workspace(z=-0.22,plot=True) # pl.show() if plot_ellipses_vary_flag: show_fig=False i = 0 ratio_list1 = [0.1,0.3,0.5,0.7,0.9] # coarse search ratio_list2 = [0.1,0.3,0.5,0.7,0.9] # coarse search ratio_list3 = [0.1,0.3,0.5,0.7,0.9] # coarse search # ratio_list1 = [0.7,0.8,0.9,1.0] # ratio_list2 = [0.7,0.8,0.9,1.0] # ratio_list3 = [0.3,0.4,0.5,0.6,0.7] # ratio_list1 = [1.0,2.,3.0] # ratio_list2 = [1.,2.,3.] # ratio_list3 = [0.3,0.4,0.5,0.6,0.7] inv_mean_list,std_list = [],[] x_l,y_l,z_l = [],[],[] s0 = 0.2 #s0 = 0.4 for s1 in ratio_list1: for s2 in ratio_list2: for s3 in ratio_list3: i += 1 s_list = [s0,s1,s2,s3,0.8] #s_list = [s1,s2,s3,s0,0.8] print '################## s_list:', s_list m,s = plot_stiff_ellipse_map(s_list,i) inv_mean_list.append(1./m) std_list.append(s) x_l.append(s1) y_l.append(s2) z_l.append(s3) ut.save_pickle({'x_l':x_l,'y_l':y_l,'z_l':z_l,'inv_mean_list':inv_mean_list,'std_list':std_list}, 'stiff_dict_'+ut.formatted_time()+'.pkl') d3m.plot_points(np.matrix([x_l,y_l,z_l]),scalar_list=inv_mean_list,mode='sphere') mlab.axes() d3m.show() sys.exit() if fname=='': print 'please specify a pkl file (-f option)' print 'Exiting...' sys.exit() d = ut.load_pickle(fname) actual_cartesian = joint_to_cartesian(d['actual']) eq_cartesian = joint_to_cartesian(d['eq_pt']) for p in actual_cartesian.p_list: print p[0],p[1],p[2] if rad != None: #rad = 0.39 # lab cabinet recessed. #rad = 0.42 # kitchen cabinet #rad = 0.80 # lab glass door pts_list = actual_cartesian.p_list ee_start_pos = pts_list[0] x_guess = ee_start_pos[0] y_guess = ee_start_pos[1] - rad print 'before call to fit_rotary_joint' pts_2d = (np.matrix(pts_list).T)[0:2,:] t0 = time.time() if rad_fix: rad_guess = 0.9 else: rad_guess = rad rad_fmin,cx,cy = fit_circle(rad_guess,x_guess,y_guess,pts_2d[:,0:-4],method='fmin') t1 = time.time() rad_opt,cx,cy = fit_circle(rad_guess,x_guess,y_guess,pts_2d[:,0:-4],method='fmin_bfgs') t2 = time.time() print 'after fit_rotary_joint' print 'optimized radius:', rad_opt print 'optimized radius fmin:', rad_fmin print 'time to bfgs:', t2-t1 print 'time to fmin:', t1-t0 if rad_fix: cx,cy = fit_rotary_joint(rad,x_guess,y_guess,pts_2d[:,0:-4]) else: rad = rad_opt if plot_mechanism_frame: if expt_plot: pl.subplot(231) # transform points so that the mechanism is in a fixed position. start_pt = actual_cartesian.p_list[0] x_diff = start_pt[0] - cx y_diff = start_pt[1] - cy angle = math.atan2(y_diff,x_diff) - math.radians(90) rot_mat = tr.Rz(angle)[0:2,0:2] translation_mat = np.matrix([cx,cy]).T robot_width,robot_length = 0.1,0.2 robot_x_list = [-robot_width/2,-robot_width/2,robot_width/2,robot_width/2,-robot_width/2] robot_y_list = [-robot_length/2,robot_length/2,robot_length/2,-robot_length/2,-robot_length/2] robot_mat = rot_mat*(np.matrix([robot_x_list,robot_y_list]) - translation_mat) mpu.plot_yx(robot_mat[1,:].A1,robot_mat[0,:].A1,linewidth=2,scatter_size=0, color='k',label='torso') pts2d_actual = (np.matrix(actual_cartesian.p_list).T)[0:2] pts2d_actual_t = rot_mat *(pts2d_actual - translation_mat) mpu.plot_yx(pts2d_actual_t[1,:].A1,pts2d_actual_t[0,:].A1,scatter_size=20,label='FK') end_pt = pts2d_actual_t[:,-1] end_angle = tr.angle_within_mod180(math.atan2(end_pt[1,0],end_pt[0,0])-math.radians(90)) mpu.plot_circle(0,0,rad,0.,end_angle,label='Actual_opt',color='r') mpu.plot_radii(0,0,rad,0.,end_angle,interval=math.radians(15),color='r') pl.legend(loc='best') pl.axis('equal') if not(expt_plot): str_parts = fname.split('.') fig_name = str_parts[0]+'_robot_pose.png' pl.savefig(fig_name) pl.figure() else: pl.subplot(232) pl.text(0.1,0.15,d['info']) pl.text(0.1,0.10,'control: '+d['strategy']) pl.text(0.1,0.05,'robot angle: %.2f'%math.degrees(angle)) pl.text(0.1,0,'optimized radius: %.2f'%rad_opt) pl.text(0.1,-0.05,'radius used: %.2f'%rad) pl.text(0.1,-0.10,'opening angle: %.2f'%math.degrees(end_angle)) s_list = d['stiffness'].stiffness_list s_scale = d['stiffness'].stiffness_scale sl = [min(s*s_scale,1.0) for s in s_list] pl.text(0.1,-0.15,'stiffness list: %.2f, %.2f, %.2f, %.2f'%(sl[0],sl[1],sl[2],sl[3])) pl.text(0.1,-0.20,'stop condition: '+d['result']) time_dict = d['time_dict'] pl.text(0.1,-0.25,'time to hook: %.2f'%(time_dict['before_hook']-time_dict['before_pull'])) pl.text(0.1,-0.30,'time to pull: %.2f'%(time_dict['before_pull']-time_dict['after_pull'])) pl.ylim(-0.45,0.25) if not(expt_plot): pl.figure() if xy_flag: st_pt = pts_2d[:,0] start_angle = tr.angle_within_mod180(math.atan2(st_pt[1,0]-cy,st_pt[0,0]-cx) - math.radians(90)) end_pt = pts_2d[:,-1] end_angle = tr.angle_within_mod180(math.atan2(end_pt[1,0]-cy,end_pt[0,0]-cx) - math.radians(90)) print 'start_angle, end_angle:', math.degrees(start_angle), math.degrees(end_angle) print 'angle through which mechanism turned:', math.degrees(end_angle-start_angle) if expt_plot: pl.subplot(233) plot_cartesian(actual_cartesian,xaxis=0,yaxis=1,color='b',label='End Effector Trajectory') plot_cartesian(eq_cartesian, xaxis=0,yaxis=1,color='g',label='Eq Point') mpu.plot_circle(cx,cy,rad,start_angle,end_angle,label='Estimated Kinematics',color='r') # if rad<0.6: # mpu.plot_radii(cx,cy,rad,start_angle,end_angle,interval=math.radians(100),color='r') # pl.title(d['info']) leg = pl.legend(loc='best')#,handletextsep=0.020,handlelen=0.003,labelspacing=0.003) leg.draw_frame(False) ax = pl.gca() ax.set_xlim(ax.get_xlim()[::-1]) ax.set_ylim(ax.get_ylim()[::-1]) force_traj = d['force'] forces = np.matrix(force_traj.f_list).T force_mag = ut.norm(forces) print 'force_mag:', force_mag.A1 elif yz_flag: plot_cartesian(actual_cartesian,xaxis=1,yaxis=2,color='b',label='FK') plot_cartesian(eq_cartesian, xaxis=1,yaxis=2,color='g',label='Eq Point') elif xz_flag: plot_cartesian(actual_cartesian,xaxis=0,yaxis=2,color='b',label='FK') plot_cartesian(eq_cartesian, xaxis=0,yaxis=2,color='g',label='Eq Point') if plot_forces_flag or plot_forces_error_flag or plot_ellipses_flag or plot_force_components_flag or plot_force_field_flag: arm_stiffness_list = d['stiffness'].stiffness_list scale = d['stiffness'].stiffness_scale asl = [min(scale*s,1.0) for s in arm_stiffness_list] ftraj_jinv,ftraj_stiff,ftraj_torque,k_cart_list=compute_forces(d['actual'],d['eq_pt'], d['torque'],asl) if plot_forces_flag: plot_forces_quiver(actual_cartesian,d['force'],color='k') plot_forces_quiver(actual_cartesian,ftraj_jinv,color='y') #plot_forces_quiver(actual_cartesian,ftraj_stiff,color='y') if plot_ellipses_flag: #plot_stiff_ellipses(k_cart_list,actual_cartesian) if expt_plot: subplotnum=234 else: pl.figure() subplotnum=111 plot_stiff_ellipses(k_cart_list,eq_cartesian,subplotnum=subplotnum) if plot_forces_error_flag: plot_error_forces(d['force'].f_list,ftraj_jinv.f_list) #plot_error_forces(d['force'].f_list,ftraj_stiff.f_list) if plot_force_components_flag: p_list = actual_cartesian.p_list frad_list,ftan_list = compute_radial_tangential_forces(d['force'].f_list,p_list,cx,cy) if expt_plot: pl.subplot(235) else: pl.figure() time_list = d['force'].time_list time_list = [t-time_list[0] for t in time_list] x_coord_list = np.matrix(p_list)[:,0].A1.tolist() mpu.plot_yx(frad_list,x_coord_list,scatter_size=50,color=time_list,cb_label='time') pl.xlabel('x coord of end effector (m)') pl.ylabel('magnitude of radial force (N)') pl.title(d['info']) if expt_plot: pl.subplot(236) else: pl.figure() mpu.plot_yx(ftan_list,x_coord_list,scatter_size=50,color=time_list,cb_label='time') pl.xlabel('x coord of end effector (m)') pl.ylabel('magnitude of tangential force (N)') pl.title(d['info']) if plot_force_field_flag: plot_stiffness_field(k_cart_list[0],plottitle='start') plot_stiffness_field(k_cart_list[-1],plottitle='end') if expt_plot: f = pl.gcf() curr_size = f.get_size_inches() f.set_size_inches(curr_size[0]*2,curr_size[1]*2) str_parts = fname.split('.') if d.has_key('strategy'): fig_name = str_parts[0]+'_'+d['strategy']+'.png' else: fig_name = str_parts[0]+'_res.png' f.savefig(fig_name) if show_fig: pl.show() else: print '################################' print 'show_fig is FALSE' if xyz_flag: plot_cartesian(traj, xaxis=0,yaxis=1,zaxis=2) mlab.show()
ajibawa-2023/Python-Code-Large/train/row_99547
582
904
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Import_L30_C0", "label": "roslib import roslib", "type": "import", "loc": [30, 30], "level": 0, "parent": null, "vector": [1, 0, 0.0332, 0.0011, 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('2009_humanoids_epc_pull')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L30_C15", "label": "load_manifest()", "type": "expression", "loc": [30, 30], "level": 0, "parent": null, "vector": [8, 0, 0.0332, 0.0011, 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": "import roslib; roslib.load_manifest('2009_humanoids_epc_pull')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Import_L32_C0", "label": "scipy.optimize import so", "type": "import", "loc": [32, 32], "level": 0, "parent": null, "vector": [1, 0, 0.0354, 0.0011, 0, 0.66, 0.069, 359, 0, 1, 0, 0, 359, 0, 0], "semantic": {"name": "scipy.optimize", "arg_names": [], "import_names": ["so"], "rhs_call_name": "", "annotation": ""}, "snippet": "import scipy.optimize as so"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Import_L34_C0", "label": "math import math, np", "type": "import", "loc": [34, 34], "level": 0, "parent": null, "vector": [1, 0, 0.0376, 0.0011, 0, 0.66, 0.1034, 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_99547:Import_L35_C0", "label": "pylab import pl", "type": "import", "loc": [35, 35], "level": 0, "parent": null, "vector": [1, 0, 0.0387, 0.0011, 0, 0.66, 0.1379, 735, 0, 1, 0, 0, 735, 0, 0], "semantic": {"name": "pylab", "arg_names": [], "import_names": ["pl"], "rhs_call_name": "", "annotation": ""}, "snippet": "import pylab as pl"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Import_L36_C0", "label": "sys import sys, optparse, time", "type": "import", "loc": [36, 36], "level": 0, "parent": null, "vector": [1, 0, 0.0398, 0.0011, 0, 0.66, 0.1724, 509, 0, 3, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys", "optparse", "time"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys, optparse, time"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Import_L37_C0", "label": "copy import copy", "type": "import", "loc": [37, 37], "level": 0, "parent": null, "vector": [1, 0, 0.0409, 0.0011, 0, 0.66, 0.2069, 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_99547:ImportFrom_L39_C0", "label": "from enthought.mayavi import mlab", "type": "import", "loc": [39, 39], "level": 0, "parent": null, "vector": [1, 0, 0.0431, 0.0011, 0, 0.66, 0.2414, 226, 0, 1, 0, 0, 226, 0, 0], "semantic": {"name": "enthought.mayavi", "arg_names": [], "import_names": ["mlab"], "rhs_call_name": "", "annotation": ""}, "snippet": "from enthought.mayavi import mlab"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Import_L41_C0", "label": "mekabot.hrl_robot import hr", "type": "import", "loc": [41, 41], "level": 0, "parent": null, "vector": [1, 0, 0.0454, 0.0011, 0, 0.66, 0.2759, 4, 0, 1, 0, 0, 4, 0, 0], "semantic": {"name": "mekabot.hrl_robot", "arg_names": [], "import_names": ["hr"], "rhs_call_name": "", "annotation": ""}, "snippet": "import mekabot.hrl_robot as hr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Import_L43_C0", "label": "hrl_lib.util import ut, tr", "type": "import", "loc": [43, 43], "level": 0, "parent": null, "vector": [1, 0, 0.0476, 0.0011, 0, 0.66, 0.3103, 775, 0, 2, 0, 0, 775, 0, 0], "semantic": {"name": "hrl_lib.util", "arg_names": [], "import_names": ["ut", "tr"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.util as ut, hrl_lib.transforms as tr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Import_L44_C0", "label": "matplotlib_util.util import mpu", "type": "import", "loc": [44, 44], "level": 0, "parent": null, "vector": [1, 0, 0.0487, 0.0011, 0, 0.66, 0.3448, 781, 0, 1, 0, 0, 781, 0, 0], "semantic": {"name": "matplotlib_util.util", "arg_names": [], "import_names": ["mpu"], "rhs_call_name": "", "annotation": ""}, "snippet": "import matplotlib_util.util as mpu"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Import_L45_C0", "label": "hrl_tilting_hokuyo.display_3d_mayavi import d3m", "type": "import", "loc": [45, 45], "level": 0, "parent": null, "vector": [1, 0, 0.0498, 0.0011, 0, 0.66, 0.3793, 181, 0, 1, 0, 0, 181, 0, 0], "semantic": {"name": "hrl_tilting_hokuyo.display_3d_mayavi", "arg_names": [], "import_names": ["d3m"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_tilting_hokuyo.display_3d_mayavi as d3m"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:ClassDef_L49_C0", "label": "JointTrajectory", "type": "class", "loc": [49, 56], "level": 0, "parent": null, "vector": [3, 0, 0.0581, 0.0088, 0, 0.66, 0.4138, 302, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "JointTrajectory", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class JointTrajectory():\n ''' class to store joint trajectories.\n data only - use for pickling.\n '''\n def __init__(self):\n self.time_list = [] # time in seconds\n self.q_list = [] #each element is a list of 7 joint angles.\n self.qdot_list = [] #each element is a list of 7 joint angles."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L50_C4", "label": "expression", "type": "expression", "loc": [50, 52], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:ClassDef_L49_C0", "vector": [8, 1, 0.0564, 0.0033, 1, 0.32, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' class to store joint trajectories.\n data only - use for pickling.\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L53_C4", "label": "__init__", "type": "function", "loc": [53, 56], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:ClassDef_L49_C0", "vector": [2, 1, 0.0603, 0.0044, 1, 0.32, 1.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.time_list = [] # time in seconds\n self.q_list = [] #each element is a list of 7 joint angles.\n self.qdot_list = [] #each element is a list of 7 joint angles."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L54_C8", "label": "self.time_list =", "type": "assigned_variable", "loc": [54, 54], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L53_C4", "vector": [14, 2, 0.0597, 0.0011, 2, 0.37, 0.0, 838, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.time_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.time_list = [] # time in seconds"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L55_C8", "label": "self.q_list =", "type": "assigned_variable", "loc": [55, 55], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L53_C4", "vector": [14, 2, 0.0608, 0.0011, 2, 0.37, 0.5, 339, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.q_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.q_list = [] #each element is a list of 7 joint angles."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L56_C8", "label": "self.qdot_list =", "type": "assigned_variable", "loc": [56, 56], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L53_C4", "vector": [14, 2, 0.0619, 0.0011, 2, 0.37, 1.0, 600, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.qdot_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.qdot_list = [] #each element is a list of 7 joint angles."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:ClassDef_L58_C0", "label": "CartesianTajectory", "type": "class", "loc": [58, 64], "level": 0, "parent": null, "vector": [3, 0, 0.0675, 0.0077, 0, 0.66, 0.4483, 610, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "CartesianTajectory", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class CartesianTajectory():\n ''' class to store trajectory of cartesian points.\n data only - use for pickling\n '''\n def __init__(self):\n self.time_list = [] # time in seconds\n self.p_list = [] #each element is a list of 3 coordinates"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L59_C4", "label": "expression", "type": "expression", "loc": [59, 61], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:ClassDef_L58_C0", "vector": [8, 1, 0.0664, 0.0033, 1, 0.38, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' class to store trajectory of cartesian points.\n data only - use for pickling\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L62_C4", "label": "__init__", "type": "function", "loc": [62, 64], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:ClassDef_L58_C0", "vector": [2, 1, 0.0697, 0.0033, 1, 0.38, 1.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.time_list = [] # time in seconds\n self.p_list = [] #each element is a list of 3 coordinates"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L63_C8", "label": "self.time_list =", "type": "assigned_variable", "loc": [63, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L62_C4", "vector": [14, 2, 0.0697, 0.0011, 2, 0.61, 0.0, 838, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.time_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.time_list = [] # time in seconds"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L64_C8", "label": "self.p_list =", "type": "assigned_variable", "loc": [64, 64], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L62_C4", "vector": [14, 2, 0.0708, 0.0011, 2, 0.61, 1.0, 789, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.p_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.p_list = [] #each element is a list of 3 coordinates"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:ClassDef_L66_C0", "label": "ForceTrajectory", "type": "class", "loc": [66, 72], "level": 0, "parent": null, "vector": [3, 0, 0.0763, 0.0077, 0, 0.66, 0.4828, 306, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "ForceTrajectory", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ForceTrajectory():\n ''' class to store time evolution of the force at the end effector.\n data only - use for pickling\n '''\n def __init__(self):\n self.time_list = [] # time in seconds\n self.f_list = [] #each element is a list of 3 coordinates"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L67_C4", "label": "expression", "type": "expression", "loc": [67, 69], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:ClassDef_L66_C0", "vector": [8, 1, 0.0752, 0.0033, 1, 0.94, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' class to store time evolution of the force at the end effector.\n data only - use for pickling\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L70_C4", "label": "__init__", "type": "function", "loc": [70, 72], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:ClassDef_L66_C0", "vector": [2, 1, 0.0785, 0.0033, 1, 0.94, 1.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.time_list = [] # time in seconds\n self.f_list = [] #each element is a list of 3 coordinates"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L71_C8", "label": "self.time_list =", "type": "assigned_variable", "loc": [71, 71], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L70_C4", "vector": [14, 2, 0.0785, 0.0011, 2, 0.87, 0.0, 838, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.time_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.time_list = [] # time in seconds"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L72_C8", "label": "self.f_list =", "type": "assigned_variable", "loc": [72, 72], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L70_C4", "vector": [14, 2, 0.0796, 0.0011, 2, 0.87, 1.0, 589, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.f_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.f_list = [] #each element is a list of 3 coordinates"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L75_C0", "label": "joint_to_cartesian", "type": "function", "loc": [75, 89], "level": 0, "parent": null, "vector": [2, 0, 0.0907, 0.0166, 0, 0.66, 0.5172, 202, 0, 1, 1, 0, 0, 0, 7], "semantic": {"name": "joint_to_cartesian", "arg_names": ["traj"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def joint_to_cartesian(traj):\n ''' traj - JointTrajectory\n returns CartesianTajectory after performing FK on traj.\n '''\n firenze = hr.M3HrlRobot(connect=False)\n pts = []\n for q in traj.q_list:\n p = firenze.FK('right_arm',q)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L76_C4", "label": "expression", "type": "expression", "loc": [76, 78], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L75_C0", "vector": [8, 1, 0.0852, 0.0033, 1, 0.51, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' traj - JointTrajectory\n returns CartesianTajectory after performing FK on traj.\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L79_C4", "label": "firenze = M3HrlRobot()", "type": "assigned_variable", "loc": [79, 79], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L75_C0", "vector": [14, 1, 0.0874, 0.0011, 1, 0.51, 0.1429, 736, 3, 1, 0, 0, 305, 10, 1], "semantic": {"name": "firenze", "arg_names": [], "import_names": [], "rhs_call_name": "M3HrlRobot", "annotation": ""}, "snippet": " firenze = hr.M3HrlRobot(connect=False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L80_C4", "label": "pts =", "type": "assigned_variable", "loc": [80, 80], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L75_C0", "vector": [14, 1, 0.0885, 0.0011, 1, 0.51, 0.2857, 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_99547:For_L81_C4", "label": "for q", "type": "for", "loc": [81, 83], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L75_C0", "vector": [6, 1, 0.0907, 0.0033, 1, 0.51, 0.4286, 516, 7, 0, 0, 0, 0, 0, 3], "semantic": {"name": "q", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for q in traj.q_list:\n p = firenze.FK('right_arm',q)\n pts.append(p.A1.tolist())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L82_C8", "label": "p = FK()", "type": "assigned_variable", "loc": [82, 82], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L81_C4", "vector": [14, 2, 0.0907, 0.0011, 2, 0.25, 0.0, 491, 3, 2, 0, 0, 252, 10, 1], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "FK", "annotation": ""}, "snippet": " p = firenze.FK('right_arm',q)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L83_C8", "label": "append()", "type": "expression", "loc": [83, 83], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L81_C4", "vector": [8, 2, 0.0918, 0.0011, 2, 0.25, 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_99547:Assign_L85_C4", "label": "ct = CartesianTajectory()", "type": "assigned_variable", "loc": [85, 85], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L75_C0", "vector": [14, 1, 0.094, 0.0011, 1, 0.51, 0.5714, 147, 3, 0, 0, 0, 610, 10, 1], "semantic": {"name": "ct", "arg_names": [], "import_names": [], "rhs_call_name": "CartesianTajectory", "annotation": ""}, "snippet": " ct = CartesianTajectory()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L86_C4", "label": "ct.time_list = copy()", "type": "assigned_variable", "loc": [86, 86], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L75_C0", "vector": [14, 1, 0.0951, 0.0011, 1, 0.51, 0.7143, 654, 3, 1, 0, 0, 739, 10, 1], "semantic": {"name": "ct.time_list", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " ct.time_list = copy.copy(traj.time_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L87_C4", "label": "ct.p_list = copy()", "type": "assigned_variable", "loc": [87, 87], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L75_C0", "vector": [14, 1, 0.0962, 0.0011, 1, 0.51, 0.8571, 841, 3, 1, 0, 0, 739, 10, 1], "semantic": {"name": "ct.p_list", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " ct.p_list = copy.copy(pts)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Return_L89_C4", "label": "return", "type": "return", "loc": [89, 89], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L75_C0", "vector": [13, 1, 0.0985, 0.0011, 1, 0.51, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ct"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L92_C0", "label": "plot_forces_quiver", "type": "function", "loc": [92, 108], "level": 0, "parent": null, "vector": [2, 0, 0.1106, 0.0188, 0, 0.66, 0.5517, 539, 0, 3, 0, 0, 0, 0, 10], "semantic": {"name": "plot_forces_quiver", "arg_names": ["pos_traj", "force_traj", "color"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def plot_forces_quiver(pos_traj,force_traj,color='k'):\n import arm_trajectories as at\n #if traj.__class__ == at.JointTrajectory:\n if isinstance(pos_traj,at.JointTrajectory):\n pos_traj = joint_to_cartesian(pos_traj)\n\n pts = np.matrix(pos_traj.p_list).T\n label_list = ['X coord (m)', 'Y coord (m)', 'Z coord (m)']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Import_L93_C4", "label": "arm_trajectories import at", "type": "import", "loc": [93, 93], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L92_C0", "vector": [1, 1, 0.1029, 0.0011, 1, 0.93, 0.0, 34, 0, 1, 0, 0, 34, 0, 0], "semantic": {"name": "arm_trajectories", "arg_names": [], "import_names": ["at"], "rhs_call_name": "", "annotation": ""}, "snippet": " import arm_trajectories as at"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L95_C4", "label": "if", "type": "if", "loc": [95, 96], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L92_C0", "vector": [4, 1, 0.1056, 0.0022, 1, 0.93, 0.1, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if isinstance(pos_traj,at.JointTrajectory):\n pos_traj = joint_to_cartesian(pos_traj)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L96_C8", "label": "pos_traj = joint_to_cartesian()", "type": "assigned_variable", "loc": [96, 96], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L95_C4", "vector": [14, 2, 0.1062, 0.0011, 2, 0.55, 0.0, 521, 3, 1, 0, 0, 202, 10, 1], "semantic": {"name": "pos_traj", "arg_names": [], "import_names": [], "rhs_call_name": "joint_to_cartesian", "annotation": ""}, "snippet": " pos_traj = joint_to_cartesian(pos_traj)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L98_C4", "label": "pts =", "type": "assigned_variable", "loc": [98, 98], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L92_C0", "vector": [14, 1, 0.1084, 0.0011, 1, 0.93, 0.2, 195, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "pts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pts = np.matrix(pos_traj.p_list).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L99_C4", "label": "label_list =", "type": "assigned_variable", "loc": [99, 99], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L92_C0", "vector": [14, 1, 0.1095, 0.0011, 1, 0.93, 0.3, 887, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "label_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " label_list = ['X coord (m)', 'Y coord (m)', 'Z coord (m)']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L100_C4", "label": "x = tolist()", "type": "assigned_variable", "loc": [100, 100], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L92_C0", "vector": [14, 1, 0.1106, 0.0011, 1, 0.93, 0.4, 190, 3, 0, 0, 0, 185, 10, 1], "semantic": {"name": "x", "arg_names": [], "import_names": [], "rhs_call_name": "tolist", "annotation": ""}, "snippet": " x = pts[0,:].A1.tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L101_C4", "label": "y = tolist()", "type": "assigned_variable", "loc": [101, 101], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L92_C0", "vector": [14, 1, 0.1117, 0.0011, 1, 0.93, 0.5, 304, 3, 0, 0, 0, 185, 10, 1], "semantic": {"name": "y", "arg_names": [], "import_names": [], "rhs_call_name": "tolist", "annotation": ""}, "snippet": " y = pts[1,:].A1.tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L103_C4", "label": "forces =", "type": "assigned_variable", "loc": [103, 103], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L92_C0", "vector": [14, 1, 0.1139, 0.0011, 1, 0.93, 0.6, 817, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "forces", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " forces = np.matrix(force_traj.f_list).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L104_C4", "label": "u = tolist()", "type": "assigned_variable", "loc": [104, 104], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L92_C0", "vector": [14, 1, 0.115, 0.0011, 1, 0.93, 0.7, 609, 3, 0, 0, 0, 185, 10, 1], "semantic": {"name": "u", "arg_names": [], "import_names": [], "rhs_call_name": "tolist", "annotation": ""}, "snippet": " u = (-1*forces[0,:]).A1.tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L105_C4", "label": "v = tolist()", "type": "assigned_variable", "loc": [105, 105], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L92_C0", "vector": [14, 1, 0.1162, 0.0011, 1, 0.93, 0.8, 553, 3, 0, 0, 0, 185, 10, 1], "semantic": {"name": "v", "arg_names": [], "import_names": [], "rhs_call_name": "tolist", "annotation": ""}, "snippet": " v = (-1*forces[1,:]).A1.tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L106_C4", "label": "quiver()", "type": "expression", "loc": [106, 106], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L92_C0", "vector": [8, 1, 0.1173, 0.0011, 1, 0.93, 0.9, 649, 3, 7, 0, 0, 0, 0, 1], "semantic": {"name": "quiver", "arg_names": [], "import_names": [], "rhs_call_name": "quiver", "annotation": ""}, "snippet": " pl.quiver(x,y,u,v,width=0.002,color=color,scale=100.0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L108_C4", "label": "axis()", "type": "expression", "loc": [108, 108], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L92_C0", "vector": [8, 1, 0.1195, 0.0011, 1, 0.93, 1.0, 860, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "axis", "arg_names": [], "import_names": [], "rhs_call_name": "axis", "annotation": ""}, "snippet": " pl.axis('equal')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L110_C0", "label": "plot_cartesian", "type": "function", "loc": [110, 154], "level": 0, "parent": null, "vector": [2, 0, 0.146, 0.0498, 0, 0.66, 0.5862, 991, 0, 8, 0, 0, 0, 0, 23], "semantic": {"name": "plot_cartesian", "arg_names": ["traj", "xaxis", "yaxis", "zaxis", "color", "label", "linewidth", "scatter_size"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def plot_cartesian(traj,xaxis=None,yaxis=None,zaxis=None,color='b',label='_nolegend_',\n linewidth=2,scatter_size=20):\n ''' xaxis - x axis for the graph (0,1 or 2)\n zaxis - for a 3d plot. not implemented.\n '''\n\n import arm_trajectories as at\n #if traj.__class__ == at.JointTrajectory:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L112_C4", "label": "expression", "type": "expression", "loc": [112, 114], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L110_C0", "vector": [8, 1, 0.125, 0.0033, 1, 0.85, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' xaxis - x axis for the graph (0,1 or 2)\n zaxis - for a 3d plot. not implemented.\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Import_L116_C4", "label": "arm_trajectories import at", "type": "import", "loc": [116, 116], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L110_C0", "vector": [1, 1, 0.1283, 0.0011, 1, 0.85, 0.1429, 34, 0, 1, 0, 0, 34, 0, 0], "semantic": {"name": "arm_trajectories", "arg_names": [], "import_names": ["at"], "rhs_call_name": "", "annotation": ""}, "snippet": " import arm_trajectories as at"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L118_C4", "label": "if", "type": "if", "loc": [118, 119], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L110_C0", "vector": [4, 1, 0.1311, 0.0022, 1, 0.85, 0.2857, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if isinstance(traj,at.JointTrajectory):\n traj = joint_to_cartesian(traj)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L119_C8", "label": "traj = joint_to_cartesian()", "type": "assigned_variable", "loc": [119, 119], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L118_C4", "vector": [14, 2, 0.1316, 0.0011, 2, 0.31, 0.0, 742, 3, 1, 0, 0, 202, 10, 1], "semantic": {"name": "traj", "arg_names": [], "import_names": [], "rhs_call_name": "joint_to_cartesian", "annotation": ""}, "snippet": " traj = joint_to_cartesian(traj)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L121_C4", "label": "pts =", "type": "assigned_variable", "loc": [121, 121], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L110_C0", "vector": [14, 1, 0.1338, 0.0011, 1, 0.85, 0.4286, 195, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "pts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pts = np.matrix(traj.p_list).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L122_C4", "label": "label_list =", "type": "assigned_variable", "loc": [122, 122], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L110_C0", "vector": [14, 1, 0.135, 0.0011, 1, 0.85, 0.5714, 887, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "label_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " label_list = ['X coord (m)', 'Y coord (m)', 'Z coord (m)']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L123_C4", "label": "x = tolist()", "type": "assigned_variable", "loc": [123, 123], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L110_C0", "vector": [14, 1, 0.1361, 0.0011, 1, 0.85, 0.7143, 190, 3, 0, 0, 0, 185, 10, 1], "semantic": {"name": "x", "arg_names": [], "import_names": [], "rhs_call_name": "tolist", "annotation": ""}, "snippet": " x = pts[xaxis,:].A1.tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L124_C4", "label": "y = tolist()", "type": "assigned_variable", "loc": [124, 124], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L110_C0", "vector": [14, 1, 0.1372, 0.0011, 1, 0.85, 0.8571, 304, 3, 0, 0, 0, 185, 10, 1], "semantic": {"name": "y", "arg_names": [], "import_names": [], "rhs_call_name": "tolist", "annotation": ""}, "snippet": " y = pts[yaxis,:].A1.tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L126_C4", "label": "if", "type": "if", "loc": [126, 154], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L110_C0", "vector": [4, 1, 0.1549, 0.0321, 1, 0.85, 1.0, 0, 0, 0, 0, 0, 0, 0, 18], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if zaxis == None:\n pl.plot(x,y,c=color,linewidth=linewidth,label=label)\n pl.scatter(x,y,c=color,s=scatter_size,label='_nolegend_', linewidths=0)\n pl.xlabel(label_list[xaxis])\n pl.ylabel(label_list[yaxis])\n pl.legend(loc='best')\n pl.axis('equal')\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L127_C8", "label": "plot()", "type": "expression", "loc": [127, 127], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L126_C4", "vector": [8, 2, 0.1405, 0.0011, 2, 0.6, 0.0, 929, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "plot", "arg_names": [], "import_names": [], "rhs_call_name": "plot", "annotation": ""}, "snippet": " pl.plot(x,y,c=color,linewidth=linewidth,label=label)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L128_C8", "label": "scatter()", "type": "expression", "loc": [128, 128], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L126_C4", "vector": [8, 2, 0.1416, 0.0011, 2, 0.6, 0.0455, 990, 3, 6, 0, 0, 0, 0, 1], "semantic": {"name": "scatter", "arg_names": [], "import_names": [], "rhs_call_name": "scatter", "annotation": ""}, "snippet": " pl.scatter(x,y,c=color,s=scatter_size,label='_nolegend_', linewidths=0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L129_C8", "label": "xlabel()", "type": "expression", "loc": [129, 129], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L126_C4", "vector": [8, 2, 0.1427, 0.0011, 2, 0.6, 0.0909, 676, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "xlabel", "arg_names": [], "import_names": [], "rhs_call_name": "xlabel", "annotation": ""}, "snippet": " pl.xlabel(label_list[xaxis])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L130_C8", "label": "ylabel()", "type": "expression", "loc": [130, 130], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L126_C4", "vector": [8, 2, 0.1438, 0.0011, 2, 0.6, 0.1364, 584, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "ylabel", "arg_names": [], "import_names": [], "rhs_call_name": "ylabel", "annotation": ""}, "snippet": " pl.ylabel(label_list[yaxis])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L131_C8", "label": "legend()", "type": "expression", "loc": [131, 131], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L126_C4", "vector": [8, 2, 0.1449, 0.0011, 2, 0.6, 0.1818, 880, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "legend", "arg_names": [], "import_names": [], "rhs_call_name": "legend", "annotation": ""}, "snippet": " pl.legend(loc='best')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L132_C8", "label": "axis()", "type": "expression", "loc": [132, 132], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L126_C4", "vector": [8, 2, 0.146, 0.0011, 2, 0.6, 0.2273, 860, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "axis", "arg_names": [], "import_names": [], "rhs_call_name": "axis", "annotation": ""}, "snippet": " pl.axis('equal')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:ImportFrom_L134_C8", "label": "from numpy import array", "type": "import", "loc": [134, 134], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L126_C4", "vector": [1, 2, 0.1482, 0.0011, 2, 0.6, 0.2727, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["array"], "rhs_call_name": "", "annotation": ""}, "snippet": " from numpy import array"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:ImportFrom_L135_C8", "label": "from enthought.mayavi.api import Engine", "type": "import", "loc": [135, 135], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L126_C4", "vector": [1, 2, 0.1493, 0.0011, 2, 0.6, 0.3182, 111, 0, 1, 0, 0, 111, 0, 0], "semantic": {"name": "enthought.mayavi.api", "arg_names": [], "import_names": ["Engine"], "rhs_call_name": "", "annotation": ""}, "snippet": " from enthought.mayavi.api import Engine"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L136_C8", "label": "engine = Engine()", "type": "assigned_variable", "loc": [136, 136], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L126_C4", "vector": [14, 2, 0.1504, 0.0011, 2, 0.6, 0.3636, 3, 3, 0, 0, 0, 298, 10, 1], "semantic": {"name": "engine", "arg_names": [], "import_names": [], "rhs_call_name": "Engine", "annotation": ""}, "snippet": " engine = Engine()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L137_C8", "label": "start()", "type": "expression", "loc": [137, 137], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L126_C4", "vector": [8, 2, 0.1515, 0.0011, 2, 0.6, 0.4091, 511, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "start", "arg_names": [], "import_names": [], "rhs_call_name": "start", "annotation": ""}, "snippet": " engine.start()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L138_C8", "label": "if", "type": "if", "loc": [138, 139], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L126_C4", "vector": [4, 2, 0.1532, 0.0022, 2, 0.6, 0.4545, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(engine.scenes) == 0:\n engine.new_scene()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L139_C12", "label": "new_scene()", "type": "expression", "loc": [139, 139], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L138_C8", "vector": [8, 3, 0.1538, 0.0011, 3, 0.37, 0.0, 16, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "new_scene", "arg_names": [], "import_names": [], "rhs_call_name": "new_scene", "annotation": ""}, "snippet": " engine.new_scene()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L141_C8", "label": "z = tolist()", "type": "assigned_variable", "loc": [141, 141], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L126_C4", "vector": [14, 2, 0.156, 0.0011, 2, 0.6, 0.5, 859, 3, 0, 0, 0, 185, 10, 1], "semantic": {"name": "z", "arg_names": [], "import_names": [], "rhs_call_name": "tolist", "annotation": ""}, "snippet": " z = pts[zaxis,:].A1.tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L142_C8", "label": "time_list =", "type": "assigned_variable", "loc": [142, 142], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L126_C4", "vector": [14, 2, 0.1571, 0.0011, 2, 0.6, 0.5455, 941, 5, 0, 0, 0, 0, 0, 0], "semantic": {"name": "time_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " time_list = [t-traj.time_list[0] for t in traj.time_list]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L143_C8", "label": "plot3d()", "type": "expression", "loc": [143, 143], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L126_C4", "vector": [8, 2, 0.1582, 0.0011, 2, 0.6, 0.5909, 290, 3, 6, 0, 0, 0, 0, 1], "semantic": {"name": "plot3d", "arg_names": [], "import_names": [], "rhs_call_name": "plot3d", "annotation": ""}, "snippet": " mlab.plot3d(x,y,z,time_list,tube_radius=None,line_width=4)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L144_C8", "label": "axes()", "type": "expression", "loc": [144, 144], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L126_C4", "vector": [8, 2, 0.1593, 0.0011, 2, 0.6, 0.6364, 590, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "axes", "arg_names": [], "import_names": [], "rhs_call_name": "axes", "annotation": ""}, "snippet": " mlab.axes()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L145_C8", "label": "xlabel()", "type": "expression", "loc": [145, 145], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L126_C4", "vector": [8, 2, 0.1604, 0.0011, 2, 0.6, 0.6818, 676, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "xlabel", "arg_names": [], "import_names": [], "rhs_call_name": "xlabel", "annotation": ""}, "snippet": " mlab.xlabel(label_list[xaxis])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L146_C8", "label": "ylabel()", "type": "expression", "loc": [146, 146], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L126_C4", "vector": [8, 2, 0.1615, 0.0011, 2, 0.6, 0.7273, 584, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "ylabel", "arg_names": [], "import_names": [], "rhs_call_name": "ylabel", "annotation": ""}, "snippet": " mlab.ylabel(label_list[yaxis])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L147_C8", "label": "zlabel()", "type": "expression", "loc": [147, 147], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L126_C4", "vector": [8, 2, 0.1626, 0.0011, 2, 0.6, 0.7727, 557, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "zlabel", "arg_names": [], "import_names": [], "rhs_call_name": "zlabel", "annotation": ""}, "snippet": " mlab.zlabel(label_list[zaxis])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L148_C8", "label": "colorbar()", "type": "expression", "loc": [148, 148], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L126_C4", "vector": [8, 2, 0.1637, 0.0011, 2, 0.6, 0.8182, 915, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "colorbar", "arg_names": [], "import_names": [], "rhs_call_name": "colorbar", "annotation": ""}, "snippet": " mlab.colorbar(title='Time')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L151_C8", "label": "axes =", "type": "assigned_variable", "loc": [151, 151], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L126_C4", "vector": [14, 2, 0.167, 0.0011, 2, 0.6, 0.8636, 590, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "axes", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " axes = engine.scenes[0].children[0].children[0].children[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L152_C8", "label": "axes.axes.position = array()", "type": "assigned_variable", "loc": [152, 152], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L126_C4", "vector": [14, 2, 0.1681, 0.0011, 2, 0.6, 0.9091, 929, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "axes.axes.position", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " axes.axes.position = array([ 0., 0.])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L153_C8", "label": "axes.axes.label_format =", "type": "assigned_variable", "loc": [153, 153], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L126_C4", "vector": [14, 2, 0.1692, 0.0011, 2, 0.6, 0.9545, 354, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "axes.axes.label_format", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " axes.axes.label_format = '%-#6.2g'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L154_C8", "label": "axes.title_text_property.font_size =", "type": "assigned_variable", "loc": [154, 154], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L126_C4", "vector": [14, 2, 0.1704, 0.0011, 2, 0.6, 1.0, 699, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "axes.title_text_property.font_size", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " axes.title_text_property.font_size=4"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L162_C0", "label": "compute_forces", "type": "function", "loc": [162, 210], "level": 0, "parent": null, "vector": [2, 0, 0.2058, 0.0542, 0, 0.66, 0.6207, 761, 0, 4, 1, 0, 0, 0, 35], "semantic": {"name": "compute_forces", "arg_names": ["q_actual_traj", "q_eq_traj", "torque_traj", "rel_stiffness_list"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def compute_forces(q_actual_traj,q_eq_traj,torque_traj,rel_stiffness_list):\n firenze = hr.M3HrlRobot(connect=False)\n\n d_gains_list_mN_deg_sec = [-100,-120,-15,-25,-1.25]\n d_gains_list = [180./1000.*s/math.pi for s in d_gains_list_mN_deg_sec]\n\n stiff_list_mNm_deg = [1800,1300,350,600,60]\n stiff_list_Nm_rad = [180./1000.*s/math.pi for s in stiff_list_mNm_deg]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L163_C4", "label": "firenze = M3HrlRobot()", "type": "assigned_variable", "loc": [163, 163], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L162_C0", "vector": [14, 1, 0.1803, 0.0011, 1, 0.5, 0.0, 736, 3, 1, 0, 0, 305, 10, 1], "semantic": {"name": "firenze", "arg_names": [], "import_names": [], "rhs_call_name": "M3HrlRobot", "annotation": ""}, "snippet": " firenze = hr.M3HrlRobot(connect=False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L165_C4", "label": "d_gains_list_mN_deg_sec =", "type": "assigned_variable", "loc": [165, 165], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L162_C0", "vector": [14, 1, 0.1825, 0.0011, 1, 0.5, 0.0625, 995, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "d_gains_list_mN_deg_sec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " d_gains_list_mN_deg_sec = [-100,-120,-15,-25,-1.25]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L166_C4", "label": "d_gains_list =", "type": "assigned_variable", "loc": [166, 166], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L162_C0", "vector": [14, 1, 0.1836, 0.0011, 1, 0.5, 0.125, 818, 5, 0, 0, 0, 0, 0, 0], "semantic": {"name": "d_gains_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " d_gains_list = [180./1000.*s/math.pi for s in d_gains_list_mN_deg_sec]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L168_C4", "label": "stiff_list_mNm_deg =", "type": "assigned_variable", "loc": [168, 168], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L162_C0", "vector": [14, 1, 0.1858, 0.0011, 1, 0.5, 0.1875, 301, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "stiff_list_mNm_deg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " stiff_list_mNm_deg = [1800,1300,350,600,60]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L169_C4", "label": "stiff_list_Nm_rad =", "type": "assigned_variable", "loc": [169, 169], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L162_C0", "vector": [14, 1, 0.1869, 0.0011, 1, 0.5, 0.25, 759, 5, 0, 0, 0, 0, 0, 0], "semantic": {"name": "stiff_list_Nm_rad", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " stiff_list_Nm_rad = [180./1000.*s/math.pi for s in stiff_list_mNm_deg]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L172_C4", "label": "dia =", "type": "assigned_variable", "loc": [172, 172], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L162_C0", "vector": [14, 1, 0.1903, 0.0011, 1, 0.5, 0.3125, 197, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "dia", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " dia = np.array(rel_stiffness_list) * np.array(stiff_list_Nm_rad)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L173_C4", "label": "k_q = matrix()", "type": "assigned_variable", "loc": [173, 173], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L162_C0", "vector": [14, 1, 0.1914, 0.0011, 1, 0.5, 0.375, 608, 3, 1, 0, 0, 162, 10, 2], "semantic": {"name": "k_q", "arg_names": [], "import_names": [], "rhs_call_name": "matrix", "annotation": ""}, "snippet": " k_q = np.matrix(np.diag(dia))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L174_C4", "label": "dia_inv =", "type": "assigned_variable", "loc": [174, 174], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L162_C0", "vector": [14, 1, 0.1925, 0.0011, 1, 0.5, 0.4375, 822, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "dia_inv", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " dia_inv = 1./dia"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L175_C4", "label": "k_q_inv = matrix()", "type": "assigned_variable", "loc": [175, 175], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L162_C0", "vector": [14, 1, 0.1936, 0.0011, 1, 0.5, 0.5, 181, 3, 1, 0, 0, 162, 10, 2], "semantic": {"name": "k_q_inv", "arg_names": [], "import_names": [], "rhs_call_name": "matrix", "annotation": ""}, "snippet": " k_q_inv = np.matrix(np.diag(dia_inv))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L177_C4", "label": "actual_cart = joint_to_cartesian()", "type": "assigned_variable", "loc": [177, 177], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L162_C0", "vector": [14, 1, 0.1958, 0.0011, 1, 0.5, 0.5625, 950, 3, 1, 0, 0, 202, 10, 1], "semantic": {"name": "actual_cart", "arg_names": [], "import_names": [], "rhs_call_name": "joint_to_cartesian", "annotation": ""}, "snippet": " actual_cart = joint_to_cartesian(q_actual_traj)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L178_C4", "label": "eq_cart = joint_to_cartesian()", "type": "assigned_variable", "loc": [178, 178], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L162_C0", "vector": [14, 1, 0.1969, 0.0011, 1, 0.5, 0.625, 945, 3, 1, 0, 0, 202, 10, 1], "semantic": {"name": "eq_cart", "arg_names": [], "import_names": [], "rhs_call_name": "joint_to_cartesian", "annotation": ""}, "snippet": " eq_cart = joint_to_cartesian(q_eq_traj)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L179_C4", "label": "force_traj_jacinv = ForceTrajectory()", "type": "assigned_variable", "loc": [179, 179], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L162_C0", "vector": [14, 1, 0.198, 0.0011, 1, 0.5, 0.6875, 812, 3, 0, 0, 0, 306, 10, 1], "semantic": {"name": "force_traj_jacinv", "arg_names": [], "import_names": [], "rhs_call_name": "ForceTrajectory", "annotation": ""}, "snippet": " force_traj_jacinv = ForceTrajectory()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L180_C4", "label": "force_traj_stiff = ForceTrajectory()", "type": "assigned_variable", "loc": [180, 180], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L162_C0", "vector": [14, 1, 0.1991, 0.0011, 1, 0.5, 0.75, 242, 3, 0, 0, 0, 306, 10, 1], "semantic": {"name": "force_traj_stiff", "arg_names": [], "import_names": [], "rhs_call_name": "ForceTrajectory", "annotation": ""}, "snippet": " force_traj_stiff = ForceTrajectory()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L181_C4", "label": "force_traj_torque = ForceTrajectory()", "type": "assigned_variable", "loc": [181, 181], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L162_C0", "vector": [14, 1, 0.2002, 0.0011, 1, 0.5, 0.8125, 577, 3, 0, 0, 0, 306, 10, 1], "semantic": {"name": "force_traj_torque", "arg_names": [], "import_names": [], "rhs_call_name": "ForceTrajectory", "annotation": ""}, "snippet": " force_traj_torque = ForceTrajectory()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L183_C4", "label": "k_cart_list =", "type": "assigned_variable", "loc": [183, 183], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L162_C0", "vector": [14, 1, 0.2024, 0.0011, 1, 0.5, 0.875, 858, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "k_cart_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " k_cart_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L185_C4", "label": "for q_actual, q_dot, q_eq, actual_pos, eq_pos, t, tau_m", "type": "for", "loc": [185, 208], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L162_C0", "vector": [6, 1, 0.2174, 0.0265, 1, 0.5, 0.9375, 854, 3, 0, 0, 0, 0, 0, 23], "semantic": {"name": "q_actual, q_dot, q_eq, actual_pos, eq_pos, t, tau_m", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for q_actual,q_dot,q_eq,actual_pos,eq_pos,t,tau_m in zip(q_actual_traj.q_list,q_actual_traj.qdot_list,q_eq_traj.q_list,actual_cart.p_list,eq_cart.p_list,q_actual_traj.time_list,torque_traj.q_list):\n\n q_eq = firenze.clamp_to_physical_joint_limits('right_arm',q_eq)\n q_delta = np.matrix(q_actual).T - np.matrix(q_eq).T\n tau = k_q * q_delta[0:5,0] - np.matrix(np.array(d_gains_list)*np.array(q_dot)[0:5]).T\n\n x_delta = np.matrix(actual_pos).T - np.matrix(eq_pos).T\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L187_C8", "label": "q_eq = clamp_to_physical_joint_limits()", "type": "assigned_variable", "loc": [187, 187], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L185_C4", "vector": [14, 2, 0.2069, 0.0011, 2, 0.9, 0.0, 498, 3, 2, 0, 0, 68, 10, 1], "semantic": {"name": "q_eq", "arg_names": [], "import_names": [], "rhs_call_name": "clamp_to_physical_joint_limits", "annotation": ""}, "snippet": " q_eq = firenze.clamp_to_physical_joint_limits('right_arm',q_eq)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L188_C8", "label": "q_delta =", "type": "assigned_variable", "loc": [188, 188], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L185_C4", "vector": [14, 2, 0.208, 0.0011, 2, 0.9, 0.0667, 607, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "q_delta", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " q_delta = np.matrix(q_actual).T - np.matrix(q_eq).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L189_C8", "label": "tau =", "type": "assigned_variable", "loc": [189, 189], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L185_C4", "vector": [14, 2, 0.2091, 0.0011, 2, 0.9, 0.1333, 329, 4, 0, 0, 0, 0, 0, 3], "semantic": {"name": "tau", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tau = k_q * q_delta[0:5,0] - np.matrix(np.array(d_gains_list)*np.array(q_dot)[0:5]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L191_C8", "label": "x_delta =", "type": "assigned_variable", "loc": [191, 191], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L185_C4", "vector": [14, 2, 0.2113, 0.0011, 2, 0.9, 0.2, 688, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "x_delta", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " x_delta = np.matrix(actual_pos).T - np.matrix(eq_pos).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L193_C8", "label": "jac_full = Jac()", "type": "assigned_variable", "loc": [193, 193], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L185_C4", "vector": [14, 2, 0.2135, 0.0011, 2, 0.9, 0.2667, 250, 3, 2, 0, 0, 115, 10, 1], "semantic": {"name": "jac_full", "arg_names": [], "import_names": [], "rhs_call_name": "Jac", "annotation": ""}, "snippet": " jac_full = firenze.Jac('right_arm',q_actual)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L194_C8", "label": "jac =", "type": "assigned_variable", "loc": [194, 194], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L185_C4", "vector": [14, 2, 0.2146, 0.0011, 2, 0.9, 0.3333, 812, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "jac", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " jac = jac_full[0:3,0:5]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L196_C8", "label": "jac_full_eq = Jac()", "type": "assigned_variable", "loc": [196, 196], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L185_C4", "vector": [14, 2, 0.2168, 0.0011, 2, 0.9, 0.4, 376, 3, 2, 0, 0, 115, 10, 1], "semantic": {"name": "jac_full_eq", "arg_names": [], "import_names": [], "rhs_call_name": "Jac", "annotation": ""}, "snippet": " jac_full_eq = firenze.Jac('right_arm',q_eq)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L197_C8", "label": "jac_eq =", "type": "assigned_variable", "loc": [197, 197], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L185_C4", "vector": [14, 2, 0.2179, 0.0011, 2, 0.9, 0.4667, 894, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "jac_eq", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " jac_eq = jac_full_eq[0:3,0:5]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L198_C8", "label": "k_cart = inv()", "type": "assigned_variable", "loc": [198, 198], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L185_C4", "vector": [14, 2, 0.219, 0.0011, 2, 0.9, 0.5333, 784, 3, 1, 0, 0, 761, 10, 1], "semantic": {"name": "k_cart", "arg_names": [], "import_names": [], "rhs_call_name": "inv", "annotation": ""}, "snippet": " k_cart = np.linalg.inv((jac_eq*k_q_inv*jac_eq.T)) # calculating stiff matrix using Jacobian for eq pt."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L199_C8", "label": "append()", "type": "expression", "loc": [199, 199], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L185_C4", "vector": [8, 2, 0.2201, 0.0011, 2, 0.9, 0.6, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " k_cart_list.append(k_cart)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L201_C8", "label": "pseudo_inv_jac =", "type": "assigned_variable", "loc": [201, 201], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L185_C4", "vector": [14, 2, 0.2223, 0.0011, 2, 0.9, 0.6667, 310, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "pseudo_inv_jac", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pseudo_inv_jac = np.linalg.inv(jac_full*jac_full.T)*jac_full"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L203_C8", "label": "tau_full = row_stack()", "type": "assigned_variable", "loc": [203, 203], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L185_C4", "vector": [14, 2, 0.2246, 0.0011, 2, 0.9, 0.7333, 389, 3, 1, 0, 0, 612, 10, 2], "semantic": {"name": "tau_full", "arg_names": [], "import_names": [], "rhs_call_name": "row_stack", "annotation": ""}, "snippet": " tau_full = np.row_stack((tau,np.matrix(tau_m[5:7]).T))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L205_C8", "label": "force =", "type": "assigned_variable", "loc": [205, 205], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L185_C4", "vector": [14, 2, 0.2268, 0.0011, 2, 0.9, 0.8, 77, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "force", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " force = -1*pseudo_inv_jac[0:3,0:5]*tau"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L206_C8", "label": "append()", "type": "expression", "loc": [206, 206], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L185_C4", "vector": [8, 2, 0.2279, 0.0011, 2, 0.9, 0.8667, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " force_traj_jacinv.f_list.append(force.A1.tolist())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L207_C8", "label": "append()", "type": "expression", "loc": [207, 207], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L185_C4", "vector": [8, 2, 0.229, 0.0011, 2, 0.9, 0.9333, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " force_traj_stiff.f_list.append((k_cart*x_delta).A1.tolist())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L208_C8", "label": "append()", "type": "expression", "loc": [208, 208], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L185_C4", "vector": [8, 2, 0.2301, 0.0011, 2, 0.9, 1.0, 243, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " force_traj_torque.f_list.append((pseudo_inv_jac*np.matrix(tau_m).T)[0:3].A1.tolist())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Return_L210_C4", "label": "return", "type": "return", "loc": [210, 210], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L162_C0", "vector": [13, 1, 0.2323, 0.0011, 1, 0.5, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return force_traj_jacinv,force_traj_stiff,force_traj_torque,k_cart_list"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L218_C0", "label": "compute_radial_tangential_forces", "type": "function", "loc": [218, 230], "level": 0, "parent": null, "vector": [2, 0, 0.2478, 0.0144, 0, 0.66, 0.6552, 224, 0, 4, 1, 0, 0, 0, 9], "semantic": {"name": "compute_radial_tangential_forces", "arg_names": ["f_list", "p_list", "cx", "cy"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def compute_radial_tangential_forces(f_list,p_list,cx,cy):\n f_rad_l,f_tan_l = [],[]\n for f,p in zip(f_list,p_list):\n rad_vec = np.array([p[0]-cx,p[1]-cy])\n rad_vec = rad_vec/np.linalg.norm(rad_vec)\n f_vec = np.array([f[0],f[1]])\n f_rad_mag = np.dot(f_vec,rad_vec)\n f_tan_mag = np.linalg.norm(f_vec-rad_vec*f_rad_mag)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L219_C4", "label": "f_rad_l, f_tan_l =", "type": "assigned_variable", "loc": [219, 219], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L218_C0", "vector": [14, 1, 0.2423, 0.0011, 1, 0.47, 0.0, 127, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "f_rad_l, f_tan_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " f_rad_l,f_tan_l = [],[]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L220_C4", "label": "for f, p", "type": "for", "loc": [220, 228], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L218_C0", "vector": [6, 1, 0.2478, 0.01, 1, 0.47, 0.5, 749, 3, 0, 0, 0, 0, 0, 9], "semantic": {"name": "f, p", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for f,p in zip(f_list,p_list):\n rad_vec = np.array([p[0]-cx,p[1]-cy])\n rad_vec = rad_vec/np.linalg.norm(rad_vec)\n f_vec = np.array([f[0],f[1]])\n f_rad_mag = np.dot(f_vec,rad_vec)\n f_tan_mag = np.linalg.norm(f_vec-rad_vec*f_rad_mag)\n f_rad_mag = abs(f_rad_mag)\n f_rad_l.append(f_rad_mag)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L221_C8", "label": "rad_vec = array()", "type": "assigned_variable", "loc": [221, 221], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L220_C4", "vector": [14, 2, 0.2445, 0.0011, 2, 0.4, 0.0, 331, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "rad_vec", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " rad_vec = np.array([p[0]-cx,p[1]-cy])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L222_C8", "label": "rad_vec =", "type": "assigned_variable", "loc": [222, 222], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L220_C4", "vector": [14, 2, 0.2456, 0.0011, 2, 0.4, 0.1429, 331, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "rad_vec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rad_vec = rad_vec/np.linalg.norm(rad_vec)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L223_C8", "label": "f_vec = array()", "type": "assigned_variable", "loc": [223, 223], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L220_C4", "vector": [14, 2, 0.2467, 0.0011, 2, 0.4, 0.2857, 231, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "f_vec", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " f_vec = np.array([f[0],f[1]])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L224_C8", "label": "f_rad_mag = dot()", "type": "assigned_variable", "loc": [224, 224], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L220_C4", "vector": [14, 2, 0.2478, 0.0011, 2, 0.4, 0.4286, 421, 3, 2, 0, 0, 310, 10, 1], "semantic": {"name": "f_rad_mag", "arg_names": [], "import_names": [], "rhs_call_name": "dot", "annotation": ""}, "snippet": " f_rad_mag = np.dot(f_vec,rad_vec)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L225_C8", "label": "f_tan_mag = norm()", "type": "assigned_variable", "loc": [225, 225], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L220_C4", "vector": [14, 2, 0.2489, 0.0011, 2, 0.4, 0.5714, 345, 3, 1, 0, 0, 902, 10, 1], "semantic": {"name": "f_tan_mag", "arg_names": [], "import_names": [], "rhs_call_name": "norm", "annotation": ""}, "snippet": " f_tan_mag = np.linalg.norm(f_vec-rad_vec*f_rad_mag)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L226_C8", "label": "f_rad_mag = abs()", "type": "assigned_variable", "loc": [226, 226], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L220_C4", "vector": [14, 2, 0.25, 0.0011, 2, 0.4, 0.7143, 421, 3, 1, 0, 0, 799, 10, 1], "semantic": {"name": "f_rad_mag", "arg_names": [], "import_names": [], "rhs_call_name": "abs", "annotation": ""}, "snippet": " f_rad_mag = abs(f_rad_mag)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L227_C8", "label": "append()", "type": "expression", "loc": [227, 227], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L220_C4", "vector": [8, 2, 0.2511, 0.0011, 2, 0.4, 0.8571, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " f_rad_l.append(f_rad_mag)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L228_C8", "label": "append()", "type": "expression", "loc": [228, 228], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L220_C4", "vector": [8, 2, 0.2522, 0.0011, 2, 0.4, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " f_tan_l.append(f_tan_mag)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Return_L230_C4", "label": "return", "type": "return", "loc": [230, 230], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L218_C0", "vector": [13, 1, 0.2544, 0.0011, 1, 0.47, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return f_rad_l,f_tan_l"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L233_C0", "label": "plot_error_forces", "type": "function", "loc": [233, 291], "level": 0, "parent": null, "vector": [2, 0, 0.2898, 0.0653, 0, 0.66, 0.6897, 432, 0, 2, 0, 0, 0, 0, 51], "semantic": {"name": "plot_error_forces", "arg_names": ["measured_list", "calc_list"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def plot_error_forces(measured_list,calc_list):\n err_x, err_y = [],[]\n err_rel_x, err_rel_y = [],[]\n mag_x, mag_y = [],[]\n for m,c in zip(measured_list,calc_list):\n err_x.append(abs(m[0]-c[0]))\n err_rel_x.append(abs(m[0]-c[0])/abs(m[0])*100)\n #err_rel_x.append(ut.bound(abs(m[0]-c[0])/abs(m[0])*100,100,0))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L234_C4", "label": "err_x, err_y =", "type": "assigned_variable", "loc": [234, 234], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L233_C0", "vector": [14, 1, 0.2588, 0.0011, 1, 0.69, 0.0, 879, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "err_x, err_y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " err_x, err_y = [],[]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L235_C4", "label": "err_rel_x, err_rel_y =", "type": "assigned_variable", "loc": [235, 235], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L233_C0", "vector": [14, 1, 0.26, 0.0011, 1, 0.69, 0.0256, 892, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "err_rel_x, err_rel_y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " err_rel_x, err_rel_y = [],[]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L236_C4", "label": "mag_x, mag_y =", "type": "assigned_variable", "loc": [236, 236], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L233_C0", "vector": [14, 1, 0.2611, 0.0011, 1, 0.69, 0.0513, 213, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "mag_x, mag_y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mag_x, mag_y = [],[]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L237_C4", "label": "for m, c", "type": "for", "loc": [237, 245], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L233_C0", "vector": [6, 1, 0.2666, 0.01, 1, 0.69, 0.0769, 557, 3, 0, 0, 0, 0, 0, 15], "semantic": {"name": "m, c", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for m,c in zip(measured_list,calc_list):\n err_x.append(abs(m[0]-c[0]))\n err_rel_x.append(abs(m[0]-c[0])/abs(m[0])*100)\n #err_rel_x.append(ut.bound(abs(m[0]-c[0])/abs(m[0])*100,100,0))\n mag_x.append(abs(m[0]))\n err_y.append(abs(m[1]-c[1]))\n err_rel_y.append(abs(m[1]-c[1])/abs(m[1])*100)\n #err_rel_y.append(ut.bound(abs(m[1]-c[1])/abs(m[1])*100,100,0))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L238_C8", "label": "append()", "type": "expression", "loc": [238, 238], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L237_C4", "vector": [8, 2, 0.2633, 0.0011, 2, 0.12, 0.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " err_x.append(abs(m[0]-c[0]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L239_C8", "label": "append()", "type": "expression", "loc": [239, 239], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L237_C4", "vector": [8, 2, 0.2644, 0.0011, 2, 0.12, 0.2, 243, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " err_rel_x.append(abs(m[0]-c[0])/abs(m[0])*100)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L241_C8", "label": "append()", "type": "expression", "loc": [241, 241], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L237_C4", "vector": [8, 2, 0.2666, 0.0011, 2, 0.12, 0.4, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " mag_x.append(abs(m[0]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L242_C8", "label": "append()", "type": "expression", "loc": [242, 242], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L237_C4", "vector": [8, 2, 0.2677, 0.0011, 2, 0.12, 0.6, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " err_y.append(abs(m[1]-c[1]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L243_C8", "label": "append()", "type": "expression", "loc": [243, 243], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L237_C4", "vector": [8, 2, 0.2688, 0.0011, 2, 0.12, 0.8, 243, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " err_rel_y.append(abs(m[1]-c[1])/abs(m[1])*100)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L245_C8", "label": "append()", "type": "expression", "loc": [245, 245], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L237_C4", "vector": [8, 2, 0.271, 0.0011, 2, 0.12, 1.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " mag_y.append(abs(m[1]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L247_C4", "label": "x_idx = range()", "type": "assigned_variable", "loc": [247, 247], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L233_C0", "vector": [14, 1, 0.2732, 0.0011, 1, 0.69, 0.1026, 380, 3, 1, 0, 0, 816, 10, 2], "semantic": {"name": "x_idx", "arg_names": [], "import_names": [], "rhs_call_name": "range", "annotation": ""}, "snippet": " x_idx = range(len(err_x))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L248_C4", "label": "zero =", "type": "assigned_variable", "loc": [248, 248], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L233_C0", "vector": [14, 1, 0.2743, 0.0011, 1, 0.69, 0.1282, 14, 5, 0, 0, 0, 0, 0, 0], "semantic": {"name": "zero", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " zero = [0 for i in x_idx]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L250_C4", "label": "fig = figure()", "type": "assigned_variable", "loc": [250, 250], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L233_C0", "vector": [14, 1, 0.2765, 0.0011, 1, 0.69, 0.1538, 806, 3, 0, 0, 0, 789, 10, 1], "semantic": {"name": "fig", "arg_names": [], "import_names": [], "rhs_call_name": "figure", "annotation": ""}, "snippet": " fig = pl.figure()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L251_C4", "label": "ax1 = add_subplot()", "type": "assigned_variable", "loc": [251, 251], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L233_C0", "vector": [14, 1, 0.2777, 0.0011, 1, 0.69, 0.1795, 946, 3, 1, 0, 0, 449, 10, 1], "semantic": {"name": "ax1", "arg_names": [], "import_names": [], "rhs_call_name": "add_subplot", "annotation": ""}, "snippet": " ax1 = fig.add_subplot(111)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L252_C4", "label": "ax2 = twinx()", "type": "assigned_variable", "loc": [252, 252], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L233_C0", "vector": [14, 1, 0.2788, 0.0011, 1, 0.69, 0.2051, 144, 3, 0, 0, 0, 165, 10, 1], "semantic": {"name": "ax2", "arg_names": [], "import_names": [], "rhs_call_name": "twinx", "annotation": ""}, "snippet": " ax2 = ax1.twinx()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L254_C4", "label": "plot()", "type": "expression", "loc": [254, 254], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L233_C0", "vector": [8, 1, 0.281, 0.0011, 1, 0.69, 0.2308, 929, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "plot", "arg_names": [], "import_names": [], "rhs_call_name": "plot", "annotation": ""}, "snippet": " ax1.plot(zero,c='k',linewidth=1,label='_nolegend_')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L255_C4", "label": "l1 = plot()", "type": "assigned_variable", "loc": [255, 255], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L233_C0", "vector": [14, 1, 0.2821, 0.0011, 1, 0.69, 0.2564, 888, 3, 4, 0, 0, 929, 10, 1], "semantic": {"name": "l1", "arg_names": [], "import_names": [], "rhs_call_name": "plot", "annotation": ""}, "snippet": " l1 = ax1.plot(err_x,c='b',linewidth=1,label='absolute error')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L256_C4", "label": "scatter()", "type": "expression", "loc": [256, 256], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L233_C0", "vector": [8, 1, 0.2832, 0.0011, 1, 0.69, 0.2821, 990, 3, 6, 0, 0, 0, 0, 1], "semantic": {"name": "scatter", "arg_names": [], "import_names": [], "rhs_call_name": "scatter", "annotation": ""}, "snippet": " ax1.scatter(x_idx,err_x,c='b',s=10,label='_nolegend_', linewidths=0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L257_C4", "label": "l2 = plot()", "type": "assigned_variable", "loc": [257, 257], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L233_C0", "vector": [14, 1, 0.2843, 0.0011, 1, 0.69, 0.3077, 40, 3, 4, 0, 0, 929, 10, 1], "semantic": {"name": "l2", "arg_names": [], "import_names": [], "rhs_call_name": "plot", "annotation": ""}, "snippet": " l2 = ax1.plot(mag_x,c='g',linewidth=1,label='magnitude')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L258_C4", "label": "scatter()", "type": "expression", "loc": [258, 258], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L233_C0", "vector": [8, 1, 0.2854, 0.0011, 1, 0.69, 0.3333, 990, 3, 6, 0, 0, 0, 0, 1], "semantic": {"name": "scatter", "arg_names": [], "import_names": [], "rhs_call_name": "scatter", "annotation": ""}, "snippet": " ax1.scatter(x_idx,mag_x,c='g',s=10,label='_nolegend_', linewidths=0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L259_C4", "label": "l3 = plot()", "type": "assigned_variable", "loc": [259, 259], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L233_C0", "vector": [14, 1, 0.2865, 0.0011, 1, 0.69, 0.359, 532, 3, 4, 0, 0, 929, 10, 1], "semantic": {"name": "l3", "arg_names": [], "import_names": [], "rhs_call_name": "plot", "annotation": ""}, "snippet": " l3 = ax2.plot(err_rel_x,c='r',linewidth=1,label='relative error %')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L261_C4", "label": "set_ylim()", "type": "expression", "loc": [261, 261], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L233_C0", "vector": [8, 1, 0.2887, 0.0011, 1, 0.69, 0.3846, 819, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "set_ylim", "arg_names": [], "import_names": [], "rhs_call_name": "set_ylim", "annotation": ""}, "snippet": " ax1.set_ylim(0,15)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L262_C4", "label": "set_ylim()", "type": "expression", "loc": [262, 262], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L233_C0", "vector": [8, 1, 0.2898, 0.0011, 1, 0.69, 0.4103, 819, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "set_ylim", "arg_names": [], "import_names": [], "rhs_call_name": "set_ylim", "annotation": ""}, "snippet": " ax2.set_ylim(0,100)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L263_C4", "label": "set_xlabel()", "type": "expression", "loc": [263, 263], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L233_C0", "vector": [8, 1, 0.2909, 0.0011, 1, 0.69, 0.4359, 441, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_xlabel", "arg_names": [], "import_names": [], "rhs_call_name": "set_xlabel", "annotation": ""}, "snippet": " ax1.set_xlabel('measurement number')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L264_C4", "label": "set_ylabel()", "type": "expression", "loc": [264, 264], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L233_C0", "vector": [8, 1, 0.292, 0.0011, 1, 0.69, 0.4615, 408, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_ylabel", "arg_names": [], "import_names": [], "rhs_call_name": "set_ylabel", "annotation": ""}, "snippet": " ax1.set_ylabel('x component of force (N)')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L265_C4", "label": "set_ylabel()", "type": "expression", "loc": [265, 265], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L233_C0", "vector": [8, 1, 0.2931, 0.0011, 1, 0.69, 0.4872, 408, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_ylabel", "arg_names": [], "import_names": [], "rhs_call_name": "set_ylabel", "annotation": ""}, "snippet": " ax2.set_ylabel('percentage error')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L266_C4", "label": "set_label_coords()", "type": "expression", "loc": [266, 266], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L233_C0", "vector": [8, 1, 0.2942, 0.0011, 1, 0.69, 0.5128, 556, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "set_label_coords", "arg_names": [], "import_names": [], "rhs_call_name": "set_label_coords", "annotation": ""}, "snippet": " ax1.yaxis.set_label_coords(-0.3,0.5)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L267_C4", "label": "set_label_coords()", "type": "expression", "loc": [267, 267], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L233_C0", "vector": [8, 1, 0.2954, 0.0011, 1, 0.69, 0.5385, 556, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "set_label_coords", "arg_names": [], "import_names": [], "rhs_call_name": "set_label_coords", "annotation": ""}, "snippet": " ax2.yaxis.set_label_coords(-0.3,0.5)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L268_C4", "label": "leg = legend()", "type": "assigned_variable", "loc": [268, 269], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L233_C0", "vector": [14, 1, 0.297, 0.0022, 1, 0.69, 0.5641, 99, 3, 6, 0, 0, 880, 10, 1], "semantic": {"name": "leg", "arg_names": [], "import_names": [], "rhs_call_name": "legend", "annotation": ""}, "snippet": " leg = pl.legend([l1,l2,l3],['absolute error','magnitude','rel error %'],loc='upper left',\n handletextsep=0.015,handlelen=0.003,labelspacing=0.003)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L271_C4", "label": "fig = figure()", "type": "assigned_variable", "loc": [271, 271], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L233_C0", "vector": [14, 1, 0.2998, 0.0011, 1, 0.69, 0.5897, 806, 3, 0, 0, 0, 789, 10, 1], "semantic": {"name": "fig", "arg_names": [], "import_names": [], "rhs_call_name": "figure", "annotation": ""}, "snippet": " fig = pl.figure()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L272_C4", "label": "ax1 = add_subplot()", "type": "assigned_variable", "loc": [272, 272], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L233_C0", "vector": [14, 1, 0.3009, 0.0011, 1, 0.69, 0.6154, 946, 3, 1, 0, 0, 449, 10, 1], "semantic": {"name": "ax1", "arg_names": [], "import_names": [], "rhs_call_name": "add_subplot", "annotation": ""}, "snippet": " ax1 = fig.add_subplot(111)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L273_C4", "label": "ax2 = twinx()", "type": "assigned_variable", "loc": [273, 273], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L233_C0", "vector": [14, 1, 0.302, 0.0011, 1, 0.69, 0.641, 144, 3, 0, 0, 0, 165, 10, 1], "semantic": {"name": "ax2", "arg_names": [], "import_names": [], "rhs_call_name": "twinx", "annotation": ""}, "snippet": " ax2 = ax1.twinx()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L275_C4", "label": "plot()", "type": "expression", "loc": [275, 275], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L233_C0", "vector": [8, 1, 0.3042, 0.0011, 1, 0.69, 0.6667, 929, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "plot", "arg_names": [], "import_names": [], "rhs_call_name": "plot", "annotation": ""}, "snippet": " ax1.plot(zero,c='k',linewidth=1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L276_C4", "label": "l1 = plot()", "type": "assigned_variable", "loc": [276, 276], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L233_C0", "vector": [14, 1, 0.3053, 0.0011, 1, 0.69, 0.6923, 888, 3, 3, 0, 0, 929, 10, 1], "semantic": {"name": "l1", "arg_names": [], "import_names": [], "rhs_call_name": "plot", "annotation": ""}, "snippet": " l1 = ax1.plot(err_y,c='b',linewidth=1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L277_C4", "label": "scatter()", "type": "expression", "loc": [277, 277], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L233_C0", "vector": [8, 1, 0.3064, 0.0011, 1, 0.69, 0.7179, 990, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "scatter", "arg_names": [], "import_names": [], "rhs_call_name": "scatter", "annotation": ""}, "snippet": " ax1.scatter(x_idx,err_y,c='b',s=10, linewidths=0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L278_C4", "label": "l2 = plot()", "type": "assigned_variable", "loc": [278, 278], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L233_C0", "vector": [14, 1, 0.3075, 0.0011, 1, 0.69, 0.7436, 40, 3, 3, 0, 0, 929, 10, 1], "semantic": {"name": "l2", "arg_names": [], "import_names": [], "rhs_call_name": "plot", "annotation": ""}, "snippet": " l2 = ax1.plot(mag_y,c='g',linewidth=1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L279_C4", "label": "scatter()", "type": "expression", "loc": [279, 279], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L233_C0", "vector": [8, 1, 0.3086, 0.0011, 1, 0.69, 0.7692, 990, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "scatter", "arg_names": [], "import_names": [], "rhs_call_name": "scatter", "annotation": ""}, "snippet": " ax1.scatter(x_idx,mag_y,c='g',s=10,linewidths=0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L280_C4", "label": "l3 = plot()", "type": "assigned_variable", "loc": [280, 280], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L233_C0", "vector": [14, 1, 0.3097, 0.0011, 1, 0.69, 0.7949, 532, 3, 3, 0, 0, 929, 10, 1], "semantic": {"name": "l3", "arg_names": [], "import_names": [], "rhs_call_name": "plot", "annotation": ""}, "snippet": " l3 = ax2.plot(err_rel_y,c='r',linewidth=1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L282_C4", "label": "set_ylim()", "type": "expression", "loc": [282, 282], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L233_C0", "vector": [8, 1, 0.3119, 0.0011, 1, 0.69, 0.8205, 819, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "set_ylim", "arg_names": [], "import_names": [], "rhs_call_name": "set_ylim", "annotation": ""}, "snippet": " ax1.set_ylim(0,15)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L283_C4", "label": "set_ylim()", "type": "expression", "loc": [283, 283], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L233_C0", "vector": [8, 1, 0.3131, 0.0011, 1, 0.69, 0.8462, 819, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "set_ylim", "arg_names": [], "import_names": [], "rhs_call_name": "set_ylim", "annotation": ""}, "snippet": " ax2.set_ylim(0,100)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L284_C4", "label": "set_label_coords()", "type": "expression", "loc": [284, 284], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L233_C0", "vector": [8, 1, 0.3142, 0.0011, 1, 0.69, 0.8718, 556, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "set_label_coords", "arg_names": [], "import_names": [], "rhs_call_name": "set_label_coords", "annotation": ""}, "snippet": " ax1.yaxis.set_label_coords(-0.3,0.5)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L285_C4", "label": "set_label_coords()", "type": "expression", "loc": [285, 285], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L233_C0", "vector": [8, 1, 0.3153, 0.0011, 1, 0.69, 0.8974, 556, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "set_label_coords", "arg_names": [], "import_names": [], "rhs_call_name": "set_label_coords", "annotation": ""}, "snippet": " ax2.yaxis.set_label_coords(-0.3,0.5)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L286_C4", "label": "set_xlabel()", "type": "expression", "loc": [286, 286], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L233_C0", "vector": [8, 1, 0.3164, 0.0011, 1, 0.69, 0.9231, 441, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_xlabel", "arg_names": [], "import_names": [], "rhs_call_name": "set_xlabel", "annotation": ""}, "snippet": " ax1.set_xlabel('measurement number')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L287_C4", "label": "set_ylabel()", "type": "expression", "loc": [287, 287], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L233_C0", "vector": [8, 1, 0.3175, 0.0011, 1, 0.69, 0.9487, 408, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_ylabel", "arg_names": [], "import_names": [], "rhs_call_name": "set_ylabel", "annotation": ""}, "snippet": " ax1.set_ylabel('y component of force (N)')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L288_C4", "label": "set_ylabel()", "type": "expression", "loc": [288, 288], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L233_C0", "vector": [8, 1, 0.3186, 0.0011, 1, 0.69, 0.9744, 408, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_ylabel", "arg_names": [], "import_names": [], "rhs_call_name": "set_ylabel", "annotation": ""}, "snippet": " ax2.set_ylabel('percentage error')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L290_C4", "label": "leg = legend()", "type": "assigned_variable", "loc": [290, 291], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L233_C0", "vector": [14, 1, 0.3213, 0.0022, 1, 0.69, 1.0, 99, 3, 6, 0, 0, 880, 10, 1], "semantic": {"name": "leg", "arg_names": [], "import_names": [], "rhs_call_name": "legend", "annotation": ""}, "snippet": " leg = pl.legend([l1,l2,l3],['absolute error','magnitude','rel error %'],loc='upper left',\n handletextsep=0.015,handlelen=0.003,labelspacing=0.003)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L307_C0", "label": "plot_stiff_ellipses", "type": "function", "loc": [307, 356], "level": 0, "parent": null, "vector": [2, 0, 0.3667, 0.0553, 0, 0.66, 0.7241, 370, 0, 4, 1, 0, 0, 0, 27], "semantic": {"name": "plot_stiff_ellipses", "arg_names": ["k_cart_list", "pos_traj", "skip", "subplotnum"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def plot_stiff_ellipses(k_cart_list,pos_traj,skip=10,subplotnum=111):\n import arm_trajectories as at\n if isinstance(pos_traj,at.JointTrajectory):\n pos_traj = joint_to_cartesian(pos_traj)\n\n pts = np.matrix(pos_traj.p_list).T\n x_l = pts[0,:].A1.tolist()\n y_l = pts[1,:].A1.tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Import_L308_C4", "label": "arm_trajectories import at", "type": "import", "loc": [308, 308], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L307_C0", "vector": [1, 1, 0.3407, 0.0011, 1, 0.26, 0.0, 34, 0, 1, 0, 0, 34, 0, 0], "semantic": {"name": "arm_trajectories", "arg_names": [], "import_names": ["at"], "rhs_call_name": "", "annotation": ""}, "snippet": " import arm_trajectories as at"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L309_C4", "label": "if", "type": "if", "loc": [309, 310], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L307_C0", "vector": [4, 1, 0.3424, 0.0022, 1, 0.26, 0.0625, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if isinstance(pos_traj,at.JointTrajectory):\n pos_traj = joint_to_cartesian(pos_traj)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L310_C8", "label": "pos_traj = joint_to_cartesian()", "type": "assigned_variable", "loc": [310, 310], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L309_C4", "vector": [14, 2, 0.3429, 0.0011, 2, 0.24, 0.0, 521, 3, 1, 0, 0, 202, 10, 1], "semantic": {"name": "pos_traj", "arg_names": [], "import_names": [], "rhs_call_name": "joint_to_cartesian", "annotation": ""}, "snippet": " pos_traj = joint_to_cartesian(pos_traj)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L312_C4", "label": "pts =", "type": "assigned_variable", "loc": [312, 312], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L307_C0", "vector": [14, 1, 0.3451, 0.0011, 1, 0.26, 0.125, 195, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "pts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pts = np.matrix(pos_traj.p_list).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L313_C4", "label": "x_l = tolist()", "type": "assigned_variable", "loc": [313, 313], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L307_C0", "vector": [14, 1, 0.3462, 0.0011, 1, 0.26, 0.1875, 508, 3, 0, 0, 0, 185, 10, 1], "semantic": {"name": "x_l", "arg_names": [], "import_names": [], "rhs_call_name": "tolist", "annotation": ""}, "snippet": " x_l = pts[0,:].A1.tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L314_C4", "label": "y_l = tolist()", "type": "assigned_variable", "loc": [314, 314], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L307_C0", "vector": [14, 1, 0.3473, 0.0011, 1, 0.26, 0.25, 853, 3, 0, 0, 0, 185, 10, 1], "semantic": {"name": "y_l", "arg_names": [], "import_names": [], "rhs_call_name": "tolist", "annotation": ""}, "snippet": " y_l = pts[1,:].A1.tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:ImportFrom_L316_C4", "label": "from pylab import figure, show, rand", "type": "import", "loc": [316, 316], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L307_C0", "vector": [1, 1, 0.3496, 0.0011, 1, 0.26, 0.3125, 735, 0, 3, 0, 0, 735, 0, 0], "semantic": {"name": "pylab", "arg_names": [], "import_names": ["figure", "show", "rand"], "rhs_call_name": "", "annotation": ""}, "snippet": " from pylab import figure, show, rand"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:ImportFrom_L317_C4", "label": "from matplotlib.patches import Ellipse", "type": "import", "loc": [317, 317], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L307_C0", "vector": [1, 1, 0.3507, 0.0011, 1, 0.26, 0.375, 275, 0, 1, 0, 0, 275, 0, 0], "semantic": {"name": "matplotlib.patches", "arg_names": [], "import_names": ["Ellipse"], "rhs_call_name": "", "annotation": ""}, "snippet": " from matplotlib.patches import Ellipse"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L319_C4", "label": "ells =", "type": "assigned_variable", "loc": [319, 319], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L307_C0", "vector": [14, 1, 0.3529, 0.0011, 1, 0.26, 0.4375, 958, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "ells", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ells = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L320_C4", "label": "scale =", "type": "assigned_variable", "loc": [320, 320], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L307_C0", "vector": [14, 1, 0.354, 0.0011, 1, 0.26, 0.5, 18, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "scale", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " scale = 25000."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L321_C4", "label": "ratio_list =", "type": "assigned_variable", "loc": [321, 321], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L307_C0", "vector": [14, 1, 0.3551, 0.0011, 1, 0.26, 0.5625, 322, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "ratio_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ratio_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L322_C4", "label": "for k_c, x, y", "type": "for", "loc": [322, 332], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L307_C0", "vector": [6, 1, 0.3617, 0.0122, 1, 0.26, 0.625, 807, 3, 0, 0, 0, 0, 0, 13], "semantic": {"name": "k_c, x, y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for k_c,x,y in zip(k_cart_list[::skip],x_l[::skip],y_l[::skip]):\n w,v = np.linalg.eig(k_c[0:2,0:2])\n w_abs = np.abs(w)\n major_axis = np.max(w_abs)\n minor_axis = np.min(w_abs)\n print('major, minor:',major_axis,minor_axis)\n# print 'k_c:', k_c\n ratio_list.append(major_axis/minor_axis)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L323_C8", "label": "w, v = eig()", "type": "assigned_variable", "loc": [323, 323], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L322_C4", "vector": [14, 2, 0.3573, 0.0011, 2, 0.64, 0.0, 556, 3, 1, 0, 0, 971, 10, 1], "semantic": {"name": "w, v", "arg_names": [], "import_names": [], "rhs_call_name": "eig", "annotation": ""}, "snippet": " w,v = np.linalg.eig(k_c[0:2,0:2])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L324_C8", "label": "w_abs = abs()", "type": "assigned_variable", "loc": [324, 324], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L322_C4", "vector": [14, 2, 0.3584, 0.0011, 2, 0.64, 0.1429, 507, 3, 1, 0, 0, 799, 10, 1], "semantic": {"name": "w_abs", "arg_names": [], "import_names": [], "rhs_call_name": "abs", "annotation": ""}, "snippet": " w_abs = np.abs(w)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L325_C8", "label": "major_axis = max()", "type": "assigned_variable", "loc": [325, 325], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L322_C4", "vector": [14, 2, 0.3595, 0.0011, 2, 0.64, 0.2857, 961, 3, 1, 0, 0, 442, 10, 1], "semantic": {"name": "major_axis", "arg_names": [], "import_names": [], "rhs_call_name": "max", "annotation": ""}, "snippet": " major_axis = np.max(w_abs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L326_C8", "label": "minor_axis = min()", "type": "assigned_variable", "loc": [326, 326], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L322_C4", "vector": [14, 2, 0.3606, 0.0011, 2, 0.64, 0.4286, 129, 3, 1, 0, 0, 867, 10, 1], "semantic": {"name": "minor_axis", "arg_names": [], "import_names": [], "rhs_call_name": "min", "annotation": ""}, "snippet": " minor_axis = np.min(w_abs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L327_C8", "label": "print()", "type": "expression", "loc": [327, 327], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L322_C4", "vector": [8, 2, 0.3617, 0.0011, 2, 0.64, 0.5714, 535, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('major, minor:',major_axis,minor_axis)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L329_C8", "label": "append()", "type": "expression", "loc": [329, 329], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L322_C4", "vector": [8, 2, 0.3639, 0.0011, 2, 0.64, 0.7143, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " ratio_list.append(major_axis/minor_axis)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L331_C8", "label": "append()", "type": "expression", "loc": [331, 331], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L322_C4", "vector": [8, 2, 0.3662, 0.0011, 2, 0.64, 0.8571, 243, 3, 1, 0, 0, 0, 0, 5], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " ells.append(Ellipse(np.array([x,y]),width=w[0]/scale,height=w[1]/scale,angle=math.degrees(math.atan2(v[1,0],v[0,0]))))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L332_C8", "label": "set_lw()", "type": "expression", "loc": [332, 332], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L322_C4", "vector": [8, 2, 0.3673, 0.0011, 2, 0.64, 1.0, 552, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_lw", "arg_names": [], "import_names": [], "rhs_call_name": "set_lw", "annotation": ""}, "snippet": " ells[-1].set_lw(2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L336_C4", "label": "ax = subplot()", "type": "assigned_variable", "loc": [336, 336], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L307_C0", "vector": [14, 1, 0.3717, 0.0011, 1, 0.26, 0.6875, 823, 3, 2, 0, 0, 905, 10, 1], "semantic": {"name": "ax", "arg_names": [], "import_names": [], "rhs_call_name": "subplot", "annotation": ""}, "snippet": " ax = pl.subplot(subplotnum, aspect='equal')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L338_C4", "label": "for e", "type": "for", "loc": [338, 342], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L307_C0", "vector": [6, 1, 0.3761, 0.0055, 1, 0.26, 0.75, 175, 2, 0, 0, 0, 0, 0, 3], "semantic": {"name": "e", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for e in ells:\n ax.add_artist(e)\n #e.set_clip_box(ax.bbox)\n #e.set_alpha(1.)\n e.set_facecolor(np.array([1,1,1]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L339_C8", "label": "add_artist()", "type": "expression", "loc": [339, 339], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L338_C4", "vector": [8, 2, 0.375, 0.0011, 2, 0.89, 0.0, 217, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "add_artist", "arg_names": [], "import_names": [], "rhs_call_name": "add_artist", "annotation": ""}, "snippet": " ax.add_artist(e)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L342_C8", "label": "set_facecolor()", "type": "expression", "loc": [342, 342], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L338_C4", "vector": [8, 2, 0.3783, 0.0011, 2, 0.89, 1.0, 308, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "set_facecolor", "arg_names": [], "import_names": [], "rhs_call_name": "set_facecolor", "annotation": ""}, "snippet": " e.set_facecolor(np.array([1,1,1]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L344_C4", "label": "plot_cartesian()", "type": "expression", "loc": [344, 345], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L307_C0", "vector": [8, 1, 0.3811, 0.0022, 1, 0.26, 0.8125, 991, 3, 6, 0, 0, 0, 0, 1], "semantic": {"name": "plot_cartesian", "arg_names": [], "import_names": [], "rhs_call_name": "plot_cartesian", "annotation": ""}, "snippet": " plot_cartesian(pos_traj,xaxis=0,yaxis=1,color='b',\n linewidth=0.0,scatter_size=0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L353_C4", "label": "mean_ratio = mean()", "type": "assigned_variable", "loc": [353, 353], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L307_C0", "vector": [14, 1, 0.3905, 0.0011, 1, 0.26, 0.875, 40, 3, 1, 0, 0, 856, 10, 2], "semantic": {"name": "mean_ratio", "arg_names": [], "import_names": [], "rhs_call_name": "mean", "annotation": ""}, "snippet": " mean_ratio = np.mean(np.array(ratio_list))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L354_C4", "label": "std_ratio = std()", "type": "assigned_variable", "loc": [354, 354], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L307_C0", "vector": [14, 1, 0.3916, 0.0011, 1, 0.26, 0.9375, 770, 3, 1, 0, 0, 616, 10, 2], "semantic": {"name": "std_ratio", "arg_names": [], "import_names": [], "rhs_call_name": "std", "annotation": ""}, "snippet": " std_ratio = np.std(np.array(ratio_list))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Return_L356_C4", "label": "return", "type": "return", "loc": [356, 356], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L307_C0", "vector": [13, 1, 0.3938, 0.0011, 1, 0.26, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return mean_ratio,std_ratio"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L361_C0", "label": "plot_stiffness_field", "type": "function", "loc": [361, 386], "level": 0, "parent": null, "vector": [2, 0, 0.4132, 0.0288, 0, 0.66, 0.7586, 136, 0, 2, 0, 0, 0, 0, 15], "semantic": {"name": "plot_stiffness_field", "arg_names": ["k_cart", "plottitle"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def plot_stiffness_field(k_cart,plottitle=''):\n n_points = 20\n ang_step = math.radians(360)/n_points\n x_list = []\n y_list = []\n u_list = []\n v_list = []\n k_cart = k_cart[0:2,0:2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L362_C4", "label": "n_points =", "type": "assigned_variable", "loc": [362, 362], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L361_C0", "vector": [14, 1, 0.4004, 0.0011, 1, 0.64, 0.0, 202, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "n_points", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " n_points = 20"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L363_C4", "label": "ang_step =", "type": "assigned_variable", "loc": [363, 363], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L361_C0", "vector": [14, 1, 0.4015, 0.0011, 1, 0.64, 0.0833, 710, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "ang_step", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ang_step = math.radians(360)/n_points"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L364_C4", "label": "x_list =", "type": "assigned_variable", "loc": [364, 364], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L361_C0", "vector": [14, 1, 0.4027, 0.0011, 1, 0.64, 0.1667, 154, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "x_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " x_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L365_C4", "label": "y_list =", "type": "assigned_variable", "loc": [365, 365], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L361_C0", "vector": [14, 1, 0.4038, 0.0011, 1, 0.64, 0.25, 11, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "y_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " y_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L366_C4", "label": "u_list =", "type": "assigned_variable", "loc": [366, 366], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L361_C0", "vector": [14, 1, 0.4049, 0.0011, 1, 0.64, 0.3333, 120, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "u_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " u_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L367_C4", "label": "v_list =", "type": "assigned_variable", "loc": [367, 367], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L361_C0", "vector": [14, 1, 0.406, 0.0011, 1, 0.64, 0.4167, 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_99547:Assign_L368_C4", "label": "k_cart =", "type": "assigned_variable", "loc": [368, 368], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L361_C0", "vector": [14, 1, 0.4071, 0.0011, 1, 0.64, 0.5, 784, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "k_cart", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " k_cart = k_cart[0:2,0:2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L370_C4", "label": "for i", "type": "for", "loc": [370, 379], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L361_C0", "vector": [6, 1, 0.4143, 0.0111, 1, 0.64, 0.5833, 826, 3, 0, 0, 0, 0, 0, 8], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(n_points):\n ang = i*ang_step\n for r in [0.5,1.,1.5]:\n dx = r*math.cos(ang)\n dy = r*math.sin(ang)\n dtau = -k_cart*np.matrix([dx,dy]).T\n x_list.append(dx)\n y_list.append(dy)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L371_C8", "label": "ang =", "type": "assigned_variable", "loc": [371, 371], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L370_C4", "vector": [14, 2, 0.4104, 0.0011, 2, 0.1, 0.0, 762, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ang", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ang = i*ang_step"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L372_C8", "label": "for r", "type": "for", "loc": [372, 379], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L370_C4", "vector": [6, 2, 0.4154, 0.0088, 2, 0.1, 1.0, 436, 0, 0, 0, 0, 0, 0, 7], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for r in [0.5,1.,1.5]:\n dx = r*math.cos(ang)\n dy = r*math.sin(ang)\n dtau = -k_cart*np.matrix([dx,dy]).T\n x_list.append(dx)\n y_list.append(dy)\n u_list.append(dtau[0,0])\n v_list.append(dtau[1,0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L373_C12", "label": "dx =", "type": "assigned_variable", "loc": [373, 373], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L372_C8", "vector": [14, 3, 0.4126, 0.0011, 3, 0.25, 0.0, 870, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "dx", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " dx = r*math.cos(ang)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L374_C12", "label": "dy =", "type": "assigned_variable", "loc": [374, 374], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L372_C8", "vector": [14, 3, 0.4137, 0.0011, 3, 0.25, 0.1667, 477, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "dy", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " dy = r*math.sin(ang)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L375_C12", "label": "dtau =", "type": "assigned_variable", "loc": [375, 375], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L372_C8", "vector": [14, 3, 0.4148, 0.0011, 3, 0.25, 0.3333, 652, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "dtau", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " dtau = -k_cart*np.matrix([dx,dy]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L376_C12", "label": "append()", "type": "expression", "loc": [376, 376], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L372_C8", "vector": [8, 3, 0.4159, 0.0011, 3, 0.25, 0.5, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " x_list.append(dx)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L377_C12", "label": "append()", "type": "expression", "loc": [377, 377], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L372_C8", "vector": [8, 3, 0.417, 0.0011, 3, 0.25, 0.6667, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " y_list.append(dy)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L378_C12", "label": "append()", "type": "expression", "loc": [378, 378], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L372_C8", "vector": [8, 3, 0.4181, 0.0011, 3, 0.25, 0.8333, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " u_list.append(dtau[0,0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L379_C12", "label": "append()", "type": "expression", "loc": [379, 379], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L372_C8", "vector": [8, 3, 0.4192, 0.0011, 3, 0.25, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " v_list.append(dtau[1,0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L381_C4", "label": "figure()", "type": "expression", "loc": [381, 381], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L361_C0", "vector": [8, 1, 0.4215, 0.0011, 1, 0.64, 0.6667, 789, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "figure", "arg_names": [], "import_names": [], "rhs_call_name": "figure", "annotation": ""}, "snippet": " pl.figure()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L383_C4", "label": "plot_radii()", "type": "expression", "loc": [383, 383], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L361_C0", "vector": [8, 1, 0.4237, 0.0011, 1, 0.64, 0.75, 459, 3, 7, 0, 0, 0, 0, 2], "semantic": {"name": "plot_radii", "arg_names": [], "import_names": [], "rhs_call_name": "plot_radii", "annotation": ""}, "snippet": " mpu.plot_radii(0,0,1.5,0.,math.radians(360),interval=ang_step,color='r')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L384_C4", "label": "quiver()", "type": "expression", "loc": [384, 384], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L361_C0", "vector": [8, 1, 0.4248, 0.0011, 1, 0.64, 0.8333, 649, 3, 7, 0, 0, 0, 0, 1], "semantic": {"name": "quiver", "arg_names": [], "import_names": [], "rhs_call_name": "quiver", "annotation": ""}, "snippet": " pl.quiver(x_list,y_list,u_list,v_list,width=0.002,color='k',scale=None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L385_C4", "label": "axis()", "type": "expression", "loc": [385, 385], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L361_C0", "vector": [8, 1, 0.4259, 0.0011, 1, 0.64, 0.9167, 860, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "axis", "arg_names": [], "import_names": [], "rhs_call_name": "axis", "annotation": ""}, "snippet": " pl.axis('equal')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L386_C4", "label": "title()", "type": "expression", "loc": [386, 386], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L361_C0", "vector": [8, 1, 0.427, 0.0011, 1, 0.64, 1.0, 48, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "title", "arg_names": [], "import_names": [], "rhs_call_name": "title", "annotation": ""}, "snippet": " pl.title(plottitle)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L389_C0", "label": "plot_stiff_ellipse_map", "type": "function", "loc": [389, 434], "level": 0, "parent": null, "vector": [2, 0, 0.4552, 0.0509, 0, 0.66, 0.7931, 503, 0, 2, 1, 0, 0, 0, 30], "semantic": {"name": "plot_stiff_ellipse_map", "arg_names": ["stiffness_list", "num"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def plot_stiff_ellipse_map(stiffness_list,num):\n firenze = hr.M3HrlRobot(connect=False)\n hook_3dprint_angle = math.radians(20-2.54)\n rot_mat = tr.Rz(0.-hook_3dprint_angle)*tr.Ry(math.radians(-90))\n\n d_gains_list_mN_deg_sec = [-100,-120,-15,-25,-1.25]\n d_gains_list = [180./1000.*s/math.pi for s in d_gains_list_mN_deg_sec]\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L390_C4", "label": "firenze = M3HrlRobot()", "type": "assigned_variable", "loc": [390, 390], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L389_C0", "vector": [14, 1, 0.4314, 0.0011, 1, 0.18, 0.0, 736, 3, 1, 0, 0, 305, 10, 1], "semantic": {"name": "firenze", "arg_names": [], "import_names": [], "rhs_call_name": "M3HrlRobot", "annotation": ""}, "snippet": " firenze = hr.M3HrlRobot(connect=False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L391_C4", "label": "hook_3dprint_angle = radians()", "type": "assigned_variable", "loc": [391, 391], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L389_C0", "vector": [14, 1, 0.4325, 0.0011, 1, 0.18, 0.0769, 460, 3, 1, 0, 0, 383, 10, 1], "semantic": {"name": "hook_3dprint_angle", "arg_names": [], "import_names": [], "rhs_call_name": "radians", "annotation": ""}, "snippet": " hook_3dprint_angle = math.radians(20-2.54)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L392_C4", "label": "rot_mat =", "type": "assigned_variable", "loc": [392, 392], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L389_C0", "vector": [14, 1, 0.4336, 0.0011, 1, 0.18, 0.1538, 968, 4, 0, 0, 0, 0, 0, 3], "semantic": {"name": "rot_mat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rot_mat = tr.Rz(0.-hook_3dprint_angle)*tr.Ry(math.radians(-90))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L394_C4", "label": "d_gains_list_mN_deg_sec =", "type": "assigned_variable", "loc": [394, 394], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L389_C0", "vector": [14, 1, 0.4358, 0.0011, 1, 0.18, 0.2308, 995, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "d_gains_list_mN_deg_sec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " d_gains_list_mN_deg_sec = [-100,-120,-15,-25,-1.25]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L395_C4", "label": "d_gains_list =", "type": "assigned_variable", "loc": [395, 395], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L389_C0", "vector": [14, 1, 0.4369, 0.0011, 1, 0.18, 0.3077, 818, 5, 0, 0, 0, 0, 0, 0], "semantic": {"name": "d_gains_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " d_gains_list = [180./1000.*s/math.pi for s in d_gains_list_mN_deg_sec]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L397_C4", "label": "stiff_list_mNm_deg =", "type": "assigned_variable", "loc": [397, 397], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L389_C0", "vector": [14, 1, 0.4392, 0.0011, 1, 0.18, 0.3846, 301, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "stiff_list_mNm_deg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " stiff_list_mNm_deg = [1800,1300,350,600,60]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L398_C4", "label": "stiff_list_Nm_rad =", "type": "assigned_variable", "loc": [398, 398], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L389_C0", "vector": [14, 1, 0.4403, 0.0011, 1, 0.18, 0.4615, 759, 5, 0, 0, 0, 0, 0, 0], "semantic": {"name": "stiff_list_Nm_rad", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " stiff_list_Nm_rad = [180./1000.*s/math.pi for s in stiff_list_mNm_deg]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L399_C4", "label": "dia =", "type": "assigned_variable", "loc": [399, 399], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L389_C0", "vector": [14, 1, 0.4414, 0.0011, 1, 0.18, 0.5385, 197, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "dia", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " dia = np.array(stiffness_list) * np.array(stiff_list_Nm_rad)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L400_C4", "label": "k_q = matrix()", "type": "assigned_variable", "loc": [400, 400], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L389_C0", "vector": [14, 1, 0.4425, 0.0011, 1, 0.18, 0.6154, 608, 3, 1, 0, 0, 162, 10, 2], "semantic": {"name": "k_q", "arg_names": [], "import_names": [], "rhs_call_name": "matrix", "annotation": ""}, "snippet": " k_q = np.matrix(np.diag(dia))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L401_C4", "label": "dia_inv =", "type": "assigned_variable", "loc": [401, 401], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L389_C0", "vector": [14, 1, 0.4436, 0.0011, 1, 0.18, 0.6923, 822, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "dia_inv", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " dia_inv = 1./dia"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L402_C4", "label": "k_q_inv = matrix()", "type": "assigned_variable", "loc": [402, 402], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L389_C0", "vector": [14, 1, 0.4447, 0.0011, 1, 0.18, 0.7692, 181, 3, 1, 0, 0, 162, 10, 2], "semantic": {"name": "k_q_inv", "arg_names": [], "import_names": [], "rhs_call_name": "matrix", "annotation": ""}, "snippet": " k_q_inv = np.matrix(np.diag(dia_inv))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L404_C4", "label": "s0, s1, s2, s3 =", "type": "assigned_variable", "loc": [404, 404], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L389_C0", "vector": [14, 1, 0.4469, 0.0011, 1, 0.18, 0.8462, 525, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "s0, s1, s2, s3", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " s0,s1,s2,s3 = stiffness_list[0],stiffness_list[1],stiffness_list[2],stiffness_list[3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L406_C4", "label": "i =", "type": "assigned_variable", "loc": [406, 406], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L389_C0", "vector": [14, 1, 0.4491, 0.0011, 1, 0.18, 0.9231, 826, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " i=0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L408_C4", "label": "for z", "type": "for", "loc": [408, 434], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L389_C0", "vector": [6, 1, 0.4657, 0.0299, 1, 0.18, 1.0, 859, 3, 0, 0, 0, 0, 0, 19], "semantic": {"name": "z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for z in np.arange(-0.23,-0.27,-0.05):\n pl.figure()\n k_cart_list = []\n pos_traj = CartesianTajectory()\n for x in np.arange(0.25,0.56,0.05):\n for y in np.arange(-0.15,-0.56,-0.05):\n if math.sqrt(x**2+y**2)>0.55:\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L409_C8", "label": "figure()", "type": "expression", "loc": [409, 409], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L408_C4", "vector": [8, 2, 0.4524, 0.0011, 2, 0.07, 0.0, 789, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "figure", "arg_names": [], "import_names": [], "rhs_call_name": "figure", "annotation": ""}, "snippet": " pl.figure()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L410_C8", "label": "k_cart_list =", "type": "assigned_variable", "loc": [410, 410], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L408_C4", "vector": [14, 2, 0.4535, 0.0011, 2, 0.07, 0.2, 858, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "k_cart_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " k_cart_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L411_C8", "label": "pos_traj = CartesianTajectory()", "type": "assigned_variable", "loc": [411, 411], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L408_C4", "vector": [14, 2, 0.4546, 0.0011, 2, 0.07, 0.4, 521, 3, 0, 0, 0, 610, 10, 1], "semantic": {"name": "pos_traj", "arg_names": [], "import_names": [], "rhs_call_name": "CartesianTajectory", "annotation": ""}, "snippet": " pos_traj = CartesianTajectory()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L412_C8", "label": "for x", "type": "for", "loc": [412, 424], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L408_C4", "vector": [6, 2, 0.4624, 0.0144, 2, 0.07, 0.6, 190, 3, 0, 0, 0, 0, 0, 10], "semantic": {"name": "x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for x in np.arange(0.25,0.56,0.05):\n for y in np.arange(-0.15,-0.56,-0.05):\n if math.sqrt(x**2+y**2)>0.55:\n continue\n q = firenze.IK('right_arm',np.matrix([x,y,z]).T,rot_mat)\n if q == None:\n continue\n jac_full = firenze.Jac('right_arm',q)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L413_C12", "label": "for y", "type": "for", "loc": [413, 424], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L412_C8", "vector": [6, 3, 0.4629, 0.0133, 3, 0.81, 0.0, 304, 3, 0, 0, 0, 0, 0, 9], "semantic": {"name": "y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for y in np.arange(-0.15,-0.56,-0.05):\n if math.sqrt(x**2+y**2)>0.55:\n continue\n q = firenze.IK('right_arm',np.matrix([x,y,z]).T,rot_mat)\n if q == None:\n continue\n jac_full = firenze.Jac('right_arm',q)\n jac = jac_full[0:3,0:5]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L414_C16", "label": "if", "type": "if", "loc": [414, 415], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L413_C12", "vector": [4, 4, 0.4585, 0.0022, 4, 0.51, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if math.sqrt(x**2+y**2)>0.55:\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L416_C16", "label": "q = IK()", "type": "assigned_variable", "loc": [416, 416], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L413_C12", "vector": [14, 4, 0.4602, 0.0011, 4, 0.51, 0.125, 516, 3, 3, 0, 0, 719, 10, 2], "semantic": {"name": "q", "arg_names": [], "import_names": [], "rhs_call_name": "IK", "annotation": ""}, "snippet": " q = firenze.IK('right_arm',np.matrix([x,y,z]).T,rot_mat)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L417_C16", "label": "if", "type": "if", "loc": [417, 418], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L413_C12", "vector": [4, 4, 0.4618, 0.0022, 4, 0.51, 0.25, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if q == None:\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L419_C16", "label": "jac_full = Jac()", "type": "assigned_variable", "loc": [419, 419], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L413_C12", "vector": [14, 4, 0.4635, 0.0011, 4, 0.51, 0.375, 250, 3, 2, 0, 0, 115, 10, 1], "semantic": {"name": "jac_full", "arg_names": [], "import_names": [], "rhs_call_name": "Jac", "annotation": ""}, "snippet": " jac_full = firenze.Jac('right_arm',q)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L420_C16", "label": "jac =", "type": "assigned_variable", "loc": [420, 420], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L413_C12", "vector": [14, 4, 0.4646, 0.0011, 4, 0.51, 0.5, 812, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "jac", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " jac = jac_full[0:3,0:5]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L421_C16", "label": "k_cart = inv()", "type": "assigned_variable", "loc": [421, 421], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L413_C12", "vector": [14, 4, 0.4657, 0.0011, 4, 0.51, 0.625, 784, 3, 1, 0, 0, 761, 10, 1], "semantic": {"name": "k_cart", "arg_names": [], "import_names": [], "rhs_call_name": "inv", "annotation": ""}, "snippet": " k_cart = np.linalg.inv((jac*k_q_inv*jac.T))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L422_C16", "label": "append()", "type": "expression", "loc": [422, 422], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L413_C12", "vector": [8, 4, 0.4668, 0.0011, 4, 0.51, 0.75, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " k_cart_list.append(k_cart)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L423_C16", "label": "append()", "type": "expression", "loc": [423, 423], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L413_C12", "vector": [8, 4, 0.4679, 0.0011, 4, 0.51, 0.875, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " pos_traj.p_list.append([x,y,z])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L424_C16", "label": "append()", "type": "expression", "loc": [424, 424], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L413_C12", "vector": [8, 4, 0.469, 0.0011, 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": " pos_traj.time_list.append(0.1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L425_C8", "label": "if", "type": "if", "loc": [425, 432], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L408_C4", "vector": [4, 2, 0.474, 0.0088, 2, 0.07, 0.8, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(pos_traj.p_list)>0:\n ret = plot_stiff_ellipses(k_cart_list,pos_traj,skip=1)\n pl.axis('equal')\n pl.legend(loc='best')\n title_string = 'z: %.2f stiff:[%.1f,%.1f,%.1f,%.1f]'%(z,s0,s1,s2,s3)\n pl.title(title_string)\n i+=1\n pl.savefig('ellipses_%03d_%03d.png'%(num,i))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L426_C12", "label": "ret = plot_stiff_ellipses()", "type": "assigned_variable", "loc": [426, 426], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L425_C8", "vector": [14, 3, 0.4712, 0.0011, 3, 0.99, 0.0, 501, 3, 3, 0, 0, 370, 10, 1], "semantic": {"name": "ret", "arg_names": [], "import_names": [], "rhs_call_name": "plot_stiff_ellipses", "annotation": ""}, "snippet": " ret = plot_stiff_ellipses(k_cart_list,pos_traj,skip=1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L427_C12", "label": "axis()", "type": "expression", "loc": [427, 427], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L425_C8", "vector": [8, 3, 0.4723, 0.0011, 3, 0.99, 0.2, 860, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "axis", "arg_names": [], "import_names": [], "rhs_call_name": "axis", "annotation": ""}, "snippet": " pl.axis('equal')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L428_C12", "label": "legend()", "type": "expression", "loc": [428, 428], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L425_C8", "vector": [8, 3, 0.4735, 0.0011, 3, 0.99, 0.4, 880, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "legend", "arg_names": [], "import_names": [], "rhs_call_name": "legend", "annotation": ""}, "snippet": " pl.legend(loc='best')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L429_C12", "label": "title_string =", "type": "assigned_variable", "loc": [429, 429], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L425_C8", "vector": [14, 3, 0.4746, 0.0011, 3, 0.99, 0.6, 866, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "title_string", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " title_string = 'z: %.2f stiff:[%.1f,%.1f,%.1f,%.1f]'%(z,s0,s1,s2,s3)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L430_C12", "label": "title()", "type": "expression", "loc": [430, 430], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L425_C8", "vector": [8, 3, 0.4757, 0.0011, 3, 0.99, 0.8, 48, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "title", "arg_names": [], "import_names": [], "rhs_call_name": "title", "annotation": ""}, "snippet": " pl.title(title_string)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L432_C12", "label": "savefig()", "type": "expression", "loc": [432, 432], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L425_C8", "vector": [8, 3, 0.4779, 0.0011, 3, 0.99, 1.0, 677, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "savefig", "arg_names": [], "import_names": [], "rhs_call_name": "savefig", "annotation": ""}, "snippet": " pl.savefig('ellipses_%03d_%03d.png'%(num,i))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Return_L434_C8", "label": "return", "type": "return", "loc": [434, 434], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L408_C4", "vector": [13, 2, 0.4801, 0.0011, 2, 0.07, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ret"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L437_C0", "label": "compute_workspace", "type": "function", "loc": [437, 466], "level": 0, "parent": null, "vector": [2, 0, 0.4994, 0.0332, 0, 0.66, 0.8276, 606, 0, 5, 1, 0, 0, 0, 21], "semantic": {"name": "compute_workspace", "arg_names": ["z", "plot", "wrist_roll_angle", "subplotnum", "title"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def compute_workspace(z,plot=False,wrist_roll_angle=math.radians(0),subplotnum=None,title=''):\n firenze = hr.M3HrlRobot(connect=False)\n# hook_3dprint_angle = math.radians(20-2.54)\n# rot_mat = tr.Rz(math.radians(-90.)-hook_3dprint_angle)*tr.Ry(math.radians(-90))\n rot_mat = tr.Rz(wrist_roll_angle)*tr.Ry(math.radians(-90))\n x_list,y_list = [],[]\n for x in np.arange(0.15,0.65,0.02):\n for y in np.arange(-0.05,-0.65,-0.02):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L438_C4", "label": "firenze = M3HrlRobot()", "type": "assigned_variable", "loc": [438, 438], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L437_C0", "vector": [14, 1, 0.4845, 0.0011, 1, 0.94, 0.0, 736, 3, 1, 0, 0, 305, 10, 1], "semantic": {"name": "firenze", "arg_names": [], "import_names": [], "rhs_call_name": "M3HrlRobot", "annotation": ""}, "snippet": " firenze = hr.M3HrlRobot(connect=False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L441_C4", "label": "rot_mat =", "type": "assigned_variable", "loc": [441, 441], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L437_C0", "vector": [14, 1, 0.4878, 0.0011, 1, 0.94, 0.25, 968, 4, 0, 0, 0, 0, 0, 3], "semantic": {"name": "rot_mat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rot_mat = tr.Rz(wrist_roll_angle)*tr.Ry(math.radians(-90))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L442_C4", "label": "x_list, y_list =", "type": "assigned_variable", "loc": [442, 442], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L437_C0", "vector": [14, 1, 0.4889, 0.0011, 1, 0.94, 0.5, 548, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "x_list, y_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " x_list,y_list = [],[]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L443_C4", "label": "for x", "type": "for", "loc": [443, 448], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L437_C0", "vector": [6, 1, 0.4928, 0.0066, 1, 0.94, 0.75, 190, 3, 0, 0, 0, 0, 0, 6], "semantic": {"name": "x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for x in np.arange(0.15,0.65,0.02):\n for y in np.arange(-0.05,-0.65,-0.02):\n q = firenze.IK('right_arm',np.matrix([x,y,z]).T,rot_mat)\n if q != None:\n x_list.append(x)\n y_list.append(y)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L444_C8", "label": "for y", "type": "for", "loc": [444, 448], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L443_C4", "vector": [6, 2, 0.4934, 0.0055, 2, 0.19, 0.0, 304, 3, 0, 0, 0, 0, 0, 5], "semantic": {"name": "y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for y in np.arange(-0.05,-0.65,-0.02):\n q = firenze.IK('right_arm',np.matrix([x,y,z]).T,rot_mat)\n if q != None:\n x_list.append(x)\n y_list.append(y)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L445_C12", "label": "q = IK()", "type": "assigned_variable", "loc": [445, 445], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L444_C8", "vector": [14, 3, 0.4923, 0.0011, 3, 0.1, 0.0, 516, 3, 3, 0, 0, 719, 10, 2], "semantic": {"name": "q", "arg_names": [], "import_names": [], "rhs_call_name": "IK", "annotation": ""}, "snippet": " q = firenze.IK('right_arm',np.matrix([x,y,z]).T,rot_mat)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L446_C12", "label": "if", "type": "if", "loc": [446, 448], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L444_C8", "vector": [4, 3, 0.4945, 0.0033, 3, 0.1, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if q != None:\n x_list.append(x)\n y_list.append(y)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L447_C16", "label": "append()", "type": "expression", "loc": [447, 447], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L446_C12", "vector": [8, 4, 0.4945, 0.0011, 4, 0.65, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " x_list.append(x)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L448_C16", "label": "append()", "type": "expression", "loc": [448, 448], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L446_C12", "vector": [8, 4, 0.4956, 0.0011, 4, 0.65, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " y_list.append(y)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L450_C4", "label": "if", "type": "if", "loc": [450, 466], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L437_C0", "vector": [4, 1, 0.5066, 0.0188, 1, 0.94, 1.0, 0, 0, 0, 0, 0, 0, 0, 10], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(x_list) > 2:\n multipoint = sg.Point(x_list[0],y_list[0])\n for x,y in zip(x_list[1:],y_list[1:]):\n multipoint = multipoint.union(sg.Point(x,y))\n hull = multipoint.convex_hull\n if plot:\n coords_seq = hull.boundary.coords\n hull_x_list,hull_y_list = [],[]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L451_C8", "label": "multipoint = Point()", "type": "assigned_variable", "loc": [451, 451], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L450_C4", "vector": [14, 2, 0.4989, 0.0011, 2, 0.91, 0.0, 875, 3, 2, 0, 0, 652, 10, 1], "semantic": {"name": "multipoint", "arg_names": [], "import_names": [], "rhs_call_name": "Point", "annotation": ""}, "snippet": " multipoint = sg.Point(x_list[0],y_list[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L452_C8", "label": "for x, y", "type": "for", "loc": [452, 453], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L450_C4", "vector": [6, 2, 0.5006, 0.0022, 2, 0.91, 0.2, 855, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "x, y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for x,y in zip(x_list[1:],y_list[1:]):\n multipoint = multipoint.union(sg.Point(x,y))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L453_C12", "label": "multipoint = union()", "type": "assigned_variable", "loc": [453, 453], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L452_C8", "vector": [14, 3, 0.5011, 0.0011, 3, 0.06, 0.0, 875, 3, 1, 0, 0, 140, 10, 2], "semantic": {"name": "multipoint", "arg_names": [], "import_names": [], "rhs_call_name": "union", "annotation": ""}, "snippet": " multipoint = multipoint.union(sg.Point(x,y))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L454_C8", "label": "hull =", "type": "assigned_variable", "loc": [454, 454], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L450_C4", "vector": [14, 2, 0.5022, 0.0011, 2, 0.91, 0.4, 341, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "hull", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " hull = multipoint.convex_hull"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L455_C8", "label": "if", "type": "if", "loc": [455, 463], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L450_C4", "vector": [4, 2, 0.5077, 0.01, 2, 0.91, 0.6, 0, 2, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if plot:\n coords_seq = hull.boundary.coords\n hull_x_list,hull_y_list = [],[]\n for c in coords_seq:\n hull_x_list.append(c[0])\n hull_y_list.append(c[1])\n mpu.plot_yx(y_list,x_list,linewidth=0,subplotnum=subplotnum,axis='equal',\n plot_title=title)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L456_C12", "label": "coords_seq =", "type": "assigned_variable", "loc": [456, 456], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L455_C8", "vector": [14, 3, 0.5044, 0.0011, 3, 0.62, 0.0, 589, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "coords_seq", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " coords_seq = hull.boundary.coords"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L457_C12", "label": "hull_x_list, hull_y_list =", "type": "assigned_variable", "loc": [457, 457], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L455_C8", "vector": [14, 3, 0.5055, 0.0011, 3, 0.62, 0.25, 173, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "hull_x_list, hull_y_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " hull_x_list,hull_y_list = [],[]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L458_C12", "label": "for c", "type": "for", "loc": [458, 460], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L455_C8", "vector": [6, 3, 0.5077, 0.0033, 3, 0.62, 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 coords_seq:\n hull_x_list.append(c[0])\n hull_y_list.append(c[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L459_C16", "label": "append()", "type": "expression", "loc": [459, 459], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L458_C12", "vector": [8, 4, 0.5077, 0.0011, 4, 0.2, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " hull_x_list.append(c[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L460_C16", "label": "append()", "type": "expression", "loc": [460, 460], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L458_C12", "vector": [8, 4, 0.5088, 0.0011, 4, 0.2, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " hull_y_list.append(c[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L461_C12", "label": "plot_yx()", "type": "expression", "loc": [461, 462], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L455_C8", "vector": [8, 3, 0.5105, 0.0022, 3, 0.62, 0.75, 112, 3, 6, 0, 0, 0, 0, 1], "semantic": {"name": "plot_yx", "arg_names": [], "import_names": [], "rhs_call_name": "plot_yx", "annotation": ""}, "snippet": " mpu.plot_yx(y_list,x_list,linewidth=0,subplotnum=subplotnum,axis='equal',\n plot_title=title)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L463_C12", "label": "plot_yx()", "type": "expression", "loc": [463, 463], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L455_C8", "vector": [8, 3, 0.5122, 0.0011, 3, 0.62, 1.0, 112, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "plot_yx", "arg_names": [], "import_names": [], "rhs_call_name": "plot_yx", "annotation": ""}, "snippet": " mpu.plot_yx(hull_y_list,hull_x_list,linewidth=2,subplotnum=subplotnum,axis='equal')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Return_L464_C8", "label": "return", "type": "return", "loc": [464, 464], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L450_C4", "vector": [13, 2, 0.5133, 0.0011, 2, 0.91, 0.8, 0, 0, 0, 0, 0, 0, 8, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return hull,len(x_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Return_L466_C8", "label": "return", "type": "return", "loc": [466, 466], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L450_C4", "vector": [13, 2, 0.5155, 0.0011, 2, 0.91, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return None,None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L468_C0", "label": "diff_roll_angles", "type": "function", "loc": [468, 469], "level": 0, "parent": null, "vector": [2, 0, 0.5183, 0.0022, 0, 0.66, 0.8621, 708, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "diff_roll_angles", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def diff_roll_angles():\n pl.subplot(211,aspect='equal')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L469_C4", "label": "subplot()", "type": "expression", "loc": [469, 469], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L468_C0", "vector": [8, 1, 0.5188, 0.0011, 1, 0.09, 0.0, 905, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "subplot", "arg_names": [], "import_names": [], "rhs_call_name": "subplot", "annotation": ""}, "snippet": " pl.subplot(211,aspect='equal')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L473_C0", "label": "compute_workspace_z", "type": "function", "loc": [473, 502], "level": 0, "parent": null, "vector": [2, 0, 0.5393, 0.0332, 0, 0.66, 0.8966, 484, 0, 0, 0, 0, 0, 0, 18], "semantic": {"name": "compute_workspace_z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def compute_workspace_z():\n n_points_list,area_list,z_list = [],[],[]\n #for z in np.arange(-0.1,-0.36,-0.02):\n #for z in np.arange(-0.05,-0.35,-0.01):\n for z in np.arange(-0.15,-0.155,-0.01):\n pl.figure()\n hull,n_points = compute_workspace(z,plot=True)\n pl.title('z: %.2f'%(z))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L474_C4", "label": "n_points_list, area_list, z_list =", "type": "assigned_variable", "loc": [474, 474], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L473_C0", "vector": [14, 1, 0.5243, 0.0011, 1, 0.73, 0.0, 706, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "n_points_list, area_list, z_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " n_points_list,area_list,z_list = [],[],[]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L477_C4", "label": "for z", "type": "for", "loc": [477, 492], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L473_C0", "vector": [6, 1, 0.536, 0.0177, 1, 0.73, 0.1111, 859, 3, 0, 0, 0, 0, 0, 10], "semantic": {"name": "z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for z in np.arange(-0.15,-0.155,-0.01):\n pl.figure()\n hull,n_points = compute_workspace(z,plot=True)\n pl.title('z: %.2f'%(z))\n pl.savefig('z_%.2f.png'%(z))\n# hull,n_points = compute_workspace(z,plot=False)\n if hull != None:\n area_list.append(hull.area)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L478_C8", "label": "figure()", "type": "expression", "loc": [478, 478], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L477_C4", "vector": [8, 2, 0.5288, 0.0011, 2, 0.1, 0.0, 789, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "figure", "arg_names": [], "import_names": [], "rhs_call_name": "figure", "annotation": ""}, "snippet": " pl.figure()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L479_C8", "label": "hull, n_points = compute_workspace()", "type": "assigned_variable", "loc": [479, 479], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L477_C4", "vector": [14, 2, 0.5299, 0.0011, 2, 0.1, 0.25, 133, 3, 2, 0, 0, 606, 10, 1], "semantic": {"name": "hull, n_points", "arg_names": [], "import_names": [], "rhs_call_name": "compute_workspace", "annotation": ""}, "snippet": " hull,n_points = compute_workspace(z,plot=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L480_C8", "label": "title()", "type": "expression", "loc": [480, 480], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L477_C4", "vector": [8, 2, 0.531, 0.0011, 2, 0.1, 0.5, 48, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "title", "arg_names": [], "import_names": [], "rhs_call_name": "title", "annotation": ""}, "snippet": " pl.title('z: %.2f'%(z))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L481_C8", "label": "savefig()", "type": "expression", "loc": [481, 481], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L477_C4", "vector": [8, 2, 0.5321, 0.0011, 2, 0.1, 0.75, 677, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "savefig", "arg_names": [], "import_names": [], "rhs_call_name": "savefig", "annotation": ""}, "snippet": " pl.savefig('z_%.2f.png'%(z))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L483_C8", "label": "if", "type": "if", "loc": [483, 492], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L477_C4", "vector": [4, 2, 0.5393, 0.0111, 2, 0.1, 1.0, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if hull != None:\n area_list.append(hull.area)\n z_list.append(z)\n n_points_list.append(n_points)\n\n coords_seq = hull.boundary.coords\n hull_x_list,hull_y_list = [],[]\n for c in coords_seq:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L484_C12", "label": "append()", "type": "expression", "loc": [484, 484], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L483_C8", "vector": [8, 3, 0.5354, 0.0011, 3, 0.16, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " area_list.append(hull.area)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L485_C12", "label": "append()", "type": "expression", "loc": [485, 485], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L483_C8", "vector": [8, 3, 0.5365, 0.0011, 3, 0.16, 0.2, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " z_list.append(z)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L486_C12", "label": "append()", "type": "expression", "loc": [486, 486], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L483_C8", "vector": [8, 3, 0.5376, 0.0011, 3, 0.16, 0.4, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " n_points_list.append(n_points)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L488_C12", "label": "coords_seq =", "type": "assigned_variable", "loc": [488, 488], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L483_C8", "vector": [14, 3, 0.5398, 0.0011, 3, 0.16, 0.6, 589, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "coords_seq", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " coords_seq = hull.boundary.coords"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L489_C12", "label": "hull_x_list, hull_y_list =", "type": "assigned_variable", "loc": [489, 489], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L483_C8", "vector": [14, 3, 0.5409, 0.0011, 3, 0.16, 0.8, 173, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "hull_x_list, hull_y_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " hull_x_list,hull_y_list = [],[]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L490_C12", "label": "for c", "type": "for", "loc": [490, 492], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L483_C8", "vector": [6, 3, 0.5431, 0.0033, 3, 0.16, 1.0, 411, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "c", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for c in coords_seq:\n hull_x_list.append(c[0])\n hull_y_list.append(c[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L491_C16", "label": "append()", "type": "expression", "loc": [491, 491], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L490_C12", "vector": [8, 4, 0.5431, 0.0011, 4, 0.43, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " hull_x_list.append(c[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L492_C16", "label": "append()", "type": "expression", "loc": [492, 492], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L490_C12", "vector": [8, 4, 0.5442, 0.0011, 4, 0.43, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " hull_y_list.append(c[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L494_C4", "label": "figure()", "type": "expression", "loc": [494, 494], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L473_C0", "vector": [8, 1, 0.5465, 0.0011, 1, 0.73, 0.2222, 789, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "figure", "arg_names": [], "import_names": [], "rhs_call_name": "figure", "annotation": ""}, "snippet": " pl.figure()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L495_C4", "label": "plot_yx()", "type": "expression", "loc": [495, 495], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L473_C0", "vector": [8, 1, 0.5476, 0.0011, 1, 0.73, 0.3333, 112, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "plot_yx", "arg_names": [], "import_names": [], "rhs_call_name": "plot_yx", "annotation": ""}, "snippet": " mpu.plot_yx(area_list,z_list,linewidth=2,label='area')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L496_C4", "label": "savefig()", "type": "expression", "loc": [496, 496], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L473_C0", "vector": [8, 1, 0.5487, 0.0011, 1, 0.73, 0.4444, 677, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "savefig", "arg_names": [], "import_names": [], "rhs_call_name": "savefig", "annotation": ""}, "snippet": " pl.savefig('hist_area.png')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L497_C4", "label": "figure()", "type": "expression", "loc": [497, 497], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L473_C0", "vector": [8, 1, 0.5498, 0.0011, 1, 0.73, 0.5556, 789, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "figure", "arg_names": [], "import_names": [], "rhs_call_name": "figure", "annotation": ""}, "snippet": " pl.figure()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L498_C4", "label": "plot_yx()", "type": "expression", "loc": [498, 498], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L473_C0", "vector": [8, 1, 0.5509, 0.0011, 1, 0.73, 0.6667, 112, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "plot_yx", "arg_names": [], "import_names": [], "rhs_call_name": "plot_yx", "annotation": ""}, "snippet": " mpu.plot_yx(n_points_list,z_list,linewidth=2,color='g',label='n_points')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L500_C4", "label": "xlabel()", "type": "expression", "loc": [500, 500], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L473_C0", "vector": [8, 1, 0.5531, 0.0011, 1, 0.73, 0.7778, 676, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "xlabel", "arg_names": [], "import_names": [], "rhs_call_name": "xlabel", "annotation": ""}, "snippet": " pl.xlabel('Z coordinate (m)')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L501_C4", "label": "ylabel()", "type": "expression", "loc": [501, 501], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L473_C0", "vector": [8, 1, 0.5542, 0.0011, 1, 0.73, 0.8889, 584, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "ylabel", "arg_names": [], "import_names": [], "rhs_call_name": "ylabel", "annotation": ""}, "snippet": " pl.ylabel('# points')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L502_C4", "label": "savefig()", "type": "expression", "loc": [502, 502], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L473_C0", "vector": [8, 1, 0.5553, 0.0011, 1, 0.73, 1.0, 677, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "savefig", "arg_names": [], "import_names": [], "rhs_call_name": "savefig", "annotation": ""}, "snippet": " pl.savefig('hist_points.png')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L514_C0", "label": "fit_rotary_joint", "type": "function", "loc": [514, 535], "level": 0, "parent": null, "vector": [2, 0, 0.5802, 0.0243, 0, 0.66, 0.931, 194, 0, 4, 1, 0, 0, 0, 5], "semantic": {"name": "fit_rotary_joint", "arg_names": ["rad", "x_guess", "y_guess", "pts"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def fit_rotary_joint(rad,x_guess,y_guess,pts):\n def error_function(params):\n center = np.matrix((params[0],params[1])).T\n #print 'pts.shape', pts.shape\n #print 'center.shape', center.shape\n #print 'ut.norm(pts-center).shape',ut.norm(pts-center).shape\n err = ut.norm(pts-center).A1 - rad\n res = np.dot(err,err)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L515_C4", "label": "error_function", "type": "function", "loc": [515, 522], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L514_C0", "vector": [2, 1, 0.5736, 0.0088, 1, 0.63, 0.0, 875, 0, 1, 1, 0, 0, 0, 3], "semantic": {"name": "error_function", "arg_names": ["params"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def error_function(params):\n center = np.matrix((params[0],params[1])).T\n #print 'pts.shape', pts.shape\n #print 'center.shape', center.shape\n #print 'ut.norm(pts-center).shape',ut.norm(pts-center).shape\n err = ut.norm(pts-center).A1 - rad\n res = np.dot(err,err)\n return res"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L516_C8", "label": "center =", "type": "assigned_variable", "loc": [516, 516], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L515_C4", "vector": [14, 2, 0.5708, 0.0011, 2, 0.68, 0.0, 546, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "center", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " center = np.matrix((params[0],params[1])).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L520_C8", "label": "err =", "type": "assigned_variable", "loc": [520, 520], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L515_C4", "vector": [14, 2, 0.5752, 0.0011, 2, 0.68, 0.3333, 541, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "err", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " err = ut.norm(pts-center).A1 - rad"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L521_C8", "label": "res = dot()", "type": "assigned_variable", "loc": [521, 521], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L515_C4", "vector": [14, 2, 0.5763, 0.0011, 2, 0.68, 0.6667, 413, 3, 2, 0, 0, 310, 10, 1], "semantic": {"name": "res", "arg_names": [], "import_names": [], "rhs_call_name": "dot", "annotation": ""}, "snippet": " res = np.dot(err,err)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Return_L522_C8", "label": "return", "type": "return", "loc": [522, 522], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L515_C4", "vector": [13, 2, 0.5774, 0.0011, 2, 0.68, 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_99547:Assign_L524_C4", "label": "params_1 =", "type": "assigned_variable", "loc": [524, 524], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L514_C0", "vector": [14, 1, 0.5796, 0.0011, 1, 0.63, 0.1429, 908, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "params_1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " params_1 = [x_guess,y_guess]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L525_C4", "label": "r = fmin_bfgs()", "type": "assigned_variable", "loc": [525, 525], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L514_C0", "vector": [14, 1, 0.5808, 0.0011, 1, 0.63, 0.2857, 436, 3, 3, 0, 0, 613, 10, 1], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "fmin_bfgs", "annotation": ""}, "snippet": " r = so.fmin_bfgs(error_function,params_1,full_output=1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L526_C4", "label": "opt_params_1, f_opt_1 =", "type": "assigned_variable", "loc": [526, 526], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L514_C0", "vector": [14, 1, 0.5819, 0.0011, 1, 0.63, 0.4286, 793, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "opt_params_1, f_opt_1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " opt_params_1,f_opt_1 = r[0],r[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L528_C4", "label": "params_2 =", "type": "assigned_variable", "loc": [528, 528], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L514_C0", "vector": [14, 1, 0.5841, 0.0011, 1, 0.63, 0.5714, 165, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "params_2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " params_2 = [x_guess,y_guess+2*rad]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L529_C4", "label": "r = fmin_bfgs()", "type": "assigned_variable", "loc": [529, 529], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L514_C0", "vector": [14, 1, 0.5852, 0.0011, 1, 0.63, 0.7143, 436, 3, 3, 0, 0, 613, 10, 1], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "fmin_bfgs", "annotation": ""}, "snippet": " r = so.fmin_bfgs(error_function,params_2,full_output=1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L530_C4", "label": "opt_params_2, f_opt_2 =", "type": "assigned_variable", "loc": [530, 530], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L514_C0", "vector": [14, 1, 0.5863, 0.0011, 1, 0.63, 0.8571, 812, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "opt_params_2, f_opt_2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " opt_params_2,f_opt_2 = r[0],r[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L532_C4", "label": "if", "type": "if", "loc": [532, 535], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L514_C0", "vector": [4, 1, 0.5902, 0.0044, 1, 0.63, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if f_opt_2<f_opt_1:\n return opt_params_2[0],opt_params_2[1]\n else:\n return opt_params_1[0],opt_params_1[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Return_L533_C8", "label": "return", "type": "return", "loc": [533, 533], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L532_C4", "vector": [13, 2, 0.5896, 0.0011, 2, 0.71, 0.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return opt_params_2[0],opt_params_2[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Return_L535_C8", "label": "return", "type": "return", "loc": [535, 535], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L532_C4", "vector": [13, 2, 0.5918, 0.0011, 2, 0.71, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return opt_params_1[0],opt_params_1[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L546_C0", "label": "fit_circle", "type": "function", "loc": [546, 580], "level": 0, "parent": null, "vector": [2, 0, 0.6228, 0.0387, 0, 0.66, 0.9655, 441, 0, 6, 1, 0, 0, 0, 9], "semantic": {"name": "fit_circle", "arg_names": ["rad_guess", "x_guess", "y_guess", "pts", "method", "verbose"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def fit_circle(rad_guess,x_guess,y_guess,pts,method,verbose=True):\n def error_function(params):\n center = np.matrix((params[0],params[1])).T\n rad = params[2]\n #print 'pts.shape', pts.shape\n #print 'center.shape', center.shape\n #print 'ut.norm(pts-center).shape',ut.norm(pts-center).shape\n err = ut.norm(pts-center).A1 - rad"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L547_C4", "label": "error_function", "type": "function", "loc": [547, 555], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L546_C0", "vector": [2, 1, 0.6095, 0.01, 1, 0.86, 0.0, 875, 0, 1, 1, 0, 0, 0, 3], "semantic": {"name": "error_function", "arg_names": ["params"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def error_function(params):\n center = np.matrix((params[0],params[1])).T\n rad = params[2]\n #print 'pts.shape', pts.shape\n #print 'center.shape', center.shape\n #print 'ut.norm(pts-center).shape',ut.norm(pts-center).shape\n err = ut.norm(pts-center).A1 - rad\n res = np.dot(err,err)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L548_C8", "label": "center =", "type": "assigned_variable", "loc": [548, 548], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L547_C4", "vector": [14, 2, 0.6062, 0.0011, 2, 0.26, 0.0, 546, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "center", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " center = np.matrix((params[0],params[1])).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L549_C8", "label": "rad =", "type": "assigned_variable", "loc": [549, 549], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L547_C4", "vector": [14, 2, 0.6073, 0.0011, 2, 0.26, 0.25, 439, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "rad", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rad = params[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L553_C8", "label": "err =", "type": "assigned_variable", "loc": [553, 553], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L547_C4", "vector": [14, 2, 0.6117, 0.0011, 2, 0.26, 0.5, 541, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "err", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " err = ut.norm(pts-center).A1 - rad"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L554_C8", "label": "res = dot()", "type": "assigned_variable", "loc": [554, 554], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L547_C4", "vector": [14, 2, 0.6128, 0.0011, 2, 0.26, 0.75, 413, 3, 2, 0, 0, 310, 10, 1], "semantic": {"name": "res", "arg_names": [], "import_names": [], "rhs_call_name": "dot", "annotation": ""}, "snippet": " res = np.dot(err,err)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Return_L555_C8", "label": "return", "type": "return", "loc": [555, 555], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L547_C4", "vector": [13, 2, 0.6139, 0.0011, 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 res"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L557_C4", "label": "params_1 =", "type": "assigned_variable", "loc": [557, 557], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L546_C0", "vector": [14, 1, 0.6162, 0.0011, 1, 0.86, 0.2, 908, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "params_1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " params_1 = [x_guess,y_guess,rad_guess]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L558_C4", "label": "if", "type": "if", "loc": [558, 565], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L546_C0", "vector": [4, 1, 0.6211, 0.0088, 1, 0.86, 0.4, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if method == 'fmin':\n r = so.fmin(error_function,params_1,xtol=0.0002,ftol=0.000001,full_output=1,disp=verbose)\n opt_params_1,fopt_1 = r[0],r[1]\n elif method == 'fmin_bfgs':\n r = so.fmin_bfgs(error_function,params_1,full_output=1,disp=verbose)\n opt_params_1,fopt_1 = r[0],r[1]\n else:\n raise RuntimeError('unknown method: '+method)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L559_C8", "label": "r = fmin()", "type": "assigned_variable", "loc": [559, 559], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L558_C4", "vector": [14, 2, 0.6184, 0.0011, 2, 0.48, 0.0, 436, 3, 6, 0, 0, 247, 10, 1], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "fmin", "annotation": ""}, "snippet": " r = so.fmin(error_function,params_1,xtol=0.0002,ftol=0.000001,full_output=1,disp=verbose)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L560_C8", "label": "opt_params_1, fopt_1 =", "type": "assigned_variable", "loc": [560, 560], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L558_C4", "vector": [14, 2, 0.6195, 0.0011, 2, 0.48, 0.5, 75, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "opt_params_1, fopt_1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " opt_params_1,fopt_1 = r[0],r[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L561_C4", "label": "if", "type": "if", "loc": [561, 565], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L558_C4", "vector": [4, 2, 0.6228, 0.0055, 2, 0.48, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif method == 'fmin_bfgs':\n r = so.fmin_bfgs(error_function,params_1,full_output=1,disp=verbose)\n opt_params_1,fopt_1 = r[0],r[1]\n else:\n raise RuntimeError('unknown method: '+method)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L562_C8", "label": "r = fmin_bfgs()", "type": "assigned_variable", "loc": [562, 562], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L561_C4", "vector": [14, 3, 0.6217, 0.0011, 3, 0.17, 0.0, 436, 3, 4, 0, 0, 613, 10, 1], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "fmin_bfgs", "annotation": ""}, "snippet": " r = so.fmin_bfgs(error_function,params_1,full_output=1,disp=verbose)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L563_C8", "label": "opt_params_1, fopt_1 =", "type": "assigned_variable", "loc": [563, 563], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L561_C4", "vector": [14, 3, 0.6228, 0.0011, 3, 0.17, 1.0, 75, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "opt_params_1, fopt_1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " opt_params_1,fopt_1 = r[0],r[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L567_C4", "label": "params_2 =", "type": "assigned_variable", "loc": [567, 567], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L546_C0", "vector": [14, 1, 0.6272, 0.0011, 1, 0.86, 0.6, 165, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "params_2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " params_2 = [x_guess,y_guess+2*rad_guess,rad_guess]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L568_C4", "label": "if", "type": "if", "loc": [568, 575], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L546_C0", "vector": [4, 1, 0.6322, 0.0088, 1, 0.86, 0.8, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if method == 'fmin':\n r = so.fmin(error_function,params_2,xtol=0.0002,ftol=0.000001,full_output=1,disp=verbose)\n opt_params_2,fopt_2 = r[0],r[1]\n elif method == 'fmin_bfgs':\n r = so.fmin_bfgs(error_function,params_2,full_output=1,disp=verbose)\n opt_params_2,fopt_2 = r[0],r[1]\n else:\n raise RuntimeError('unknown method: '+method)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L569_C8", "label": "r = fmin()", "type": "assigned_variable", "loc": [569, 569], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L568_C4", "vector": [14, 2, 0.6294, 0.0011, 2, 0.85, 0.0, 436, 3, 6, 0, 0, 247, 10, 1], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "fmin", "annotation": ""}, "snippet": " r = so.fmin(error_function,params_2,xtol=0.0002,ftol=0.000001,full_output=1,disp=verbose)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L570_C8", "label": "opt_params_2, fopt_2 =", "type": "assigned_variable", "loc": [570, 570], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L568_C4", "vector": [14, 2, 0.6305, 0.0011, 2, 0.85, 0.5, 161, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "opt_params_2, fopt_2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " opt_params_2,fopt_2 = r[0],r[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L571_C4", "label": "if", "type": "if", "loc": [571, 575], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L568_C4", "vector": [4, 2, 0.6338, 0.0055, 2, 0.85, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif method == 'fmin_bfgs':\n r = so.fmin_bfgs(error_function,params_2,full_output=1,disp=verbose)\n opt_params_2,fopt_2 = r[0],r[1]\n else:\n raise RuntimeError('unknown method: '+method)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L572_C8", "label": "r = fmin_bfgs()", "type": "assigned_variable", "loc": [572, 572], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L571_C4", "vector": [14, 3, 0.6327, 0.0011, 3, 0.51, 0.0, 436, 3, 4, 0, 0, 613, 10, 1], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "fmin_bfgs", "annotation": ""}, "snippet": " r = so.fmin_bfgs(error_function,params_2,full_output=1,disp=verbose)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L573_C8", "label": "opt_params_2, fopt_2 =", "type": "assigned_variable", "loc": [573, 573], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L571_C4", "vector": [14, 3, 0.6338, 0.0011, 3, 0.51, 1.0, 161, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "opt_params_2, fopt_2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " opt_params_2,fopt_2 = r[0],r[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L577_C4", "label": "if", "type": "if", "loc": [577, 580], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L546_C0", "vector": [4, 1, 0.6399, 0.0044, 1, 0.86, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if fopt_2<fopt_1:\n return opt_params_2[2],opt_params_2[0],opt_params_2[1]\n else:\n return opt_params_1[2],opt_params_1[0],opt_params_1[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Return_L578_C8", "label": "return", "type": "return", "loc": [578, 578], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L577_C4", "vector": [13, 2, 0.6394, 0.0011, 2, 0.06, 0.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return opt_params_2[2],opt_params_2[0],opt_params_2[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Return_L580_C8", "label": "return", "type": "return", "loc": [580, 580], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L577_C4", "vector": [13, 2, 0.6416, 0.0011, 2, 0.06, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return opt_params_1[2],opt_params_1[0],opt_params_1[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L584_C0", "label": "if", "type": "if", "loc": [584, 900], "level": 0, "parent": null, "vector": [4, 0, 0.8208, 0.3507, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 99], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n p = optparse.OptionParser()\n p.add_option('-f', action='store', type='string', dest='fname',\n help='pkl file to use.', default='')\n p.add_option('--xy', action='store_true', dest='xy',\n help='plot the x and y coordinates of the end effector.')\n p.add_option('--yz', action='store_true', dest='yz',\n help='plot the y and z coordinates of the end effector.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L585_C4", "label": "p = OptionParser()", "type": "assigned_variable", "loc": [585, 585], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L584_C0", "vector": [14, 1, 0.6471, 0.0011, 1, 0.29, 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_99547:Expr_L586_C4", "label": "add_option()", "type": "expression", "loc": [586, 587], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L584_C0", "vector": [8, 1, 0.6488, 0.0022, 1, 0.29, 0.0204, 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_99547:Expr_L588_C4", "label": "add_option()", "type": "expression", "loc": [588, 589], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L584_C0", "vector": [8, 1, 0.651, 0.0022, 1, 0.29, 0.0408, 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('--xy', action='store_true', dest='xy',\n help='plot the x and y coordinates of the end effector.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L590_C4", "label": "add_option()", "type": "expression", "loc": [590, 591], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L584_C0", "vector": [8, 1, 0.6532, 0.0022, 1, 0.29, 0.0612, 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('--yz', action='store_true', dest='yz',\n help='plot the y and z coordinates of the end effector.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L592_C4", "label": "add_option()", "type": "expression", "loc": [592, 593], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L584_C0", "vector": [8, 1, 0.6554, 0.0022, 1, 0.29, 0.0816, 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('--xz', action='store_true', dest='xz',\n help='plot the x and z coordinates of the end effector.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L594_C4", "label": "add_option()", "type": "expression", "loc": [594, 595], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L584_C0", "vector": [8, 1, 0.6576, 0.0022, 1, 0.29, 0.102, 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('--plot_ellipses', action='store_true', dest='plot_ellipses',\n help='plot the stiffness ellipse in the x-y plane')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L596_C4", "label": "add_option()", "type": "expression", "loc": [596, 597], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L584_C0", "vector": [8, 1, 0.6598, 0.0022, 1, 0.29, 0.1224, 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('--pfc', action='store_true', dest='pfc',\n help='plot the radial and tangential components of the force.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L598_C4", "label": "add_option()", "type": "expression", "loc": [598, 599], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L584_C0", "vector": [8, 1, 0.6621, 0.0022, 1, 0.29, 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('--pmf', action='store_true', dest='pmf',\n help='plot things with the mechanism alinged with the axes.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L600_C4", "label": "add_option()", "type": "expression", "loc": [600, 601], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L584_C0", "vector": [8, 1, 0.6643, 0.0022, 1, 0.29, 0.1633, 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('--pff', action='store_true', dest='pff',\n help='plot the force field corresponding to a stiffness ellipse.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L602_C4", "label": "add_option()", "type": "expression", "loc": [602, 603], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L584_C0", "vector": [8, 1, 0.6665, 0.0022, 1, 0.29, 0.1837, 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('--pev', action='store_true', dest='pev',\n help='plot the stiffness ellipses for different combinations of the rel stiffnesses.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L604_C4", "label": "add_option()", "type": "expression", "loc": [604, 605], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L584_C0", "vector": [8, 1, 0.6687, 0.0022, 1, 0.29, 0.2041, 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('--plot_forces', action='store_true', dest='plot_forces',\n help='plot the force in the x-y plane')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L606_C4", "label": "add_option()", "type": "expression", "loc": [606, 607], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L584_C0", "vector": [8, 1, 0.6709, 0.0022, 1, 0.29, 0.2245, 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('--plot_forces_error', action='store_true', dest='plot_forces_error',\n help='plot the error between the computed and measured (ATI) forces in the x-y plane')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L608_C4", "label": "add_option()", "type": "expression", "loc": [608, 609], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L584_C0", "vector": [8, 1, 0.6731, 0.0022, 1, 0.29, 0.2449, 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('--xyz', action='store_true', dest='xyz',\n help='plot in 3d the coordinates of the end effector.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L610_C4", "label": "add_option()", "type": "expression", "loc": [610, 611], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L584_C0", "vector": [8, 1, 0.6753, 0.0022, 1, 0.29, 0.2653, 176, 3, 6, 0, 0, 0, 0, 1], "semantic": {"name": "add_option", "arg_names": [], "import_names": [], "rhs_call_name": "add_option", "annotation": ""}, "snippet": " p.add_option('-r', action='store', type='float', dest='rad',\n help='radius of the joint.', default=None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L612_C4", "label": "add_option()", "type": "expression", "loc": [612, 613], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L584_C0", "vector": [8, 1, 0.6775, 0.0022, 1, 0.29, 0.2857, 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('--rad_fix', action='store_true', dest='rad_fix',\n help='do not optimize for the radius.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L614_C4", "label": "add_option()", "type": "expression", "loc": [614, 615], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L584_C0", "vector": [8, 1, 0.6798, 0.0022, 1, 0.29, 0.3061, 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('--noshow', action='store_true', dest='noshow',\n help='do not display the figure (use while saving figures to disk)')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L616_C4", "label": "add_option()", "type": "expression", "loc": [616, 617], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L584_C0", "vector": [8, 1, 0.682, 0.0022, 1, 0.29, 0.3265, 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('--exptplot', action='store_true', dest='exptplot',\n help='put all the graphs of an experiment as subplots.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L618_C4", "label": "add_option()", "type": "expression", "loc": [618, 619], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L584_C0", "vector": [8, 1, 0.6842, 0.0022, 1, 0.29, 0.3469, 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('--pwf', action='store_true', dest='pwf',\n help='plot the workspace at some z coord.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L621_C4", "label": "opt, args = parse_args()", "type": "assigned_variable", "loc": [621, 621], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L584_C0", "vector": [14, 1, 0.6869, 0.0011, 1, 0.29, 0.3673, 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_99547:Assign_L622_C4", "label": "fname =", "type": "assigned_variable", "loc": [622, 622], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L584_C0", "vector": [14, 1, 0.6881, 0.0011, 1, 0.29, 0.3878, 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_99547:Assign_L623_C4", "label": "xy_flag =", "type": "assigned_variable", "loc": [623, 623], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L584_C0", "vector": [14, 1, 0.6892, 0.0011, 1, 0.29, 0.4082, 813, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "xy_flag", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " xy_flag = opt.xy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L624_C4", "label": "yz_flag =", "type": "assigned_variable", "loc": [624, 624], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L584_C0", "vector": [14, 1, 0.6903, 0.0011, 1, 0.29, 0.4286, 102, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "yz_flag", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " yz_flag = opt.yz"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L625_C4", "label": "xz_flag =", "type": "assigned_variable", "loc": [625, 625], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L584_C0", "vector": [14, 1, 0.6914, 0.0011, 1, 0.29, 0.449, 208, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "xz_flag", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " xz_flag = opt.xz"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L626_C4", "label": "plot_forces_flag =", "type": "assigned_variable", "loc": [626, 626], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L584_C0", "vector": [14, 1, 0.6925, 0.0011, 1, 0.29, 0.4694, 38, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "plot_forces_flag", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " plot_forces_flag = opt.plot_forces"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L627_C4", "label": "plot_ellipses_flag =", "type": "assigned_variable", "loc": [627, 627], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L584_C0", "vector": [14, 1, 0.6936, 0.0011, 1, 0.29, 0.4898, 873, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "plot_ellipses_flag", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " plot_ellipses_flag = opt.plot_ellipses"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L628_C4", "label": "plot_forces_error_flag =", "type": "assigned_variable", "loc": [628, 628], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L584_C0", "vector": [14, 1, 0.6947, 0.0011, 1, 0.29, 0.5102, 344, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "plot_forces_error_flag", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " plot_forces_error_flag = opt.plot_forces_error"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L629_C4", "label": "plot_force_components_flag =", "type": "assigned_variable", "loc": [629, 629], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L584_C0", "vector": [14, 1, 0.6958, 0.0011, 1, 0.29, 0.5306, 77, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "plot_force_components_flag", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " plot_force_components_flag = opt.pfc"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L630_C4", "label": "plot_force_field_flag =", "type": "assigned_variable", "loc": [630, 630], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L584_C0", "vector": [14, 1, 0.6969, 0.0011, 1, 0.29, 0.551, 364, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "plot_force_field_flag", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " plot_force_field_flag = opt.pff"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L631_C4", "label": "plot_mechanism_frame =", "type": "assigned_variable", "loc": [631, 631], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L584_C0", "vector": [14, 1, 0.698, 0.0011, 1, 0.29, 0.5714, 689, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "plot_mechanism_frame", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " plot_mechanism_frame = opt.pmf"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L632_C4", "label": "xyz_flag =", "type": "assigned_variable", "loc": [632, 632], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L584_C0", "vector": [14, 1, 0.6991, 0.0011, 1, 0.29, 0.5918, 737, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "xyz_flag", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " xyz_flag = opt.xyz"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L633_C4", "label": "rad =", "type": "assigned_variable", "loc": [633, 633], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L584_C0", "vector": [14, 1, 0.7002, 0.0011, 1, 0.29, 0.6122, 439, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "rad", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rad = opt.rad"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L634_C4", "label": "show_fig =", "type": "assigned_variable", "loc": [634, 634], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L584_C0", "vector": [14, 1, 0.7013, 0.0011, 1, 0.29, 0.6327, 616, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "show_fig", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " show_fig = not(opt.noshow)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L635_C4", "label": "plot_ellipses_vary_flag =", "type": "assigned_variable", "loc": [635, 635], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L584_C0", "vector": [14, 1, 0.7024, 0.0011, 1, 0.29, 0.6531, 316, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "plot_ellipses_vary_flag", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " plot_ellipses_vary_flag = opt.pev"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L636_C4", "label": "expt_plot =", "type": "assigned_variable", "loc": [636, 636], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L584_C0", "vector": [14, 1, 0.7035, 0.0011, 1, 0.29, 0.6735, 687, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "expt_plot", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " expt_plot = opt.exptplot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L637_C4", "label": "rad_fix =", "type": "assigned_variable", "loc": [637, 637], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L584_C0", "vector": [14, 1, 0.7046, 0.0011, 1, 0.29, 0.6939, 988, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "rad_fix", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rad_fix = opt.rad_fix"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L638_C4", "label": "plot_workspace_flag =", "type": "assigned_variable", "loc": [638, 638], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L584_C0", "vector": [14, 1, 0.7058, 0.0011, 1, 0.29, 0.7143, 247, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "plot_workspace_flag", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " plot_workspace_flag = opt.pwf"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L641_C4", "label": "if", "type": "if", "loc": [641, 642], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L584_C0", "vector": [4, 1, 0.7096, 0.0022, 1, 0.29, 0.7347, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if plot_workspace_flag:\n compute_workspace_z()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L642_C8", "label": "compute_workspace_z()", "type": "expression", "loc": [642, 642], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L641_C4", "vector": [8, 2, 0.7102, 0.0011, 2, 0.71, 0.0, 484, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "compute_workspace_z", "arg_names": [], "import_names": [], "rhs_call_name": "compute_workspace_z", "annotation": ""}, "snippet": " compute_workspace_z()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L646_C4", "label": "if", "type": "if", "loc": [646, 683], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L584_C0", "vector": [4, 1, 0.7351, 0.042, 1, 0.29, 0.7551, 0, 2, 0, 0, 0, 0, 0, 14], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if plot_ellipses_vary_flag:\n show_fig=False\n i = 0\n ratio_list1 = [0.1,0.3,0.5,0.7,0.9] # coarse search\n ratio_list2 = [0.1,0.3,0.5,0.7,0.9] # coarse search\n ratio_list3 = [0.1,0.3,0.5,0.7,0.9] # coarse search\n# ratio_list1 = [0.7,0.8,0.9,1.0]\n# ratio_list2 = [0.7,0.8,0.9,1.0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L647_C8", "label": "show_fig =", "type": "assigned_variable", "loc": [647, 647], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L646_C4", "vector": [14, 2, 0.7157, 0.0011, 2, 0.88, 0.0, 616, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "show_fig", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " show_fig=False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L648_C8", "label": "i =", "type": "assigned_variable", "loc": [648, 648], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L646_C4", "vector": [14, 2, 0.7168, 0.0011, 2, 0.88, 0.0769, 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_99547:Assign_L649_C8", "label": "ratio_list1 =", "type": "assigned_variable", "loc": [649, 649], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L646_C4", "vector": [14, 2, 0.7179, 0.0011, 2, 0.88, 0.1538, 316, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "ratio_list1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ratio_list1 = [0.1,0.3,0.5,0.7,0.9] # coarse search"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L650_C8", "label": "ratio_list2 =", "type": "assigned_variable", "loc": [650, 650], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L646_C4", "vector": [14, 2, 0.719, 0.0011, 2, 0.88, 0.2308, 320, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "ratio_list2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ratio_list2 = [0.1,0.3,0.5,0.7,0.9] # coarse search"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L651_C8", "label": "ratio_list3 =", "type": "assigned_variable", "loc": [651, 651], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L646_C4", "vector": [14, 2, 0.7201, 0.0011, 2, 0.88, 0.3077, 19, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "ratio_list3", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ratio_list3 = [0.1,0.3,0.5,0.7,0.9] # coarse search"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L659_C8", "label": "inv_mean_list, std_list =", "type": "assigned_variable", "loc": [659, 659], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L646_C4", "vector": [14, 2, 0.729, 0.0011, 2, 0.88, 0.3846, 618, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "inv_mean_list, std_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " inv_mean_list,std_list = [],[]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L660_C8", "label": "x_l, y_l, z_l =", "type": "assigned_variable", "loc": [660, 660], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L646_C4", "vector": [14, 2, 0.7301, 0.0011, 2, 0.88, 0.4615, 876, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "x_l, y_l, z_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " x_l,y_l,z_l = [],[],[]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L661_C8", "label": "s0 =", "type": "assigned_variable", "loc": [661, 661], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L646_C4", "vector": [14, 2, 0.7312, 0.0011, 2, 0.88, 0.5385, 660, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "s0", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " s0 = 0.2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L663_C8", "label": "for s1", "type": "for", "loc": [663, 675], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L646_C4", "vector": [6, 2, 0.74, 0.0144, 2, 0.88, 0.6154, 745, 2, 0, 0, 0, 0, 0, 7], "semantic": {"name": "s1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for s1 in ratio_list1:\n for s2 in ratio_list2:\n for s3 in ratio_list3:\n i += 1\n s_list = [s0,s1,s2,s3,0.8]\n #s_list = [s1,s2,s3,s0,0.8]\n print('################## s_list:', s_list)\n m,s = plot_stiff_ellipse_map(s_list,i)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L664_C12", "label": "for s2", "type": "for", "loc": [664, 675], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L663_C8", "vector": [6, 3, 0.7406, 0.0133, 3, 0.49, 0.0, 448, 2, 0, 0, 0, 0, 0, 7], "semantic": {"name": "s2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for s2 in ratio_list2:\n for s3 in ratio_list3:\n i += 1\n s_list = [s0,s1,s2,s3,0.8]\n #s_list = [s1,s2,s3,s0,0.8]\n print('################## s_list:', s_list)\n m,s = plot_stiff_ellipse_map(s_list,i)\n inv_mean_list.append(1./m)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L665_C16", "label": "for s3", "type": "for", "loc": [665, 675], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L664_C12", "vector": [6, 4, 0.7412, 0.0122, 4, 0.72, 0.0, 626, 2, 0, 0, 0, 0, 0, 7], "semantic": {"name": "s3", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for s3 in ratio_list3:\n i += 1\n s_list = [s0,s1,s2,s3,0.8]\n #s_list = [s1,s2,s3,s0,0.8]\n print('################## s_list:', s_list)\n m,s = plot_stiff_ellipse_map(s_list,i)\n inv_mean_list.append(1./m)\n std_list.append(s)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L667_C20", "label": "s_list =", "type": "assigned_variable", "loc": [667, 667], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L665_C16", "vector": [14, 5, 0.7378, 0.0011, 5, 0.47, 0.0, 363, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "s_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " s_list = [s0,s1,s2,s3,0.8]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L669_C20", "label": "print()", "type": "expression", "loc": [669, 669], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L665_C16", "vector": [8, 5, 0.74, 0.0011, 5, 0.47, 0.1429, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('################## s_list:', s_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L670_C20", "label": "m, s = plot_stiff_ellipse_map()", "type": "assigned_variable", "loc": [670, 670], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L665_C16", "vector": [14, 5, 0.7412, 0.0011, 5, 0.47, 0.2857, 483, 3, 2, 0, 0, 503, 10, 1], "semantic": {"name": "m, s", "arg_names": [], "import_names": [], "rhs_call_name": "plot_stiff_ellipse_map", "annotation": ""}, "snippet": " m,s = plot_stiff_ellipse_map(s_list,i)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L671_C20", "label": "append()", "type": "expression", "loc": [671, 671], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L665_C16", "vector": [8, 5, 0.7423, 0.0011, 5, 0.47, 0.4286, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " inv_mean_list.append(1./m)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L672_C20", "label": "append()", "type": "expression", "loc": [672, 672], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L665_C16", "vector": [8, 5, 0.7434, 0.0011, 5, 0.47, 0.5714, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " std_list.append(s)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L673_C20", "label": "append()", "type": "expression", "loc": [673, 673], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L665_C16", "vector": [8, 5, 0.7445, 0.0011, 5, 0.47, 0.7143, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " x_l.append(s1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L674_C20", "label": "append()", "type": "expression", "loc": [674, 674], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L665_C16", "vector": [8, 5, 0.7456, 0.0011, 5, 0.47, 0.8571, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " y_l.append(s2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L675_C20", "label": "append()", "type": "expression", "loc": [675, 675], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L665_C16", "vector": [8, 5, 0.7467, 0.0011, 5, 0.47, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " z_l.append(s3)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L677_C8", "label": "save_pickle()", "type": "expression", "loc": [677, 678], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L646_C4", "vector": [8, 2, 0.7494, 0.0022, 2, 0.88, 0.6923, 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({'x_l':x_l,'y_l':y_l,'z_l':z_l,'inv_mean_list':inv_mean_list,'std_list':std_list},\n 'stiff_dict_'+ut.formatted_time()+'.pkl')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L679_C8", "label": "plot_points()", "type": "expression", "loc": [679, 679], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L646_C4", "vector": [8, 2, 0.7511, 0.0011, 2, 0.88, 0.7692, 111, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "plot_points", "arg_names": [], "import_names": [], "rhs_call_name": "plot_points", "annotation": ""}, "snippet": " d3m.plot_points(np.matrix([x_l,y_l,z_l]),scalar_list=inv_mean_list,mode='sphere')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L680_C8", "label": "axes()", "type": "expression", "loc": [680, 680], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L646_C4", "vector": [8, 2, 0.7522, 0.0011, 2, 0.88, 0.8462, 590, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "axes", "arg_names": [], "import_names": [], "rhs_call_name": "axes", "annotation": ""}, "snippet": " mlab.axes()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L681_C8", "label": "show()", "type": "expression", "loc": [681, 681], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L646_C4", "vector": [8, 2, 0.7533, 0.0011, 2, 0.88, 0.9231, 497, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "show", "arg_names": [], "import_names": [], "rhs_call_name": "show", "annotation": ""}, "snippet": " d3m.show()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L683_C8", "label": "exit()", "type": "expression", "loc": [683, 683], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L646_C4", "vector": [8, 2, 0.7555, 0.0011, 2, 0.88, 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_99547:If_L685_C4", "label": "if", "type": "if", "loc": [685, 688], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L584_C0", "vector": [4, 1, 0.7594, 0.0044, 1, 0.29, 0.7755, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if fname=='':\n print('please specify a pkl file (-f option)')\n print('Exiting...')\n sys.exit()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L686_C8", "label": "print()", "type": "expression", "loc": [686, 686], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L685_C4", "vector": [8, 2, 0.7588, 0.0011, 2, 0.33, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('please specify a pkl file (-f option)')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L687_C8", "label": "print()", "type": "expression", "loc": [687, 687], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L685_C4", "vector": [8, 2, 0.76, 0.0011, 2, 0.33, 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_99547:Expr_L688_C8", "label": "exit()", "type": "expression", "loc": [688, 688], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L685_C4", "vector": [8, 2, 0.7611, 0.0011, 2, 0.33, 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_99547:Assign_L690_C4", "label": "d = load_pickle()", "type": "assigned_variable", "loc": [690, 690], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L584_C0", "vector": [14, 1, 0.7633, 0.0011, 1, 0.29, 0.7959, 355, 3, 1, 0, 0, 65, 10, 1], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "load_pickle", "annotation": ""}, "snippet": " d = ut.load_pickle(fname)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L691_C4", "label": "actual_cartesian = joint_to_cartesian()", "type": "assigned_variable", "loc": [691, 691], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L584_C0", "vector": [14, 1, 0.7644, 0.0011, 1, 0.29, 0.8163, 824, 3, 1, 0, 0, 202, 10, 1], "semantic": {"name": "actual_cartesian", "arg_names": [], "import_names": [], "rhs_call_name": "joint_to_cartesian", "annotation": ""}, "snippet": " actual_cartesian = joint_to_cartesian(d['actual'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L692_C4", "label": "eq_cartesian = joint_to_cartesian()", "type": "assigned_variable", "loc": [692, 692], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L584_C0", "vector": [14, 1, 0.7655, 0.0011, 1, 0.29, 0.8367, 883, 3, 1, 0, 0, 202, 10, 1], "semantic": {"name": "eq_cartesian", "arg_names": [], "import_names": [], "rhs_call_name": "joint_to_cartesian", "annotation": ""}, "snippet": " eq_cartesian = joint_to_cartesian(d['eq_pt'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L694_C4", "label": "for p", "type": "for", "loc": [694, 695], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L584_C0", "vector": [6, 1, 0.7683, 0.0022, 1, 0.29, 0.8571, 491, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for p in actual_cartesian.p_list:\n print(p[0],p[1],p[2])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L695_C8", "label": "print()", "type": "expression", "loc": [695, 695], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L694_C4", "vector": [8, 2, 0.7688, 0.0011, 2, 0.97, 0.0, 535, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(p[0],p[1],p[2])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L698_C4", "label": "if", "type": "if", "loc": [698, 727], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L584_C0", "vector": [4, 1, 0.7882, 0.0332, 1, 0.29, 0.8776, 0, 0, 0, 0, 0, 0, 0, 13], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if rad != None:\n #rad = 0.39 # lab cabinet recessed.\n #rad = 0.42 # kitchen cabinet\n #rad = 0.80 # lab glass door\n pts_list = actual_cartesian.p_list\n ee_start_pos = pts_list[0]\n x_guess = ee_start_pos[0]\n y_guess = ee_start_pos[1] - rad"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L702_C8", "label": "pts_list =", "type": "assigned_variable", "loc": [702, 702], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L698_C4", "vector": [14, 2, 0.7765, 0.0011, 2, 0.4, 0.0, 713, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pts_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pts_list = actual_cartesian.p_list"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L703_C8", "label": "ee_start_pos =", "type": "assigned_variable", "loc": [703, 703], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L698_C4", "vector": [14, 2, 0.7777, 0.0011, 2, 0.4, 0.0588, 996, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ee_start_pos", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ee_start_pos = pts_list[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L704_C8", "label": "x_guess =", "type": "assigned_variable", "loc": [704, 704], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L698_C4", "vector": [14, 2, 0.7788, 0.0011, 2, 0.4, 0.1176, 547, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "x_guess", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " x_guess = ee_start_pos[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L705_C8", "label": "y_guess =", "type": "assigned_variable", "loc": [705, 705], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L698_C4", "vector": [14, 2, 0.7799, 0.0011, 2, 0.4, 0.1765, 583, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "y_guess", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " y_guess = ee_start_pos[1] - rad"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L706_C8", "label": "print()", "type": "expression", "loc": [706, 706], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L698_C4", "vector": [8, 2, 0.781, 0.0011, 2, 0.4, 0.2353, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('before call to fit_rotary_joint')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L707_C8", "label": "pts_2d =", "type": "assigned_variable", "loc": [707, 707], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L698_C4", "vector": [14, 2, 0.7821, 0.0011, 2, 0.4, 0.2941, 945, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "pts_2d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pts_2d = (np.matrix(pts_list).T)[0:2,:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L708_C8", "label": "t0 = time()", "type": "assigned_variable", "loc": [708, 708], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L698_C4", "vector": [14, 2, 0.7832, 0.0011, 2, 0.4, 0.3529, 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_99547:If_L710_C8", "label": "if", "type": "if", "loc": [710, 713], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L698_C4", "vector": [4, 2, 0.7871, 0.0044, 2, 0.4, 0.4118, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if rad_fix:\n rad_guess = 0.9\n else:\n rad_guess = rad"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L711_C12", "label": "rad_guess =", "type": "assigned_variable", "loc": [711, 711], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L710_C8", "vector": [14, 3, 0.7865, 0.0011, 3, 0.09, 0.0, 590, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "rad_guess", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rad_guess = 0.9"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L713_C12", "label": "rad_guess =", "type": "assigned_variable", "loc": [713, 713], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L710_C8", "vector": [14, 3, 0.7887, 0.0011, 3, 0.09, 1.0, 590, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "rad_guess", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rad_guess = rad"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L714_C8", "label": "rad_fmin, cx, cy = fit_circle()", "type": "assigned_variable", "loc": [714, 714], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L698_C4", "vector": [14, 2, 0.7898, 0.0011, 2, 0.4, 0.4706, 289, 3, 5, 0, 0, 441, 10, 1], "semantic": {"name": "rad_fmin, cx, cy", "arg_names": [], "import_names": [], "rhs_call_name": "fit_circle", "annotation": ""}, "snippet": " rad_fmin,cx,cy = fit_circle(rad_guess,x_guess,y_guess,pts_2d[:,0:-4],method='fmin')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L715_C8", "label": "t1 = time()", "type": "assigned_variable", "loc": [715, 715], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L698_C4", "vector": [14, 2, 0.7909, 0.0011, 2, 0.4, 0.5294, 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_99547:Assign_L716_C8", "label": "rad_opt, cx, cy = fit_circle()", "type": "assigned_variable", "loc": [716, 716], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L698_C4", "vector": [14, 2, 0.792, 0.0011, 2, 0.4, 0.5882, 923, 3, 5, 0, 0, 441, 10, 1], "semantic": {"name": "rad_opt, cx, cy", "arg_names": [], "import_names": [], "rhs_call_name": "fit_circle", "annotation": ""}, "snippet": " rad_opt,cx,cy = fit_circle(rad_guess,x_guess,y_guess,pts_2d[:,0:-4],method='fmin_bfgs')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L717_C8", "label": "t2 = time()", "type": "assigned_variable", "loc": [717, 717], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L698_C4", "vector": [14, 2, 0.7931, 0.0011, 2, 0.4, 0.6471, 469, 3, 0, 0, 0, 654, 10, 1], "semantic": {"name": "t2", "arg_names": [], "import_names": [], "rhs_call_name": "time", "annotation": ""}, "snippet": " t2 = time.time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L718_C8", "label": "print()", "type": "expression", "loc": [718, 718], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L698_C4", "vector": [8, 2, 0.7942, 0.0011, 2, 0.4, 0.7059, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('after fit_rotary_joint')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L719_C8", "label": "print()", "type": "expression", "loc": [719, 719], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L698_C4", "vector": [8, 2, 0.7954, 0.0011, 2, 0.4, 0.7647, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('optimized radius:', rad_opt)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L720_C8", "label": "print()", "type": "expression", "loc": [720, 720], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L698_C4", "vector": [8, 2, 0.7965, 0.0011, 2, 0.4, 0.8235, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('optimized radius fmin:', rad_fmin)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L721_C8", "label": "print()", "type": "expression", "loc": [721, 721], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L698_C4", "vector": [8, 2, 0.7976, 0.0011, 2, 0.4, 0.8824, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('time to bfgs:', t2-t1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L722_C8", "label": "print()", "type": "expression", "loc": [722, 722], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L698_C4", "vector": [8, 2, 0.7987, 0.0011, 2, 0.4, 0.9412, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('time to fmin:', t1-t0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L724_C8", "label": "if", "type": "if", "loc": [724, 727], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L698_C4", "vector": [4, 2, 0.8025, 0.0044, 2, 0.4, 1.0, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if rad_fix:\n cx,cy = fit_rotary_joint(rad,x_guess,y_guess,pts_2d[:,0:-4])\n else:\n rad = rad_opt"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L725_C12", "label": "cx, cy = fit_rotary_joint()", "type": "assigned_variable", "loc": [725, 725], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L724_C8", "vector": [14, 3, 0.802, 0.0011, 3, 0.2, 0.0, 959, 3, 4, 0, 0, 194, 10, 1], "semantic": {"name": "cx, cy", "arg_names": [], "import_names": [], "rhs_call_name": "fit_rotary_joint", "annotation": ""}, "snippet": " cx,cy = fit_rotary_joint(rad,x_guess,y_guess,pts_2d[:,0:-4])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L727_C12", "label": "rad =", "type": "assigned_variable", "loc": [727, 727], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L724_C8", "vector": [14, 3, 0.8042, 0.0011, 3, 0.2, 1.0, 439, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "rad", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rad = rad_opt"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L730_C4", "label": "if", "type": "if", "loc": [730, 787], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L584_C0", "vector": [4, 1, 0.839, 0.0642, 1, 0.29, 0.898, 0, 2, 0, 0, 0, 0, 0, 36], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if plot_mechanism_frame:\n\n if expt_plot:\n pl.subplot(231)\n\n # transform points so that the mechanism is in a fixed position.\n start_pt = actual_cartesian.p_list[0]\n x_diff = start_pt[0] - cx"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L732_C8", "label": "if", "type": "if", "loc": [732, 733], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L730_C4", "vector": [4, 2, 0.8103, 0.0022, 2, 0.09, 0.0, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if expt_plot:\n pl.subplot(231)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L733_C12", "label": "subplot()", "type": "expression", "loc": [733, 733], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L732_C8", "vector": [8, 3, 0.8108, 0.0011, 3, 0.12, 0.0, 905, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "subplot", "arg_names": [], "import_names": [], "rhs_call_name": "subplot", "annotation": ""}, "snippet": " pl.subplot(231)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L736_C8", "label": "start_pt =", "type": "assigned_variable", "loc": [736, 736], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L730_C4", "vector": [14, 2, 0.8142, 0.0011, 2, 0.09, 0.027, 727, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "start_pt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " start_pt = actual_cartesian.p_list[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L737_C8", "label": "x_diff =", "type": "assigned_variable", "loc": [737, 737], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L730_C4", "vector": [14, 2, 0.8153, 0.0011, 2, 0.09, 0.0541, 533, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "x_diff", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " x_diff = start_pt[0] - cx"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L738_C8", "label": "y_diff =", "type": "assigned_variable", "loc": [738, 738], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L730_C4", "vector": [14, 2, 0.8164, 0.0011, 2, 0.09, 0.0811, 518, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "y_diff", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " y_diff = start_pt[1] - cy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L739_C8", "label": "angle =", "type": "assigned_variable", "loc": [739, 739], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L730_C4", "vector": [14, 2, 0.8175, 0.0011, 2, 0.09, 0.1081, 418, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "angle", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " angle = math.atan2(y_diff,x_diff) - math.radians(90)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L740_C8", "label": "rot_mat =", "type": "assigned_variable", "loc": [740, 740], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L730_C4", "vector": [14, 2, 0.8186, 0.0011, 2, 0.09, 0.1351, 968, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "rot_mat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rot_mat = tr.Rz(angle)[0:2,0:2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L741_C8", "label": "translation_mat =", "type": "assigned_variable", "loc": [741, 741], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L730_C4", "vector": [14, 2, 0.8197, 0.0011, 2, 0.09, 0.1622, 470, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "translation_mat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " translation_mat = np.matrix([cx,cy]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L743_C8", "label": "robot_width, robot_length =", "type": "assigned_variable", "loc": [743, 743], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L730_C4", "vector": [14, 2, 0.8219, 0.0011, 2, 0.09, 0.1892, 173, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "robot_width, robot_length", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " robot_width,robot_length = 0.1,0.2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L744_C8", "label": "robot_x_list =", "type": "assigned_variable", "loc": [744, 744], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L730_C4", "vector": [14, 2, 0.823, 0.0011, 2, 0.09, 0.2162, 173, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "robot_x_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " robot_x_list = [-robot_width/2,-robot_width/2,robot_width/2,robot_width/2,-robot_width/2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L745_C8", "label": "robot_y_list =", "type": "assigned_variable", "loc": [745, 745], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L730_C4", "vector": [14, 2, 0.8241, 0.0011, 2, 0.09, 0.2432, 364, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "robot_y_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " robot_y_list = [-robot_length/2,robot_length/2,robot_length/2,-robot_length/2,-robot_length/2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L746_C8", "label": "robot_mat =", "type": "assigned_variable", "loc": [746, 746], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L730_C4", "vector": [14, 2, 0.8252, 0.0011, 2, 0.09, 0.2703, 101, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "robot_mat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " robot_mat = rot_mat*(np.matrix([robot_x_list,robot_y_list]) - translation_mat)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L747_C8", "label": "plot_yx()", "type": "expression", "loc": [747, 748], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L730_C4", "vector": [8, 2, 0.8269, 0.0022, 2, 0.09, 0.2973, 112, 3, 6, 0, 0, 0, 0, 1], "semantic": {"name": "plot_yx", "arg_names": [], "import_names": [], "rhs_call_name": "plot_yx", "annotation": ""}, "snippet": " mpu.plot_yx(robot_mat[1,:].A1,robot_mat[0,:].A1,linewidth=2,scatter_size=0,\n color='k',label='torso')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L750_C8", "label": "pts2d_actual =", "type": "assigned_variable", "loc": [750, 750], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L730_C4", "vector": [14, 2, 0.8296, 0.0011, 2, 0.09, 0.3243, 824, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "pts2d_actual", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pts2d_actual = (np.matrix(actual_cartesian.p_list).T)[0:2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L751_C8", "label": "pts2d_actual_t =", "type": "assigned_variable", "loc": [751, 751], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L730_C4", "vector": [14, 2, 0.8308, 0.0011, 2, 0.09, 0.3514, 458, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pts2d_actual_t", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pts2d_actual_t = rot_mat *(pts2d_actual - translation_mat)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L752_C8", "label": "plot_yx()", "type": "expression", "loc": [752, 752], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L730_C4", "vector": [8, 2, 0.8319, 0.0011, 2, 0.09, 0.3784, 112, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "plot_yx", "arg_names": [], "import_names": [], "rhs_call_name": "plot_yx", "annotation": ""}, "snippet": " mpu.plot_yx(pts2d_actual_t[1,:].A1,pts2d_actual_t[0,:].A1,scatter_size=20,label='FK')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L754_C8", "label": "end_pt =", "type": "assigned_variable", "loc": [754, 754], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L730_C4", "vector": [14, 2, 0.8341, 0.0011, 2, 0.09, 0.4054, 292, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "end_pt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " end_pt = pts2d_actual_t[:,-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L755_C8", "label": "end_angle = angle_within_mod180()", "type": "assigned_variable", "loc": [755, 755], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L730_C4", "vector": [14, 2, 0.8352, 0.0011, 2, 0.09, 0.4324, 919, 3, 1, 0, 0, 694, 10, 3], "semantic": {"name": "end_angle", "arg_names": [], "import_names": [], "rhs_call_name": "angle_within_mod180", "annotation": ""}, "snippet": " end_angle = tr.angle_within_mod180(math.atan2(end_pt[1,0],end_pt[0,0])-math.radians(90))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L757_C8", "label": "plot_circle()", "type": "expression", "loc": [757, 757], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L730_C4", "vector": [8, 2, 0.8374, 0.0011, 2, 0.09, 0.4595, 365, 3, 7, 0, 0, 0, 0, 1], "semantic": {"name": "plot_circle", "arg_names": [], "import_names": [], "rhs_call_name": "plot_circle", "annotation": ""}, "snippet": " mpu.plot_circle(0,0,rad,0.,end_angle,label='Actual_opt',color='r')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L758_C8", "label": "plot_radii()", "type": "expression", "loc": [758, 758], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L730_C4", "vector": [8, 2, 0.8385, 0.0011, 2, 0.09, 0.4865, 459, 3, 7, 0, 0, 0, 0, 2], "semantic": {"name": "plot_radii", "arg_names": [], "import_names": [], "rhs_call_name": "plot_radii", "annotation": ""}, "snippet": " mpu.plot_radii(0,0,rad,0.,end_angle,interval=math.radians(15),color='r')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L759_C8", "label": "legend()", "type": "expression", "loc": [759, 759], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L730_C4", "vector": [8, 2, 0.8396, 0.0011, 2, 0.09, 0.5135, 880, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "legend", "arg_names": [], "import_names": [], "rhs_call_name": "legend", "annotation": ""}, "snippet": " pl.legend(loc='best')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L760_C8", "label": "axis()", "type": "expression", "loc": [760, 760], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L730_C4", "vector": [8, 2, 0.8407, 0.0011, 2, 0.09, 0.5405, 860, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "axis", "arg_names": [], "import_names": [], "rhs_call_name": "axis", "annotation": ""}, "snippet": " pl.axis('equal')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L762_C8", "label": "if", "type": "if", "loc": [762, 768], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L730_C4", "vector": [4, 2, 0.8462, 0.0077, 2, 0.09, 0.5676, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not(expt_plot):\n str_parts = fname.split('.')\n fig_name = str_parts[0]+'_robot_pose.png'\n pl.savefig(fig_name)\n pl.figure()\n else:\n pl.subplot(232)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L763_C12", "label": "str_parts = split()", "type": "assigned_variable", "loc": [763, 763], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L762_C8", "vector": [14, 3, 0.844, 0.0011, 3, 0.34, 0.0, 705, 3, 1, 0, 0, 908, 10, 1], "semantic": {"name": "str_parts", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": " str_parts = fname.split('.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L764_C12", "label": "fig_name =", "type": "assigned_variable", "loc": [764, 764], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L762_C8", "vector": [14, 3, 0.8451, 0.0011, 3, 0.34, 0.25, 219, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "fig_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " fig_name = str_parts[0]+'_robot_pose.png'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L765_C12", "label": "savefig()", "type": "expression", "loc": [765, 765], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L762_C8", "vector": [8, 3, 0.8462, 0.0011, 3, 0.34, 0.5, 677, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "savefig", "arg_names": [], "import_names": [], "rhs_call_name": "savefig", "annotation": ""}, "snippet": " pl.savefig(fig_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L766_C12", "label": "figure()", "type": "expression", "loc": [766, 766], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L762_C8", "vector": [8, 3, 0.8473, 0.0011, 3, 0.34, 0.75, 789, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "figure", "arg_names": [], "import_names": [], "rhs_call_name": "figure", "annotation": ""}, "snippet": " pl.figure()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L768_C12", "label": "subplot()", "type": "expression", "loc": [768, 768], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L762_C8", "vector": [8, 3, 0.8496, 0.0011, 3, 0.34, 1.0, 905, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "subplot", "arg_names": [], "import_names": [], "rhs_call_name": "subplot", "annotation": ""}, "snippet": " pl.subplot(232)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L770_C8", "label": "text()", "type": "expression", "loc": [770, 770], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L730_C4", "vector": [8, 2, 0.8518, 0.0011, 2, 0.09, 0.5946, 439, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "text", "arg_names": [], "import_names": [], "rhs_call_name": "text", "annotation": ""}, "snippet": " pl.text(0.1,0.15,d['info'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L771_C8", "label": "text()", "type": "expression", "loc": [771, 771], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L730_C4", "vector": [8, 2, 0.8529, 0.0011, 2, 0.09, 0.6216, 439, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "text", "arg_names": [], "import_names": [], "rhs_call_name": "text", "annotation": ""}, "snippet": " pl.text(0.1,0.10,'control: '+d['strategy'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L772_C8", "label": "text()", "type": "expression", "loc": [772, 772], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L730_C4", "vector": [8, 2, 0.854, 0.0011, 2, 0.09, 0.6486, 439, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "text", "arg_names": [], "import_names": [], "rhs_call_name": "text", "annotation": ""}, "snippet": " pl.text(0.1,0.05,'robot angle: %.2f'%math.degrees(angle))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L773_C8", "label": "text()", "type": "expression", "loc": [773, 773], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L730_C4", "vector": [8, 2, 0.8551, 0.0011, 2, 0.09, 0.6757, 439, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "text", "arg_names": [], "import_names": [], "rhs_call_name": "text", "annotation": ""}, "snippet": " pl.text(0.1,0,'optimized radius: %.2f'%rad_opt)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L774_C8", "label": "text()", "type": "expression", "loc": [774, 774], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L730_C4", "vector": [8, 2, 0.8562, 0.0011, 2, 0.09, 0.7027, 439, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "text", "arg_names": [], "import_names": [], "rhs_call_name": "text", "annotation": ""}, "snippet": " pl.text(0.1,-0.05,'radius used: %.2f'%rad)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L775_C8", "label": "text()", "type": "expression", "loc": [775, 775], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L730_C4", "vector": [8, 2, 0.8573, 0.0011, 2, 0.09, 0.7297, 439, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "text", "arg_names": [], "import_names": [], "rhs_call_name": "text", "annotation": ""}, "snippet": " pl.text(0.1,-0.10,'opening angle: %.2f'%math.degrees(end_angle))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L776_C8", "label": "s_list =", "type": "assigned_variable", "loc": [776, 776], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L730_C4", "vector": [14, 2, 0.8584, 0.0011, 2, 0.09, 0.7568, 363, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "s_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " s_list = d['stiffness'].stiffness_list"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L777_C8", "label": "s_scale =", "type": "assigned_variable", "loc": [777, 777], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L730_C4", "vector": [14, 2, 0.8595, 0.0011, 2, 0.09, 0.7838, 389, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "s_scale", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " s_scale = d['stiffness'].stiffness_scale"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L778_C8", "label": "sl =", "type": "assigned_variable", "loc": [778, 778], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L730_C4", "vector": [14, 2, 0.8606, 0.0011, 2, 0.09, 0.8108, 555, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "sl", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " sl = [min(s*s_scale,1.0) for s in s_list]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L779_C8", "label": "text()", "type": "expression", "loc": [779, 779], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L730_C4", "vector": [8, 2, 0.8617, 0.0011, 2, 0.09, 0.8378, 439, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "text", "arg_names": [], "import_names": [], "rhs_call_name": "text", "annotation": ""}, "snippet": " pl.text(0.1,-0.15,'stiffness list: %.2f, %.2f, %.2f, %.2f'%(sl[0],sl[1],sl[2],sl[3]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L780_C8", "label": "text()", "type": "expression", "loc": [780, 780], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L730_C4", "vector": [8, 2, 0.8628, 0.0011, 2, 0.09, 0.8649, 439, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "text", "arg_names": [], "import_names": [], "rhs_call_name": "text", "annotation": ""}, "snippet": " pl.text(0.1,-0.20,'stop condition: '+d['result'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L781_C8", "label": "time_dict =", "type": "assigned_variable", "loc": [781, 781], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L730_C4", "vector": [14, 2, 0.8639, 0.0011, 2, 0.09, 0.8919, 361, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "time_dict", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " time_dict = d['time_dict']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L782_C8", "label": "text()", "type": "expression", "loc": [782, 782], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L730_C4", "vector": [8, 2, 0.865, 0.0011, 2, 0.09, 0.9189, 439, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "text", "arg_names": [], "import_names": [], "rhs_call_name": "text", "annotation": ""}, "snippet": " pl.text(0.1,-0.25,'time to hook: %.2f'%(time_dict['before_hook']-time_dict['before_pull']))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L783_C8", "label": "text()", "type": "expression", "loc": [783, 783], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L730_C4", "vector": [8, 2, 0.8662, 0.0011, 2, 0.09, 0.9459, 439, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "text", "arg_names": [], "import_names": [], "rhs_call_name": "text", "annotation": ""}, "snippet": " pl.text(0.1,-0.30,'time to pull: %.2f'%(time_dict['before_pull']-time_dict['after_pull']))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L785_C8", "label": "ylim()", "type": "expression", "loc": [785, 785], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L730_C4", "vector": [8, 2, 0.8684, 0.0011, 2, 0.09, 0.973, 247, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "ylim", "arg_names": [], "import_names": [], "rhs_call_name": "ylim", "annotation": ""}, "snippet": " pl.ylim(-0.45,0.25)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L786_C8", "label": "if", "type": "if", "loc": [786, 787], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L730_C4", "vector": [4, 2, 0.87, 0.0022, 2, 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(expt_plot):\n pl.figure()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L787_C12", "label": "figure()", "type": "expression", "loc": [787, 787], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L786_C8", "vector": [8, 3, 0.8706, 0.0011, 3, 0.89, 0.0, 789, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "figure", "arg_names": [], "import_names": [], "rhs_call_name": "figure", "annotation": ""}, "snippet": " pl.figure()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L790_C4", "label": "if", "type": "if", "loc": [790, 825], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L584_C0", "vector": [4, 1, 0.8933, 0.0398, 1, 0.29, 0.9184, 0, 2, 0, 0, 0, 0, 0, 29], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if xy_flag:\n st_pt = pts_2d[:,0]\n start_angle = tr.angle_within_mod180(math.atan2(st_pt[1,0]-cy,st_pt[0,0]-cx) - math.radians(90))\n end_pt = pts_2d[:,-1]\n end_angle = tr.angle_within_mod180(math.atan2(end_pt[1,0]-cy,end_pt[0,0]-cx) - math.radians(90))\n \n print('start_angle, end_angle:', math.degrees(start_angle), math.degrees(end_angle))\n print('angle through which mechanism turned:', math.degrees(end_angle-start_angle))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L791_C8", "label": "st_pt =", "type": "assigned_variable", "loc": [791, 791], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L790_C4", "vector": [14, 2, 0.875, 0.0011, 2, 0.16, 0.0, 515, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "st_pt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " st_pt = pts_2d[:,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L792_C8", "label": "start_angle = angle_within_mod180()", "type": "assigned_variable", "loc": [792, 792], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L790_C4", "vector": [14, 2, 0.8761, 0.0011, 2, 0.16, 0.0526, 662, 3, 1, 0, 0, 694, 10, 3], "semantic": {"name": "start_angle", "arg_names": [], "import_names": [], "rhs_call_name": "angle_within_mod180", "annotation": ""}, "snippet": " start_angle = tr.angle_within_mod180(math.atan2(st_pt[1,0]-cy,st_pt[0,0]-cx) - math.radians(90))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L793_C8", "label": "end_pt =", "type": "assigned_variable", "loc": [793, 793], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L790_C4", "vector": [14, 2, 0.8772, 0.0011, 2, 0.16, 0.1053, 292, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "end_pt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " end_pt = pts_2d[:,-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L794_C8", "label": "end_angle = angle_within_mod180()", "type": "assigned_variable", "loc": [794, 794], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L790_C4", "vector": [14, 2, 0.8783, 0.0011, 2, 0.16, 0.1579, 919, 3, 1, 0, 0, 694, 10, 3], "semantic": {"name": "end_angle", "arg_names": [], "import_names": [], "rhs_call_name": "angle_within_mod180", "annotation": ""}, "snippet": " end_angle = tr.angle_within_mod180(math.atan2(end_pt[1,0]-cy,end_pt[0,0]-cx) - math.radians(90))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L796_C8", "label": "print()", "type": "expression", "loc": [796, 796], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L790_C4", "vector": [8, 2, 0.8805, 0.0011, 2, 0.16, 0.2105, 535, 3, 3, 0, 0, 0, 0, 3], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('start_angle, end_angle:', math.degrees(start_angle), math.degrees(end_angle))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L797_C8", "label": "print()", "type": "expression", "loc": [797, 797], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L790_C4", "vector": [8, 2, 0.8816, 0.0011, 2, 0.16, 0.2632, 535, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('angle through which mechanism turned:', math.degrees(end_angle-start_angle))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L799_C8", "label": "if", "type": "if", "loc": [799, 800], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L790_C4", "vector": [4, 2, 0.8844, 0.0022, 2, 0.16, 0.3158, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if expt_plot:\n pl.subplot(233)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L800_C12", "label": "subplot()", "type": "expression", "loc": [800, 800], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L799_C8", "vector": [8, 3, 0.885, 0.0011, 3, 0.36, 0.0, 905, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "subplot", "arg_names": [], "import_names": [], "rhs_call_name": "subplot", "annotation": ""}, "snippet": " pl.subplot(233)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L802_C8", "label": "plot_cartesian()", "type": "expression", "loc": [802, 802], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L790_C4", "vector": [8, 2, 0.8872, 0.0011, 2, 0.16, 0.3684, 991, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "plot_cartesian", "arg_names": [], "import_names": [], "rhs_call_name": "plot_cartesian", "annotation": ""}, "snippet": " plot_cartesian(actual_cartesian,xaxis=0,yaxis=1,color='b',label='End Effector Trajectory')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L803_C8", "label": "plot_cartesian()", "type": "expression", "loc": [803, 803], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L790_C4", "vector": [8, 2, 0.8883, 0.0011, 2, 0.16, 0.4211, 991, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "plot_cartesian", "arg_names": [], "import_names": [], "rhs_call_name": "plot_cartesian", "annotation": ""}, "snippet": " plot_cartesian(eq_cartesian, xaxis=0,yaxis=1,color='g',label='Eq Point')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L804_C8", "label": "plot_circle()", "type": "expression", "loc": [804, 804], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L790_C4", "vector": [8, 2, 0.8894, 0.0011, 2, 0.16, 0.4737, 365, 3, 7, 0, 0, 0, 0, 1], "semantic": {"name": "plot_circle", "arg_names": [], "import_names": [], "rhs_call_name": "plot_circle", "annotation": ""}, "snippet": " mpu.plot_circle(cx,cy,rad,start_angle,end_angle,label='Estimated Kinematics',color='r')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L808_C8", "label": "leg = legend()", "type": "assigned_variable", "loc": [808, 808], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L790_C4", "vector": [14, 2, 0.8938, 0.0011, 2, 0.16, 0.5263, 99, 3, 1, 0, 0, 880, 10, 1], "semantic": {"name": "leg", "arg_names": [], "import_names": [], "rhs_call_name": "legend", "annotation": ""}, "snippet": " leg = pl.legend(loc='best')#,handletextsep=0.020,handlelen=0.003,labelspacing=0.003)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L809_C8", "label": "draw_frame()", "type": "expression", "loc": [809, 809], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L790_C4", "vector": [8, 2, 0.8949, 0.0011, 2, 0.16, 0.5789, 680, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "draw_frame", "arg_names": [], "import_names": [], "rhs_call_name": "draw_frame", "annotation": ""}, "snippet": " leg.draw_frame(False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L811_C8", "label": "ax = gca()", "type": "assigned_variable", "loc": [811, 811], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L790_C4", "vector": [14, 2, 0.8971, 0.0011, 2, 0.16, 0.6316, 823, 3, 0, 0, 0, 420, 10, 1], "semantic": {"name": "ax", "arg_names": [], "import_names": [], "rhs_call_name": "gca", "annotation": ""}, "snippet": " ax = pl.gca()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L812_C8", "label": "set_xlim()", "type": "expression", "loc": [812, 812], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L790_C4", "vector": [8, 2, 0.8982, 0.0011, 2, 0.16, 0.6842, 806, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "set_xlim", "arg_names": [], "import_names": [], "rhs_call_name": "set_xlim", "annotation": ""}, "snippet": " ax.set_xlim(ax.get_xlim()[::-1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L813_C8", "label": "set_ylim()", "type": "expression", "loc": [813, 813], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L790_C4", "vector": [8, 2, 0.8993, 0.0011, 2, 0.16, 0.7368, 819, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "set_ylim", "arg_names": [], "import_names": [], "rhs_call_name": "set_ylim", "annotation": ""}, "snippet": " ax.set_ylim(ax.get_ylim()[::-1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L815_C8", "label": "force_traj =", "type": "assigned_variable", "loc": [815, 815], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L790_C4", "vector": [14, 2, 0.9015, 0.0011, 2, 0.16, 0.7895, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "force_traj", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " force_traj = d['force']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L816_C8", "label": "forces =", "type": "assigned_variable", "loc": [816, 816], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L790_C4", "vector": [14, 2, 0.9027, 0.0011, 2, 0.16, 0.8421, 817, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "forces", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " forces = np.matrix(force_traj.f_list).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L817_C8", "label": "force_mag = norm()", "type": "assigned_variable", "loc": [817, 817], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L790_C4", "vector": [14, 2, 0.9038, 0.0011, 2, 0.16, 0.8947, 834, 3, 1, 0, 0, 902, 10, 1], "semantic": {"name": "force_mag", "arg_names": [], "import_names": [], "rhs_call_name": "norm", "annotation": ""}, "snippet": " force_mag = ut.norm(forces)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L818_C8", "label": "print()", "type": "expression", "loc": [818, 818], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L790_C4", "vector": [8, 2, 0.9049, 0.0011, 2, 0.16, 0.9474, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('force_mag:', force_mag.A1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L820_C4", "label": "if", "type": "if", "loc": [820, 825], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L790_C4", "vector": [4, 2, 0.9098, 0.0066, 2, 0.16, 1.0, 0, 2, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif yz_flag:\n plot_cartesian(actual_cartesian,xaxis=1,yaxis=2,color='b',label='FK')\n plot_cartesian(eq_cartesian, xaxis=1,yaxis=2,color='g',label='Eq Point')\n elif xz_flag:\n plot_cartesian(actual_cartesian,xaxis=0,yaxis=2,color='b',label='FK')\n plot_cartesian(eq_cartesian, xaxis=0,yaxis=2,color='g',label='Eq Point')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L821_C8", "label": "plot_cartesian()", "type": "expression", "loc": [821, 821], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L820_C4", "vector": [8, 3, 0.9082, 0.0011, 3, 0.54, 0.0, 991, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "plot_cartesian", "arg_names": [], "import_names": [], "rhs_call_name": "plot_cartesian", "annotation": ""}, "snippet": " plot_cartesian(actual_cartesian,xaxis=1,yaxis=2,color='b',label='FK')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L822_C8", "label": "plot_cartesian()", "type": "expression", "loc": [822, 822], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L820_C4", "vector": [8, 3, 0.9093, 0.0011, 3, 0.54, 0.5, 991, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "plot_cartesian", "arg_names": [], "import_names": [], "rhs_call_name": "plot_cartesian", "annotation": ""}, "snippet": " plot_cartesian(eq_cartesian, xaxis=1,yaxis=2,color='g',label='Eq Point')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L823_C4", "label": "if", "type": "if", "loc": [823, 825], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L820_C4", "vector": [4, 3, 0.9115, 0.0033, 3, 0.54, 1.0, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif xz_flag:\n plot_cartesian(actual_cartesian,xaxis=0,yaxis=2,color='b',label='FK')\n plot_cartesian(eq_cartesian, xaxis=0,yaxis=2,color='g',label='Eq Point')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L824_C8", "label": "plot_cartesian()", "type": "expression", "loc": [824, 824], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L823_C4", "vector": [8, 4, 0.9115, 0.0011, 4, 0.91, 0.0, 991, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "plot_cartesian", "arg_names": [], "import_names": [], "rhs_call_name": "plot_cartesian", "annotation": ""}, "snippet": " plot_cartesian(actual_cartesian,xaxis=0,yaxis=2,color='b',label='FK')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L825_C8", "label": "plot_cartesian()", "type": "expression", "loc": [825, 825], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L823_C4", "vector": [8, 4, 0.9126, 0.0011, 4, 0.91, 1.0, 991, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "plot_cartesian", "arg_names": [], "import_names": [], "rhs_call_name": "plot_cartesian", "annotation": ""}, "snippet": " plot_cartesian(eq_cartesian, xaxis=0,yaxis=2,color='g',label='Eq Point')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L828_C4", "label": "if", "type": "if", "loc": [828, 878], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L584_C0", "vector": [4, 1, 0.9436, 0.0564, 1, 0.29, 0.9388, 0, 0, 0, 0, 0, 0, 0, 24], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if plot_forces_flag or plot_forces_error_flag or plot_ellipses_flag or plot_force_components_flag or plot_force_field_flag:\n arm_stiffness_list = d['stiffness'].stiffness_list\n scale = d['stiffness'].stiffness_scale\n asl = [min(scale*s,1.0) for s in arm_stiffness_list]\n ftraj_jinv,ftraj_stiff,ftraj_torque,k_cart_list=compute_forces(d['actual'],d['eq_pt'],\n d['torque'],asl)\n if plot_forces_flag:\n plot_forces_quiver(actual_cartesian,d['force'],color='k')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L829_C8", "label": "arm_stiffness_list =", "type": "assigned_variable", "loc": [829, 829], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L828_C4", "vector": [14, 2, 0.917, 0.0011, 2, 0.48, 0.0, 442, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "arm_stiffness_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " arm_stiffness_list = d['stiffness'].stiffness_list"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L830_C8", "label": "scale =", "type": "assigned_variable", "loc": [830, 830], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L828_C4", "vector": [14, 2, 0.9181, 0.0011, 2, 0.48, 0.125, 18, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "scale", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " scale = d['stiffness'].stiffness_scale"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L831_C8", "label": "asl =", "type": "assigned_variable", "loc": [831, 831], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L828_C4", "vector": [14, 2, 0.9192, 0.0011, 2, 0.48, 0.25, 870, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "asl", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " asl = [min(scale*s,1.0) for s in arm_stiffness_list]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L832_C8", "label": "ftraj_jinv, ftraj_stiff, ftraj_torque, k_cart_list = compute_forces()", "type": "assigned_variable", "loc": [832, 833], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L828_C4", "vector": [14, 2, 0.9209, 0.0022, 2, 0.48, 0.375, 537, 3, 4, 0, 0, 761, 10, 1], "semantic": {"name": "ftraj_jinv, ftraj_stiff, ftraj_torque, k_cart_list", "arg_names": [], "import_names": [], "rhs_call_name": "compute_forces", "annotation": ""}, "snippet": " ftraj_jinv,ftraj_stiff,ftraj_torque,k_cart_list=compute_forces(d['actual'],d['eq_pt'],\n d['torque'],asl)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L834_C8", "label": "if", "type": "if", "loc": [834, 836], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L828_C4", "vector": [4, 2, 0.9237, 0.0033, 2, 0.48, 0.5, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if plot_forces_flag:\n plot_forces_quiver(actual_cartesian,d['force'],color='k')\n plot_forces_quiver(actual_cartesian,ftraj_jinv,color='y')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L835_C12", "label": "plot_forces_quiver()", "type": "expression", "loc": [835, 835], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L834_C8", "vector": [8, 3, 0.9237, 0.0011, 3, 0.36, 0.0, 539, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "plot_forces_quiver", "arg_names": [], "import_names": [], "rhs_call_name": "plot_forces_quiver", "annotation": ""}, "snippet": " plot_forces_quiver(actual_cartesian,d['force'],color='k')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L836_C12", "label": "plot_forces_quiver()", "type": "expression", "loc": [836, 836], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L834_C8", "vector": [8, 3, 0.9248, 0.0011, 3, 0.36, 1.0, 539, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "plot_forces_quiver", "arg_names": [], "import_names": [], "rhs_call_name": "plot_forces_quiver", "annotation": ""}, "snippet": " plot_forces_quiver(actual_cartesian,ftraj_jinv,color='y')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L839_C8", "label": "if", "type": "if", "loc": [839, 846], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L828_C4", "vector": [4, 2, 0.932, 0.0088, 2, 0.48, 0.625, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if plot_ellipses_flag:\n #plot_stiff_ellipses(k_cart_list,actual_cartesian)\n if expt_plot:\n subplotnum=234\n else:\n pl.figure()\n subplotnum=111\n plot_stiff_ellipses(k_cart_list,eq_cartesian,subplotnum=subplotnum)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L841_C12", "label": "if", "type": "if", "loc": [841, 845], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L839_C8", "vector": [4, 3, 0.9325, 0.0055, 3, 0.79, 0.0, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if expt_plot:\n subplotnum=234\n else:\n pl.figure()\n subplotnum=111"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L842_C16", "label": "subplotnum =", "type": "assigned_variable", "loc": [842, 842], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L841_C12", "vector": [14, 4, 0.9314, 0.0011, 4, 0.51, 0.0, 279, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "subplotnum", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " subplotnum=234"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L844_C16", "label": "figure()", "type": "expression", "loc": [844, 844], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L841_C12", "vector": [8, 4, 0.9336, 0.0011, 4, 0.51, 0.5, 789, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "figure", "arg_names": [], "import_names": [], "rhs_call_name": "figure", "annotation": ""}, "snippet": " pl.figure()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L845_C16", "label": "subplotnum =", "type": "assigned_variable", "loc": [845, 845], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L841_C12", "vector": [14, 4, 0.9347, 0.0011, 4, 0.51, 1.0, 279, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "subplotnum", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " subplotnum=111"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L846_C12", "label": "plot_stiff_ellipses()", "type": "expression", "loc": [846, 846], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L839_C8", "vector": [8, 3, 0.9358, 0.0011, 3, 0.79, 1.0, 370, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "plot_stiff_ellipses", "arg_names": [], "import_names": [], "rhs_call_name": "plot_stiff_ellipses", "annotation": ""}, "snippet": " plot_stiff_ellipses(k_cart_list,eq_cartesian,subplotnum=subplotnum)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L848_C8", "label": "if", "type": "if", "loc": [848, 849], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L828_C4", "vector": [4, 2, 0.9386, 0.0022, 2, 0.48, 0.75, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if plot_forces_error_flag:\n plot_error_forces(d['force'].f_list,ftraj_jinv.f_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L849_C12", "label": "plot_error_forces()", "type": "expression", "loc": [849, 849], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L848_C8", "vector": [8, 3, 0.9392, 0.0011, 3, 0.74, 0.0, 432, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "plot_error_forces", "arg_names": [], "import_names": [], "rhs_call_name": "plot_error_forces", "annotation": ""}, "snippet": " plot_error_forces(d['force'].f_list,ftraj_jinv.f_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L852_C8", "label": "if", "type": "if", "loc": [852, 874], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L828_C4", "vector": [4, 2, 0.9546, 0.0254, 2, 0.48, 0.875, 0, 2, 0, 0, 0, 0, 0, 15], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if plot_force_components_flag:\n p_list = actual_cartesian.p_list\n frad_list,ftan_list = compute_radial_tangential_forces(d['force'].f_list,p_list,cx,cy)\n if expt_plot:\n pl.subplot(235)\n else:\n pl.figure()\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L853_C12", "label": "p_list =", "type": "assigned_variable", "loc": [853, 853], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L852_C8", "vector": [14, 3, 0.9436, 0.0011, 3, 0.89, 0.0, 98, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "p_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p_list = actual_cartesian.p_list"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L854_C12", "label": "frad_list, ftan_list = compute_radial_tangential_forces()", "type": "assigned_variable", "loc": [854, 854], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L852_C8", "vector": [14, 3, 0.9447, 0.0011, 3, 0.89, 0.0714, 736, 3, 4, 0, 0, 224, 10, 1], "semantic": {"name": "frad_list, ftan_list", "arg_names": [], "import_names": [], "rhs_call_name": "compute_radial_tangential_forces", "annotation": ""}, "snippet": " frad_list,ftan_list = compute_radial_tangential_forces(d['force'].f_list,p_list,cx,cy)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L855_C12", "label": "if", "type": "if", "loc": [855, 858], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L852_C8", "vector": [4, 3, 0.9475, 0.0044, 3, 0.89, 0.1429, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if expt_plot:\n pl.subplot(235)\n else:\n pl.figure()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L856_C16", "label": "subplot()", "type": "expression", "loc": [856, 856], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L855_C12", "vector": [8, 4, 0.9469, 0.0011, 4, 0.77, 0.0, 905, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "subplot", "arg_names": [], "import_names": [], "rhs_call_name": "subplot", "annotation": ""}, "snippet": " pl.subplot(235)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L858_C16", "label": "figure()", "type": "expression", "loc": [858, 858], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L855_C12", "vector": [8, 4, 0.9491, 0.0011, 4, 0.77, 1.0, 789, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "figure", "arg_names": [], "import_names": [], "rhs_call_name": "figure", "annotation": ""}, "snippet": " pl.figure()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L860_C12", "label": "time_list =", "type": "assigned_variable", "loc": [860, 860], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L852_C8", "vector": [14, 3, 0.9513, 0.0011, 3, 0.89, 0.2143, 941, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "time_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " time_list = d['force'].time_list"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L861_C12", "label": "time_list =", "type": "assigned_variable", "loc": [861, 861], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L852_C8", "vector": [14, 3, 0.9524, 0.0011, 3, 0.89, 0.2857, 941, 5, 0, 0, 0, 0, 0, 0], "semantic": {"name": "time_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " time_list = [t-time_list[0] for t in time_list]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L862_C12", "label": "x_coord_list = tolist()", "type": "assigned_variable", "loc": [862, 862], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L852_C8", "vector": [14, 3, 0.9535, 0.0011, 3, 0.89, 0.3571, 243, 3, 0, 0, 0, 185, 10, 2], "semantic": {"name": "x_coord_list", "arg_names": [], "import_names": [], "rhs_call_name": "tolist", "annotation": ""}, "snippet": " x_coord_list = np.matrix(p_list)[:,0].A1.tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L863_C12", "label": "plot_yx()", "type": "expression", "loc": [863, 863], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L852_C8", "vector": [8, 3, 0.9546, 0.0011, 3, 0.89, 0.4286, 112, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "plot_yx", "arg_names": [], "import_names": [], "rhs_call_name": "plot_yx", "annotation": ""}, "snippet": " mpu.plot_yx(frad_list,x_coord_list,scatter_size=50,color=time_list,cb_label='time')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L864_C12", "label": "xlabel()", "type": "expression", "loc": [864, 864], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L852_C8", "vector": [8, 3, 0.9558, 0.0011, 3, 0.89, 0.5, 676, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "xlabel", "arg_names": [], "import_names": [], "rhs_call_name": "xlabel", "annotation": ""}, "snippet": " pl.xlabel('x coord of end effector (m)')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L865_C12", "label": "ylabel()", "type": "expression", "loc": [865, 865], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L852_C8", "vector": [8, 3, 0.9569, 0.0011, 3, 0.89, 0.5714, 584, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "ylabel", "arg_names": [], "import_names": [], "rhs_call_name": "ylabel", "annotation": ""}, "snippet": " pl.ylabel('magnitude of radial force (N)')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L866_C12", "label": "title()", "type": "expression", "loc": [866, 866], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L852_C8", "vector": [8, 3, 0.958, 0.0011, 3, 0.89, 0.6429, 48, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "title", "arg_names": [], "import_names": [], "rhs_call_name": "title", "annotation": ""}, "snippet": " pl.title(d['info'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L867_C12", "label": "if", "type": "if", "loc": [867, 870], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L852_C8", "vector": [4, 3, 0.9607, 0.0044, 3, 0.89, 0.7143, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if expt_plot:\n pl.subplot(236)\n else:\n pl.figure()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L868_C16", "label": "subplot()", "type": "expression", "loc": [868, 868], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L867_C12", "vector": [8, 4, 0.9602, 0.0011, 4, 0.86, 0.0, 905, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "subplot", "arg_names": [], "import_names": [], "rhs_call_name": "subplot", "annotation": ""}, "snippet": " pl.subplot(236)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L870_C16", "label": "figure()", "type": "expression", "loc": [870, 870], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L867_C12", "vector": [8, 4, 0.9624, 0.0011, 4, 0.86, 1.0, 789, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "figure", "arg_names": [], "import_names": [], "rhs_call_name": "figure", "annotation": ""}, "snippet": " pl.figure()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L871_C12", "label": "plot_yx()", "type": "expression", "loc": [871, 871], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L852_C8", "vector": [8, 3, 0.9635, 0.0011, 3, 0.89, 0.7857, 112, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "plot_yx", "arg_names": [], "import_names": [], "rhs_call_name": "plot_yx", "annotation": ""}, "snippet": " mpu.plot_yx(ftan_list,x_coord_list,scatter_size=50,color=time_list,cb_label='time')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L872_C12", "label": "xlabel()", "type": "expression", "loc": [872, 872], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L852_C8", "vector": [8, 3, 0.9646, 0.0011, 3, 0.89, 0.8571, 676, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "xlabel", "arg_names": [], "import_names": [], "rhs_call_name": "xlabel", "annotation": ""}, "snippet": " pl.xlabel('x coord of end effector (m)')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L873_C12", "label": "ylabel()", "type": "expression", "loc": [873, 873], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L852_C8", "vector": [8, 3, 0.9657, 0.0011, 3, 0.89, 0.9286, 584, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "ylabel", "arg_names": [], "import_names": [], "rhs_call_name": "ylabel", "annotation": ""}, "snippet": " pl.ylabel('magnitude of tangential force (N)')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L874_C12", "label": "title()", "type": "expression", "loc": [874, 874], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L852_C8", "vector": [8, 3, 0.9668, 0.0011, 3, 0.89, 1.0, 48, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "title", "arg_names": [], "import_names": [], "rhs_call_name": "title", "annotation": ""}, "snippet": " pl.title(d['info'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L876_C8", "label": "if", "type": "if", "loc": [876, 878], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L828_C4", "vector": [4, 2, 0.9701, 0.0033, 2, 0.48, 1.0, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if plot_force_field_flag:\n plot_stiffness_field(k_cart_list[0],plottitle='start')\n plot_stiffness_field(k_cart_list[-1],plottitle='end')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L877_C12", "label": "plot_stiffness_field()", "type": "expression", "loc": [877, 877], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L876_C8", "vector": [8, 3, 0.9701, 0.0011, 3, 0.39, 0.0, 136, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "plot_stiffness_field", "arg_names": [], "import_names": [], "rhs_call_name": "plot_stiffness_field", "annotation": ""}, "snippet": " plot_stiffness_field(k_cart_list[0],plottitle='start')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L878_C12", "label": "plot_stiffness_field()", "type": "expression", "loc": [878, 878], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L876_C8", "vector": [8, 3, 0.9712, 0.0011, 3, 0.39, 1.0, 136, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "plot_stiffness_field", "arg_names": [], "import_names": [], "rhs_call_name": "plot_stiffness_field", "annotation": ""}, "snippet": " plot_stiffness_field(k_cart_list[-1],plottitle='end')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L881_C4", "label": "if", "type": "if", "loc": [881, 890], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L584_C0", "vector": [4, 1, 0.9795, 0.0111, 1, 0.29, 0.9592, 0, 2, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if expt_plot:\n f = pl.gcf()\n curr_size = f.get_size_inches()\n f.set_size_inches(curr_size[0]*2,curr_size[1]*2)\n str_parts = fname.split('.')\n if d.has_key('strategy'):\n fig_name = str_parts[0]+'_'+d['strategy']+'.png'\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L882_C8", "label": "f = gcf()", "type": "assigned_variable", "loc": [882, 882], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L881_C4", "vector": [14, 2, 0.9757, 0.0011, 2, 0.5, 0.0, 899, 3, 0, 0, 0, 274, 10, 1], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "gcf", "annotation": ""}, "snippet": " f = pl.gcf()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L883_C8", "label": "curr_size = get_size_inches()", "type": "assigned_variable", "loc": [883, 883], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L881_C4", "vector": [14, 2, 0.9768, 0.0011, 2, 0.5, 0.2, 156, 3, 0, 0, 0, 444, 10, 1], "semantic": {"name": "curr_size", "arg_names": [], "import_names": [], "rhs_call_name": "get_size_inches", "annotation": ""}, "snippet": " curr_size = f.get_size_inches()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L884_C8", "label": "set_size_inches()", "type": "expression", "loc": [884, 884], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L881_C4", "vector": [8, 2, 0.9779, 0.0011, 2, 0.5, 0.4, 620, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "set_size_inches", "arg_names": [], "import_names": [], "rhs_call_name": "set_size_inches", "annotation": ""}, "snippet": " f.set_size_inches(curr_size[0]*2,curr_size[1]*2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L885_C8", "label": "str_parts = split()", "type": "assigned_variable", "loc": [885, 885], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L881_C4", "vector": [14, 2, 0.979, 0.0011, 2, 0.5, 0.6, 705, 3, 1, 0, 0, 908, 10, 1], "semantic": {"name": "str_parts", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": " str_parts = fname.split('.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L886_C8", "label": "if", "type": "if", "loc": [886, 889], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L881_C4", "vector": [4, 2, 0.9817, 0.0044, 2, 0.5, 0.8, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if d.has_key('strategy'):\n fig_name = str_parts[0]+'_'+d['strategy']+'.png'\n else:\n fig_name = str_parts[0]+'_res.png'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L887_C12", "label": "fig_name =", "type": "assigned_variable", "loc": [887, 887], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L886_C8", "vector": [14, 3, 0.9812, 0.0011, 3, 0.9, 0.0, 219, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "fig_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " fig_name = str_parts[0]+'_'+d['strategy']+'.png'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L889_C12", "label": "fig_name =", "type": "assigned_variable", "loc": [889, 889], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L886_C8", "vector": [14, 3, 0.9834, 0.0011, 3, 0.9, 1.0, 219, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "fig_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " fig_name = str_parts[0]+'_res.png'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L890_C8", "label": "savefig()", "type": "expression", "loc": [890, 890], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L881_C4", "vector": [8, 2, 0.9845, 0.0011, 2, 0.5, 1.0, 677, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "savefig", "arg_names": [], "import_names": [], "rhs_call_name": "savefig", "annotation": ""}, "snippet": " f.savefig(fig_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L892_C4", "label": "if", "type": "if", "loc": [892, 896], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L584_C0", "vector": [4, 1, 0.9889, 0.0055, 1, 0.29, 0.9796, 0, 2, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if show_fig:\n pl.show()\n else:\n print('################################')\n print('show_fig is FALSE')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L893_C8", "label": "show()", "type": "expression", "loc": [893, 893], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L892_C4", "vector": [8, 2, 0.9878, 0.0011, 2, 0.34, 0.0, 497, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "show", "arg_names": [], "import_names": [], "rhs_call_name": "show", "annotation": ""}, "snippet": " pl.show()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L895_C8", "label": "print()", "type": "expression", "loc": [895, 895], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L892_C4", "vector": [8, 2, 0.99, 0.0011, 2, 0.34, 0.5, 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_99547:Expr_L896_C8", "label": "print()", "type": "expression", "loc": [896, 896], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L892_C4", "vector": [8, 2, 0.9912, 0.0011, 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('show_fig is FALSE')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L898_C4", "label": "if", "type": "if", "loc": [898, 900], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L584_C0", "vector": [4, 1, 0.9945, 0.0033, 1, 0.29, 1.0, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if xyz_flag:\n plot_cartesian(traj, xaxis=0,yaxis=1,zaxis=2)\n mlab.show()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L899_C8", "label": "plot_cartesian()", "type": "expression", "loc": [899, 899], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L898_C4", "vector": [8, 2, 0.9945, 0.0011, 2, 0.16, 0.0, 991, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "plot_cartesian", "arg_names": [], "import_names": [], "rhs_call_name": "plot_cartesian", "annotation": ""}, "snippet": " plot_cartesian(traj, xaxis=0,yaxis=1,zaxis=2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L900_C8", "label": "show()", "type": "expression", "loc": [900, 900], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L898_C4", "vector": [8, 2, 0.9956, 0.0011, 2, 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": " mlab.show()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99547:ClassDef_L49_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L50_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:ClassDef_L49_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L53_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L54_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L55_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L56_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:ClassDef_L58_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L59_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:ClassDef_L58_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L62_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L63_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L64_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:ClassDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L67_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:ClassDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L70_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L70_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L71_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L70_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L72_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L75_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L76_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L75_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L79_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L75_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L80_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L75_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L81_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L82_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L83_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L75_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L85_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L75_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L86_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L75_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L87_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L75_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Return_L89_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L92_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Import_L93_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L92_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L95_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L95_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L96_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L92_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L98_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L92_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L99_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L92_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L100_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L92_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L101_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L92_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L103_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L92_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L104_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L92_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L105_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L92_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L106_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L92_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L108_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L110_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L112_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L110_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Import_L116_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L110_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L118_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L118_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L119_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L110_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L121_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L110_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L122_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L110_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L123_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L110_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L124_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L110_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L126_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L126_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L127_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L126_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L128_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L126_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L129_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L126_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L130_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L126_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L131_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L126_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L132_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L126_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:ImportFrom_L134_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L126_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:ImportFrom_L135_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L126_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L136_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L126_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L137_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L126_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L138_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L138_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L139_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L126_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L141_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L126_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L142_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L126_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L143_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L126_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L144_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L126_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L145_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L126_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L146_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L126_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L147_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L126_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L148_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L126_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L151_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L126_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L152_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L126_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L153_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L126_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L154_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L162_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L163_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L162_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L165_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L162_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L166_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L162_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L168_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L162_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L169_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L162_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L172_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L162_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L173_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L162_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L174_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L162_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L175_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L162_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L177_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L162_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L178_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L162_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L179_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L162_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L180_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L162_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L181_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L162_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L183_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L162_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L185_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L185_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L187_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L185_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L188_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L185_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L189_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L185_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L191_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L185_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L193_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L185_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L194_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L185_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L196_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L185_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L197_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L185_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L198_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L185_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L199_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L185_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L201_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L185_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L203_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L185_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L205_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L185_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L206_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L185_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L207_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L185_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L208_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L162_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Return_L210_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L218_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L219_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L218_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L220_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L220_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L221_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L220_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L222_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L220_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L223_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L220_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L224_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L220_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L225_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L220_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L226_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L220_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L227_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L220_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L228_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L218_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Return_L230_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L233_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L234_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L233_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L235_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L233_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L236_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L233_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L237_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L237_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L238_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L237_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L239_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L237_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L241_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L237_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L242_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L237_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L243_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L237_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L245_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L233_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L247_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L233_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L248_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L233_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L250_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L233_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L251_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L233_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L252_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L233_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L254_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L233_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L255_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L233_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L256_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L233_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L257_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L233_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L258_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L233_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L259_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L233_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L261_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L233_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L262_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L233_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L263_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L233_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L264_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L233_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L265_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L233_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L266_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L233_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L267_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L233_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L268_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L233_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L271_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L233_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L272_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L233_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L273_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L233_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L275_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L233_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L276_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L233_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L277_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L233_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L278_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L233_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L279_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L233_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L280_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L233_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L282_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L233_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L283_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L233_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L284_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L233_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L285_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L233_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L286_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L233_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L287_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L233_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L288_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L233_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L290_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L307_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Import_L308_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L307_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L309_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L309_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L310_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L307_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L312_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L307_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L313_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L307_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L314_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L307_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:ImportFrom_L316_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L307_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:ImportFrom_L317_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L307_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L319_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L307_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L320_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L307_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L321_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L307_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L322_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L322_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L323_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L322_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L324_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L322_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L325_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L322_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L326_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L322_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L327_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L322_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L329_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L322_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L331_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L322_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L332_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L307_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L336_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L307_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L338_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L338_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L339_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L338_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L342_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L307_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L344_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L307_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L353_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L307_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L354_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L307_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Return_L356_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L361_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L362_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L361_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L363_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L361_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L364_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L361_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L365_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L361_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L366_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L361_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L367_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L361_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L368_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L361_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L370_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L370_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L371_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L370_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L372_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L372_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L373_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L372_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L374_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L372_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L375_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L372_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L376_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L372_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L377_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L372_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L378_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L372_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L379_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L361_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L381_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L361_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L383_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L361_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L384_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L361_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L385_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L361_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L386_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L389_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L390_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L389_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L391_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L389_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L392_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L389_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L394_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L389_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L395_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L389_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L397_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L389_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L398_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L389_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L399_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L389_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L400_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L389_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L401_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L389_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L402_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L389_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L404_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L389_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L406_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L389_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L408_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L408_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L409_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L408_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L410_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L408_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L411_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L408_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L412_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L412_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L413_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L413_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L414_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L413_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L416_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L413_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L417_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L413_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L419_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L413_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L420_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L413_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L421_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L413_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L422_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L413_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L423_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L413_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L424_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L408_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L425_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L425_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L426_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L425_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L427_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L425_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L428_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L425_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L429_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L425_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L430_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L425_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L432_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L408_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Return_L434_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L437_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L438_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L437_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L441_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L437_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L442_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L437_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L443_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L443_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L444_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L444_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L445_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L444_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L446_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L446_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L447_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L446_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L448_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L437_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L450_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L450_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L451_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L450_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L452_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L452_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L453_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L450_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L454_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L450_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L455_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L455_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L456_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L455_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L457_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L455_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L458_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L458_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L459_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L458_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L460_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L455_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L461_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L455_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L463_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L450_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Return_L464_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L450_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Return_L466_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L468_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L469_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L473_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L474_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L473_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L477_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L477_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L478_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L477_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L479_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L477_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L480_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L477_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L481_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L477_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L483_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L483_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L484_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L483_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L485_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L483_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L486_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L483_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L488_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L483_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L489_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L483_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L490_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L490_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L491_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L490_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L492_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L473_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L494_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L473_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L495_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L473_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L496_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L473_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L497_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L473_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L498_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L473_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L500_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L473_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L501_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L473_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L502_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L514_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L515_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L515_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L516_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L515_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L520_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L515_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L521_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L515_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Return_L522_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L514_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L524_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L514_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L525_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L514_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L526_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L514_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L528_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L514_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L529_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L514_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L530_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L514_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L532_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L532_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Return_L533_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L532_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Return_L535_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L546_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L547_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L547_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L548_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L547_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L549_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L547_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L553_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L547_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L554_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L547_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Return_L555_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L546_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L557_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L546_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L558_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L558_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L559_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L558_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L560_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L558_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L561_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L561_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L562_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L561_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L563_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L546_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L567_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L546_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L568_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L568_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L569_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L568_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L570_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L568_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L571_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L571_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L572_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L571_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L573_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:FunctionDef_L546_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L577_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L577_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Return_L578_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L577_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Return_L580_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L584_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L585_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L584_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L586_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L584_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L588_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L584_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L590_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L584_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L592_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L584_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L594_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L584_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L596_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L584_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L598_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L584_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L600_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L584_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L602_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L584_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L604_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L584_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L606_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L584_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L608_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L584_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L610_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L584_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L612_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L584_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L614_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L584_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L616_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L584_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L618_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L584_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L621_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L584_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L622_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L584_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L623_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L584_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L624_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L584_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L625_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L584_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L626_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L584_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L627_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L584_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L628_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L584_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L629_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L584_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L630_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L584_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L631_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L584_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L632_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L584_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L633_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L584_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L634_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L584_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L635_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L584_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L636_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L584_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L637_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L584_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L638_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L584_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L641_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L641_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L642_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L584_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L646_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L646_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L647_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L646_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L648_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L646_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L649_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L646_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L650_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L646_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L651_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L646_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L659_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L646_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L660_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L646_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L661_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L646_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L663_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L663_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L664_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L664_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L665_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L665_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L667_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L665_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L669_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L665_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L670_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L665_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L671_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L665_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L672_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L665_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L673_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L665_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L674_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L665_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L675_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L646_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L677_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L646_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L679_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L646_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L680_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L646_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L681_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L646_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L683_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L584_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L685_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L685_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L686_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L685_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L687_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L685_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L688_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L584_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L690_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L584_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L691_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L584_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L692_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L584_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L694_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:For_L694_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L695_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L584_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L698_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L698_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L702_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L698_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L703_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L698_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L704_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L698_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L705_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L698_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L706_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L698_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L707_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L698_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L708_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L698_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L710_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L710_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L711_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L710_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L713_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L698_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L714_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L698_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L715_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L698_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L716_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L698_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L717_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L698_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L718_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L698_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L719_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L698_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L720_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L698_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L721_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L698_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L722_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L698_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L724_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L724_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L725_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L724_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L727_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L584_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L730_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L730_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L732_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L732_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L733_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L730_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L736_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L730_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L737_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L730_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L738_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L730_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L739_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L730_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L740_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L730_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L741_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L730_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L743_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L730_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L744_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L730_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L745_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L730_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L746_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L730_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L747_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L730_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L750_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L730_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L751_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L730_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L752_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L730_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L754_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L730_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L755_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L730_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L757_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L730_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L758_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L730_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L759_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L730_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L760_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L730_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L762_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L762_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L763_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L762_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L764_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L762_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L765_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L762_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L766_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L762_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L768_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L730_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L770_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L730_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L771_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L730_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L772_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L730_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L773_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L730_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L774_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L730_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L775_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L730_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L776_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L730_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L777_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L730_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L778_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L730_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L779_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L730_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L780_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L730_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L781_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L730_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L782_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L730_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L783_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L730_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L785_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L730_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L786_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L786_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L787_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L584_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L790_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L790_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L791_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L790_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L792_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L790_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L793_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L790_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L794_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L790_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L796_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L790_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L797_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L790_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L799_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L799_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L800_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L790_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L802_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L790_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L803_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L790_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L804_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L790_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L808_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L790_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L809_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L790_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L811_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L790_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L812_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L790_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L813_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L790_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L815_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L790_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L816_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L790_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L817_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L790_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L818_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L790_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L820_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L820_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L821_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L820_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L822_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L820_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L823_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L823_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L824_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L823_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L825_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L584_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L828_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L828_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L829_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L828_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L830_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L828_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L831_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L828_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L832_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L828_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L834_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L834_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L835_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L834_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L836_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L828_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L839_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L839_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L841_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L841_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L842_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L841_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L844_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L841_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L845_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L839_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L846_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L828_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L848_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L848_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L849_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L828_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L852_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L852_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L853_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L852_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L854_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L852_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L855_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L855_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L856_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L855_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L858_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L852_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L860_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L852_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L861_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L852_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L862_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L852_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L863_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L852_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L864_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L852_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L865_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L852_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L866_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L852_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L867_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L867_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L868_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L867_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L870_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L852_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L871_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L852_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L872_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L852_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L873_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L852_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L874_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L828_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L876_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L876_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L877_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L876_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L878_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L584_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L881_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L881_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L882_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L881_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L883_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L881_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L884_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L881_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L885_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L881_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L886_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L886_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L887_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L886_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Assign_L889_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L881_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L890_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L584_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L892_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L892_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L893_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L892_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L895_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L892_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L896_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L584_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L898_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L898_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L899_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99547:If_L898_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99547:Expr_L900_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 m3.toolbox as m3t import hokuyo.hokuyo_scan as hs import tilting_hokuyo.tilt_hokuyo_servo as ths import mekabot.hrl_robot as hr import hrl_lib.util as ut, hrl_lib.transforms as tr import util as uto import camera import sys, time, os, optparse import math, numpy as np import copy import arm_trajectories as at from opencv.cv import * from opencv.highgui import * from threading import RLock import threading hook_3dprint_angle = math.radians(20-2.54) class CompliantMotionGenerator(threading.Thread): ''' a specific form of compliant motion. class name might be inappropriate. ''' def __init__(self): # stiffness in Nm/rad: [20,50,15,25] self.settings_r = hr.MekaArmSettings(stiffness_list=[0.1939,0.6713,0.748,0.7272,0.8]) # self.settings_r = hr.MekaArmSettings(stiffness_list=[0.2,1.0,1.0,0.4,0.8]) self.settings_stiff = hr.MekaArmSettings(stiffness_list=[0.8,1.0,1.0,1.0,0.8]) self.firenze = hr.M3HrlRobot(connect=True,right_arm_settings=self.settings_stiff) self.hok = hs.Hokuyo('utm',0,flip=True) self.thok = ths.tilt_hokuyo('/dev/robot/servo0',5,self.hok,l1=0.,l2=-0.055) self.cam = camera.Camera('mekabotUTM') self.set_camera_settings() self.fit_circle_lock = RLock() threading.Thread.__init__(self) def run(self): self.circle_estimator() def stop(self): self.run_fit_circle_thread = False self.firenze.stop() ## pose the arm by moving the end effector to the hookable location. # @param hook_angle - RADIANS(0, -90, 90 etc.) # 0 - horizontal, -pi/2 hook points up, +pi/2 hook points down def pose_arm(self,hook_angle): print 'press ENTER to pose the robot.' k=m3t.get_keystroke() if k!='\r': print 'You did not press ENTER.' return # settings_r_orig = copy.copy(self.firenze.arm_settings['right_arm']) settings_torque_gc = hr.MekaArmSettings(stiffness_list=[0.,0.,0.,0.,0.],control_mode='torque_gc') self.firenze.set_arm_settings(settings_torque_gc,None) self.firenze.step() print 'hit ENTER to end posing, something else to exit' k=m3t.get_keystroke() p = self.firenze.end_effector_pos('right_arm') q = self.firenze.get_joint_angles('right_arm') # self.firenze.set_arm_settings(settings_r_orig,None) self.firenze.set_arm_settings(self.settings_stiff,None) self.firenze.set_joint_angles('right_arm',q) self.firenze.step() self.firenze.set_joint_angles('right_arm',q) self.firenze.step() rot_mat = tr.Rz(hook_angle-hook_3dprint_angle)*tr.Ry(math.radians(-90)) self.firenze.go_cartesian('right_arm',p,rot_mat,speed=0.1) print 'hit ENTER after making finer adjustment, something else to exit' k=m3t.get_keystroke() p = self.firenze.end_effector_pos('right_arm') q = self.firenze.get_joint_angles('right_arm') self.firenze.set_joint_angles('right_arm',q) self.firenze.step() def set_camera_settings(self): self.cam.set_frame_rate(30) self.cam.set_auto() self.cam.set_gamma(1) self.cam.set_whitebalance(r_val=512,b_val=544) def compliant_motion(self,equi_pt_generator,time_step,rapid_call_func=None): ''' equi_pt_generator: function that returns stop,q q: list of 7 joint angles stop: string which is '' for compliant motion to continue rapid_call_func: called in the time between calls to the equi_pt_generator can be used for logging, safety etc. returns stop stop: string which is '' for compliant motion to continue time_step: time between successive calls to equi_pt_generator returns stop (the string which has the reason why the compliant motion stopped.) ''' stop,q = equi_pt_generator() while stop == '': self.firenze.set_joint_angles('right_arm',q) t1 = time.time() t_end = t1+time_step while t1<t_end: self.firenze.step() if rapid_call_func != None: stop = rapid_call_func() if stop != '': break t1 = time.time() if stop != '': break stop,q = equi_pt_generator() return stop ## log the joint angles, equi pt joint angles and forces. def log_state(self): t_now = time.time() q_now = self.firenze.get_joint_angles('right_arm') qdot_now = self.firenze.get_joint_velocities('right_arm') tau_now = self.firenze.get_joint_torques('right_arm') self.jt_torque_trajectory.q_list.append(tau_now) self.jt_torque_trajectory.time_list.append(t_now) self.pull_trajectory.q_list.append(q_now) self.pull_trajectory.qdot_list.append(qdot_now) self.pull_trajectory.time_list.append(t_now) #self.eq_pt_trajectory.p_list.append(self.eq_pt_cartesian.A1.tolist()) self.eq_pt_trajectory.q_list.append(self.q_guess) # see equi_pt_generator - q_guess is the config for the eq point. self.eq_pt_trajectory.time_list.append(t_now) wrist_force = self.firenze.get_wrist_force('right_arm',base_frame=True) self.force_trajectory.f_list.append(wrist_force.A1.tolist()) self.force_trajectory.time_list.append(t_now) def common_stopping_conditions(self): stop = '' if self.q_guess == None: stop = 'IK fail' wrist_force = self.firenze.get_wrist_force('right_arm',base_frame=True) mag = np.linalg.norm(wrist_force) if mag > self.eq_force_threshold: stop = 'force exceed' if mag < 1.2 and self.hooked_location_moved: if (self.prev_force_mag - mag) > 10.: stop = 'slip: force step decrease and below thresold.' else: self.slip_count += 1 else: self.slip_count = 0 if self.slip_count == 4: stop = 'slip: force below threshold for too long.' curr_pos = self.firenze.FK('right_arm',self.pull_trajectory.q_list[-1]) if curr_pos[0,0]<0.27 and curr_pos[1,0]>-0.2: stop = 'danger of self collision' return stop def update_eq_point(self,motion_vec,step_size): next_pt = self.eq_pt_cartesian + step_size * motion_vec rot_mat = self.eq_IK_rot_mat # self.q_guess[1] += math.radians(1) q_eq = self.firenze.IK('right_arm',next_pt,rot_mat,self.q_guess) self.eq_pt_cartesian = next_pt self.q_guess = q_eq return q_eq def circle_estimator(self): self.run_fit_circle_thread = True print 'Starting the circle estimating thread.' while self.run_fit_circle_thread: self.fit_circle_lock.acquire() if len(self.cartesian_pts_list)==0: self.fit_circle_lock.release() continue pts_2d = (np.matrix(self.cartesian_pts_list).T)[0:2,:] self.fit_circle_lock.release() rad = self.rad_guess start_pos = self.firenze.FK('right_arm',self.pull_trajectory.q_list[0]) rad,cx,cy = at.fit_circle(rad,start_pos[0,0],start_pos[1,0]-rad,pts_2d,method='fmin_bfgs',verbose=False) rad = ut.bound(rad,3.0,0.1) self.fit_circle_lock.acquire() self.cx = cx self.cy = cy # self.rad = rad self.fit_circle_lock.release() print 'Ended the circle estimating thread.' ## constantly update the estimate of the kinematics and move the # equilibrium point along the tangent of the estimated arc, and # try to keep the radial force constant. def equi_pt_generator_control_radial_force(self): self.log_state() q_eq = self.update_eq_point(self.eq_motion_vec,0.01) stop = self.common_stopping_conditions() wrist_force = self.firenze.get_wrist_force('right_arm',base_frame=True) mag = np.linalg.norm(wrist_force) start_pos = self.firenze.FK('right_arm',self.pull_trajectory.q_list[0]) curr_pos = self.firenze.FK('right_arm',self.pull_trajectory.q_list[-1]) if (start_pos[0,0]-curr_pos[0,0])>0.09 and self.hooked_location_moved==False: # change the force threshold once the hook has started pulling. self.hooked_location_moved = True self.eq_force_threshold = ut.bound(mag+30.,20.,80.) self.piecewise_force_threshold = ut.bound(mag+5.,0.,80.) self.fit_circle_lock.acquire() self.cartesian_pts_list.append(curr_pos.A1.tolist()) self.fit_circle_lock.release() # find tangential direction. radial_vec = curr_pos[0:2]-np.matrix([self.cx,self.cy]).T radial_vec = radial_vec/np.linalg.norm(radial_vec) tan_x,tan_y = -radial_vec[1,0],radial_vec[0,0] if tan_x >0.: tan_x = -tan_x tan_y = -tan_y self.eq_motion_vec = np.matrix([tan_x,tan_y,0.]).T f_vec = -1*np.array([wrist_force[0,0],wrist_force[1,0]]) f_rad_mag = np.dot(f_vec,radial_vec.A1) #if f_rad_mag>10.: if f_rad_mag>5.: self.eq_motion_vec[0:2] -= radial_vec/2. * self.hook_maintain_dist_plane/0.05 else: self.eq_motion_vec[0:2] += radial_vec/2. * self.hook_maintain_dist_plane/0.05 self.prev_force_mag = mag return stop,q_eq ## moves eq point along the -x axis. def equi_pt_generator_line(self): self.log_state() #q_eq = self.update_eq_point(self.eq_motion_vec,0.005) q_eq = self.update_eq_point(self.eq_motion_vec,0.010) stop = self.common_stopping_conditions() wrist_force = self.firenze.get_wrist_force('right_arm',base_frame=True) mag = np.linalg.norm(wrist_force) start_pos = self.firenze.FK('right_arm',self.pull_trajectory.q_list[0]) curr_pos = self.firenze.FK('right_arm',self.pull_trajectory.q_list[-1]) if (start_pos[0,0]-curr_pos[0,0])>0.09 and self.hooked_location_moved==False: # change the force threshold once the hook has started pulling. self.hooked_location_moved = True self.eq_force_threshold = ut.bound(mag+15.,20.,80.) self.prev_force_mag = mag return stop,q_eq ## move the end effector to properly hook onto the world # direction of motion governed by the hook angle. # @param hook_angle - angle of hook in RADIANS (see pose_arm or pull for details.) def get_firm_hook(self, hook_angle): rot_mat = tr.Rz(hook_angle-hook_3dprint_angle)*tr.Ry(math.radians(-90)) # move in the +x until contact. vec = np.matrix([0.08,0.,0.]).T self.firenze.move_till_hit('right_arm',vec=vec,force_threshold=2.0,rot=rot_mat, speed=0.05) # now move in direction of hook. vec = tr.rotX(-hook_angle) * np.matrix([0.,0.05,0.]).T self.firenze.move_till_hit('right_arm',vec=vec,force_threshold=5.0,rot=rot_mat, speed=0.05,bias_FT=False) self.firenze.set_arm_settings(self.settings_r,None) self.firenze.step() def pull(self,hook_angle,force_threshold,use_utm=False,use_camera=False,strategy='line_neg_x', pull_loc=None, info_string=''): ''' force_threshold - max force at which to stop pulling. hook_angle - radians(0, -90, 90 etc.) 0 - horizontal, -pi/2 hook points up, +pi/2 hook points down use_utm - to take 3D scans or not. use_camera - to take pictures from the camera or not. strategy - 'line_neg_x': move eq point along -x axis. 'piecewise_linear': try and estimate circle and move along it. 'control_radial_force': try and keep the radial force constant 'control_radial_dist' pull_loc - 3x1 np matrix of location for pulling. If None then arm will go into gravity comp and user can show the location. info_string - string saved with key 'info' in the pkl. ''' if use_utm: self.firenze.step() armconfig1 = self.firenze.get_joint_angles('right_arm') plist1,slist1 = self.scan_3d() if use_camera: cam_plist1, cam_imlist1 = self.image_region() else: cam_plist1,cam_imlist1 = None,None rot_mat = tr.Rz(hook_angle-hook_3dprint_angle)*tr.Ry(math.radians(-90)) if pull_loc == None: self.pose_arm(hook_angle) pull_loc = self.firenze.end_effector_pos('right_arm') ut.save_pickle(pull_loc,'pull_loc_'+info_string+'_'+ut.formatted_time()+'.pkl') else: pt1 = copy.copy(pull_loc) pt1[0,0] = pt1[0,0]-0.1 print 'pt1:', pt1.A1 print 'pull_loc:', pull_loc.A1 self.firenze.go_cartesian('right_arm',pt1,rot_mat,speed=0.2) self.firenze.go_cartesian('right_arm',pull_loc,rot_mat,speed=0.07) print 'press ENTER to pull' k=m3t.get_keystroke() if k != '\r': return time_dict = {} time_dict['before_hook'] = time.time() print 'first getting a good hook' self.get_firm_hook(hook_angle) time.sleep(0.5) time_dict['before_pull'] = time.time() print 'pull begins' stiffness_scale = self.settings_r.stiffness_scale vec = tr.rotX(-hook_angle) * np.matrix([0.,0.05/stiffness_scale,0.]).T self.keep_hook_vec = vec self.hook_maintain_dist_plane = np.dot(vec.A1,np.array([0.,1.,0.])) self.eq_pt_cartesian = self.firenze.end_effector_pos('right_arm') + vec q_eq = self.firenze.IK('right_arm',self.eq_pt_cartesian,rot_mat) self.firenze.go_jointangles('right_arm',q_eq,speed=math.radians(30)) self.q_guess = q_eq # self.q_guess = self.firenze.get_joint_angles('right_arm') self.pull_trajectory = at.JointTrajectory() self.jt_torque_trajectory = at.JointTrajectory() self.eq_pt_trajectory = at.JointTrajectory() self.force_trajectory = at.ForceTrajectory() self.firenze.step() start_config = self.firenze.get_joint_angles('right_arm') self.eq_IK_rot_mat = rot_mat # for equi pt generators. self.eq_force_threshold = force_threshold self.hooked_location_moved = False # flag to indicate when the hooking location started moving. self.prev_force_mag = np.linalg.norm(self.firenze.get_wrist_force('right_arm')) self.eq_motion_vec = np.matrix([-1.,0.,0.]).T self.slip_count = 0 if strategy == 'line_neg_x': result = self.compliant_motion(self.equi_pt_generator_line,0.025) elif strategy == 'control_radial_force': self.cartesian_pts_list = [] self.piecewise_force_threshold = force_threshold self.rad_guess = 1.0 self.cx = 0.6 self.cy = -self.rad_guess self.start() # start the circle estimation thread result = self.compliant_motion(self.equi_pt_generator_control_radial_force,0.025) else: raise RuntimeError('unknown pull strategy: ', strategy) if result == 'slip: force step decrease' or result == 'danger of self collision': self.firenze.motors_off() print 'powered off the motors.' print 'Compliant motion result:', result print 'Original force threshold:', force_threshold print 'Adapted force threshold:', self.eq_force_threshold time_dict['after_pull'] = time.time() d = {'actual': self.pull_trajectory, 'eq_pt': self.eq_pt_trajectory, 'force': self.force_trajectory, 'torque': self.jt_torque_trajectory, 'stiffness': self.firenze.arm_settings['right_arm'], 'info': info_string, 'force_threshold': force_threshold, 'eq_force_threshold': self.eq_force_threshold, 'hook_angle':hook_angle, 'result':result,'strategy':strategy,'time_dict':time_dict} self.firenze.step() armconfig2 = self.firenze.get_joint_angles('right_arm') if use_utm: plist2,slist2 = self.scan_3d() d['start_config']=start_config d['armconfig1']=armconfig1 d['armconfig2']=armconfig2 d['l1'],d['l2']=0.,-0.055 d['scanlist1'],d['poslist1']=slist1,plist1 d['scanlist2'],d['poslist2']=slist2,plist2 d['cam_plist1']=cam_plist1 d['cam_imlist1']=cam_imlist1 ut.save_pickle(d,'pull_trajectories_'+d['info']+'_'+ut.formatted_time()+'.pkl') def scan_3d(self): tilt_angles = (math.radians(20),math.radians(70)) pos_list,scan_list = self.thok.scan(tilt_angles,speed=math.radians(10),save_scan=False) return pos_list,scan_list def save_frame(self): cvim = self.cam.get_frame() cvSaveImage('im_'+ut.formatted_time()+'.png',cvim) def image_region(self): ''' takes images from the UTM camera at different angles. returns list of servo angles, list of images. images are numpy images. so that they can be pickled. ''' im_list = [] p_list = [] for cmd_ang in [0,30,45]: self.thok.servo.move_angle(math.radians(cmd_ang)) cvim = self.cam.get_frame() cvim = self.cam.get_frame() im_list.append(uto.cv2np(cvim,format='BGR')) p_list.append(self.thok.servo.read_angle()) self.thok.servo.move_angle(math.radians(0)) return p_list,im_list def test_IK(rot_mat): ''' try out the IK at a number of different cartesian points in the workspace, with the given rotation matrix for the end effector. ''' print 'press ENTER to start.' k=m3t.get_keystroke() while k=='\r': p = firenze.end_effector_pos('right_arm') firenze.go_cartesian('right_arm',p,rot_mat,speed=0.1) firenze.step() print 'press ENTER to save joint angles.' k=m3t.get_keystroke() if k == '\r': firenze.step() q = firenze.get_joint_angles('right_arm') ut.save_pickle(q,'arm_config_'+ut.formatted_time()+'.pkl') print 'press ENTER for next IK test. something else to exit.' k=m3t.get_keystroke() def test_elbow_angle(): firenze = hr.M3HrlRobot(connect=False) hook_3dprint_angle = math.radians(20-2.54) rot_mat = tr.Rz(math.radians(-90.)-hook_3dprint_angle)*tr.Ry(math.radians(-90)) x_list = [0.55,0.45,0.35] y = -0.2 z = -0.23 for x in x_list: p0 = np.matrix([x,y,z]).T q = firenze.IK('right_arm',p0,rot_mat) # q[1] = math.radians(15) # q = firenze.IK('right_arm',p0,rot_mat,q_guess = q) elbow_angle = firenze.elbow_plane_angle('right_arm',q) print '---------------------------------------' print 'ee position:', p0.A1 # print 'joint angles:', q print 'elbow_angle:', math.degrees(elbow_angle) if __name__=='__main__': p = optparse.OptionParser() p.add_option('--ik_single_pos', action='store_true', dest='ik_single_pos', help='test IK at a single position.') p.add_option('--ik_test', action='store_true', dest='ik_test', help='test IK in a loop.') p.add_option('--pull', action='store_true', dest='pull', help='pull with hook up (name will be changed later).') p.add_option('--pull_pos', action='store', type='string', dest='pull_pos_pkl', help='pkl file with 3D coord of point to start pulling at.', default='') p.add_option('--firm_hook', action='store_true', dest='firm_hook', help='test getting a firm hook on things.') p.add_option('--scan', action='store_true', dest='scan', help='take and save 3D scans. specify --pull also.') p.add_option('--camera', action='store_true', dest='camera', help='take and save images from UTM camera. specify --pull also.') p.add_option('--ha', action='store', dest='ha',type='float', default=None,help='hook angle (degrees).') p.add_option('--ft', action='store', dest='ft',type='float', default=None,help='force threshold (Newtons).') p.add_option('--info', action='store', type='string', dest='info_string', help='string to save in the pkl log.', default='') p.add_option('--ve', action='store_true', dest='ve', help='vary experiment. (vary stiffness settings and repeatedly pull)') p.add_option('--eaf', action='store_true', dest='eaf', help='test elbow angle finding with the horizontal plane.') opt, args = p.parse_args() ik_single_pos_flag = opt.ik_single_pos test_ik_flag = opt.ik_test pull_flag = opt.pull pull_pos_pkl = opt.pull_pos_pkl firm_hook_flag = opt.firm_hook scan_flag = opt.scan camera_flag = opt.camera ha = opt.ha ft = opt.ft info_string = opt.info_string vary_expt_flag = opt.ve elbow_angle_flag = opt.eaf try: if vary_expt_flag: stiff_scale_list = [1.0,1.2,0.8] if pull_pos_pkl != '': pull_loc = ut.load_pickle(pull_pos_pkl) else: raise RuntimeError('Need to specify a pull_pos with vary_expt') cmg = CompliantMotionGenerator() print 'hit a key to power up the arms.' k=m3t.get_keystroke() cmg.firenze.power_on() #for strategy in ['line_neg_x','control_radial_force']: for strategy in ['line_neg_x','control_radial_dist','control_radial_force']: #for strategy in ['line_neg_x']: #for strategy in ['piecewise_linear']: for s_scale in stiff_scale_list: cmg.settings_r.stiffness_scale = s_scale cmg.pull(math.radians(ha), ft,use_utm=scan_flag,use_camera=camera_flag, strategy=strategy,pull_loc=pull_loc,info_string=info_string) cmg.firenze.maintain_configuration() cmg.firenze.motors_on() cmg.firenze.set_arm_settings(cmg.settings_stiff,None) time.sleep(0.5) print 'hit a key to end everything' k=m3t.get_keystroke() cmg.firenze.stop() sys.exit() if pull_flag or firm_hook_flag: if ha == None: print 'please specify hook angle (--ha)' print 'Exiting...' sys.exit() if ft == None and pull_flag: print 'please specify force threshold (--ft) along with --pull' print 'Exiting...' sys.exit() cmg = CompliantMotionGenerator() print 'hit a key to power up the arms.' k=m3t.get_keystroke() cmg.firenze.power_on() if pull_flag: if pull_pos_pkl != '': pull_loc = ut.load_pickle(pull_pos_pkl) else: pull_loc = None # cmg.pull(math.radians(ha), ft,use_utm=scan_flag,use_camera=camera_flag, # strategy = 'control_radial_dist',pull_loc=pull_loc,info_string=info_string) # cmg.pull(math.radians(ha), ft,use_utm=scan_flag,use_camera=camera_flag, # strategy = 'piecewise_linear',pull_loc=pull_loc,info_string=info_string) cmg.pull(math.radians(ha), ft,use_utm=scan_flag,use_camera=camera_flag, strategy = 'control_radial_force',pull_loc=pull_loc,info_string=info_string) # cmg.pull(math.radians(ha), ft,use_utm=scan_flag,use_camera=camera_flag, # strategy = 'line_neg_x',pull_loc=pull_loc,info_string=info_string) if firm_hook_flag: hook_angle = math.radians(ha) p = np.matrix([0.3,-0.25,-0.2]).T rot_mat = tr.Rz(hook_angle-hook_3dprint_angle)*tr.Ry(math.radians(-90)) cmg.firenze.go_cartesian('right_arm',p,rot_mat,speed=0.1) print 'hit a key to get a firm hook.' k=m3t.get_keystroke() cmg.get_firm_hook(hook_angle) print 'hit a key to end everything' k=m3t.get_keystroke() cmg.stop() # cmg = CompliantMotionGenerator() # print 'hit a key to test IK' # k=m3t.get_keystroke() # cmg.get_firm_hook(ha) #----------- non-class functions test -------------------- if elbow_angle_flag: test_elbow_angle() if ik_single_pos_flag or test_ik_flag: if ha == None: raise RuntimeError('You need to specify a hooking angle (--ha)') settings_r = hr.MekaArmSettings(stiffness_list=[0.15,0.7,0.8,0.8,0.8]) firenze = hr.M3HrlRobot(connect=True,right_arm_settings=settings_r) print 'hit a key to power up the arms.' k=m3t.get_keystroke() firenze.power_on() print 'hit a key to test IK' k=m3t.get_keystroke() #p = np.matrix([0.26,-0.25,-0.25]).T p = np.matrix([0.45,-0.2,-0.23]).T rot_mat = tr.Rz(math.radians(ha)-hook_3dprint_angle)*tr.Ry(math.radians(-90)) #rot_mat = tr.Rz(math.radians(0))*tr.Ry(math.radians(-90)) firenze.go_cartesian('right_arm',p,rot_mat,speed=0.1) if test_ik_flag: rot_mat = tr.Rz(math.radians(-110))*tr.Ry(math.radians(-90)) #rot_mat = tr.Rz(math.radians(0))*tr.Ry(math.radians(-90)) test_IK(rot_mat) print 'hit a key to end everything' k=m3t.get_keystroke() firenze.stop() except (KeyboardInterrupt, SystemExit): cmg.stop()
ajibawa-2023/Python-Code-Large/train/row_99548
415
676
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Import_L30_C0", "label": "m3.toolbox import m3t", "type": "import", "loc": [30, 30], "level": 0, "parent": null, "vector": [1, 0, 0.0444, 0.0015, 0, 0.66, 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_99548:Import_L32_C0", "label": "hokuyo.hokuyo_scan import hs", "type": "import", "loc": [32, 32], "level": 0, "parent": null, "vector": [1, 0, 0.0473, 0.0015, 0, 0.66, 0.0526, 464, 0, 1, 0, 0, 464, 0, 0], "semantic": {"name": "hokuyo.hokuyo_scan", "arg_names": [], "import_names": ["hs"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hokuyo.hokuyo_scan as hs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Import_L33_C0", "label": "tilting_hokuyo.tilt_hokuyo_servo import ths", "type": "import", "loc": [33, 33], "level": 0, "parent": null, "vector": [1, 0, 0.0488, 0.0015, 0, 0.66, 0.1053, 212, 0, 1, 0, 0, 212, 0, 0], "semantic": {"name": "tilting_hokuyo.tilt_hokuyo_servo", "arg_names": [], "import_names": ["ths"], "rhs_call_name": "", "annotation": ""}, "snippet": "import tilting_hokuyo.tilt_hokuyo_servo as ths"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Import_L34_C0", "label": "mekabot.hrl_robot import hr", "type": "import", "loc": [34, 34], "level": 0, "parent": null, "vector": [1, 0, 0.0503, 0.0015, 0, 0.66, 0.1579, 4, 0, 1, 0, 0, 4, 0, 0], "semantic": {"name": "mekabot.hrl_robot", "arg_names": [], "import_names": ["hr"], "rhs_call_name": "", "annotation": ""}, "snippet": "import mekabot.hrl_robot as hr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Import_L35_C0", "label": "hrl_lib.util import ut, tr", "type": "import", "loc": [35, 35], "level": 0, "parent": null, "vector": [1, 0, 0.0518, 0.0015, 0, 0.66, 0.2105, 775, 0, 2, 0, 0, 775, 0, 0], "semantic": {"name": "hrl_lib.util", "arg_names": [], "import_names": ["ut", "tr"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.util as ut, hrl_lib.transforms as tr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Import_L36_C0", "label": "util import uto", "type": "import", "loc": [36, 36], "level": 0, "parent": null, "vector": [1, 0, 0.0533, 0.0015, 0, 0.66, 0.2632, 811, 0, 1, 0, 0, 811, 0, 0], "semantic": {"name": "util", "arg_names": [], "import_names": ["uto"], "rhs_call_name": "", "annotation": ""}, "snippet": "import util as uto"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Import_L37_C0", "label": "camera import camera", "type": "import", "loc": [37, 37], "level": 0, "parent": null, "vector": [1, 0, 0.0547, 0.0015, 0, 0.66, 0.3158, 848, 0, 1, 0, 0, 848, 0, 0], "semantic": {"name": "camera", "arg_names": [], "import_names": ["camera"], "rhs_call_name": "", "annotation": ""}, "snippet": "import camera"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Import_L39_C0", "label": "sys import sys, time, os\u2026", "type": "import", "loc": [39, 39], "level": 0, "parent": null, "vector": [1, 0, 0.0577, 0.0015, 0, 0.66, 0.3684, 509, 0, 4, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys", "time", "os", "optparse"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys, time, os, optparse"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Import_L40_C0", "label": "math import math, np", "type": "import", "loc": [40, 40], "level": 0, "parent": null, "vector": [1, 0, 0.0592, 0.0015, 0, 0.66, 0.4211, 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_99548:Import_L41_C0", "label": "copy import copy", "type": "import", "loc": [41, 41], "level": 0, "parent": null, "vector": [1, 0, 0.0607, 0.0015, 0, 0.66, 0.4737, 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_99548:Import_L43_C0", "label": "arm_trajectories import at", "type": "import", "loc": [43, 43], "level": 0, "parent": null, "vector": [1, 0, 0.0636, 0.0015, 0, 0.66, 0.5263, 34, 0, 1, 0, 0, 34, 0, 0], "semantic": {"name": "arm_trajectories", "arg_names": [], "import_names": ["at"], "rhs_call_name": "", "annotation": ""}, "snippet": "import arm_trajectories as at"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:ImportFrom_L45_C0", "label": "from opencv.cv import *", "type": "import", "loc": [45, 45], "level": 0, "parent": null, "vector": [1, 0, 0.0666, 0.0015, 0, 0.66, 0.5789, 718, 0, 1, 0, 0, 718, 0, 0], "semantic": {"name": "opencv.cv", "arg_names": [], "import_names": ["*"], "rhs_call_name": "", "annotation": ""}, "snippet": "from opencv.cv import *"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:ImportFrom_L46_C0", "label": "from opencv.highgui import *", "type": "import", "loc": [46, 46], "level": 0, "parent": null, "vector": [1, 0, 0.068, 0.0015, 0, 0.66, 0.6316, 453, 0, 1, 0, 0, 453, 0, 0], "semantic": {"name": "opencv.highgui", "arg_names": [], "import_names": ["*"], "rhs_call_name": "", "annotation": ""}, "snippet": "from opencv.highgui import *"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:ImportFrom_L49_C0", "label": "from threading import RLock", "type": "import", "loc": [49, 49], "level": 0, "parent": null, "vector": [1, 0, 0.0725, 0.0015, 0, 0.66, 0.6842, 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_99548:Import_L50_C0", "label": "threading import threading", "type": "import", "loc": [50, 50], "level": 0, "parent": null, "vector": [1, 0, 0.074, 0.0015, 0, 0.66, 0.7368, 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_99548:Assign_L52_C0", "label": "hook_3dprint_angle = radians()", "type": "assigned_variable", "loc": [52, 52], "level": 0, "parent": null, "vector": [14, 0, 0.0769, 0.0015, 0, 0.66, 0.7895, 460, 3, 1, 0, 0, 383, 10, 1], "semantic": {"name": "hook_3dprint_angle", "arg_names": [], "import_names": [], "rhs_call_name": "radians", "annotation": ""}, "snippet": "hook_3dprint_angle = math.radians(20-2.54)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:ClassDef_L54_C0", "label": "CompliantMotionGenerator", "type": "class", "loc": [54, 473], "level": 0, "parent": null, "vector": [3, 0, 0.3898, 0.6213, 0, 0.66, 0.8421, 257, 0, 17, 0, 0, 634, 0, 99], "semantic": {"name": "CompliantMotionGenerator", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class CompliantMotionGenerator(threading.Thread):\n ''' a specific form of compliant motion.\n class name might be inappropriate.\n '''\n def __init__(self):\n # stiffness in Nm/rad: [20,50,15,25]\n self.settings_r = hr.MekaArmSettings(stiffness_list=[0.1939,0.6713,0.748,0.7272,0.8])\n# self.settings_r = hr.MekaArmSettings(stiffness_list=[0.2,1.0,1.0,0.4,0.8])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L55_C4", "label": "expression", "type": "expression", "loc": [55, 57], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:ClassDef_L54_C0", "vector": [8, 1, 0.0828, 0.0044, 1, 0.78, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' a specific form of compliant motion.\n class name might be inappropriate.\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L58_C4", "label": "__init__", "type": "function", "loc": [58, 73], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:ClassDef_L54_C0", "vector": [2, 1, 0.0969, 0.0237, 1, 0.78, 0.0588, 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 # stiffness in Nm/rad: [20,50,15,25]\n self.settings_r = hr.MekaArmSettings(stiffness_list=[0.1939,0.6713,0.748,0.7272,0.8])\n# self.settings_r = hr.MekaArmSettings(stiffness_list=[0.2,1.0,1.0,0.4,0.8])\n\n self.settings_stiff = hr.MekaArmSettings(stiffness_list=[0.8,1.0,1.0,1.0,0.8])\n self.firenze = hr.M3HrlRobot(connect=True,right_arm_settings=self.settings_stiff)\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L60_C8", "label": "self.settings_r = MekaArmSettings()", "type": "assigned_variable", "loc": [60, 60], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L58_C4", "vector": [14, 2, 0.0888, 0.0015, 2, 0.51, 0.0, 47, 3, 1, 0, 0, 503, 10, 1], "semantic": {"name": "self.settings_r", "arg_names": [], "import_names": [], "rhs_call_name": "MekaArmSettings", "annotation": ""}, "snippet": " self.settings_r = hr.MekaArmSettings(stiffness_list=[0.1939,0.6713,0.748,0.7272,0.8])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L63_C8", "label": "self.settings_stiff = MekaArmSettings()", "type": "assigned_variable", "loc": [63, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L58_C4", "vector": [14, 2, 0.0932, 0.0015, 2, 0.51, 0.125, 180, 3, 1, 0, 0, 503, 10, 1], "semantic": {"name": "self.settings_stiff", "arg_names": [], "import_names": [], "rhs_call_name": "MekaArmSettings", "annotation": ""}, "snippet": " self.settings_stiff = hr.MekaArmSettings(stiffness_list=[0.8,1.0,1.0,1.0,0.8])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L64_C8", "label": "self.firenze = M3HrlRobot()", "type": "assigned_variable", "loc": [64, 64], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L58_C4", "vector": [14, 2, 0.0947, 0.0015, 2, 0.51, 0.25, 817, 3, 2, 0, 0, 305, 10, 1], "semantic": {"name": "self.firenze", "arg_names": [], "import_names": [], "rhs_call_name": "M3HrlRobot", "annotation": ""}, "snippet": " self.firenze = hr.M3HrlRobot(connect=True,right_arm_settings=self.settings_stiff)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L66_C8", "label": "self.hok = Hokuyo()", "type": "assigned_variable", "loc": [66, 66], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L58_C4", "vector": [14, 2, 0.0976, 0.0015, 2, 0.51, 0.375, 364, 3, 3, 0, 0, 66, 10, 1], "semantic": {"name": "self.hok", "arg_names": [], "import_names": [], "rhs_call_name": "Hokuyo", "annotation": ""}, "snippet": " self.hok = hs.Hokuyo('utm',0,flip=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L67_C8", "label": "self.thok = tilt_hokuyo()", "type": "assigned_variable", "loc": [67, 67], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L58_C4", "vector": [14, 2, 0.0991, 0.0015, 2, 0.51, 0.5, 228, 3, 5, 0, 0, 577, 10, 1], "semantic": {"name": "self.thok", "arg_names": [], "import_names": [], "rhs_call_name": "tilt_hokuyo", "annotation": ""}, "snippet": " self.thok = ths.tilt_hokuyo('/dev/robot/servo0',5,self.hok,l1=0.,l2=-0.055)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L69_C8", "label": "self.cam = Camera()", "type": "assigned_variable", "loc": [69, 69], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L58_C4", "vector": [14, 2, 0.1021, 0.0015, 2, 0.51, 0.625, 484, 3, 1, 0, 0, 468, 10, 1], "semantic": {"name": "self.cam", "arg_names": [], "import_names": [], "rhs_call_name": "Camera", "annotation": ""}, "snippet": " self.cam = camera.Camera('mekabotUTM')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L70_C8", "label": "set_camera_settings()", "type": "expression", "loc": [70, 70], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L58_C4", "vector": [8, 2, 0.1036, 0.0015, 2, 0.51, 0.75, 60, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "set_camera_settings", "arg_names": [], "import_names": [], "rhs_call_name": "set_camera_settings", "annotation": ""}, "snippet": " self.set_camera_settings()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L72_C8", "label": "self.fit_circle_lock = RLock()", "type": "assigned_variable", "loc": [72, 72], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L58_C4", "vector": [14, 2, 0.1065, 0.0015, 2, 0.51, 0.875, 336, 3, 0, 0, 0, 207, 10, 1], "semantic": {"name": "self.fit_circle_lock", "arg_names": [], "import_names": [], "rhs_call_name": "RLock", "annotation": ""}, "snippet": " self.fit_circle_lock = RLock()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L73_C8", "label": "__init__()", "type": "expression", "loc": [73, 73], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L58_C4", "vector": [8, 2, 0.108, 0.0015, 2, 0.51, 1.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_99548:FunctionDef_L75_C4", "label": "run", "type": "function", "loc": [75, 76], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:ClassDef_L54_C0", "vector": [2, 1, 0.1117, 0.003, 1, 0.78, 0.1176, 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.circle_estimator()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L76_C8", "label": "circle_estimator()", "type": "expression", "loc": [76, 76], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L75_C4", "vector": [8, 2, 0.1124, 0.0015, 2, 0.36, 0.0, 512, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "circle_estimator", "arg_names": [], "import_names": [], "rhs_call_name": "circle_estimator", "annotation": ""}, "snippet": " self.circle_estimator()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L78_C4", "label": "stop", "type": "function", "loc": [78, 80], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:ClassDef_L54_C0", "vector": [2, 1, 0.1169, 0.0044, 1, 0.78, 0.1765, 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.run_fit_circle_thread = False\n self.firenze.stop()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L79_C8", "label": "self.run_fit_circle_thread =", "type": "assigned_variable", "loc": [79, 79], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L78_C4", "vector": [14, 2, 0.1169, 0.0015, 2, 0.17, 0.0, 381, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.run_fit_circle_thread", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.run_fit_circle_thread = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L80_C8", "label": "stop()", "type": "expression", "loc": [80, 80], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L78_C4", "vector": [8, 2, 0.1183, 0.0015, 2, 0.17, 1.0, 343, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "stop", "annotation": ""}, "snippet": " self.firenze.stop()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L85_C4", "label": "pose_arm", "type": "function", "loc": [85, 118], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:ClassDef_L54_C0", "vector": [2, 1, 0.1501, 0.0503, 1, 0.78, 0.2353, 557, 0, 2, 0, 0, 0, 0, 25], "semantic": {"name": "pose_arm", "arg_names": ["self", "hook_angle"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def pose_arm(self,hook_angle):\n print('press ENTER to pose the robot.')\n k=m3t.get_keystroke()\n\n if k!='\\r':\n print('You did not press ENTER.')\n return\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L86_C8", "label": "print()", "type": "expression", "loc": [86, 86], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L85_C4", "vector": [8, 2, 0.1272, 0.0015, 2, 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('press ENTER to pose the robot.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L87_C8", "label": "k = get_keystroke()", "type": "assigned_variable", "loc": [87, 87], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L85_C4", "vector": [14, 2, 0.1287, 0.0015, 2, 0.71, 0.0455, 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_99548:If_L89_C8", "label": "if", "type": "if", "loc": [89, 91], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L85_C4", "vector": [4, 2, 0.1331, 0.0044, 2, 0.71, 0.0909, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if k!='\\r':\n print('You did not press ENTER.')\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L90_C12", "label": "print()", "type": "expression", "loc": [90, 90], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L89_C8", "vector": [8, 3, 0.1331, 0.0015, 3, 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('You did not press ENTER.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Return_L91_C12", "label": "return", "type": "return", "loc": [91, 91], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L89_C8", "vector": [13, 3, 0.1346, 0.0015, 3, 0.13, 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_99548:Assign_L94_C8", "label": "settings_torque_gc = MekaArmSettings()", "type": "assigned_variable", "loc": [94, 94], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L85_C4", "vector": [14, 2, 0.1391, 0.0015, 2, 0.71, 0.1364, 752, 3, 2, 0, 0, 503, 10, 1], "semantic": {"name": "settings_torque_gc", "arg_names": [], "import_names": [], "rhs_call_name": "MekaArmSettings", "annotation": ""}, "snippet": " settings_torque_gc = hr.MekaArmSettings(stiffness_list=[0.,0.,0.,0.,0.],control_mode='torque_gc')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L95_C8", "label": "set_arm_settings()", "type": "expression", "loc": [95, 95], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L85_C4", "vector": [8, 2, 0.1405, 0.0015, 2, 0.71, 0.1818, 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.firenze.set_arm_settings(settings_torque_gc,None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L96_C8", "label": "step()", "type": "expression", "loc": [96, 96], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L85_C4", "vector": [8, 2, 0.142, 0.0015, 2, 0.71, 0.2273, 880, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "step", "arg_names": [], "import_names": [], "rhs_call_name": "step", "annotation": ""}, "snippet": " self.firenze.step()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L97_C8", "label": "print()", "type": "expression", "loc": [97, 97], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L85_C4", "vector": [8, 2, 0.1435, 0.0015, 2, 0.71, 0.2727, 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 end posing, something else to exit')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L98_C8", "label": "k = get_keystroke()", "type": "assigned_variable", "loc": [98, 98], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L85_C4", "vector": [14, 2, 0.145, 0.0015, 2, 0.71, 0.3182, 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_99548:Assign_L100_C8", "label": "p = end_effector_pos()", "type": "assigned_variable", "loc": [100, 100], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L85_C4", "vector": [14, 2, 0.1479, 0.0015, 2, 0.71, 0.3636, 491, 3, 1, 0, 0, 889, 10, 1], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "end_effector_pos", "annotation": ""}, "snippet": " p = self.firenze.end_effector_pos('right_arm')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L102_C8", "label": "q = get_joint_angles()", "type": "assigned_variable", "loc": [102, 102], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L85_C4", "vector": [14, 2, 0.1509, 0.0015, 2, 0.71, 0.4091, 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.firenze.get_joint_angles('right_arm')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L104_C8", "label": "set_arm_settings()", "type": "expression", "loc": [104, 104], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L85_C4", "vector": [8, 2, 0.1538, 0.0015, 2, 0.71, 0.4545, 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.firenze.set_arm_settings(self.settings_stiff,None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L105_C8", "label": "set_joint_angles()", "type": "expression", "loc": [105, 105], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L85_C4", "vector": [8, 2, 0.1553, 0.0015, 2, 0.71, 0.5, 718, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "set_joint_angles", "arg_names": [], "import_names": [], "rhs_call_name": "set_joint_angles", "annotation": ""}, "snippet": " self.firenze.set_joint_angles('right_arm',q)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L106_C8", "label": "step()", "type": "expression", "loc": [106, 106], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L85_C4", "vector": [8, 2, 0.1568, 0.0015, 2, 0.71, 0.5455, 880, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "step", "arg_names": [], "import_names": [], "rhs_call_name": "step", "annotation": ""}, "snippet": " self.firenze.step()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L107_C8", "label": "set_joint_angles()", "type": "expression", "loc": [107, 107], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L85_C4", "vector": [8, 2, 0.1583, 0.0015, 2, 0.71, 0.5909, 718, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "set_joint_angles", "arg_names": [], "import_names": [], "rhs_call_name": "set_joint_angles", "annotation": ""}, "snippet": " self.firenze.set_joint_angles('right_arm',q)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L108_C8", "label": "step()", "type": "expression", "loc": [108, 108], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L85_C4", "vector": [8, 2, 0.1598, 0.0015, 2, 0.71, 0.6364, 880, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "step", "arg_names": [], "import_names": [], "rhs_call_name": "step", "annotation": ""}, "snippet": " self.firenze.step()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L110_C8", "label": "rot_mat =", "type": "assigned_variable", "loc": [110, 110], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L85_C4", "vector": [14, 2, 0.1627, 0.0015, 2, 0.71, 0.6818, 968, 4, 0, 0, 0, 0, 0, 3], "semantic": {"name": "rot_mat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rot_mat = tr.Rz(hook_angle-hook_3dprint_angle)*tr.Ry(math.radians(-90))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L111_C8", "label": "go_cartesian()", "type": "expression", "loc": [111, 111], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L85_C4", "vector": [8, 2, 0.1642, 0.0015, 2, 0.71, 0.7273, 840, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "go_cartesian", "arg_names": [], "import_names": [], "rhs_call_name": "go_cartesian", "annotation": ""}, "snippet": " self.firenze.go_cartesian('right_arm',p,rot_mat,speed=0.1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L113_C8", "label": "print()", "type": "expression", "loc": [113, 113], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L85_C4", "vector": [8, 2, 0.1672, 0.0015, 2, 0.71, 0.7727, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('hit ENTER after making finer adjustment, something else to exit')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L114_C8", "label": "k = get_keystroke()", "type": "assigned_variable", "loc": [114, 114], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L85_C4", "vector": [14, 2, 0.1686, 0.0015, 2, 0.71, 0.8182, 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_99548:Assign_L115_C8", "label": "p = end_effector_pos()", "type": "assigned_variable", "loc": [115, 115], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L85_C4", "vector": [14, 2, 0.1701, 0.0015, 2, 0.71, 0.8636, 491, 3, 1, 0, 0, 889, 10, 1], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "end_effector_pos", "annotation": ""}, "snippet": " p = self.firenze.end_effector_pos('right_arm')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L116_C8", "label": "q = get_joint_angles()", "type": "assigned_variable", "loc": [116, 116], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L85_C4", "vector": [14, 2, 0.1716, 0.0015, 2, 0.71, 0.9091, 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.firenze.get_joint_angles('right_arm')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L117_C8", "label": "set_joint_angles()", "type": "expression", "loc": [117, 117], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L85_C4", "vector": [8, 2, 0.1731, 0.0015, 2, 0.71, 0.9545, 718, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "set_joint_angles", "arg_names": [], "import_names": [], "rhs_call_name": "set_joint_angles", "annotation": ""}, "snippet": " self.firenze.set_joint_angles('right_arm',q)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L118_C8", "label": "step()", "type": "expression", "loc": [118, 118], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L85_C4", "vector": [8, 2, 0.1746, 0.0015, 2, 0.71, 1.0, 880, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "step", "arg_names": [], "import_names": [], "rhs_call_name": "step", "annotation": ""}, "snippet": " self.firenze.step()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L120_C4", "label": "set_camera_settings", "type": "function", "loc": [120, 124], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:ClassDef_L54_C0", "vector": [2, 1, 0.1805, 0.0074, 1, 0.78, 0.2941, 60, 0, 1, 0, 0, 0, 0, 4], "semantic": {"name": "set_camera_settings", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def set_camera_settings(self):\n self.cam.set_frame_rate(30)\n self.cam.set_auto()\n self.cam.set_gamma(1)\n self.cam.set_whitebalance(r_val=512,b_val=544)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L121_C8", "label": "set_frame_rate()", "type": "expression", "loc": [121, 121], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L120_C4", "vector": [8, 2, 0.179, 0.0015, 2, 0.1, 0.0, 975, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_frame_rate", "arg_names": [], "import_names": [], "rhs_call_name": "set_frame_rate", "annotation": ""}, "snippet": " self.cam.set_frame_rate(30)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L122_C8", "label": "set_auto()", "type": "expression", "loc": [122, 122], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L120_C4", "vector": [8, 2, 0.1805, 0.0015, 2, 0.1, 0.3333, 673, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "set_auto", "arg_names": [], "import_names": [], "rhs_call_name": "set_auto", "annotation": ""}, "snippet": " self.cam.set_auto()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L123_C8", "label": "set_gamma()", "type": "expression", "loc": [123, 123], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L120_C4", "vector": [8, 2, 0.182, 0.0015, 2, 0.1, 0.6667, 342, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_gamma", "arg_names": [], "import_names": [], "rhs_call_name": "set_gamma", "annotation": ""}, "snippet": " self.cam.set_gamma(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L124_C8", "label": "set_whitebalance()", "type": "expression", "loc": [124, 124], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L120_C4", "vector": [8, 2, 0.1834, 0.0015, 2, 0.1, 1.0, 157, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "set_whitebalance", "arg_names": [], "import_names": [], "rhs_call_name": "set_whitebalance", "annotation": ""}, "snippet": " self.cam.set_whitebalance(r_val=512,b_val=544)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L126_C4", "label": "compliant_motion", "type": "function", "loc": [126, 155], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:ClassDef_L54_C0", "vector": [2, 1, 0.2078, 0.0444, 1, 0.78, 0.3529, 584, 0, 4, 1, 0, 0, 0, 7], "semantic": {"name": "compliant_motion", "arg_names": ["self", "equi_pt_generator", "time_step", "rapid_call_func"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def compliant_motion(self,equi_pt_generator,time_step,rapid_call_func=None):\n ''' equi_pt_generator: function that returns stop,q\n q: list of 7 joint angles\n stop: string which is '' for compliant motion to continue\n rapid_call_func: called in the time between calls to the equi_pt_generator\n can be used for logging, safety etc.\n returns stop\n stop: string which is '' for compliant motion to continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L127_C8", "label": "expression", "type": "expression", "loc": [127, 137], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L126_C4", "vector": [8, 2, 0.1953, 0.0163, 2, 0.32, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' equi_pt_generator: function that returns stop,q\n q: list of 7 joint angles\n stop: string which is '' for compliant motion to continue\n rapid_call_func: called in the time between calls to the equi_pt_generator\n can be used for logging, safety etc.\n returns stop\n stop: string which is '' for compliant motion to continue\n time_step: time between successive calls to equi_pt_generator"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L139_C8", "label": "stop, q = equi_pt_generator()", "type": "assigned_variable", "loc": [139, 139], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L126_C4", "vector": [14, 2, 0.2056, 0.0015, 2, 0.32, 0.3333, 973, 3, 0, 0, 0, 648, 10, 1], "semantic": {"name": "stop, q", "arg_names": [], "import_names": [], "rhs_call_name": "equi_pt_generator", "annotation": ""}, "snippet": " stop,q = equi_pt_generator()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:While_L140_C8", "label": "while", "type": "while", "loc": [140, 154], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L126_C4", "vector": [5, 2, 0.2175, 0.0222, 2, 0.32, 0.6667, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while stop == '':\n self.firenze.set_joint_angles('right_arm',q)\n t1 = time.time()\n t_end = t1+time_step\n while t1<t_end:\n self.firenze.step()\n if rapid_call_func != None:\n stop = rapid_call_func()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L141_C12", "label": "set_joint_angles()", "type": "expression", "loc": [141, 141], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:While_L140_C8", "vector": [8, 3, 0.2086, 0.0015, 3, 0.69, 0.0, 718, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "set_joint_angles", "arg_names": [], "import_names": [], "rhs_call_name": "set_joint_angles", "annotation": ""}, "snippet": " self.firenze.set_joint_angles('right_arm',q)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L142_C12", "label": "t1 = time()", "type": "assigned_variable", "loc": [142, 142], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:While_L140_C8", "vector": [14, 3, 0.2101, 0.0015, 3, 0.69, 0.2, 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_99548:Assign_L143_C12", "label": "t_end =", "type": "assigned_variable", "loc": [143, 143], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:While_L140_C8", "vector": [14, 3, 0.2115, 0.0015, 3, 0.69, 0.4, 945, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "t_end", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " t_end = t1+time_step"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:While_L144_C12", "label": "while", "type": "while", "loc": [144, 150], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:While_L140_C8", "vector": [5, 3, 0.2175, 0.0104, 3, 0.69, 0.6, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while t1<t_end:\n self.firenze.step()\n if rapid_call_func != None:\n stop = rapid_call_func()\n if stop != '':\n break\n t1 = time.time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L145_C16", "label": "step()", "type": "expression", "loc": [145, 145], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:While_L144_C12", "vector": [8, 4, 0.2145, 0.0015, 4, 0.25, 0.0, 880, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "step", "arg_names": [], "import_names": [], "rhs_call_name": "step", "annotation": ""}, "snippet": " self.firenze.step()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L146_C16", "label": "if", "type": "if", "loc": [146, 149], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:While_L144_C12", "vector": [4, 4, 0.2182, 0.0059, 4, 0.25, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if rapid_call_func != None:\n stop = rapid_call_func()\n if stop != '':\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L147_C20", "label": "stop = rapid_call_func()", "type": "assigned_variable", "loc": [147, 147], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L146_C16", "vector": [14, 5, 0.2175, 0.0015, 5, 0.12, 0.0, 343, 3, 0, 0, 0, 571, 10, 1], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "rapid_call_func", "annotation": ""}, "snippet": " stop = rapid_call_func()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L148_C20", "label": "if", "type": "if", "loc": [148, 149], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L146_C16", "vector": [4, 5, 0.2197, 0.003, 5, 0.12, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if stop != '':\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L150_C16", "label": "t1 = time()", "type": "assigned_variable", "loc": [150, 150], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:While_L144_C12", "vector": [14, 4, 0.2219, 0.0015, 4, 0.25, 1.0, 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_99548:If_L152_C12", "label": "if", "type": "if", "loc": [152, 153], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:While_L140_C8", "vector": [4, 3, 0.2256, 0.003, 3, 0.69, 0.8, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if stop != '':\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L154_C12", "label": "stop, q = equi_pt_generator()", "type": "assigned_variable", "loc": [154, 154], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:While_L140_C8", "vector": [14, 3, 0.2278, 0.0015, 3, 0.69, 1.0, 973, 3, 0, 0, 0, 648, 10, 1], "semantic": {"name": "stop, q", "arg_names": [], "import_names": [], "rhs_call_name": "equi_pt_generator", "annotation": ""}, "snippet": " stop,q = equi_pt_generator()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Return_L155_C8", "label": "return", "type": "return", "loc": [155, 155], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L126_C4", "vector": [13, 2, 0.2293, 0.0015, 2, 0.32, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return stop"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L158_C4", "label": "log_state", "type": "function", "loc": [158, 177], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:ClassDef_L54_C0", "vector": [2, 1, 0.2478, 0.0296, 1, 0.78, 0.4118, 805, 0, 1, 0, 0, 0, 0, 15], "semantic": {"name": "log_state", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def log_state(self):\n t_now = time.time()\n q_now = self.firenze.get_joint_angles('right_arm')\n qdot_now = self.firenze.get_joint_velocities('right_arm')\n\n tau_now = self.firenze.get_joint_torques('right_arm')\n self.jt_torque_trajectory.q_list.append(tau_now)\n self.jt_torque_trajectory.time_list.append(t_now)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L159_C8", "label": "t_now = time()", "type": "assigned_variable", "loc": [159, 159], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L158_C4", "vector": [14, 2, 0.2352, 0.0015, 2, 0.23, 0.0, 23, 3, 0, 0, 0, 654, 10, 1], "semantic": {"name": "t_now", "arg_names": [], "import_names": [], "rhs_call_name": "time", "annotation": ""}, "snippet": " t_now = time.time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L160_C8", "label": "q_now = get_joint_angles()", "type": "assigned_variable", "loc": [160, 160], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L158_C4", "vector": [14, 2, 0.2367, 0.0015, 2, 0.23, 0.0769, 353, 3, 1, 0, 0, 820, 10, 1], "semantic": {"name": "q_now", "arg_names": [], "import_names": [], "rhs_call_name": "get_joint_angles", "annotation": ""}, "snippet": " q_now = self.firenze.get_joint_angles('right_arm')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L161_C8", "label": "qdot_now = get_joint_velocities()", "type": "assigned_variable", "loc": [161, 161], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L158_C4", "vector": [14, 2, 0.2382, 0.0015, 2, 0.23, 0.1538, 850, 3, 1, 0, 0, 27, 10, 1], "semantic": {"name": "qdot_now", "arg_names": [], "import_names": [], "rhs_call_name": "get_joint_velocities", "annotation": ""}, "snippet": " qdot_now = self.firenze.get_joint_velocities('right_arm')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L163_C8", "label": "tau_now = get_joint_torques()", "type": "assigned_variable", "loc": [163, 163], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L158_C4", "vector": [14, 2, 0.2411, 0.0015, 2, 0.23, 0.2308, 667, 3, 1, 0, 0, 216, 10, 1], "semantic": {"name": "tau_now", "arg_names": [], "import_names": [], "rhs_call_name": "get_joint_torques", "annotation": ""}, "snippet": " tau_now = self.firenze.get_joint_torques('right_arm')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L164_C8", "label": "append()", "type": "expression", "loc": [164, 164], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L158_C4", "vector": [8, 2, 0.2426, 0.0015, 2, 0.23, 0.3077, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.jt_torque_trajectory.q_list.append(tau_now)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L165_C8", "label": "append()", "type": "expression", "loc": [165, 165], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L158_C4", "vector": [8, 2, 0.2441, 0.0015, 2, 0.23, 0.3846, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.jt_torque_trajectory.time_list.append(t_now)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L167_C8", "label": "append()", "type": "expression", "loc": [167, 167], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L158_C4", "vector": [8, 2, 0.247, 0.0015, 2, 0.23, 0.4615, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.pull_trajectory.q_list.append(q_now)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L168_C8", "label": "append()", "type": "expression", "loc": [168, 168], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L158_C4", "vector": [8, 2, 0.2485, 0.0015, 2, 0.23, 0.5385, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.pull_trajectory.qdot_list.append(qdot_now)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L169_C8", "label": "append()", "type": "expression", "loc": [169, 169], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L158_C4", "vector": [8, 2, 0.25, 0.0015, 2, 0.23, 0.6154, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.pull_trajectory.time_list.append(t_now)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L172_C8", "label": "append()", "type": "expression", "loc": [172, 172], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L158_C4", "vector": [8, 2, 0.2544, 0.0015, 2, 0.23, 0.6923, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.eq_pt_trajectory.q_list.append(self.q_guess) # see equi_pt_generator - q_guess is the config for the eq point."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L173_C8", "label": "append()", "type": "expression", "loc": [173, 173], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L158_C4", "vector": [8, 2, 0.2559, 0.0015, 2, 0.23, 0.7692, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.eq_pt_trajectory.time_list.append(t_now)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L175_C8", "label": "wrist_force = get_wrist_force()", "type": "assigned_variable", "loc": [175, 175], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L158_C4", "vector": [14, 2, 0.2589, 0.0015, 2, 0.23, 0.8462, 483, 3, 2, 0, 0, 854, 10, 1], "semantic": {"name": "wrist_force", "arg_names": [], "import_names": [], "rhs_call_name": "get_wrist_force", "annotation": ""}, "snippet": " wrist_force = self.firenze.get_wrist_force('right_arm',base_frame=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L176_C8", "label": "append()", "type": "expression", "loc": [176, 176], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L158_C4", "vector": [8, 2, 0.2604, 0.0015, 2, 0.23, 0.9231, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.force_trajectory.f_list.append(wrist_force.A1.tolist())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L177_C8", "label": "append()", "type": "expression", "loc": [177, 177], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L158_C4", "vector": [8, 2, 0.2618, 0.0015, 2, 0.23, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.force_trajectory.time_list.append(t_now)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L179_C4", "label": "common_stopping_conditions", "type": "function", "loc": [179, 204], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:ClassDef_L54_C0", "vector": [2, 1, 0.2833, 0.0385, 1, 0.78, 0.4706, 763, 0, 1, 1, 0, 0, 0, 3], "semantic": {"name": "common_stopping_conditions", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def common_stopping_conditions(self):\n stop = ''\n if self.q_guess == None:\n stop = 'IK fail'\n\n wrist_force = self.firenze.get_wrist_force('right_arm',base_frame=True)\n mag = np.linalg.norm(wrist_force)\n if mag > self.eq_force_threshold:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L180_C8", "label": "stop =", "type": "assigned_variable", "loc": [180, 180], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L179_C4", "vector": [14, 2, 0.2663, 0.0015, 2, 0.73, 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_99548:If_L181_C8", "label": "if", "type": "if", "loc": [181, 182], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L179_C4", "vector": [4, 2, 0.2685, 0.003, 2, 0.73, 0.1111, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.q_guess == None:\n stop = 'IK fail'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L182_C12", "label": "stop =", "type": "assigned_variable", "loc": [182, 182], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L181_C8", "vector": [14, 3, 0.2692, 0.0015, 3, 0.8, 0.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_99548:Assign_L184_C8", "label": "wrist_force = get_wrist_force()", "type": "assigned_variable", "loc": [184, 184], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L179_C4", "vector": [14, 2, 0.2722, 0.0015, 2, 0.73, 0.2222, 483, 3, 2, 0, 0, 854, 10, 1], "semantic": {"name": "wrist_force", "arg_names": [], "import_names": [], "rhs_call_name": "get_wrist_force", "annotation": ""}, "snippet": " wrist_force = self.firenze.get_wrist_force('right_arm',base_frame=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L185_C8", "label": "mag = norm()", "type": "assigned_variable", "loc": [185, 185], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L179_C4", "vector": [14, 2, 0.2737, 0.0015, 2, 0.73, 0.3333, 533, 3, 1, 0, 0, 902, 10, 1], "semantic": {"name": "mag", "arg_names": [], "import_names": [], "rhs_call_name": "norm", "annotation": ""}, "snippet": " mag = np.linalg.norm(wrist_force)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L186_C8", "label": "if", "type": "if", "loc": [186, 187], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L179_C4", "vector": [4, 2, 0.2759, 0.003, 2, 0.73, 0.4444, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if mag > self.eq_force_threshold:\n stop = 'force exceed'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L187_C12", "label": "stop =", "type": "assigned_variable", "loc": [187, 187], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L186_C8", "vector": [14, 3, 0.2766, 0.0015, 3, 0.9, 0.0, 343, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " stop = 'force exceed'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L189_C8", "label": "if", "type": "if", "loc": [189, 195], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L179_C4", "vector": [4, 2, 0.284, 0.0104, 2, 0.73, 0.5556, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if mag < 1.2 and self.hooked_location_moved:\n if (self.prev_force_mag - mag) > 10.:\n stop = 'slip: force step decrease and below thresold.'\n else:\n self.slip_count += 1\n else:\n self.slip_count = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L190_C12", "label": "if", "type": "if", "loc": [190, 193], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L189_C8", "vector": [4, 3, 0.2833, 0.0059, 3, 0.36, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (self.prev_force_mag - mag) > 10.:\n stop = 'slip: force step decrease and below thresold.'\n else:\n self.slip_count += 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L191_C16", "label": "stop =", "type": "assigned_variable", "loc": [191, 191], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L190_C12", "vector": [14, 4, 0.2825, 0.0015, 4, 0.57, 0.0, 343, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " stop = 'slip: force step decrease and below thresold.'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L195_C12", "label": "self.slip_count =", "type": "assigned_variable", "loc": [195, 195], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L189_C8", "vector": [14, 3, 0.2885, 0.0015, 3, 0.36, 1.0, 338, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.slip_count", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.slip_count = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L197_C8", "label": "if", "type": "if", "loc": [197, 198], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L179_C4", "vector": [4, 2, 0.2922, 0.003, 2, 0.73, 0.6667, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.slip_count == 4:\n stop = 'slip: force below threshold for too long.'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L198_C12", "label": "stop =", "type": "assigned_variable", "loc": [198, 198], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L197_C8", "vector": [14, 3, 0.2929, 0.0015, 3, 0.96, 0.0, 343, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " stop = 'slip: force below threshold for too long.'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L200_C8", "label": "curr_pos = FK()", "type": "assigned_variable", "loc": [200, 200], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L179_C4", "vector": [14, 2, 0.2959, 0.0015, 2, 0.73, 0.7778, 909, 3, 2, 0, 0, 252, 10, 1], "semantic": {"name": "curr_pos", "arg_names": [], "import_names": [], "rhs_call_name": "FK", "annotation": ""}, "snippet": " curr_pos = self.firenze.FK('right_arm',self.pull_trajectory.q_list[-1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L201_C8", "label": "if", "type": "if", "loc": [201, 202], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L179_C4", "vector": [4, 2, 0.2981, 0.003, 2, 0.73, 0.8889, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if curr_pos[0,0]<0.27 and curr_pos[1,0]>-0.2:\n stop = 'danger of self collision'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L202_C12", "label": "stop =", "type": "assigned_variable", "loc": [202, 202], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L201_C8", "vector": [14, 3, 0.2988, 0.0015, 3, 0.45, 0.0, 343, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " stop = 'danger of self collision'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Return_L204_C8", "label": "return", "type": "return", "loc": [204, 204], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L179_C4", "vector": [13, 2, 0.3018, 0.0015, 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 stop"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L206_C4", "label": "update_eq_point", "type": "function", "loc": [206, 213], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:ClassDef_L54_C0", "vector": [2, 1, 0.3099, 0.0118, 1, 0.78, 0.5294, 20, 0, 3, 1, 0, 0, 0, 1], "semantic": {"name": "update_eq_point", "arg_names": ["self", "motion_vec", "step_size"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def update_eq_point(self,motion_vec,step_size):\n next_pt = self.eq_pt_cartesian + step_size * motion_vec\n rot_mat = self.eq_IK_rot_mat\n# self.q_guess[1] += math.radians(1)\n q_eq = self.firenze.IK('right_arm',next_pt,rot_mat,self.q_guess)\n self.eq_pt_cartesian = next_pt\n self.q_guess = q_eq\n return q_eq"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L207_C8", "label": "next_pt =", "type": "assigned_variable", "loc": [207, 207], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L206_C4", "vector": [14, 2, 0.3062, 0.0015, 2, 0.42, 0.0, 46, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "next_pt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " next_pt = self.eq_pt_cartesian + step_size * motion_vec"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L208_C8", "label": "rot_mat =", "type": "assigned_variable", "loc": [208, 208], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L206_C4", "vector": [14, 2, 0.3077, 0.0015, 2, 0.42, 0.2, 968, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "rot_mat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rot_mat = self.eq_IK_rot_mat"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L210_C8", "label": "q_eq = IK()", "type": "assigned_variable", "loc": [210, 210], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L206_C4", "vector": [14, 2, 0.3107, 0.0015, 2, 0.42, 0.4, 498, 3, 4, 0, 0, 719, 10, 1], "semantic": {"name": "q_eq", "arg_names": [], "import_names": [], "rhs_call_name": "IK", "annotation": ""}, "snippet": " q_eq = self.firenze.IK('right_arm',next_pt,rot_mat,self.q_guess)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L211_C8", "label": "self.eq_pt_cartesian =", "type": "assigned_variable", "loc": [211, 211], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L206_C4", "vector": [14, 2, 0.3121, 0.0015, 2, 0.42, 0.6, 13, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.eq_pt_cartesian", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.eq_pt_cartesian = next_pt"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L212_C8", "label": "self.q_guess =", "type": "assigned_variable", "loc": [212, 212], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L206_C4", "vector": [14, 2, 0.3136, 0.0015, 2, 0.42, 0.8, 495, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.q_guess", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.q_guess = q_eq"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Return_L213_C8", "label": "return", "type": "return", "loc": [213, 213], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L206_C4", "vector": [13, 2, 0.3151, 0.0015, 2, 0.42, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return q_eq"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L215_C4", "label": "circle_estimator", "type": "function", "loc": [215, 238], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:ClassDef_L54_C0", "vector": [2, 1, 0.3351, 0.0355, 1, 0.78, 0.5882, 512, 0, 1, 0, 0, 0, 0, 12], "semantic": {"name": "circle_estimator", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def circle_estimator(self):\n self.run_fit_circle_thread = True\n print('Starting the circle estimating thread.')\n\n while self.run_fit_circle_thread:\n self.fit_circle_lock.acquire()\n if len(self.cartesian_pts_list)==0:\n self.fit_circle_lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L216_C8", "label": "self.run_fit_circle_thread =", "type": "assigned_variable", "loc": [216, 216], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L215_C4", "vector": [14, 2, 0.3195, 0.0015, 2, 0.35, 0.0, 381, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.run_fit_circle_thread", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.run_fit_circle_thread = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L217_C8", "label": "print()", "type": "expression", "loc": [217, 217], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L215_C4", "vector": [8, 2, 0.321, 0.0015, 2, 0.35, 0.3333, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Starting the circle estimating thread.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:While_L219_C8", "label": "while", "type": "while", "loc": [219, 236], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L215_C4", "vector": [5, 2, 0.3365, 0.0266, 2, 0.35, 0.6667, 0, 7, 0, 0, 0, 0, 0, 10], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while self.run_fit_circle_thread:\n self.fit_circle_lock.acquire()\n if len(self.cartesian_pts_list)==0:\n self.fit_circle_lock.release()\n continue\n pts_2d = (np.matrix(self.cartesian_pts_list).T)[0:2,:]\n self.fit_circle_lock.release()\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L220_C12", "label": "acquire()", "type": "expression", "loc": [220, 220], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:While_L219_C8", "vector": [8, 3, 0.3254, 0.0015, 3, 0.32, 0.0, 229, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "acquire", "arg_names": [], "import_names": [], "rhs_call_name": "acquire", "annotation": ""}, "snippet": " self.fit_circle_lock.acquire()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L221_C12", "label": "if", "type": "if", "loc": [221, 223], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:While_L219_C8", "vector": [4, 3, 0.3284, 0.0044, 3, 0.32, 0.0909, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(self.cartesian_pts_list)==0:\n self.fit_circle_lock.release()\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L222_C16", "label": "release()", "type": "expression", "loc": [222, 222], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L221_C12", "vector": [8, 4, 0.3284, 0.0015, 4, 0.53, 0.0, 784, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "release", "arg_names": [], "import_names": [], "rhs_call_name": "release", "annotation": ""}, "snippet": " self.fit_circle_lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L224_C12", "label": "pts_2d =", "type": "assigned_variable", "loc": [224, 224], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:While_L219_C8", "vector": [14, 3, 0.3314, 0.0015, 3, 0.32, 0.1818, 945, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "pts_2d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pts_2d = (np.matrix(self.cartesian_pts_list).T)[0:2,:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L225_C12", "label": "release()", "type": "expression", "loc": [225, 225], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:While_L219_C8", "vector": [8, 3, 0.3328, 0.0015, 3, 0.32, 0.2727, 784, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "release", "arg_names": [], "import_names": [], "rhs_call_name": "release", "annotation": ""}, "snippet": " self.fit_circle_lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L227_C12", "label": "rad =", "type": "assigned_variable", "loc": [227, 227], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:While_L219_C8", "vector": [14, 3, 0.3358, 0.0015, 3, 0.32, 0.3636, 439, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "rad", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rad = self.rad_guess"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L228_C12", "label": "start_pos = FK()", "type": "assigned_variable", "loc": [228, 228], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:While_L219_C8", "vector": [14, 3, 0.3373, 0.0015, 3, 0.32, 0.4545, 12, 3, 2, 0, 0, 252, 10, 1], "semantic": {"name": "start_pos", "arg_names": [], "import_names": [], "rhs_call_name": "FK", "annotation": ""}, "snippet": " start_pos = self.firenze.FK('right_arm',self.pull_trajectory.q_list[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L229_C12", "label": "rad, cx, cy = fit_circle()", "type": "assigned_variable", "loc": [229, 229], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:While_L219_C8", "vector": [14, 3, 0.3388, 0.0015, 3, 0.32, 0.5455, 693, 3, 6, 0, 0, 441, 10, 1], "semantic": {"name": "rad, cx, cy", "arg_names": [], "import_names": [], "rhs_call_name": "fit_circle", "annotation": ""}, "snippet": " rad,cx,cy = at.fit_circle(rad,start_pos[0,0],start_pos[1,0]-rad,pts_2d,method='fmin_bfgs',verbose=False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L230_C12", "label": "rad = bound()", "type": "assigned_variable", "loc": [230, 230], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:While_L219_C8", "vector": [14, 3, 0.3402, 0.0015, 3, 0.32, 0.6364, 439, 3, 3, 0, 0, 996, 10, 1], "semantic": {"name": "rad", "arg_names": [], "import_names": [], "rhs_call_name": "bound", "annotation": ""}, "snippet": " rad = ut.bound(rad,3.0,0.1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L232_C12", "label": "acquire()", "type": "expression", "loc": [232, 232], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:While_L219_C8", "vector": [8, 3, 0.3432, 0.0015, 3, 0.32, 0.7273, 229, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "acquire", "arg_names": [], "import_names": [], "rhs_call_name": "acquire", "annotation": ""}, "snippet": " self.fit_circle_lock.acquire()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L233_C12", "label": "self.cx =", "type": "assigned_variable", "loc": [233, 233], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:While_L219_C8", "vector": [14, 3, 0.3447, 0.0015, 3, 0.32, 0.8182, 349, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.cx", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.cx = cx"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L234_C12", "label": "self.cy =", "type": "assigned_variable", "loc": [234, 234], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:While_L219_C8", "vector": [14, 3, 0.3462, 0.0015, 3, 0.32, 0.9091, 425, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.cy", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.cy = cy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L236_C12", "label": "release()", "type": "expression", "loc": [236, 236], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:While_L219_C8", "vector": [8, 3, 0.3491, 0.0015, 3, 0.32, 1.0, 784, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "release", "arg_names": [], "import_names": [], "rhs_call_name": "release", "annotation": ""}, "snippet": " self.fit_circle_lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L238_C8", "label": "print()", "type": "expression", "loc": [238, 238], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L215_C4", "vector": [8, 2, 0.3521, 0.0015, 2, 0.35, 1.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Ended the circle estimating thread.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L244_C4", "label": "equi_pt_generator_control_radial_force", "type": "function", "loc": [244, 284], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:ClassDef_L54_C0", "vector": [2, 1, 0.3905, 0.0607, 1, 0.78, 0.6471, 142, 0, 1, 1, 0, 0, 0, 18], "semantic": {"name": "equi_pt_generator_control_radial_force", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def equi_pt_generator_control_radial_force(self):\n self.log_state()\n q_eq = self.update_eq_point(self.eq_motion_vec,0.01)\n stop = self.common_stopping_conditions()\n\n wrist_force = self.firenze.get_wrist_force('right_arm',base_frame=True)\n mag = np.linalg.norm(wrist_force)\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L245_C8", "label": "log_state()", "type": "expression", "loc": [245, 245], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L244_C4", "vector": [8, 2, 0.3624, 0.0015, 2, 0.0, 0.0, 805, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "log_state", "arg_names": [], "import_names": [], "rhs_call_name": "log_state", "annotation": ""}, "snippet": " self.log_state()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L246_C8", "label": "q_eq = update_eq_point()", "type": "assigned_variable", "loc": [246, 246], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L244_C4", "vector": [14, 2, 0.3639, 0.0015, 2, 0.0, 0.05, 498, 3, 2, 0, 0, 20, 10, 1], "semantic": {"name": "q_eq", "arg_names": [], "import_names": [], "rhs_call_name": "update_eq_point", "annotation": ""}, "snippet": " q_eq = self.update_eq_point(self.eq_motion_vec,0.01)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L247_C8", "label": "stop = common_stopping_conditions()", "type": "assigned_variable", "loc": [247, 247], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L244_C4", "vector": [14, 2, 0.3654, 0.0015, 2, 0.0, 0.1, 343, 3, 0, 0, 0, 763, 10, 1], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "common_stopping_conditions", "annotation": ""}, "snippet": " stop = self.common_stopping_conditions()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L249_C8", "label": "wrist_force = get_wrist_force()", "type": "assigned_variable", "loc": [249, 249], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L244_C4", "vector": [14, 2, 0.3683, 0.0015, 2, 0.0, 0.15, 483, 3, 2, 0, 0, 854, 10, 1], "semantic": {"name": "wrist_force", "arg_names": [], "import_names": [], "rhs_call_name": "get_wrist_force", "annotation": ""}, "snippet": " wrist_force = self.firenze.get_wrist_force('right_arm',base_frame=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L250_C8", "label": "mag = norm()", "type": "assigned_variable", "loc": [250, 250], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L244_C4", "vector": [14, 2, 0.3698, 0.0015, 2, 0.0, 0.2, 533, 3, 1, 0, 0, 902, 10, 1], "semantic": {"name": "mag", "arg_names": [], "import_names": [], "rhs_call_name": "norm", "annotation": ""}, "snippet": " mag = np.linalg.norm(wrist_force)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L252_C8", "label": "start_pos = FK()", "type": "assigned_variable", "loc": [252, 252], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L244_C4", "vector": [14, 2, 0.3728, 0.0015, 2, 0.0, 0.25, 12, 3, 2, 0, 0, 252, 10, 1], "semantic": {"name": "start_pos", "arg_names": [], "import_names": [], "rhs_call_name": "FK", "annotation": ""}, "snippet": " start_pos = self.firenze.FK('right_arm',self.pull_trajectory.q_list[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L253_C8", "label": "curr_pos = FK()", "type": "assigned_variable", "loc": [253, 253], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L244_C4", "vector": [14, 2, 0.3743, 0.0015, 2, 0.0, 0.3, 909, 3, 2, 0, 0, 252, 10, 1], "semantic": {"name": "curr_pos", "arg_names": [], "import_names": [], "rhs_call_name": "FK", "annotation": ""}, "snippet": " curr_pos = self.firenze.FK('right_arm',self.pull_trajectory.q_list[-1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L254_C8", "label": "if", "type": "if", "loc": [254, 258], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L244_C4", "vector": [4, 2, 0.3787, 0.0074, 2, 0.0, 0.35, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (start_pos[0,0]-curr_pos[0,0])>0.09 and self.hooked_location_moved==False:\n # change the force threshold once the hook has started pulling.\n self.hooked_location_moved = True\n self.eq_force_threshold = ut.bound(mag+30.,20.,80.)\n self.piecewise_force_threshold = ut.bound(mag+5.,0.,80.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L256_C12", "label": "self.hooked_location_moved =", "type": "assigned_variable", "loc": [256, 256], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L254_C8", "vector": [14, 3, 0.3787, 0.0015, 3, 0.52, 0.0, 183, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.hooked_location_moved", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.hooked_location_moved = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L257_C12", "label": "self.eq_force_threshold = bound()", "type": "assigned_variable", "loc": [257, 257], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L254_C8", "vector": [14, 3, 0.3802, 0.0015, 3, 0.52, 0.5, 675, 3, 3, 0, 0, 996, 10, 1], "semantic": {"name": "self.eq_force_threshold", "arg_names": [], "import_names": [], "rhs_call_name": "bound", "annotation": ""}, "snippet": " self.eq_force_threshold = ut.bound(mag+30.,20.,80.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L258_C12", "label": "self.piecewise_force_threshold = bound()", "type": "assigned_variable", "loc": [258, 258], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L254_C8", "vector": [14, 3, 0.3817, 0.0015, 3, 0.52, 1.0, 282, 3, 3, 0, 0, 996, 10, 1], "semantic": {"name": "self.piecewise_force_threshold", "arg_names": [], "import_names": [], "rhs_call_name": "bound", "annotation": ""}, "snippet": " self.piecewise_force_threshold = ut.bound(mag+5.,0.,80.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L260_C8", "label": "acquire()", "type": "expression", "loc": [260, 260], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L244_C4", "vector": [8, 2, 0.3846, 0.0015, 2, 0.0, 0.4, 229, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "acquire", "arg_names": [], "import_names": [], "rhs_call_name": "acquire", "annotation": ""}, "snippet": " self.fit_circle_lock.acquire()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L261_C8", "label": "append()", "type": "expression", "loc": [261, 261], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L244_C4", "vector": [8, 2, 0.3861, 0.0015, 2, 0.0, 0.45, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.cartesian_pts_list.append(curr_pos.A1.tolist())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L262_C8", "label": "release()", "type": "expression", "loc": [262, 262], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L244_C4", "vector": [8, 2, 0.3876, 0.0015, 2, 0.0, 0.5, 784, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "release", "arg_names": [], "import_names": [], "rhs_call_name": "release", "annotation": ""}, "snippet": " self.fit_circle_lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L265_C8", "label": "radial_vec =", "type": "assigned_variable", "loc": [265, 265], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L244_C4", "vector": [14, 2, 0.392, 0.0015, 2, 0.0, 0.55, 253, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "radial_vec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " radial_vec = curr_pos[0:2]-np.matrix([self.cx,self.cy]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L266_C8", "label": "radial_vec =", "type": "assigned_variable", "loc": [266, 266], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L244_C4", "vector": [14, 2, 0.3935, 0.0015, 2, 0.0, 0.6, 253, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "radial_vec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " radial_vec = radial_vec/np.linalg.norm(radial_vec)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L267_C8", "label": "tan_x, tan_y =", "type": "assigned_variable", "loc": [267, 267], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L244_C4", "vector": [14, 2, 0.395, 0.0015, 2, 0.0, 0.65, 33, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "tan_x, tan_y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tan_x,tan_y = -radial_vec[1,0],radial_vec[0,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L269_C8", "label": "if", "type": "if", "loc": [269, 271], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L244_C4", "vector": [4, 2, 0.3994, 0.0044, 2, 0.0, 0.7, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if tan_x >0.:\n tan_x = -tan_x\n tan_y = -tan_y"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L270_C12", "label": "tan_x =", "type": "assigned_variable", "loc": [270, 270], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L269_C8", "vector": [14, 3, 0.3994, 0.0015, 3, 0.85, 0.0, 718, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "tan_x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tan_x = -tan_x"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L271_C12", "label": "tan_y =", "type": "assigned_variable", "loc": [271, 271], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L269_C8", "vector": [14, 3, 0.4009, 0.0015, 3, 0.85, 1.0, 936, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "tan_y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tan_y = -tan_y"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L273_C8", "label": "self.eq_motion_vec =", "type": "assigned_variable", "loc": [273, 273], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L244_C4", "vector": [14, 2, 0.4038, 0.0015, 2, 0.0, 0.75, 232, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.eq_motion_vec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.eq_motion_vec = np.matrix([tan_x,tan_y,0.]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L275_C8", "label": "f_vec =", "type": "assigned_variable", "loc": [275, 275], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L244_C4", "vector": [14, 2, 0.4068, 0.0015, 2, 0.0, 0.8, 231, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "f_vec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " f_vec = -1*np.array([wrist_force[0,0],wrist_force[1,0]])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L276_C8", "label": "f_rad_mag = dot()", "type": "assigned_variable", "loc": [276, 276], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L244_C4", "vector": [14, 2, 0.4083, 0.0015, 2, 0.0, 0.85, 421, 3, 2, 0, 0, 310, 10, 1], "semantic": {"name": "f_rad_mag", "arg_names": [], "import_names": [], "rhs_call_name": "dot", "annotation": ""}, "snippet": " f_rad_mag = np.dot(f_vec,radial_vec.A1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L278_C8", "label": "if", "type": "if", "loc": [278, 281], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L244_C4", "vector": [4, 2, 0.4135, 0.0059, 2, 0.0, 0.9, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if f_rad_mag>5.:\n self.eq_motion_vec[0:2] -= radial_vec/2. * self.hook_maintain_dist_plane/0.05\n else:\n self.eq_motion_vec[0:2] += radial_vec/2. * self.hook_maintain_dist_plane/0.05"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L283_C8", "label": "self.prev_force_mag =", "type": "assigned_variable", "loc": [283, 283], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L244_C4", "vector": [14, 2, 0.4186, 0.0015, 2, 0.0, 0.95, 497, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.prev_force_mag", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.prev_force_mag = mag"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Return_L284_C8", "label": "return", "type": "return", "loc": [284, 284], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L244_C4", "vector": [13, 2, 0.4201, 0.0015, 2, 0.0, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return stop,q_eq"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L287_C4", "label": "equi_pt_generator_line", "type": "function", "loc": [287, 304], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:ClassDef_L54_C0", "vector": [2, 1, 0.4371, 0.0266, 1, 0.78, 0.7059, 826, 0, 1, 1, 0, 0, 0, 8], "semantic": {"name": "equi_pt_generator_line", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def equi_pt_generator_line(self):\n self.log_state()\n #q_eq = self.update_eq_point(self.eq_motion_vec,0.005)\n q_eq = self.update_eq_point(self.eq_motion_vec,0.010)\n stop = self.common_stopping_conditions()\n\n wrist_force = self.firenze.get_wrist_force('right_arm',base_frame=True)\n mag = np.linalg.norm(wrist_force)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L288_C8", "label": "log_state()", "type": "expression", "loc": [288, 288], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L287_C4", "vector": [8, 2, 0.426, 0.0015, 2, 0.74, 0.0, 805, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "log_state", "arg_names": [], "import_names": [], "rhs_call_name": "log_state", "annotation": ""}, "snippet": " self.log_state()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L290_C8", "label": "q_eq = update_eq_point()", "type": "assigned_variable", "loc": [290, 290], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L287_C4", "vector": [14, 2, 0.429, 0.0015, 2, 0.74, 0.1111, 498, 3, 2, 0, 0, 20, 10, 1], "semantic": {"name": "q_eq", "arg_names": [], "import_names": [], "rhs_call_name": "update_eq_point", "annotation": ""}, "snippet": " q_eq = self.update_eq_point(self.eq_motion_vec,0.010)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L291_C8", "label": "stop = common_stopping_conditions()", "type": "assigned_variable", "loc": [291, 291], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L287_C4", "vector": [14, 2, 0.4305, 0.0015, 2, 0.74, 0.2222, 343, 3, 0, 0, 0, 763, 10, 1], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "common_stopping_conditions", "annotation": ""}, "snippet": " stop = self.common_stopping_conditions()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L293_C8", "label": "wrist_force = get_wrist_force()", "type": "assigned_variable", "loc": [293, 293], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L287_C4", "vector": [14, 2, 0.4334, 0.0015, 2, 0.74, 0.3333, 483, 3, 2, 0, 0, 854, 10, 1], "semantic": {"name": "wrist_force", "arg_names": [], "import_names": [], "rhs_call_name": "get_wrist_force", "annotation": ""}, "snippet": " wrist_force = self.firenze.get_wrist_force('right_arm',base_frame=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L294_C8", "label": "mag = norm()", "type": "assigned_variable", "loc": [294, 294], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L287_C4", "vector": [14, 2, 0.4349, 0.0015, 2, 0.74, 0.4444, 533, 3, 1, 0, 0, 902, 10, 1], "semantic": {"name": "mag", "arg_names": [], "import_names": [], "rhs_call_name": "norm", "annotation": ""}, "snippet": " mag = np.linalg.norm(wrist_force)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L296_C8", "label": "start_pos = FK()", "type": "assigned_variable", "loc": [296, 296], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L287_C4", "vector": [14, 2, 0.4379, 0.0015, 2, 0.74, 0.5556, 12, 3, 2, 0, 0, 252, 10, 1], "semantic": {"name": "start_pos", "arg_names": [], "import_names": [], "rhs_call_name": "FK", "annotation": ""}, "snippet": " start_pos = self.firenze.FK('right_arm',self.pull_trajectory.q_list[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L297_C8", "label": "curr_pos = FK()", "type": "assigned_variable", "loc": [297, 297], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L287_C4", "vector": [14, 2, 0.4393, 0.0015, 2, 0.74, 0.6667, 909, 3, 2, 0, 0, 252, 10, 1], "semantic": {"name": "curr_pos", "arg_names": [], "import_names": [], "rhs_call_name": "FK", "annotation": ""}, "snippet": " curr_pos = self.firenze.FK('right_arm',self.pull_trajectory.q_list[-1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L298_C8", "label": "if", "type": "if", "loc": [298, 301], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L287_C4", "vector": [4, 2, 0.443, 0.0059, 2, 0.74, 0.7778, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (start_pos[0,0]-curr_pos[0,0])>0.09 and self.hooked_location_moved==False:\n # change the force threshold once the hook has started pulling.\n self.hooked_location_moved = True\n self.eq_force_threshold = ut.bound(mag+15.,20.,80.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L300_C12", "label": "self.hooked_location_moved =", "type": "assigned_variable", "loc": [300, 300], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L298_C8", "vector": [14, 3, 0.4438, 0.0015, 3, 0.31, 0.0, 183, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.hooked_location_moved", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.hooked_location_moved = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L301_C12", "label": "self.eq_force_threshold = bound()", "type": "assigned_variable", "loc": [301, 301], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L298_C8", "vector": [14, 3, 0.4453, 0.0015, 3, 0.31, 1.0, 675, 3, 3, 0, 0, 996, 10, 1], "semantic": {"name": "self.eq_force_threshold", "arg_names": [], "import_names": [], "rhs_call_name": "bound", "annotation": ""}, "snippet": " self.eq_force_threshold = ut.bound(mag+15.,20.,80.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L303_C8", "label": "self.prev_force_mag =", "type": "assigned_variable", "loc": [303, 303], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L287_C4", "vector": [14, 2, 0.4482, 0.0015, 2, 0.74, 0.8889, 497, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.prev_force_mag", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.prev_force_mag = mag"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Return_L304_C8", "label": "return", "type": "return", "loc": [304, 304], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L287_C4", "vector": [13, 2, 0.4497, 0.0015, 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 stop,q_eq"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L309_C4", "label": "get_firm_hook", "type": "function", "loc": [309, 322], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:ClassDef_L54_C0", "vector": [2, 1, 0.4667, 0.0207, 1, 0.78, 0.7647, 674, 0, 2, 0, 0, 0, 0, 10], "semantic": {"name": "get_firm_hook", "arg_names": ["self", "hook_angle"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_firm_hook(self, hook_angle):\n rot_mat = tr.Rz(hook_angle-hook_3dprint_angle)*tr.Ry(math.radians(-90))\n\n # move in the +x until contact.\n vec = np.matrix([0.08,0.,0.]).T\n self.firenze.move_till_hit('right_arm',vec=vec,force_threshold=2.0,rot=rot_mat,\n speed=0.05)\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L310_C8", "label": "rot_mat =", "type": "assigned_variable", "loc": [310, 310], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L309_C4", "vector": [14, 2, 0.4586, 0.0015, 2, 0.19, 0.0, 968, 4, 0, 0, 0, 0, 0, 3], "semantic": {"name": "rot_mat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rot_mat = tr.Rz(hook_angle-hook_3dprint_angle)*tr.Ry(math.radians(-90))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L313_C8", "label": "vec =", "type": "assigned_variable", "loc": [313, 313], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L309_C4", "vector": [14, 2, 0.463, 0.0015, 2, 0.19, 0.1667, 132, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "vec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " vec = np.matrix([0.08,0.,0.]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L314_C8", "label": "move_till_hit()", "type": "expression", "loc": [314, 315], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L309_C4", "vector": [8, 2, 0.4652, 0.003, 2, 0.19, 0.3333, 163, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "move_till_hit", "arg_names": [], "import_names": [], "rhs_call_name": "move_till_hit", "annotation": ""}, "snippet": " self.firenze.move_till_hit('right_arm',vec=vec,force_threshold=2.0,rot=rot_mat,\n speed=0.05)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L318_C8", "label": "vec =", "type": "assigned_variable", "loc": [318, 318], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L309_C4", "vector": [14, 2, 0.4704, 0.0015, 2, 0.19, 0.5, 132, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "vec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " vec = tr.rotX(-hook_angle) * np.matrix([0.,0.05,0.]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L319_C8", "label": "move_till_hit()", "type": "expression", "loc": [319, 320], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L309_C4", "vector": [8, 2, 0.4726, 0.003, 2, 0.19, 0.6667, 163, 3, 6, 0, 0, 0, 0, 1], "semantic": {"name": "move_till_hit", "arg_names": [], "import_names": [], "rhs_call_name": "move_till_hit", "annotation": ""}, "snippet": " self.firenze.move_till_hit('right_arm',vec=vec,force_threshold=5.0,rot=rot_mat,\n speed=0.05,bias_FT=False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L321_C8", "label": "set_arm_settings()", "type": "expression", "loc": [321, 321], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L309_C4", "vector": [8, 2, 0.4749, 0.0015, 2, 0.19, 0.8333, 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.firenze.set_arm_settings(self.settings_r,None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L322_C8", "label": "step()", "type": "expression", "loc": [322, 322], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L309_C4", "vector": [8, 2, 0.4763, 0.0015, 2, 0.19, 1.0, 880, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "step", "arg_names": [], "import_names": [], "rhs_call_name": "step", "annotation": ""}, "snippet": " self.firenze.step()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L324_C4", "label": "pull", "type": "function", "loc": [324, 446], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:ClassDef_L54_C0", "vector": [2, 1, 0.5695, 0.182, 1, 0.78, 0.8235, 964, 0, 8, 0, 0, 0, 0, 56], "semantic": {"name": "pull", "arg_names": ["self", "hook_angle", "force_threshold", "use_utm", "use_camera", "strategy", "pull_loc", "info_string"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def pull(self,hook_angle,force_threshold,use_utm=False,use_camera=False,strategy='line_neg_x',\n pull_loc=None, info_string=''):\n ''' force_threshold - max force at which to stop pulling.\n hook_angle - radians(0, -90, 90 etc.)\n 0 - horizontal, -pi/2 hook points up, +pi/2 hook points down\n use_utm - to take 3D scans or not.\n use_camera - to take pictures from the camera or not.\n strategy - 'line_neg_x': move eq point along -x axis."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L326_C8", "label": "expression", "type": "expression", "loc": [326, 338], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L324_C4", "vector": [8, 2, 0.4911, 0.0192, 2, 0.35, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' force_threshold - max force at which to stop pulling.\n hook_angle - radians(0, -90, 90 etc.)\n 0 - horizontal, -pi/2 hook points up, +pi/2 hook points down\n use_utm - to take 3D scans or not.\n use_camera - to take pictures from the camera or not.\n strategy - 'line_neg_x': move eq point along -x axis.\n 'piecewise_linear': try and estimate circle and move along it.\n 'control_radial_force': try and keep the radial force constant"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L339_C8", "label": "if", "type": "if", "loc": [339, 342], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L324_C4", "vector": [4, 2, 0.5037, 0.0059, 2, 0.35, 0.0213, 0, 2, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if use_utm:\n self.firenze.step()\n armconfig1 = self.firenze.get_joint_angles('right_arm')\n plist1,slist1 = self.scan_3d()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L340_C12", "label": "step()", "type": "expression", "loc": [340, 340], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L339_C8", "vector": [8, 3, 0.503, 0.0015, 3, 0.55, 0.0, 880, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "step", "arg_names": [], "import_names": [], "rhs_call_name": "step", "annotation": ""}, "snippet": " self.firenze.step()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L341_C12", "label": "armconfig1 = get_joint_angles()", "type": "assigned_variable", "loc": [341, 341], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L339_C8", "vector": [14, 3, 0.5044, 0.0015, 3, 0.55, 0.5, 209, 3, 1, 0, 0, 820, 10, 1], "semantic": {"name": "armconfig1", "arg_names": [], "import_names": [], "rhs_call_name": "get_joint_angles", "annotation": ""}, "snippet": " armconfig1 = self.firenze.get_joint_angles('right_arm')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L342_C12", "label": "plist1, slist1 = scan_3d()", "type": "assigned_variable", "loc": [342, 342], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L339_C8", "vector": [14, 3, 0.5059, 0.0015, 3, 0.55, 1.0, 305, 3, 0, 0, 0, 731, 10, 1], "semantic": {"name": "plist1, slist1", "arg_names": [], "import_names": [], "rhs_call_name": "scan_3d", "annotation": ""}, "snippet": " plist1,slist1 = self.scan_3d()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L344_C8", "label": "if", "type": "if", "loc": [344, 347], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L324_C4", "vector": [4, 2, 0.5111, 0.0059, 2, 0.35, 0.0426, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if use_camera:\n cam_plist1, cam_imlist1 = self.image_region()\n else:\n cam_plist1,cam_imlist1 = None,None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L345_C12", "label": "cam_plist1, cam_imlist1 = image_region()", "type": "assigned_variable", "loc": [345, 345], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L344_C8", "vector": [14, 3, 0.5104, 0.0015, 3, 0.7, 0.0, 523, 3, 0, 0, 0, 851, 10, 1], "semantic": {"name": "cam_plist1, cam_imlist1", "arg_names": [], "import_names": [], "rhs_call_name": "image_region", "annotation": ""}, "snippet": " cam_plist1, cam_imlist1 = self.image_region()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L347_C12", "label": "cam_plist1, cam_imlist1 =", "type": "assigned_variable", "loc": [347, 347], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L344_C8", "vector": [14, 3, 0.5133, 0.0015, 3, 0.7, 1.0, 523, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "cam_plist1, cam_imlist1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cam_plist1,cam_imlist1 = None,None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L349_C8", "label": "rot_mat =", "type": "assigned_variable", "loc": [349, 349], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L324_C4", "vector": [14, 2, 0.5163, 0.0015, 2, 0.35, 0.0638, 968, 4, 0, 0, 0, 0, 0, 3], "semantic": {"name": "rot_mat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rot_mat = tr.Rz(hook_angle-hook_3dprint_angle)*tr.Ry(math.radians(-90))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L351_C8", "label": "if", "type": "if", "loc": [351, 361], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L324_C4", "vector": [4, 2, 0.5266, 0.0163, 2, 0.35, 0.0851, 0, 0, 0, 0, 0, 0, 0, 9], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if pull_loc == None:\n self.pose_arm(hook_angle)\n pull_loc = self.firenze.end_effector_pos('right_arm')\n ut.save_pickle(pull_loc,'pull_loc_'+info_string+'_'+ut.formatted_time()+'.pkl')\n else:\n pt1 = copy.copy(pull_loc)\n pt1[0,0] = pt1[0,0]-0.1\n print('pt1:', pt1.A1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L352_C12", "label": "pose_arm()", "type": "expression", "loc": [352, 352], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L351_C8", "vector": [8, 3, 0.5207, 0.0015, 3, 0.03, 0.0, 557, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "pose_arm", "arg_names": [], "import_names": [], "rhs_call_name": "pose_arm", "annotation": ""}, "snippet": " self.pose_arm(hook_angle)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L353_C12", "label": "pull_loc = end_effector_pos()", "type": "assigned_variable", "loc": [353, 353], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L351_C8", "vector": [14, 3, 0.5222, 0.0015, 3, 0.03, 0.125, 640, 3, 1, 0, 0, 889, 10, 1], "semantic": {"name": "pull_loc", "arg_names": [], "import_names": [], "rhs_call_name": "end_effector_pos", "annotation": ""}, "snippet": " pull_loc = self.firenze.end_effector_pos('right_arm')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L354_C12", "label": "save_pickle()", "type": "expression", "loc": [354, 354], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L351_C8", "vector": [8, 3, 0.5237, 0.0015, 3, 0.03, 0.25, 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(pull_loc,'pull_loc_'+info_string+'_'+ut.formatted_time()+'.pkl')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L356_C12", "label": "pt1 = copy()", "type": "assigned_variable", "loc": [356, 356], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L351_C8", "vector": [14, 3, 0.5266, 0.0015, 3, 0.03, 0.375, 211, 3, 1, 0, 0, 739, 10, 1], "semantic": {"name": "pt1", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " pt1 = copy.copy(pull_loc)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L357_C12", "label": "assign", "type": "assigned_variable", "loc": [357, 357], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L351_C8", "vector": [14, 3, 0.5281, 0.0015, 3, 0.03, 0.5, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pt1[0,0] = pt1[0,0]-0.1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L358_C12", "label": "print()", "type": "expression", "loc": [358, 358], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L351_C8", "vector": [8, 3, 0.5296, 0.0015, 3, 0.03, 0.625, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('pt1:', pt1.A1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L359_C12", "label": "print()", "type": "expression", "loc": [359, 359], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L351_C8", "vector": [8, 3, 0.5311, 0.0015, 3, 0.03, 0.75, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('pull_loc:', pull_loc.A1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L360_C12", "label": "go_cartesian()", "type": "expression", "loc": [360, 360], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L351_C8", "vector": [8, 3, 0.5325, 0.0015, 3, 0.03, 0.875, 840, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "go_cartesian", "arg_names": [], "import_names": [], "rhs_call_name": "go_cartesian", "annotation": ""}, "snippet": " self.firenze.go_cartesian('right_arm',pt1,rot_mat,speed=0.2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L361_C12", "label": "go_cartesian()", "type": "expression", "loc": [361, 361], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L351_C8", "vector": [8, 3, 0.534, 0.0015, 3, 0.03, 1.0, 840, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "go_cartesian", "arg_names": [], "import_names": [], "rhs_call_name": "go_cartesian", "annotation": ""}, "snippet": " self.firenze.go_cartesian('right_arm',pull_loc,rot_mat,speed=0.07)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L364_C8", "label": "print()", "type": "expression", "loc": [364, 364], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L324_C4", "vector": [8, 2, 0.5385, 0.0015, 2, 0.35, 0.1064, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('press ENTER to pull')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L365_C8", "label": "k = get_keystroke()", "type": "assigned_variable", "loc": [365, 365], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L324_C4", "vector": [14, 2, 0.5399, 0.0015, 2, 0.35, 0.1277, 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_99548:If_L366_C8", "label": "if", "type": "if", "loc": [366, 367], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L324_C4", "vector": [4, 2, 0.5422, 0.003, 2, 0.35, 0.1489, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if k != '\\r':\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Return_L367_C12", "label": "return", "type": "return", "loc": [367, 367], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L366_C8", "vector": [13, 3, 0.5429, 0.0015, 3, 0.98, 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_99548:Assign_L369_C8", "label": "time_dict =", "type": "assigned_variable", "loc": [369, 369], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L324_C4", "vector": [14, 2, 0.5459, 0.0015, 2, 0.35, 0.1702, 361, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "time_dict", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " time_dict = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L370_C8", "label": " = time()", "type": "assigned_variable", "loc": [370, 370], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L324_C4", "vector": [14, 2, 0.5473, 0.0015, 2, 0.35, 0.1915, 0, 3, 0, 0, 0, 654, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "time", "annotation": ""}, "snippet": " time_dict['before_hook'] = time.time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L371_C8", "label": "print()", "type": "expression", "loc": [371, 371], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L324_C4", "vector": [8, 2, 0.5488, 0.0015, 2, 0.35, 0.2128, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('first getting a good hook')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L372_C8", "label": "get_firm_hook()", "type": "expression", "loc": [372, 372], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L324_C4", "vector": [8, 2, 0.5503, 0.0015, 2, 0.35, 0.234, 674, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "get_firm_hook", "arg_names": [], "import_names": [], "rhs_call_name": "get_firm_hook", "annotation": ""}, "snippet": " self.get_firm_hook(hook_angle)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L373_C8", "label": "sleep()", "type": "expression", "loc": [373, 373], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L324_C4", "vector": [8, 2, 0.5518, 0.0015, 2, 0.35, 0.2553, 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_99548:Assign_L374_C8", "label": " = time()", "type": "assigned_variable", "loc": [374, 374], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L324_C4", "vector": [14, 2, 0.5533, 0.0015, 2, 0.35, 0.2766, 0, 3, 0, 0, 0, 654, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "time", "annotation": ""}, "snippet": " time_dict['before_pull'] = time.time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L376_C8", "label": "print()", "type": "expression", "loc": [376, 376], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L324_C4", "vector": [8, 2, 0.5562, 0.0015, 2, 0.35, 0.2979, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('pull begins')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L377_C8", "label": "stiffness_scale =", "type": "assigned_variable", "loc": [377, 377], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L324_C4", "vector": [14, 2, 0.5577, 0.0015, 2, 0.35, 0.3191, 822, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "stiffness_scale", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " stiffness_scale = self.settings_r.stiffness_scale"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L378_C8", "label": "vec =", "type": "assigned_variable", "loc": [378, 378], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L324_C4", "vector": [14, 2, 0.5592, 0.0015, 2, 0.35, 0.3404, 132, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "vec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " vec = tr.rotX(-hook_angle) * np.matrix([0.,0.05/stiffness_scale,0.]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L379_C8", "label": "self.keep_hook_vec =", "type": "assigned_variable", "loc": [379, 379], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L324_C4", "vector": [14, 2, 0.5607, 0.0015, 2, 0.35, 0.3617, 161, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.keep_hook_vec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.keep_hook_vec = vec"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L380_C8", "label": "self.hook_maintain_dist_plane = dot()", "type": "assigned_variable", "loc": [380, 380], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L324_C4", "vector": [14, 2, 0.5621, 0.0015, 2, 0.35, 0.383, 52, 3, 2, 0, 0, 310, 10, 2], "semantic": {"name": "self.hook_maintain_dist_plane", "arg_names": [], "import_names": [], "rhs_call_name": "dot", "annotation": ""}, "snippet": " self.hook_maintain_dist_plane = np.dot(vec.A1,np.array([0.,1.,0.]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L381_C8", "label": "self.eq_pt_cartesian =", "type": "assigned_variable", "loc": [381, 381], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L324_C4", "vector": [14, 2, 0.5636, 0.0015, 2, 0.35, 0.4043, 13, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.eq_pt_cartesian", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.eq_pt_cartesian = self.firenze.end_effector_pos('right_arm') + vec"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L382_C8", "label": "q_eq = IK()", "type": "assigned_variable", "loc": [382, 382], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L324_C4", "vector": [14, 2, 0.5651, 0.0015, 2, 0.35, 0.4255, 498, 3, 3, 0, 0, 719, 10, 1], "semantic": {"name": "q_eq", "arg_names": [], "import_names": [], "rhs_call_name": "IK", "annotation": ""}, "snippet": " q_eq = self.firenze.IK('right_arm',self.eq_pt_cartesian,rot_mat)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L383_C8", "label": "go_jointangles()", "type": "expression", "loc": [383, 383], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L324_C4", "vector": [8, 2, 0.5666, 0.0015, 2, 0.35, 0.4468, 285, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "go_jointangles", "arg_names": [], "import_names": [], "rhs_call_name": "go_jointangles", "annotation": ""}, "snippet": " self.firenze.go_jointangles('right_arm',q_eq,speed=math.radians(30))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L384_C8", "label": "self.q_guess =", "type": "assigned_variable", "loc": [384, 384], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L324_C4", "vector": [14, 2, 0.568, 0.0015, 2, 0.35, 0.4681, 495, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.q_guess", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.q_guess = q_eq"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L388_C8", "label": "self.pull_trajectory = JointTrajectory()", "type": "assigned_variable", "loc": [388, 388], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L324_C4", "vector": [14, 2, 0.574, 0.0015, 2, 0.35, 0.4894, 663, 3, 0, 0, 0, 302, 10, 1], "semantic": {"name": "self.pull_trajectory", "arg_names": [], "import_names": [], "rhs_call_name": "JointTrajectory", "annotation": ""}, "snippet": " self.pull_trajectory = at.JointTrajectory()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L389_C8", "label": "self.jt_torque_trajectory = JointTrajectory()", "type": "assigned_variable", "loc": [389, 389], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L324_C4", "vector": [14, 2, 0.5754, 0.0015, 2, 0.35, 0.5106, 631, 3, 0, 0, 0, 302, 10, 1], "semantic": {"name": "self.jt_torque_trajectory", "arg_names": [], "import_names": [], "rhs_call_name": "JointTrajectory", "annotation": ""}, "snippet": " self.jt_torque_trajectory = at.JointTrajectory()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L390_C8", "label": "self.eq_pt_trajectory = JointTrajectory()", "type": "assigned_variable", "loc": [390, 390], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L324_C4", "vector": [14, 2, 0.5769, 0.0015, 2, 0.35, 0.5319, 70, 3, 0, 0, 0, 302, 10, 1], "semantic": {"name": "self.eq_pt_trajectory", "arg_names": [], "import_names": [], "rhs_call_name": "JointTrajectory", "annotation": ""}, "snippet": " self.eq_pt_trajectory = at.JointTrajectory()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L391_C8", "label": "self.force_trajectory = ForceTrajectory()", "type": "assigned_variable", "loc": [391, 391], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L324_C4", "vector": [14, 2, 0.5784, 0.0015, 2, 0.35, 0.5532, 198, 3, 0, 0, 0, 306, 10, 1], "semantic": {"name": "self.force_trajectory", "arg_names": [], "import_names": [], "rhs_call_name": "ForceTrajectory", "annotation": ""}, "snippet": " self.force_trajectory = at.ForceTrajectory()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L393_C8", "label": "step()", "type": "expression", "loc": [393, 393], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L324_C4", "vector": [8, 2, 0.5814, 0.0015, 2, 0.35, 0.5745, 880, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "step", "arg_names": [], "import_names": [], "rhs_call_name": "step", "annotation": ""}, "snippet": " self.firenze.step()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L394_C8", "label": "start_config = get_joint_angles()", "type": "assigned_variable", "loc": [394, 394], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L324_C4", "vector": [14, 2, 0.5828, 0.0015, 2, 0.35, 0.5957, 689, 3, 1, 0, 0, 820, 10, 1], "semantic": {"name": "start_config", "arg_names": [], "import_names": [], "rhs_call_name": "get_joint_angles", "annotation": ""}, "snippet": " start_config = self.firenze.get_joint_angles('right_arm')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L396_C8", "label": "self.eq_IK_rot_mat =", "type": "assigned_variable", "loc": [396, 396], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L324_C4", "vector": [14, 2, 0.5858, 0.0015, 2, 0.35, 0.617, 155, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.eq_IK_rot_mat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.eq_IK_rot_mat = rot_mat # for equi pt generators."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L397_C8", "label": "self.eq_force_threshold =", "type": "assigned_variable", "loc": [397, 397], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L324_C4", "vector": [14, 2, 0.5873, 0.0015, 2, 0.35, 0.6383, 675, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.eq_force_threshold", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.eq_force_threshold = force_threshold"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L398_C8", "label": "self.hooked_location_moved =", "type": "assigned_variable", "loc": [398, 398], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L324_C4", "vector": [14, 2, 0.5888, 0.0015, 2, 0.35, 0.6596, 183, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.hooked_location_moved", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.hooked_location_moved = False # flag to indicate when the hooking location started moving."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L399_C8", "label": "self.prev_force_mag = norm()", "type": "assigned_variable", "loc": [399, 399], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L324_C4", "vector": [14, 2, 0.5902, 0.0015, 2, 0.35, 0.6809, 497, 3, 1, 0, 0, 902, 10, 2], "semantic": {"name": "self.prev_force_mag", "arg_names": [], "import_names": [], "rhs_call_name": "norm", "annotation": ""}, "snippet": " self.prev_force_mag = np.linalg.norm(self.firenze.get_wrist_force('right_arm'))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L400_C8", "label": "self.eq_motion_vec =", "type": "assigned_variable", "loc": [400, 400], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L324_C4", "vector": [14, 2, 0.5917, 0.0015, 2, 0.35, 0.7021, 232, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.eq_motion_vec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.eq_motion_vec = np.matrix([-1.,0.,0.]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L401_C8", "label": "self.slip_count =", "type": "assigned_variable", "loc": [401, 401], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L324_C4", "vector": [14, 2, 0.5932, 0.0015, 2, 0.35, 0.7234, 338, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.slip_count", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.slip_count = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L402_C8", "label": "if", "type": "if", "loc": [402, 413], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L324_C4", "vector": [4, 2, 0.6028, 0.0178, 2, 0.35, 0.7447, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if strategy == 'line_neg_x':\n result = self.compliant_motion(self.equi_pt_generator_line,0.025)\n elif strategy == 'control_radial_force':\n self.cartesian_pts_list = []\n self.piecewise_force_threshold = force_threshold\n self.rad_guess = 1.0\n self.cx = 0.6\n self.cy = -self.rad_guess"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L403_C12", "label": "result = compliant_motion()", "type": "assigned_variable", "loc": [403, 403], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L402_C8", "vector": [14, 3, 0.5962, 0.0015, 3, 0.87, 0.0, 51, 3, 2, 0, 0, 584, 10, 1], "semantic": {"name": "result", "arg_names": [], "import_names": [], "rhs_call_name": "compliant_motion", "annotation": ""}, "snippet": " result = self.compliant_motion(self.equi_pt_generator_line,0.025)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L404_C8", "label": "if", "type": "if", "loc": [404, 413], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L402_C8", "vector": [4, 3, 0.6043, 0.0148, 3, 0.87, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif strategy == 'control_radial_force':\n self.cartesian_pts_list = []\n self.piecewise_force_threshold = force_threshold\n self.rad_guess = 1.0\n self.cx = 0.6\n self.cy = -self.rad_guess\n self.start() # start the circle estimation thread\n result = self.compliant_motion(self.equi_pt_generator_control_radial_force,0.025)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L405_C12", "label": "self.cartesian_pts_list =", "type": "assigned_variable", "loc": [405, 405], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L404_C8", "vector": [14, 4, 0.5991, 0.0015, 4, 0.35, 0.0, 692, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.cartesian_pts_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.cartesian_pts_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L406_C12", "label": "self.piecewise_force_threshold =", "type": "assigned_variable", "loc": [406, 406], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L404_C8", "vector": [14, 4, 0.6006, 0.0015, 4, 0.35, 0.1667, 282, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.piecewise_force_threshold", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.piecewise_force_threshold = force_threshold"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L407_C12", "label": "self.rad_guess =", "type": "assigned_variable", "loc": [407, 407], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L404_C8", "vector": [14, 4, 0.6021, 0.0015, 4, 0.35, 0.3333, 802, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "self.rad_guess", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.rad_guess = 1.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L408_C12", "label": "self.cx =", "type": "assigned_variable", "loc": [408, 408], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L404_C8", "vector": [14, 4, 0.6036, 0.0015, 4, 0.35, 0.5, 349, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "self.cx", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.cx = 0.6"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L409_C12", "label": "self.cy =", "type": "assigned_variable", "loc": [409, 409], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L404_C8", "vector": [14, 4, 0.605, 0.0015, 4, 0.35, 0.6667, 425, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.cy", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.cy = -self.rad_guess"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L410_C12", "label": "start()", "type": "expression", "loc": [410, 410], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L404_C8", "vector": [8, 4, 0.6065, 0.0015, 4, 0.35, 0.8333, 511, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "start", "arg_names": [], "import_names": [], "rhs_call_name": "start", "annotation": ""}, "snippet": " self.start() # start the circle estimation thread"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L411_C12", "label": "result = compliant_motion()", "type": "assigned_variable", "loc": [411, 411], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L404_C8", "vector": [14, 4, 0.608, 0.0015, 4, 0.35, 1.0, 51, 3, 2, 0, 0, 584, 10, 1], "semantic": {"name": "result", "arg_names": [], "import_names": [], "rhs_call_name": "compliant_motion", "annotation": ""}, "snippet": " result = self.compliant_motion(self.equi_pt_generator_control_radial_force,0.025)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L415_C8", "label": "if", "type": "if", "loc": [415, 417], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L324_C4", "vector": [4, 2, 0.6154, 0.0044, 2, 0.35, 0.766, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if result == 'slip: force step decrease' or result == 'danger of self collision':\n self.firenze.motors_off()\n print('powered off the motors.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L416_C12", "label": "motors_off()", "type": "expression", "loc": [416, 416], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L415_C8", "vector": [8, 3, 0.6154, 0.0015, 3, 0.58, 0.0, 881, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "motors_off", "arg_names": [], "import_names": [], "rhs_call_name": "motors_off", "annotation": ""}, "snippet": " self.firenze.motors_off()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L417_C12", "label": "print()", "type": "expression", "loc": [417, 417], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L415_C8", "vector": [8, 3, 0.6169, 0.0015, 3, 0.58, 1.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('powered off the motors.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L419_C8", "label": "print()", "type": "expression", "loc": [419, 419], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L324_C4", "vector": [8, 2, 0.6198, 0.0015, 2, 0.35, 0.7872, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Compliant motion result:', result)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L420_C8", "label": "print()", "type": "expression", "loc": [420, 420], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L324_C4", "vector": [8, 2, 0.6213, 0.0015, 2, 0.35, 0.8085, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Original force threshold:', force_threshold)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L421_C8", "label": "print()", "type": "expression", "loc": [421, 421], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L324_C4", "vector": [8, 2, 0.6228, 0.0015, 2, 0.35, 0.8298, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Adapted force threshold:', self.eq_force_threshold)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L423_C8", "label": " = time()", "type": "assigned_variable", "loc": [423, 423], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L324_C4", "vector": [14, 2, 0.6257, 0.0015, 2, 0.35, 0.8511, 0, 3, 0, 0, 0, 654, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "time", "annotation": ""}, "snippet": " time_dict['after_pull'] = time.time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L425_C8", "label": "d =", "type": "assigned_variable", "loc": [425, 430], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L324_C4", "vector": [14, 2, 0.6324, 0.0089, 2, 0.35, 0.8723, 355, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " d = {'actual': self.pull_trajectory, 'eq_pt': self.eq_pt_trajectory,\n 'force': self.force_trajectory, 'torque': self.jt_torque_trajectory,\n 'stiffness': self.firenze.arm_settings['right_arm'],\n 'info': info_string, 'force_threshold': force_threshold,\n 'eq_force_threshold': self.eq_force_threshold, 'hook_angle':hook_angle,\n 'result':result,'strategy':strategy,'time_dict':time_dict}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L432_C8", "label": "step()", "type": "expression", "loc": [432, 432], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L324_C4", "vector": [8, 2, 0.6391, 0.0015, 2, 0.35, 0.8936, 880, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "step", "arg_names": [], "import_names": [], "rhs_call_name": "step", "annotation": ""}, "snippet": " self.firenze.step()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L433_C8", "label": "armconfig2 = get_joint_angles()", "type": "assigned_variable", "loc": [433, 433], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L324_C4", "vector": [14, 2, 0.6405, 0.0015, 2, 0.35, 0.9149, 939, 3, 1, 0, 0, 820, 10, 1], "semantic": {"name": "armconfig2", "arg_names": [], "import_names": [], "rhs_call_name": "get_joint_angles", "annotation": ""}, "snippet": " armconfig2 = self.firenze.get_joint_angles('right_arm')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L434_C8", "label": "if", "type": "if", "loc": [434, 441], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L324_C4", "vector": [4, 2, 0.6472, 0.0118, 2, 0.35, 0.9362, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if use_utm:\n plist2,slist2 = self.scan_3d()\n d['start_config']=start_config\n d['armconfig1']=armconfig1\n d['armconfig2']=armconfig2\n d['l1'],d['l2']=0.,-0.055\n d['scanlist1'],d['poslist1']=slist1,plist1\n d['scanlist2'],d['poslist2']=slist2,plist2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L435_C12", "label": "plist2, slist2 = scan_3d()", "type": "assigned_variable", "loc": [435, 435], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L434_C8", "vector": [14, 3, 0.6435, 0.0015, 3, 0.55, 0.0, 431, 3, 0, 0, 0, 731, 10, 1], "semantic": {"name": "plist2, slist2", "arg_names": [], "import_names": [], "rhs_call_name": "scan_3d", "annotation": ""}, "snippet": " plist2,slist2 = self.scan_3d()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L436_C12", "label": "assign", "type": "assigned_variable", "loc": [436, 436], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L434_C8", "vector": [14, 3, 0.645, 0.0015, 3, 0.55, 0.1667, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " d['start_config']=start_config"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L437_C12", "label": "assign", "type": "assigned_variable", "loc": [437, 437], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L434_C8", "vector": [14, 3, 0.6464, 0.0015, 3, 0.55, 0.3333, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " d['armconfig1']=armconfig1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L438_C12", "label": "assign", "type": "assigned_variable", "loc": [438, 438], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L434_C8", "vector": [14, 3, 0.6479, 0.0015, 3, 0.55, 0.5, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " d['armconfig2']=armconfig2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L439_C12", "label": "assign", "type": "assigned_variable", "loc": [439, 439], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L434_C8", "vector": [14, 3, 0.6494, 0.0015, 3, 0.55, 0.6667, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " d['l1'],d['l2']=0.,-0.055"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L440_C12", "label": "assign", "type": "assigned_variable", "loc": [440, 440], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L434_C8", "vector": [14, 3, 0.6509, 0.0015, 3, 0.55, 0.8333, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " d['scanlist1'],d['poslist1']=slist1,plist1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L441_C12", "label": "assign", "type": "assigned_variable", "loc": [441, 441], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L434_C8", "vector": [14, 3, 0.6524, 0.0015, 3, 0.55, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " d['scanlist2'],d['poslist2']=slist2,plist2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L443_C8", "label": "assign", "type": "assigned_variable", "loc": [443, 443], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L324_C4", "vector": [14, 2, 0.6553, 0.0015, 2, 0.35, 0.9574, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " d['cam_plist1']=cam_plist1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L444_C8", "label": "assign", "type": "assigned_variable", "loc": [444, 444], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L324_C4", "vector": [14, 2, 0.6568, 0.0015, 2, 0.35, 0.9787, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " d['cam_imlist1']=cam_imlist1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L446_C8", "label": "save_pickle()", "type": "expression", "loc": [446, 446], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L324_C4", "vector": [8, 2, 0.6598, 0.0015, 2, 0.35, 1.0, 390, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "save_pickle", "arg_names": [], "import_names": [], "rhs_call_name": "save_pickle", "annotation": ""}, "snippet": " ut.save_pickle(d,'pull_trajectories_'+d['info']+'_'+ut.formatted_time()+'.pkl')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L448_C4", "label": "scan_3d", "type": "function", "loc": [448, 451], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:ClassDef_L54_C0", "vector": [2, 1, 0.6649, 0.0059, 1, 0.78, 0.8824, 731, 0, 1, 1, 0, 0, 0, 4], "semantic": {"name": "scan_3d", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def scan_3d(self):\n tilt_angles = (math.radians(20),math.radians(70))\n pos_list,scan_list = self.thok.scan(tilt_angles,speed=math.radians(10),save_scan=False)\n return pos_list,scan_list"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L449_C8", "label": "tilt_angles =", "type": "assigned_variable", "loc": [449, 449], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L448_C4", "vector": [14, 2, 0.6642, 0.0015, 2, 0.21, 0.0, 609, 0, 0, 0, 0, 0, 8, 2], "semantic": {"name": "tilt_angles", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tilt_angles = (math.radians(20),math.radians(70))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L450_C8", "label": "pos_list, scan_list = scan()", "type": "assigned_variable", "loc": [450, 450], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L448_C4", "vector": [14, 2, 0.6657, 0.0015, 2, 0.21, 0.5, 818, 3, 3, 0, 0, 202, 10, 2], "semantic": {"name": "pos_list, scan_list", "arg_names": [], "import_names": [], "rhs_call_name": "scan", "annotation": ""}, "snippet": " pos_list,scan_list = self.thok.scan(tilt_angles,speed=math.radians(10),save_scan=False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Return_L451_C8", "label": "return", "type": "return", "loc": [451, 451], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L448_C4", "vector": [13, 2, 0.6672, 0.0015, 2, 0.21, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return pos_list,scan_list"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L453_C4", "label": "save_frame", "type": "function", "loc": [453, 455], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:ClassDef_L54_C0", "vector": [2, 1, 0.6716, 0.0044, 1, 0.78, 0.9412, 334, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "save_frame", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def save_frame(self):\n cvim = self.cam.get_frame()\n cvSaveImage('im_'+ut.formatted_time()+'.png',cvim)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L454_C8", "label": "cvim = get_frame()", "type": "assigned_variable", "loc": [454, 454], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L453_C4", "vector": [14, 2, 0.6716, 0.0015, 2, 0.74, 0.0, 758, 3, 0, 0, 0, 489, 10, 1], "semantic": {"name": "cvim", "arg_names": [], "import_names": [], "rhs_call_name": "get_frame", "annotation": ""}, "snippet": " cvim = self.cam.get_frame()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L455_C8", "label": "cvSaveImage()", "type": "expression", "loc": [455, 455], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L453_C4", "vector": [8, 2, 0.6731, 0.0015, 2, 0.74, 1.0, 100, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "cvSaveImage", "arg_names": [], "import_names": [], "rhs_call_name": "cvSaveImage", "annotation": ""}, "snippet": " cvSaveImage('im_'+ut.formatted_time()+'.png',cvim)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L457_C4", "label": "image_region", "type": "function", "loc": [457, 473], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:ClassDef_L54_C0", "vector": [2, 1, 0.6879, 0.0251, 1, 0.78, 1.0, 851, 0, 1, 1, 0, 0, 0, 10], "semantic": {"name": "image_region", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def image_region(self):\n ''' takes images from the UTM camera at different angles.\n returns list of servo angles, list of images.\n images are numpy images. so that they can be pickled.\n '''\n im_list = []\n p_list = []\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L458_C8", "label": "expression", "type": "expression", "loc": [458, 461], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L457_C4", "vector": [8, 2, 0.6797, 0.0059, 2, 0.06, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' takes images from the UTM camera at different angles.\n returns list of servo angles, list of images.\n images are numpy images. so that they can be pickled.\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L462_C8", "label": "im_list =", "type": "assigned_variable", "loc": [462, 462], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L457_C4", "vector": [14, 2, 0.6834, 0.0015, 2, 0.06, 0.2, 638, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "im_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " im_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L463_C8", "label": "p_list =", "type": "assigned_variable", "loc": [463, 463], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L457_C4", "vector": [14, 2, 0.6849, 0.0015, 2, 0.06, 0.4, 98, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "p_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:For_L465_C8", "label": "for cmd_ang", "type": "for", "loc": [465, 470], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L457_C4", "vector": [6, 2, 0.6916, 0.0089, 2, 0.06, 0.6, 555, 0, 0, 0, 0, 0, 0, 8], "semantic": {"name": "cmd_ang", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for cmd_ang in [0,30,45]:\n self.thok.servo.move_angle(math.radians(cmd_ang))\n cvim = self.cam.get_frame()\n cvim = self.cam.get_frame()\n im_list.append(uto.cv2np(cvim,format='BGR'))\n p_list.append(self.thok.servo.read_angle())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L466_C12", "label": "move_angle()", "type": "expression", "loc": [466, 466], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:For_L465_C8", "vector": [8, 3, 0.6893, 0.0015, 3, 0.54, 0.0, 293, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "move_angle", "arg_names": [], "import_names": [], "rhs_call_name": "move_angle", "annotation": ""}, "snippet": " self.thok.servo.move_angle(math.radians(cmd_ang))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L467_C12", "label": "cvim = get_frame()", "type": "assigned_variable", "loc": [467, 467], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:For_L465_C8", "vector": [14, 3, 0.6908, 0.0015, 3, 0.54, 0.25, 758, 3, 0, 0, 0, 489, 10, 1], "semantic": {"name": "cvim", "arg_names": [], "import_names": [], "rhs_call_name": "get_frame", "annotation": ""}, "snippet": " cvim = self.cam.get_frame()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L468_C12", "label": "cvim = get_frame()", "type": "assigned_variable", "loc": [468, 468], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:For_L465_C8", "vector": [14, 3, 0.6923, 0.0015, 3, 0.54, 0.5, 758, 3, 0, 0, 0, 489, 10, 1], "semantic": {"name": "cvim", "arg_names": [], "import_names": [], "rhs_call_name": "get_frame", "annotation": ""}, "snippet": " cvim = self.cam.get_frame()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L469_C12", "label": "append()", "type": "expression", "loc": [469, 469], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:For_L465_C8", "vector": [8, 3, 0.6938, 0.0015, 3, 0.54, 0.75, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " im_list.append(uto.cv2np(cvim,format='BGR'))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L470_C12", "label": "append()", "type": "expression", "loc": [470, 470], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:For_L465_C8", "vector": [8, 3, 0.6953, 0.0015, 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": " p_list.append(self.thok.servo.read_angle())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L472_C8", "label": "move_angle()", "type": "expression", "loc": [472, 472], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L457_C4", "vector": [8, 2, 0.6982, 0.0015, 2, 0.06, 0.8, 293, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "move_angle", "arg_names": [], "import_names": [], "rhs_call_name": "move_angle", "annotation": ""}, "snippet": " self.thok.servo.move_angle(math.radians(0))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Return_L473_C8", "label": "return", "type": "return", "loc": [473, 473], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L457_C4", "vector": [13, 2, 0.6997, 0.0015, 2, 0.06, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return p_list,im_list"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L475_C0", "label": "test_IK", "type": "function", "loc": [475, 493], "level": 0, "parent": null, "vector": [2, 0, 0.716, 0.0281, 0, 0.66, 0.8947, 40, 0, 1, 0, 0, 0, 0, 13], "semantic": {"name": "test_IK", "arg_names": ["rot_mat"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def test_IK(rot_mat):\n ''' try out the IK at a number of different cartesian\n points in the workspace, with the given rotation\n matrix for the end effector.\n '''\n print('press ENTER to start.')\n k=m3t.get_keystroke()\n while k=='\\r':"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L476_C4", "label": "expression", "type": "expression", "loc": [476, 479], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L475_C0", "vector": [8, 1, 0.7064, 0.0059, 1, 0.12, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' try out the IK at a number of different cartesian\n points in the workspace, with the given rotation\n matrix for the end effector.\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L480_C4", "label": "print()", "type": "expression", "loc": [480, 480], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L475_C0", "vector": [8, 1, 0.7101, 0.0015, 1, 0.12, 0.3333, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('press ENTER to start.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L481_C4", "label": "k = get_keystroke()", "type": "assigned_variable", "loc": [481, 481], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L475_C0", "vector": [14, 1, 0.7115, 0.0015, 1, 0.12, 0.6667, 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_99548:While_L482_C4", "label": "while", "type": "while", "loc": [482, 493], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L475_C0", "vector": [5, 1, 0.7212, 0.0178, 1, 0.12, 1.0, 0, 0, 0, 0, 0, 0, 0, 11], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while k=='\\r':\n p = firenze.end_effector_pos('right_arm')\n firenze.go_cartesian('right_arm',p,rot_mat,speed=0.1)\n firenze.step()\n print('press ENTER to save joint angles.')\n k=m3t.get_keystroke()\n if k == '\\r':\n firenze.step()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L483_C8", "label": "p = end_effector_pos()", "type": "assigned_variable", "loc": [483, 483], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:While_L482_C4", "vector": [14, 2, 0.7145, 0.0015, 2, 0.77, 0.0, 491, 3, 1, 0, 0, 889, 10, 1], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "end_effector_pos", "annotation": ""}, "snippet": " p = firenze.end_effector_pos('right_arm')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L484_C8", "label": "go_cartesian()", "type": "expression", "loc": [484, 484], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:While_L482_C4", "vector": [8, 2, 0.716, 0.0015, 2, 0.77, 0.1429, 840, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "go_cartesian", "arg_names": [], "import_names": [], "rhs_call_name": "go_cartesian", "annotation": ""}, "snippet": " firenze.go_cartesian('right_arm',p,rot_mat,speed=0.1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L485_C8", "label": "step()", "type": "expression", "loc": [485, 485], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:While_L482_C4", "vector": [8, 2, 0.7175, 0.0015, 2, 0.77, 0.2857, 880, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "step", "arg_names": [], "import_names": [], "rhs_call_name": "step", "annotation": ""}, "snippet": " firenze.step()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L486_C8", "label": "print()", "type": "expression", "loc": [486, 486], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:While_L482_C4", "vector": [8, 2, 0.7189, 0.0015, 2, 0.77, 0.4286, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('press ENTER to save joint angles.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L487_C8", "label": "k = get_keystroke()", "type": "assigned_variable", "loc": [487, 487], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:While_L482_C4", "vector": [14, 2, 0.7204, 0.0015, 2, 0.77, 0.5714, 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_99548:If_L488_C8", "label": "if", "type": "if", "loc": [488, 491], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:While_L482_C4", "vector": [4, 2, 0.7241, 0.0059, 2, 0.77, 0.7143, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if k == '\\r':\n firenze.step()\n q = firenze.get_joint_angles('right_arm')\n ut.save_pickle(q,'arm_config_'+ut.formatted_time()+'.pkl')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L489_C12", "label": "step()", "type": "expression", "loc": [489, 489], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L488_C8", "vector": [8, 3, 0.7234, 0.0015, 3, 0.48, 0.0, 880, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "step", "arg_names": [], "import_names": [], "rhs_call_name": "step", "annotation": ""}, "snippet": " firenze.step()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L490_C12", "label": "q = get_joint_angles()", "type": "assigned_variable", "loc": [490, 490], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L488_C8", "vector": [14, 3, 0.7249, 0.0015, 3, 0.48, 0.5, 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('right_arm')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L491_C12", "label": "save_pickle()", "type": "expression", "loc": [491, 491], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L488_C8", "vector": [8, 3, 0.7263, 0.0015, 3, 0.48, 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(q,'arm_config_'+ut.formatted_time()+'.pkl')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L492_C8", "label": "print()", "type": "expression", "loc": [492, 492], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:While_L482_C4", "vector": [8, 2, 0.7278, 0.0015, 2, 0.77, 0.8571, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('press ENTER for next IK test. something else to exit.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L493_C8", "label": "k = get_keystroke()", "type": "assigned_variable", "loc": [493, 493], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:While_L482_C4", "vector": [14, 2, 0.7293, 0.0015, 2, 0.77, 1.0, 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_99548:FunctionDef_L495_C0", "label": "test_elbow_angle", "type": "function", "loc": [495, 512], "level": 0, "parent": null, "vector": [2, 0, 0.7448, 0.0266, 0, 0.66, 0.9474, 801, 0, 0, 0, 0, 0, 0, 13], "semantic": {"name": "test_elbow_angle", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def test_elbow_angle():\n firenze = hr.M3HrlRobot(connect=False)\n hook_3dprint_angle = math.radians(20-2.54)\n rot_mat = tr.Rz(math.radians(-90.)-hook_3dprint_angle)*tr.Ry(math.radians(-90))\n\n x_list = [0.55,0.45,0.35]\n y = -0.2\n z = -0.23"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L496_C4", "label": "firenze = M3HrlRobot()", "type": "assigned_variable", "loc": [496, 496], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L495_C0", "vector": [14, 1, 0.7337, 0.0015, 1, 0.27, 0.0, 736, 3, 1, 0, 0, 305, 10, 1], "semantic": {"name": "firenze", "arg_names": [], "import_names": [], "rhs_call_name": "M3HrlRobot", "annotation": ""}, "snippet": " firenze = hr.M3HrlRobot(connect=False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L497_C4", "label": "hook_3dprint_angle = radians()", "type": "assigned_variable", "loc": [497, 497], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L495_C0", "vector": [14, 1, 0.7352, 0.0015, 1, 0.27, 0.1667, 460, 3, 1, 0, 0, 383, 10, 1], "semantic": {"name": "hook_3dprint_angle", "arg_names": [], "import_names": [], "rhs_call_name": "radians", "annotation": ""}, "snippet": " hook_3dprint_angle = math.radians(20-2.54)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L498_C4", "label": "rot_mat =", "type": "assigned_variable", "loc": [498, 498], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L495_C0", "vector": [14, 1, 0.7367, 0.0015, 1, 0.27, 0.3333, 968, 4, 0, 0, 0, 0, 0, 4], "semantic": {"name": "rot_mat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rot_mat = tr.Rz(math.radians(-90.)-hook_3dprint_angle)*tr.Ry(math.radians(-90))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L500_C4", "label": "x_list =", "type": "assigned_variable", "loc": [500, 500], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L495_C0", "vector": [14, 1, 0.7396, 0.0015, 1, 0.27, 0.5, 154, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "x_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " x_list = [0.55,0.45,0.35]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L501_C4", "label": "y =", "type": "assigned_variable", "loc": [501, 501], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L495_C0", "vector": [14, 1, 0.7411, 0.0015, 1, 0.27, 0.6667, 304, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " y = -0.2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L502_C4", "label": "z =", "type": "assigned_variable", "loc": [502, 502], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L495_C0", "vector": [14, 1, 0.7426, 0.0015, 1, 0.27, 0.8333, 859, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " z = -0.23"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:For_L503_C4", "label": "for x", "type": "for", "loc": [503, 512], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L495_C0", "vector": [6, 1, 0.7507, 0.0148, 1, 0.27, 1.0, 190, 2, 0, 0, 0, 0, 0, 7], "semantic": {"name": "x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for x in x_list:\n p0 = np.matrix([x,y,z]).T\n q = firenze.IK('right_arm',p0,rot_mat)\n# q[1] = math.radians(15)\n# q = firenze.IK('right_arm',p0,rot_mat,q_guess = q)\n elbow_angle = firenze.elbow_plane_angle('right_arm',q)\n print('---------------------------------------')\n print('ee position:', p0.A1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L504_C8", "label": "p0 =", "type": "assigned_variable", "loc": [504, 504], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:For_L503_C4", "vector": [14, 2, 0.7456, 0.0015, 2, 0.93, 0.0, 477, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "p0", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p0 = np.matrix([x,y,z]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L505_C8", "label": "q = IK()", "type": "assigned_variable", "loc": [505, 505], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:For_L503_C4", "vector": [14, 2, 0.747, 0.0015, 2, 0.93, 0.2, 516, 3, 3, 0, 0, 719, 10, 1], "semantic": {"name": "q", "arg_names": [], "import_names": [], "rhs_call_name": "IK", "annotation": ""}, "snippet": " q = firenze.IK('right_arm',p0,rot_mat)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L508_C8", "label": "elbow_angle = elbow_plane_angle()", "type": "assigned_variable", "loc": [508, 508], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:For_L503_C4", "vector": [14, 2, 0.7515, 0.0015, 2, 0.93, 0.4, 278, 3, 2, 0, 0, 59, 10, 1], "semantic": {"name": "elbow_angle", "arg_names": [], "import_names": [], "rhs_call_name": "elbow_plane_angle", "annotation": ""}, "snippet": " elbow_angle = firenze.elbow_plane_angle('right_arm',q)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L509_C8", "label": "print()", "type": "expression", "loc": [509, 509], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:For_L503_C4", "vector": [8, 2, 0.753, 0.0015, 2, 0.93, 0.6, 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_99548:Expr_L510_C8", "label": "print()", "type": "expression", "loc": [510, 510], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:For_L503_C4", "vector": [8, 2, 0.7544, 0.0015, 2, 0.93, 0.8, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('ee position:', p0.A1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L512_C8", "label": "print()", "type": "expression", "loc": [512, 512], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:For_L503_C4", "vector": [8, 2, 0.7574, 0.0015, 2, 0.93, 1.0, 535, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('elbow_angle:', math.degrees(elbow_angle))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L516_C0", "label": "if", "type": "if", "loc": [516, 673], "level": 0, "parent": null, "vector": [4, 0, 0.8794, 0.2337, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 79], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__=='__main__':\n\n p = optparse.OptionParser()\n p.add_option('--ik_single_pos', action='store_true', dest='ik_single_pos',\n help='test IK at a single position.')\n p.add_option('--ik_test', action='store_true', dest='ik_test',\n help='test IK in a loop.')\n p.add_option('--pull', action='store_true', dest='pull',"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L518_C4", "label": "p = OptionParser()", "type": "assigned_variable", "loc": [518, 518], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L516_C0", "vector": [14, 1, 0.7663, 0.0015, 1, 0.87, 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_99548:Expr_L519_C4", "label": "add_option()", "type": "expression", "loc": [519, 520], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L516_C0", "vector": [8, 1, 0.7685, 0.003, 1, 0.87, 0.0385, 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('--ik_single_pos', action='store_true', dest='ik_single_pos',\n help='test IK at a single position.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L521_C4", "label": "add_option()", "type": "expression", "loc": [521, 522], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L516_C0", "vector": [8, 1, 0.7714, 0.003, 1, 0.87, 0.0769, 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('--ik_test', action='store_true', dest='ik_test',\n help='test IK in a loop.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L523_C4", "label": "add_option()", "type": "expression", "loc": [523, 524], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L516_C0", "vector": [8, 1, 0.7744, 0.003, 1, 0.87, 0.1154, 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('--pull', action='store_true', dest='pull',\n help='pull with hook up (name will be changed later).')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L525_C4", "label": "add_option()", "type": "expression", "loc": [525, 526], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L516_C0", "vector": [8, 1, 0.7774, 0.003, 1, 0.87, 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('--pull_pos', action='store', type='string', dest='pull_pos_pkl',\n help='pkl file with 3D coord of point to start pulling at.', default='')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L527_C4", "label": "add_option()", "type": "expression", "loc": [527, 528], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L516_C0", "vector": [8, 1, 0.7803, 0.003, 1, 0.87, 0.1923, 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('--firm_hook', action='store_true', dest='firm_hook',\n help='test getting a firm hook on things.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L529_C4", "label": "add_option()", "type": "expression", "loc": [529, 530], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L516_C0", "vector": [8, 1, 0.7833, 0.003, 1, 0.87, 0.2308, 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('--scan', action='store_true', dest='scan',\n help='take and save 3D scans. specify --pull also.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L531_C4", "label": "add_option()", "type": "expression", "loc": [531, 532], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L516_C0", "vector": [8, 1, 0.7862, 0.003, 1, 0.87, 0.2692, 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('--camera', action='store_true', dest='camera',\n help='take and save images from UTM camera. specify --pull also.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L533_C4", "label": "add_option()", "type": "expression", "loc": [533, 534], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L516_C0", "vector": [8, 1, 0.7892, 0.003, 1, 0.87, 0.3077, 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('--ha', action='store', dest='ha',type='float',\n default=None,help='hook angle (degrees).')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L535_C4", "label": "add_option()", "type": "expression", "loc": [535, 536], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L516_C0", "vector": [8, 1, 0.7922, 0.003, 1, 0.87, 0.3462, 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('--ft', action='store', dest='ft',type='float',\n default=None,help='force threshold (Newtons).')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L537_C4", "label": "add_option()", "type": "expression", "loc": [537, 538], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L516_C0", "vector": [8, 1, 0.7951, 0.003, 1, 0.87, 0.3846, 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('--info', action='store', type='string', dest='info_string',\n help='string to save in the pkl log.', default='')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L539_C4", "label": "add_option()", "type": "expression", "loc": [539, 540], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L516_C0", "vector": [8, 1, 0.7981, 0.003, 1, 0.87, 0.4231, 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('--ve', action='store_true', dest='ve',\n help='vary experiment. (vary stiffness settings and repeatedly pull)')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L541_C4", "label": "add_option()", "type": "expression", "loc": [541, 542], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L516_C0", "vector": [8, 1, 0.801, 0.003, 1, 0.87, 0.4615, 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('--eaf', action='store_true', dest='eaf',\n help='test elbow angle finding with the horizontal plane.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L544_C4", "label": "opt, args = parse_args()", "type": "assigned_variable", "loc": [544, 544], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L516_C0", "vector": [14, 1, 0.8047, 0.0015, 1, 0.87, 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_99548:Assign_L545_C4", "label": "ik_single_pos_flag =", "type": "assigned_variable", "loc": [545, 545], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L516_C0", "vector": [14, 1, 0.8062, 0.0015, 1, 0.87, 0.5385, 174, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ik_single_pos_flag", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ik_single_pos_flag = opt.ik_single_pos"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L546_C4", "label": "test_ik_flag =", "type": "assigned_variable", "loc": [546, 546], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L516_C0", "vector": [14, 1, 0.8077, 0.0015, 1, 0.87, 0.5769, 185, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "test_ik_flag", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " test_ik_flag = opt.ik_test"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L547_C4", "label": "pull_flag =", "type": "assigned_variable", "loc": [547, 547], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L516_C0", "vector": [14, 1, 0.8092, 0.0015, 1, 0.87, 0.6154, 786, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pull_flag", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pull_flag = opt.pull"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L548_C4", "label": "pull_pos_pkl =", "type": "assigned_variable", "loc": [548, 548], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L516_C0", "vector": [14, 1, 0.8107, 0.0015, 1, 0.87, 0.6538, 541, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pull_pos_pkl", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pull_pos_pkl = opt.pull_pos_pkl"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L549_C4", "label": "firm_hook_flag =", "type": "assigned_variable", "loc": [549, 549], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L516_C0", "vector": [14, 1, 0.8121, 0.0015, 1, 0.87, 0.6923, 208, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "firm_hook_flag", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " firm_hook_flag = opt.firm_hook"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L550_C4", "label": "scan_flag =", "type": "assigned_variable", "loc": [550, 550], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L516_C0", "vector": [14, 1, 0.8136, 0.0015, 1, 0.87, 0.7308, 915, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "scan_flag", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " scan_flag = opt.scan"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L551_C4", "label": "camera_flag =", "type": "assigned_variable", "loc": [551, 551], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L516_C0", "vector": [14, 1, 0.8151, 0.0015, 1, 0.87, 0.7692, 965, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "camera_flag", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " camera_flag = opt.camera"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L552_C4", "label": "ha =", "type": "assigned_variable", "loc": [552, 552], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L516_C0", "vector": [14, 1, 0.8166, 0.0015, 1, 0.87, 0.8077, 499, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ha", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ha = opt.ha"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L553_C4", "label": "ft =", "type": "assigned_variable", "loc": [553, 553], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L516_C0", "vector": [14, 1, 0.818, 0.0015, 1, 0.87, 0.8462, 505, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ft", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ft = opt.ft"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L554_C4", "label": "info_string =", "type": "assigned_variable", "loc": [554, 554], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L516_C0", "vector": [14, 1, 0.8195, 0.0015, 1, 0.87, 0.8846, 986, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "info_string", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " info_string = opt.info_string"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L555_C4", "label": "vary_expt_flag =", "type": "assigned_variable", "loc": [555, 555], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L516_C0", "vector": [14, 1, 0.821, 0.0015, 1, 0.87, 0.9231, 532, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "vary_expt_flag", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " vary_expt_flag = opt.ve"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L556_C4", "label": "elbow_angle_flag =", "type": "assigned_variable", "loc": [556, 556], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L516_C0", "vector": [14, 1, 0.8225, 0.0015, 1, 0.87, 0.9615, 566, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "elbow_angle_flag", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elbow_angle_flag = opt.eaf"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Try_L558_C4", "label": "try", "type": "try", "loc": [558, 673], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L516_C0", "vector": [7, 1, 0.9105, 0.1716, 1, 0.87, 1.0, 0, 0, 1, 0, 0, 0, 0, 65], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n if vary_expt_flag:\n stiff_scale_list = [1.0,1.2,0.8]\n if pull_pos_pkl != '':\n pull_loc = ut.load_pickle(pull_pos_pkl)\n else:\n raise RuntimeError('Need to specify a pull_pos with vary_expt')\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L559_C8", "label": "if", "type": "if", "loc": [559, 588], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:Try_L558_C4", "vector": [4, 2, 0.8484, 0.0444, 2, 0.03, 0.0, 0, 2, 0, 0, 0, 0, 0, 16], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if vary_expt_flag:\n stiff_scale_list = [1.0,1.2,0.8]\n if pull_pos_pkl != '':\n pull_loc = ut.load_pickle(pull_pos_pkl)\n else:\n raise RuntimeError('Need to specify a pull_pos with vary_expt')\n\n cmg = CompliantMotionGenerator()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L560_C12", "label": "stiff_scale_list =", "type": "assigned_variable", "loc": [560, 560], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L559_C8", "vector": [14, 3, 0.8284, 0.0015, 3, 0.29, 0.0, 525, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "stiff_scale_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " stiff_scale_list = [1.0,1.2,0.8]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L561_C12", "label": "if", "type": "if", "loc": [561, 564], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L559_C8", "vector": [4, 3, 0.8321, 0.0059, 3, 0.29, 0.1, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if pull_pos_pkl != '':\n pull_loc = ut.load_pickle(pull_pos_pkl)\n else:\n raise RuntimeError('Need to specify a pull_pos with vary_expt')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L562_C16", "label": "pull_loc = load_pickle()", "type": "assigned_variable", "loc": [562, 562], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L561_C12", "vector": [14, 4, 0.8314, 0.0015, 4, 0.88, 0.0, 640, 3, 1, 0, 0, 65, 10, 1], "semantic": {"name": "pull_loc", "arg_names": [], "import_names": [], "rhs_call_name": "load_pickle", "annotation": ""}, "snippet": " pull_loc = ut.load_pickle(pull_pos_pkl)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L566_C12", "label": "cmg = CompliantMotionGenerator()", "type": "assigned_variable", "loc": [566, 566], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L559_C8", "vector": [14, 3, 0.8373, 0.0015, 3, 0.29, 0.2, 440, 3, 0, 0, 0, 257, 10, 1], "semantic": {"name": "cmg", "arg_names": [], "import_names": [], "rhs_call_name": "CompliantMotionGenerator", "annotation": ""}, "snippet": " cmg = CompliantMotionGenerator()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L567_C12", "label": "print()", "type": "expression", "loc": [567, 567], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L559_C8", "vector": [8, 3, 0.8388, 0.0015, 3, 0.29, 0.3, 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 power up the arms.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L568_C12", "label": "k = get_keystroke()", "type": "assigned_variable", "loc": [568, 568], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L559_C8", "vector": [14, 3, 0.8402, 0.0015, 3, 0.29, 0.4, 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_99548:Expr_L569_C12", "label": "power_on()", "type": "expression", "loc": [569, 569], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L559_C8", "vector": [8, 3, 0.8417, 0.0015, 3, 0.29, 0.5, 777, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "power_on", "arg_names": [], "import_names": [], "rhs_call_name": "power_on", "annotation": ""}, "snippet": " cmg.firenze.power_on()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:For_L572_C12", "label": "for strategy", "type": "for", "loc": [572, 582], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L559_C8", "vector": [6, 3, 0.8536, 0.0163, 3, 0.29, 0.6, 352, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "strategy", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for strategy in ['line_neg_x','control_radial_dist','control_radial_force']:\n #for strategy in ['line_neg_x']:\n #for strategy in ['piecewise_linear']:\n for s_scale in stiff_scale_list:\n cmg.settings_r.stiffness_scale = s_scale\n cmg.pull(math.radians(ha), ft,use_utm=scan_flag,use_camera=camera_flag,\n strategy=strategy,pull_loc=pull_loc,info_string=info_string)\n cmg.firenze.maintain_configuration()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:For_L575_C16", "label": "for s_scale", "type": "for", "loc": [575, 582], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:For_L572_C12", "vector": [6, 4, 0.8558, 0.0118, 4, 0.31, 0.0, 389, 2, 0, 0, 0, 0, 0, 6], "semantic": {"name": "s_scale", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for s_scale in stiff_scale_list:\n cmg.settings_r.stiffness_scale = s_scale\n cmg.pull(math.radians(ha), ft,use_utm=scan_flag,use_camera=camera_flag,\n strategy=strategy,pull_loc=pull_loc,info_string=info_string)\n cmg.firenze.maintain_configuration()\n cmg.firenze.motors_on()\n cmg.firenze.set_arm_settings(cmg.settings_stiff,None)\n time.sleep(0.5)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L576_C20", "label": "cmg.settings_r.stiffness_scale =", "type": "assigned_variable", "loc": [576, 576], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:For_L575_C16", "vector": [14, 5, 0.8521, 0.0015, 5, 0.55, 0.0, 562, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "cmg.settings_r.stiffness_scale", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cmg.settings_r.stiffness_scale = s_scale"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L577_C20", "label": "pull()", "type": "expression", "loc": [577, 578], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:For_L575_C16", "vector": [8, 5, 0.8543, 0.003, 5, 0.55, 0.2, 964, 3, 7, 0, 0, 0, 0, 2], "semantic": {"name": "pull", "arg_names": [], "import_names": [], "rhs_call_name": "pull", "annotation": ""}, "snippet": " cmg.pull(math.radians(ha), ft,use_utm=scan_flag,use_camera=camera_flag,\n strategy=strategy,pull_loc=pull_loc,info_string=info_string)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L579_C20", "label": "maintain_configuration()", "type": "expression", "loc": [579, 579], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:For_L575_C16", "vector": [8, 5, 0.8565, 0.0015, 5, 0.55, 0.4, 171, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "maintain_configuration", "arg_names": [], "import_names": [], "rhs_call_name": "maintain_configuration", "annotation": ""}, "snippet": " cmg.firenze.maintain_configuration()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L580_C20", "label": "motors_on()", "type": "expression", "loc": [580, 580], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:For_L575_C16", "vector": [8, 5, 0.858, 0.0015, 5, 0.55, 0.6, 466, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "motors_on", "arg_names": [], "import_names": [], "rhs_call_name": "motors_on", "annotation": ""}, "snippet": " cmg.firenze.motors_on()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L581_C20", "label": "set_arm_settings()", "type": "expression", "loc": [581, 581], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:For_L575_C16", "vector": [8, 5, 0.8595, 0.0015, 5, 0.55, 0.8, 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": " cmg.firenze.set_arm_settings(cmg.settings_stiff,None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L582_C20", "label": "sleep()", "type": "expression", "loc": [582, 582], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:For_L575_C16", "vector": [8, 5, 0.8609, 0.0015, 5, 0.55, 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.5)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L584_C12", "label": "print()", "type": "expression", "loc": [584, 584], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L559_C8", "vector": [8, 3, 0.8639, 0.0015, 3, 0.29, 0.7, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('hit a key to end everything')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L585_C12", "label": "k = get_keystroke()", "type": "assigned_variable", "loc": [585, 585], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L559_C8", "vector": [14, 3, 0.8654, 0.0015, 3, 0.29, 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_99548:Expr_L586_C12", "label": "stop()", "type": "expression", "loc": [586, 586], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L559_C8", "vector": [8, 3, 0.8669, 0.0015, 3, 0.29, 0.9, 343, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "stop", "annotation": ""}, "snippet": " cmg.firenze.stop()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L588_C12", "label": "exit()", "type": "expression", "loc": [588, 588], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L559_C8", "vector": [8, 3, 0.8698, 0.0015, 3, 0.29, 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_99548:If_L590_C8", "label": "if", "type": "if", "loc": [590, 633], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:Try_L558_C4", "vector": [4, 2, 0.9046, 0.0651, 2, 0.03, 0.3333, 0, 0, 0, 0, 0, 0, 0, 25], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if pull_flag or firm_hook_flag:\n if ha == None:\n print('please specify hook angle (--ha)')\n print('Exiting...')\n sys.exit()\n\n if ft == None and pull_flag:\n print('please specify force threshold (--ft) along with --pull')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L591_C12", "label": "if", "type": "if", "loc": [591, 594], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L590_C8", "vector": [4, 3, 0.8765, 0.0059, 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 ha == None:\n print('please specify hook angle (--ha)')\n print('Exiting...')\n sys.exit()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L592_C16", "label": "print()", "type": "expression", "loc": [592, 592], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L591_C12", "vector": [8, 4, 0.8757, 0.0015, 4, 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('please specify hook angle (--ha)')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L593_C16", "label": "print()", "type": "expression", "loc": [593, 593], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L591_C12", "vector": [8, 4, 0.8772, 0.0015, 4, 0.03, 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_99548:Expr_L594_C16", "label": "exit()", "type": "expression", "loc": [594, 594], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L591_C12", "vector": [8, 4, 0.8787, 0.0015, 4, 0.03, 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_99548:If_L596_C12", "label": "if", "type": "if", "loc": [596, 599], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L590_C8", "vector": [4, 3, 0.8839, 0.0059, 3, 0.04, 0.1, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if ft == None and pull_flag:\n print('please specify force threshold (--ft) along with --pull')\n print('Exiting...')\n sys.exit()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L597_C16", "label": "print()", "type": "expression", "loc": [597, 597], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L596_C12", "vector": [8, 4, 0.8831, 0.0015, 4, 0.49, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('please specify force threshold (--ft) along with --pull')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L598_C16", "label": "print()", "type": "expression", "loc": [598, 598], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L596_C12", "vector": [8, 4, 0.8846, 0.0015, 4, 0.49, 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_99548:Expr_L599_C16", "label": "exit()", "type": "expression", "loc": [599, 599], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L596_C12", "vector": [8, 4, 0.8861, 0.0015, 4, 0.49, 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_99548:Assign_L601_C12", "label": "cmg = CompliantMotionGenerator()", "type": "assigned_variable", "loc": [601, 601], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L590_C8", "vector": [14, 3, 0.8891, 0.0015, 3, 0.04, 0.2, 440, 3, 0, 0, 0, 257, 10, 1], "semantic": {"name": "cmg", "arg_names": [], "import_names": [], "rhs_call_name": "CompliantMotionGenerator", "annotation": ""}, "snippet": " cmg = CompliantMotionGenerator()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L603_C12", "label": "print()", "type": "expression", "loc": [603, 603], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L590_C8", "vector": [8, 3, 0.892, 0.0015, 3, 0.04, 0.3, 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 power up the arms.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L604_C12", "label": "k = get_keystroke()", "type": "assigned_variable", "loc": [604, 604], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L590_C8", "vector": [14, 3, 0.8935, 0.0015, 3, 0.04, 0.4, 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_99548:Expr_L605_C12", "label": "power_on()", "type": "expression", "loc": [605, 605], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L590_C8", "vector": [8, 3, 0.895, 0.0015, 3, 0.04, 0.5, 777, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "power_on", "arg_names": [], "import_names": [], "rhs_call_name": "power_on", "annotation": ""}, "snippet": " cmg.firenze.power_on()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L607_C12", "label": "if", "type": "if", "loc": [607, 618], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L590_C8", "vector": [4, 3, 0.9061, 0.0178, 3, 0.04, 0.6, 0, 2, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if pull_flag:\n if pull_pos_pkl != '':\n pull_loc = ut.load_pickle(pull_pos_pkl)\n else:\n pull_loc = None\n\n # cmg.pull(math.radians(ha), ft,use_utm=scan_flag,use_camera=camera_flag,\n # strategy = 'control_radial_dist',pull_loc=pull_loc,info_string=info_string)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L608_C16", "label": "if", "type": "if", "loc": [608, 611], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L607_C12", "vector": [4, 4, 0.9016, 0.0059, 4, 0.19, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if pull_pos_pkl != '':\n pull_loc = ut.load_pickle(pull_pos_pkl)\n else:\n pull_loc = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L609_C20", "label": "pull_loc = load_pickle()", "type": "assigned_variable", "loc": [609, 609], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L608_C16", "vector": [14, 5, 0.9009, 0.0015, 5, 0.19, 0.0, 640, 3, 1, 0, 0, 65, 10, 1], "semantic": {"name": "pull_loc", "arg_names": [], "import_names": [], "rhs_call_name": "load_pickle", "annotation": ""}, "snippet": " pull_loc = ut.load_pickle(pull_pos_pkl)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L611_C20", "label": "pull_loc =", "type": "assigned_variable", "loc": [611, 611], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L608_C16", "vector": [14, 5, 0.9038, 0.0015, 5, 0.19, 1.0, 640, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "pull_loc", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pull_loc = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L617_C16", "label": "pull()", "type": "expression", "loc": [617, 618], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L607_C12", "vector": [8, 4, 0.9135, 0.003, 4, 0.19, 1.0, 964, 3, 7, 0, 0, 0, 0, 2], "semantic": {"name": "pull", "arg_names": [], "import_names": [], "rhs_call_name": "pull", "annotation": ""}, "snippet": " cmg.pull(math.radians(ha), ft,use_utm=scan_flag,use_camera=camera_flag,\n strategy = 'control_radial_force',pull_loc=pull_loc,info_string=info_string)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L622_C12", "label": "if", "type": "if", "loc": [622, 629], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L590_C8", "vector": [4, 3, 0.9253, 0.0118, 3, 0.04, 0.7, 0, 2, 0, 0, 0, 0, 0, 9], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if firm_hook_flag:\n hook_angle = math.radians(ha)\n p = np.matrix([0.3,-0.25,-0.2]).T\n rot_mat = tr.Rz(hook_angle-hook_3dprint_angle)*tr.Ry(math.radians(-90))\n cmg.firenze.go_cartesian('right_arm',p,rot_mat,speed=0.1)\n print('hit a key to get a firm hook.')\n k=m3t.get_keystroke()\n cmg.get_firm_hook(hook_angle)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L623_C16", "label": "hook_angle = radians()", "type": "assigned_variable", "loc": [623, 623], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L622_C12", "vector": [14, 4, 0.9216, 0.0015, 4, 0.89, 0.0, 343, 3, 1, 0, 0, 383, 10, 1], "semantic": {"name": "hook_angle", "arg_names": [], "import_names": [], "rhs_call_name": "radians", "annotation": ""}, "snippet": " hook_angle = math.radians(ha)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L624_C16", "label": "p =", "type": "assigned_variable", "loc": [624, 624], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L622_C12", "vector": [14, 4, 0.9231, 0.0015, 4, 0.89, 0.1667, 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.25,-0.2]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L625_C16", "label": "rot_mat =", "type": "assigned_variable", "loc": [625, 625], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L622_C12", "vector": [14, 4, 0.9246, 0.0015, 4, 0.89, 0.3333, 968, 4, 0, 0, 0, 0, 0, 3], "semantic": {"name": "rot_mat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rot_mat = tr.Rz(hook_angle-hook_3dprint_angle)*tr.Ry(math.radians(-90))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L626_C16", "label": "go_cartesian()", "type": "expression", "loc": [626, 626], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L622_C12", "vector": [8, 4, 0.926, 0.0015, 4, 0.89, 0.5, 840, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "go_cartesian", "arg_names": [], "import_names": [], "rhs_call_name": "go_cartesian", "annotation": ""}, "snippet": " cmg.firenze.go_cartesian('right_arm',p,rot_mat,speed=0.1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L627_C16", "label": "print()", "type": "expression", "loc": [627, 627], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L622_C12", "vector": [8, 4, 0.9275, 0.0015, 4, 0.89, 0.6667, 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 get a firm hook.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L628_C16", "label": "k = get_keystroke()", "type": "assigned_variable", "loc": [628, 628], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L622_C12", "vector": [14, 4, 0.929, 0.0015, 4, 0.89, 0.8333, 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_99548:Expr_L629_C16", "label": "get_firm_hook()", "type": "expression", "loc": [629, 629], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L622_C12", "vector": [8, 4, 0.9305, 0.0015, 4, 0.89, 1.0, 674, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "get_firm_hook", "arg_names": [], "import_names": [], "rhs_call_name": "get_firm_hook", "annotation": ""}, "snippet": " cmg.get_firm_hook(hook_angle)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L631_C12", "label": "print()", "type": "expression", "loc": [631, 631], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L590_C8", "vector": [8, 3, 0.9334, 0.0015, 3, 0.04, 0.8, 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 end everything')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L632_C12", "label": "k = get_keystroke()", "type": "assigned_variable", "loc": [632, 632], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L590_C8", "vector": [14, 3, 0.9349, 0.0015, 3, 0.04, 0.9, 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_99548:Expr_L633_C12", "label": "stop()", "type": "expression", "loc": [633, 633], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L590_C8", "vector": [8, 3, 0.9364, 0.0015, 3, 0.04, 1.0, 343, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "stop", "annotation": ""}, "snippet": " cmg.stop()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L641_C8", "label": "if", "type": "if", "loc": [641, 642], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:Try_L558_C4", "vector": [4, 2, 0.949, 0.003, 2, 0.03, 0.6667, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if elbow_angle_flag:\n test_elbow_angle()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L642_C12", "label": "test_elbow_angle()", "type": "expression", "loc": [642, 642], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L641_C8", "vector": [8, 3, 0.9497, 0.0015, 3, 0.2, 0.0, 801, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "test_elbow_angle", "arg_names": [], "import_names": [], "rhs_call_name": "test_elbow_angle", "annotation": ""}, "snippet": " test_elbow_angle()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L644_C8", "label": "if", "type": "if", "loc": [644, 670], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:Try_L558_C4", "vector": [4, 2, 0.9719, 0.0399, 2, 0.03, 1.0, 0, 0, 0, 0, 0, 0, 0, 22], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if ik_single_pos_flag or test_ik_flag:\n if ha == None:\n raise RuntimeError('You need to specify a hooking angle (--ha)')\n\n settings_r = hr.MekaArmSettings(stiffness_list=[0.15,0.7,0.8,0.8,0.8])\n firenze = hr.M3HrlRobot(connect=True,right_arm_settings=settings_r)\n print('hit a key to power up the arms.')\n k=m3t.get_keystroke()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L645_C12", "label": "if", "type": "if", "loc": [645, 646], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L644_C8", "vector": [4, 3, 0.9549, 0.003, 3, 0.64, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if ha == None:\n raise RuntimeError('You need to specify a hooking angle (--ha)')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L648_C12", "label": "settings_r = MekaArmSettings()", "type": "assigned_variable", "loc": [648, 648], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L644_C8", "vector": [14, 3, 0.9586, 0.0015, 3, 0.64, 0.0714, 801, 3, 1, 0, 0, 503, 10, 1], "semantic": {"name": "settings_r", "arg_names": [], "import_names": [], "rhs_call_name": "MekaArmSettings", "annotation": ""}, "snippet": " settings_r = hr.MekaArmSettings(stiffness_list=[0.15,0.7,0.8,0.8,0.8])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L649_C12", "label": "firenze = M3HrlRobot()", "type": "assigned_variable", "loc": [649, 649], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L644_C8", "vector": [14, 3, 0.9601, 0.0015, 3, 0.64, 0.1429, 736, 3, 2, 0, 0, 305, 10, 1], "semantic": {"name": "firenze", "arg_names": [], "import_names": [], "rhs_call_name": "M3HrlRobot", "annotation": ""}, "snippet": " firenze = hr.M3HrlRobot(connect=True,right_arm_settings=settings_r)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L650_C12", "label": "print()", "type": "expression", "loc": [650, 650], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L644_C8", "vector": [8, 3, 0.9615, 0.0015, 3, 0.64, 0.2143, 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 power up the arms.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L651_C12", "label": "k = get_keystroke()", "type": "assigned_variable", "loc": [651, 651], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L644_C8", "vector": [14, 3, 0.963, 0.0015, 3, 0.64, 0.2857, 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_99548:Expr_L652_C12", "label": "power_on()", "type": "expression", "loc": [652, 652], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L644_C8", "vector": [8, 3, 0.9645, 0.0015, 3, 0.64, 0.3571, 777, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "power_on", "arg_names": [], "import_names": [], "rhs_call_name": "power_on", "annotation": ""}, "snippet": " firenze.power_on()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L654_C12", "label": "print()", "type": "expression", "loc": [654, 654], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L644_C8", "vector": [8, 3, 0.9675, 0.0015, 3, 0.64, 0.4286, 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 test IK')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L655_C12", "label": "k = get_keystroke()", "type": "assigned_variable", "loc": [655, 655], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L644_C8", "vector": [14, 3, 0.9689, 0.0015, 3, 0.64, 0.5, 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_99548:Assign_L657_C12", "label": "p =", "type": "assigned_variable", "loc": [657, 657], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L644_C8", "vector": [14, 3, 0.9719, 0.0015, 3, 0.64, 0.5714, 491, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p = np.matrix([0.45,-0.2,-0.23]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L658_C12", "label": "rot_mat =", "type": "assigned_variable", "loc": [658, 658], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L644_C8", "vector": [14, 3, 0.9734, 0.0015, 3, 0.64, 0.6429, 968, 4, 0, 0, 0, 0, 0, 4], "semantic": {"name": "rot_mat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rot_mat = tr.Rz(math.radians(ha)-hook_3dprint_angle)*tr.Ry(math.radians(-90))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L660_C12", "label": "go_cartesian()", "type": "expression", "loc": [660, 660], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L644_C8", "vector": [8, 3, 0.9763, 0.0015, 3, 0.64, 0.7143, 840, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "go_cartesian", "arg_names": [], "import_names": [], "rhs_call_name": "go_cartesian", "annotation": ""}, "snippet": " firenze.go_cartesian('right_arm',p,rot_mat,speed=0.1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L663_C12", "label": "if", "type": "if", "loc": [663, 666], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L644_C8", "vector": [4, 3, 0.983, 0.0059, 3, 0.64, 0.7857, 0, 2, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if test_ik_flag:\n rot_mat = tr.Rz(math.radians(-110))*tr.Ry(math.radians(-90))\n #rot_mat = tr.Rz(math.radians(0))*tr.Ry(math.radians(-90))\n test_IK(rot_mat)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L664_C16", "label": "rot_mat =", "type": "assigned_variable", "loc": [664, 664], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L663_C12", "vector": [14, 4, 0.9822, 0.0015, 4, 0.3, 0.0, 968, 4, 0, 0, 0, 0, 0, 4], "semantic": {"name": "rot_mat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rot_mat = tr.Rz(math.radians(-110))*tr.Ry(math.radians(-90))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L666_C16", "label": "test_IK()", "type": "expression", "loc": [666, 666], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L663_C12", "vector": [8, 4, 0.9852, 0.0015, 4, 0.3, 1.0, 40, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "test_IK", "arg_names": [], "import_names": [], "rhs_call_name": "test_IK", "annotation": ""}, "snippet": " test_IK(rot_mat)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L668_C12", "label": "print()", "type": "expression", "loc": [668, 668], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L644_C8", "vector": [8, 3, 0.9882, 0.0015, 3, 0.64, 0.8571, 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 end everything')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L669_C12", "label": "k = get_keystroke()", "type": "assigned_variable", "loc": [669, 669], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L644_C8", "vector": [14, 3, 0.9896, 0.0015, 3, 0.64, 0.9286, 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_99548:Expr_L670_C12", "label": "stop()", "type": "expression", "loc": [670, 670], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L644_C8", "vector": [8, 3, 0.9911, 0.0015, 3, 0.64, 1.0, 343, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "stop", "annotation": ""}, "snippet": " firenze.stop()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L673_C8", "label": "stop()", "type": "expression", "loc": [673, 673], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99548:Try_L558_C4", "vector": [8, 2, 0.9956, 0.0015, 2, 0.03, 0.0, 343, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "stop", "annotation": ""}, "snippet": " cmg.stop()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99548:ClassDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L55_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:ClassDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L58_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L60_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L63_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L64_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L66_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L67_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L69_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L72_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L73_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:ClassDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L75_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L75_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L76_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:ClassDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L78_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L79_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L80_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:ClassDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L85_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L85_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L86_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L85_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L87_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L85_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L89_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L89_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L90_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L89_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Return_L91_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L85_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L94_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L85_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L95_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L85_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L96_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L85_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L97_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L85_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L98_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L85_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L100_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L85_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L102_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L85_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L104_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L85_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L105_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L85_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L106_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L85_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L107_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L85_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L108_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L85_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L110_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L85_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L111_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L85_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L113_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L85_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L114_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L85_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L115_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L85_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L116_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L85_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L117_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L85_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L118_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:ClassDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L120_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L121_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L122_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L123_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L124_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:ClassDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L126_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L126_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L127_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L126_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L139_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L126_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:While_L140_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:While_L140_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L141_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:While_L140_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L142_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:While_L140_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L143_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:While_L140_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:While_L144_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:While_L144_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L145_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:While_L144_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L146_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L146_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L147_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L146_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L148_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:While_L144_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L150_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:While_L140_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L152_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:While_L140_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L154_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L126_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Return_L155_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:ClassDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L158_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L158_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L159_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L158_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L160_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L158_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L161_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L158_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L163_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L158_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L164_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L158_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L165_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L158_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L167_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L158_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L168_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L158_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L169_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L158_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L172_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L158_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L173_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L158_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L175_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L158_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L176_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L158_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L177_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:ClassDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L179_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L179_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L180_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L179_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L181_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L181_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L182_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L179_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L184_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L179_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L185_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L179_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L186_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L186_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L187_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L179_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L189_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L189_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L190_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L190_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L191_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L189_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L195_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L179_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L197_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L197_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L198_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L179_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L200_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L179_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L201_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L201_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L202_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L179_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Return_L204_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:ClassDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L206_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L206_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L207_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L206_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L208_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L206_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L210_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L206_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L211_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L206_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L212_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L206_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Return_L213_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:ClassDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L215_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L215_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L216_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L215_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L217_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L215_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:While_L219_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:While_L219_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L220_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:While_L219_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L221_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L221_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L222_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:While_L219_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L224_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:While_L219_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L225_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:While_L219_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L227_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:While_L219_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L228_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:While_L219_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L229_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:While_L219_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L230_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:While_L219_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L232_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:While_L219_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L233_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:While_L219_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L234_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:While_L219_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L236_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L215_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L238_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:ClassDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L244_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L244_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L245_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L244_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L246_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L244_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L247_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L244_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L249_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L244_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L250_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L244_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L252_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L244_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L253_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L244_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L254_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L254_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L256_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L254_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L257_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L254_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L258_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L244_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L260_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L244_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L261_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L244_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L262_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L244_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L265_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L244_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L266_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L244_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L267_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L244_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L269_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L269_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L270_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L269_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L271_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L244_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L273_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L244_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L275_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L244_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L276_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L244_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L278_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L244_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L283_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L244_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Return_L284_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:ClassDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L287_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L287_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L288_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L287_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L290_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L287_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L291_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L287_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L293_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L287_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L294_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L287_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L296_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L287_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L297_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L287_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L298_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L298_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L300_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L298_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L301_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L287_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L303_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L287_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Return_L304_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:ClassDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L309_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L309_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L310_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L309_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L313_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L309_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L314_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L309_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L318_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L309_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L319_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L309_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L321_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L309_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L322_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:ClassDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L324_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L324_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L326_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L324_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L339_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L339_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L340_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L339_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L341_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L339_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L342_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L324_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L344_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L344_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L345_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L344_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L347_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L324_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L349_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L324_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L351_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L351_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L352_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L351_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L353_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L351_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L354_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L351_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L356_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L351_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L357_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L351_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L358_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L351_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L359_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L351_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L360_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L351_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L361_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L324_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L364_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L324_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L365_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L324_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L366_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L366_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Return_L367_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L324_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L369_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L324_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L370_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L324_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L371_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L324_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L372_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L324_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L373_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L324_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L374_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L324_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L376_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L324_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L377_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L324_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L378_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L324_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L379_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L324_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L380_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L324_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L381_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L324_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L382_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L324_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L383_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L324_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L384_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L324_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L388_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L324_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L389_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L324_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L390_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L324_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L391_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L324_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L393_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L324_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L394_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L324_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L396_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L324_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L397_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L324_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L398_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L324_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L399_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L324_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L400_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L324_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L401_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L324_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L402_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L402_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L403_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L402_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L404_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L404_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L405_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L404_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L406_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L404_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L407_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L404_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L408_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L404_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L409_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L404_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L410_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L404_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L411_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L324_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L415_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L415_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L416_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L415_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L417_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L324_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L419_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L324_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L420_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L324_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L421_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L324_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L423_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L324_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L425_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L324_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L432_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L324_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L433_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L324_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L434_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L434_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L435_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L434_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L436_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L434_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L437_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L434_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L438_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L434_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L439_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L434_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L440_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L434_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L441_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L324_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L443_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L324_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L444_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L324_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L446_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:ClassDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L448_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L448_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L449_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L448_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L450_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L448_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Return_L451_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:ClassDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L453_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L453_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L454_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L453_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L455_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:ClassDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L457_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L457_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L458_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L457_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L462_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L457_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L463_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L457_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:For_L465_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:For_L465_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L466_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:For_L465_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L467_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:For_L465_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L468_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:For_L465_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L469_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:For_L465_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L470_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L457_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L472_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L457_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Return_L473_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L475_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L476_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L475_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L480_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L475_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L481_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L475_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:While_L482_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:While_L482_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L483_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:While_L482_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L484_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:While_L482_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L485_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:While_L482_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L486_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:While_L482_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L487_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:While_L482_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L488_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L488_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L489_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L488_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L490_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L488_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L491_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:While_L482_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L492_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:While_L482_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L493_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L495_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L496_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L495_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L497_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L495_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L498_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L495_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L500_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L495_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L501_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L495_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L502_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:FunctionDef_L495_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:For_L503_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:For_L503_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L504_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:For_L503_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L505_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:For_L503_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L508_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:For_L503_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L509_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:For_L503_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L510_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:For_L503_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L512_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L516_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L518_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L516_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L519_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L516_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L521_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L516_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L523_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L516_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L525_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L516_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L527_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L516_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L529_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L516_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L531_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L516_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L533_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L516_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L535_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L516_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L537_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L516_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L539_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L516_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L541_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L516_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L544_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L516_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L545_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L516_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L546_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L516_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L547_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L516_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L548_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L516_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L549_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L516_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L550_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L516_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L551_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L516_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L552_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L516_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L553_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L516_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L554_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L516_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L555_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L516_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L556_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L516_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Try_L558_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:Try_L558_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L559_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L559_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L560_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L559_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L561_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L561_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L562_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L559_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L566_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L559_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L567_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L559_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L568_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L559_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L569_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L559_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:For_L572_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:For_L572_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:For_L575_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:For_L575_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L576_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:For_L575_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L577_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:For_L575_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L579_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:For_L575_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L580_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:For_L575_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L581_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:For_L575_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L582_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L559_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L584_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L559_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L585_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L559_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L586_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L559_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L588_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:Try_L558_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L590_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L590_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L591_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L591_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L592_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L591_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L593_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L591_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L594_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L590_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L596_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L596_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L597_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L596_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L598_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L596_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L599_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L590_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L601_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L590_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L603_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L590_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L604_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L590_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L605_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L590_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L607_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L607_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L608_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L608_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L609_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L608_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L611_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L607_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L617_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L590_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L622_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L622_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L623_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L622_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L624_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L622_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L625_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L622_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L626_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L622_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L627_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L622_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L628_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L622_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L629_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L590_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L631_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L590_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L632_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L590_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L633_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:Try_L558_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L641_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L641_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L642_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:Try_L558_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L644_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L644_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L645_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L644_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L648_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L644_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L649_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L644_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L650_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L644_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L651_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L644_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L652_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L644_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L654_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L644_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L655_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L644_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L657_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L644_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L658_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L644_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L660_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L644_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L663_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L663_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L664_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L663_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L666_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L644_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L668_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L644_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Assign_L669_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:If_L644_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L670_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99548:Try_L558_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99548:Expr_L673_C8"}]
import roslib roslib.load_manifest("phantom_omni") import rospy import tf import math from geometry_msgs.msg import PoseStamped import pdb rospy.init_node("long_tip_pose_publisher") pub = rospy.Publisher('pr2_right', PoseStamped) r = rospy.Rate(60) while not rospy.is_shutdown(): ps = PoseStamped() ps.header.frame_id = 'omni1_link6' ps.header.stamp = rospy.get_rostime() ps.pose.position.x = -.134 ps.pose.position.y = 0 ps.pose.position.z = 0 q = tf.transformations.quaternion_from_euler(0, math.pi, 0) ps.pose.orientation.x = q[0] ps.pose.orientation.y = q[1] ps.pose.orientation.z = q[2] ps.pose.orientation.w = q[3] pub.publish(ps) r.sleep()
ajibawa-2023/Python-Code-Large/train/row_99549
24
30
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99549:Import_L1_C0", "label": "roslib import roslib", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0333, 0.0333, 0, 0.66, 0.0, 796, 0, 1, 0, 0, 796, 0, 0], "semantic": {"name": "roslib", "arg_names": [], "import_names": ["roslib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import roslib"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99549:Expr_L2_C0", "label": "load_manifest()", "type": "expression", "loc": [2, 2], "level": 0, "parent": null, "vector": [8, 0, 0.0667, 0.0333, 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(\"phantom_omni\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99549:Import_L3_C0", "label": "rospy import rospy", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.1, 0.0333, 0, 0.66, 0.2, 164, 0, 1, 0, 0, 164, 0, 0], "semantic": {"name": "rospy", "arg_names": [], "import_names": ["rospy"], "rhs_call_name": "", "annotation": ""}, "snippet": "import rospy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99549:Import_L4_C0", "label": "tf import tf", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.1333, 0.0333, 0, 0.66, 0.3, 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_99549:Import_L5_C0", "label": "math import math", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.1667, 0.0333, 0, 0.66, 0.4, 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_99549:ImportFrom_L7_C0", "label": "from geometry_msgs.msg import PoseStamped", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.2333, 0.0333, 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_99549:Import_L8_C0", "label": "pdb import pdb", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.2667, 0.0333, 0, 0.66, 0.6, 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_99549:Expr_L10_C0", "label": "init_node()", "type": "expression", "loc": [10, 10], "level": 0, "parent": null, "vector": [8, 0, 0.3333, 0.0333, 0, 0.66, 0.7, 463, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "init_node", "arg_names": [], "import_names": [], "rhs_call_name": "init_node", "annotation": ""}, "snippet": "rospy.init_node(\"long_tip_pose_publisher\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99549:Assign_L11_C0", "label": "pub = Publisher()", "type": "assigned_variable", "loc": [11, 11], "level": 0, "parent": null, "vector": [14, 0, 0.3667, 0.0333, 0, 0.66, 0.8, 41, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": "pub = rospy.Publisher('pr2_right', PoseStamped)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99549:Assign_L12_C0", "label": "r = Rate()", "type": "assigned_variable", "loc": [12, 12], "level": 0, "parent": null, "vector": [14, 0, 0.4, 0.0333, 0, 0.66, 0.9, 436, 3, 1, 0, 0, 543, 10, 1], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "Rate", "annotation": ""}, "snippet": "r = rospy.Rate(60)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99549:While_L14_C0", "label": "while", "type": "while", "loc": [14, 27], "level": 0, "parent": null, "vector": [5, 0, 0.6833, 0.4667, 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 ps = PoseStamped()\n ps.header.frame_id = 'omni1_link6'\n ps.header.stamp = rospy.get_rostime()\n ps.pose.position.x = -.134 \n ps.pose.position.y = 0\n ps.pose.position.z = 0\n q = tf.transformations.quaternion_from_euler(0, math.pi, 0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99549:Assign_L15_C4", "label": "ps = PoseStamped()", "type": "assigned_variable", "loc": [15, 15], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99549:While_L14_C0", "vector": [14, 1, 0.5, 0.0333, 1, 0.48, 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_99549:Assign_L16_C4", "label": "ps.header.frame_id =", "type": "assigned_variable", "loc": [16, 16], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99549:While_L14_C0", "vector": [14, 1, 0.5333, 0.0333, 1, 0.48, 0.0833, 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 = 'omni1_link6'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99549:Assign_L17_C4", "label": "ps.header.stamp = get_rostime()", "type": "assigned_variable", "loc": [17, 17], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99549:While_L14_C0", "vector": [14, 1, 0.5667, 0.0333, 1, 0.48, 0.1667, 161, 3, 0, 0, 0, 173, 10, 1], "semantic": {"name": "ps.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "get_rostime", "annotation": ""}, "snippet": " ps.header.stamp = rospy.get_rostime()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99549:Assign_L18_C4", "label": "ps.pose.position.x =", "type": "assigned_variable", "loc": [18, 18], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99549:While_L14_C0", "vector": [14, 1, 0.6, 0.0333, 1, 0.48, 0.25, 782, 0, 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 = -.134 "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99549:Assign_L19_C4", "label": "ps.pose.position.y =", "type": "assigned_variable", "loc": [19, 19], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99549:While_L14_C0", "vector": [14, 1, 0.6333, 0.0333, 1, 0.48, 0.3333, 661, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "ps.pose.position.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ps.pose.position.y = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99549:Assign_L20_C4", "label": "ps.pose.position.z =", "type": "assigned_variable", "loc": [20, 20], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99549:While_L14_C0", "vector": [14, 1, 0.6667, 0.0333, 1, 0.48, 0.4167, 771, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "ps.pose.position.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ps.pose.position.z = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99549:Assign_L21_C4", "label": "q = quaternion_from_euler()", "type": "assigned_variable", "loc": [21, 21], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99549:While_L14_C0", "vector": [14, 1, 0.7, 0.0333, 1, 0.48, 0.5, 516, 3, 3, 0, 0, 561, 10, 1], "semantic": {"name": "q", "arg_names": [], "import_names": [], "rhs_call_name": "quaternion_from_euler", "annotation": ""}, "snippet": " q = tf.transformations.quaternion_from_euler(0, math.pi, 0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99549:Assign_L22_C4", "label": "ps.pose.orientation.x =", "type": "assigned_variable", "loc": [22, 22], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99549:While_L14_C0", "vector": [14, 1, 0.7333, 0.0333, 1, 0.48, 0.5833, 628, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ps.pose.orientation.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ps.pose.orientation.x = q[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99549:Assign_L23_C4", "label": "ps.pose.orientation.y =", "type": "assigned_variable", "loc": [23, 23], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99549:While_L14_C0", "vector": [14, 1, 0.7667, 0.0333, 1, 0.48, 0.6667, 848, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ps.pose.orientation.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ps.pose.orientation.y = q[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99549:Assign_L24_C4", "label": "ps.pose.orientation.z =", "type": "assigned_variable", "loc": [24, 24], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99549:While_L14_C0", "vector": [14, 1, 0.8, 0.0333, 1, 0.48, 0.75, 126, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ps.pose.orientation.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ps.pose.orientation.z = q[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99549:Assign_L25_C4", "label": "ps.pose.orientation.w =", "type": "assigned_variable", "loc": [25, 25], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99549:While_L14_C0", "vector": [14, 1, 0.8333, 0.0333, 1, 0.48, 0.8333, 163, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ps.pose.orientation.w", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ps.pose.orientation.w = q[3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99549:Expr_L26_C4", "label": "publish()", "type": "expression", "loc": [26, 26], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99549:While_L14_C0", "vector": [8, 1, 0.8667, 0.0333, 1, 0.48, 0.9167, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " pub.publish(ps)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99549:Expr_L27_C4", "label": "sleep()", "type": "expression", "loc": [27, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99549:While_L14_C0", "vector": [8, 1, 0.9, 0.0333, 1, 0.48, 1.0, 476, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " r.sleep()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99549:While_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99549:Assign_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99549:While_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99549:Assign_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99549:While_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99549:Assign_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99549:While_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99549:Assign_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99549:While_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99549:Assign_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99549:While_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99549:Assign_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99549:While_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99549:Assign_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99549:While_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99549:Assign_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99549:While_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99549:Assign_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99549:While_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99549:Assign_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99549:While_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99549:Assign_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99549:While_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99549:Expr_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99549:While_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99549:Expr_L27_C4"}]
import roslib roslib.load_manifest("phantom_omni") import rospy import tf import tf.transformations as tr from geometry_msgs.msg import PoseStamped from geometry_msgs.msg import Pose from geometry_msgs.msg import Wrench import math import numpy as np def tf2mat(tf_trans): (trans, rot) = tf_trans return np.matrix(tr.translation_matrix(trans)) * np.matrix(tr.quaternion_matrix(rot)) def mat2pose(m): trans = tr.translation_from_matrix(m) rot = tr.quaternion_from_matrix(m) p = Pose() p.position.x = trans[0] p.position.y = trans[1] p.position.z = trans[2] p.orientation.x = rot[0] p.orientation.y = rot[1] p.orientation.z = rot[2] p.orientation.w = rot[3] return p rospy.init_node("omni_potential_well") wpub = rospy.Publisher('force_feedback', Wrench) r = rospy.Rate(100) listener = tf.TransformListener() listener.waitForTransform("/world", "/omni1_link6", rospy.Time(), rospy.Duration(4.0)) listener.waitForTransform("/world", "/sensable", rospy.Time(), rospy.Duration(4.0)) print 'running.' well_center = None angle = 0.; while not rospy.is_shutdown(): w_T_6 = tf2mat(listener.lookupTransform('/world', '/omni1_link6', rospy.Time(0))) qm = np.matrix(tr.quaternion_matrix(tr.quaternion_from_euler(0, math.pi, 0))) tm = np.matrix(tr.translation_matrix([-.134, 0, 0])) tip_6 = tm * qm tip_world = w_T_6 * tip_6 pos = np.matrix(tr.translation_from_matrix(tip_world)).T force_world = (w_T_6[0:3,0:3] * np.matrix([-2., 0, 0]).T) trans, rot = listener.lookupTransform('/sensable', '/world', rospy.Time(0)) quat_mat = np.matrix(tr.quaternion_matrix(rot)) force_sensable = quat_mat[0:3, 0:3] * force_world wr = Wrench() angle = np.radians(.3) + angle wr.force.x = force_sensable[0] wr.force.y = force_sensable[1] wr.force.z = force_sensable[2] print wr.force.z wpub.publish(wr) r.sleep() #ps = PoseStamped() #ps.header.frame_id = 'sensable' #ps.header.stamp = rospy.get_rostime() #ps.pose = mat2pose(tip_world) #pub.publish(ps) #print force_sensable.T #if well_center == None: # well_center = pos #else: # trans, rot = listener.lookupTransform('/world', '/sensable', rospy.Time(0)) # quat_mat = np.matrix(tr.quaternion_matrix(rot)) # dir = -(well_center - pos) # mag = np.linalg.norm(dir) # dir = dir / mag # mag = np.min(mag*10., 5) # print dir.T, mag # force_world = dir * mag # force_sensable = quat_mat[0:3, 0:3] * force_world # wr = Wrench() # wr.force.x = force_sensable[0] # wr.force.y = force_sensable[1] # wr.force.z = force_sensable[2] # wpub.publish(wr) #ps = PoseStamped() #ps.header.frame_id = 'world' #ps.header.stamp = rospy.get_rostime() #ps.pose = mat2pose(tip_world) #pub.publish(ps) #r.sleep() #Input force in link6's frame #Output force in omni base frame #wr = Wrench() #wr.force.x = np.random.rand()*2 - 1 #wr.force.y = np.random.rand()*2 - 1 #wr.force.z = np.random.rand()*2 - 1 #wpub.publish(wr)
ajibawa-2023/Python-Code-Large/train/row_99550
53
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_99550:Import_L1_C0", "label": "roslib import roslib", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0071, 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_99550:Expr_L2_C0", "label": "load_manifest()", "type": "expression", "loc": [2, 2], "level": 0, "parent": null, "vector": [8, 0, 0.0142, 0.0071, 0, 0.66, 0.0476, 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(\"phantom_omni\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99550:Import_L3_C0", "label": "rospy import rospy", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0213, 0.0071, 0, 0.66, 0.0952, 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_99550:Import_L4_C0", "label": "tf import tf", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0284, 0.0071, 0, 0.66, 0.1429, 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_99550:Import_L5_C0", "label": "tf.transformations import tr", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0355, 0.0071, 0, 0.66, 0.1905, 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_99550:ImportFrom_L7_C0", "label": "from geometry_msgs.msg import PoseStamped", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.0496, 0.0071, 0, 0.66, 0.2381, 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_99550:ImportFrom_L8_C0", "label": "from geometry_msgs.msg import Pose", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.0567, 0.0071, 0, 0.66, 0.2857, 951, 0, 1, 0, 0, 951, 0, 0], "semantic": {"name": "geometry_msgs.msg", "arg_names": [], "import_names": ["Pose"], "rhs_call_name": "", "annotation": ""}, "snippet": "from geometry_msgs.msg import Pose"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99550:ImportFrom_L9_C0", "label": "from geometry_msgs.msg import Wrench", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.0638, 0.0071, 0, 0.66, 0.3333, 951, 0, 1, 0, 0, 951, 0, 0], "semantic": {"name": "geometry_msgs.msg", "arg_names": [], "import_names": ["Wrench"], "rhs_call_name": "", "annotation": ""}, "snippet": "from geometry_msgs.msg import Wrench"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99550:Import_L11_C0", "label": "math import math", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.078, 0.0071, 0, 0.66, 0.381, 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_99550:Import_L12_C0", "label": "numpy import np", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.0851, 0.0071, 0, 0.66, 0.4286, 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_99550:FunctionDef_L14_C0", "label": "tf2mat", "type": "function", "loc": [14, 16], "level": 0, "parent": null, "vector": [2, 0, 0.1064, 0.0213, 0, 0.66, 0.4762, 546, 0, 1, 1, 0, 0, 0, 4], "semantic": {"name": "tf2mat", "arg_names": ["tf_trans"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def tf2mat(tf_trans):\n (trans, rot) = tf_trans\n return np.matrix(tr.translation_matrix(trans)) * np.matrix(tr.quaternion_matrix(rot))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99550:Assign_L15_C4", "label": "trans, rot =", "type": "assigned_variable", "loc": [15, 15], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99550:FunctionDef_L14_C0", "vector": [14, 1, 0.1064, 0.0071, 1, 0.12, 0.0, 330, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "trans, rot", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " (trans, rot) = tf_trans"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99550:Return_L16_C4", "label": "return", "type": "return", "loc": [16, 16], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99550:FunctionDef_L14_C0", "vector": [13, 1, 0.1135, 0.0071, 1, 0.12, 1.0, 0, 4, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return np.matrix(tr.translation_matrix(trans)) * np.matrix(tr.quaternion_matrix(rot))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99550:FunctionDef_L18_C0", "label": "mat2pose", "type": "function", "loc": [18, 29], "level": 0, "parent": null, "vector": [2, 0, 0.1667, 0.0851, 0, 0.66, 0.5238, 574, 0, 1, 1, 0, 0, 0, 3], "semantic": {"name": "mat2pose", "arg_names": ["m"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def mat2pose(m):\n trans = tr.translation_from_matrix(m)\n rot = tr.quaternion_from_matrix(m)\n p = Pose()\n p.position.x = trans[0]\n p.position.y = trans[1]\n p.position.z = trans[2]\n p.orientation.x = rot[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99550:Assign_L19_C4", "label": "trans = translation_from_matrix()", "type": "assigned_variable", "loc": [19, 19], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99550:FunctionDef_L18_C0", "vector": [14, 1, 0.1348, 0.0071, 1, 0.82, 0.0, 786, 3, 1, 0, 0, 449, 10, 1], "semantic": {"name": "trans", "arg_names": [], "import_names": [], "rhs_call_name": "translation_from_matrix", "annotation": ""}, "snippet": " trans = tr.translation_from_matrix(m)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99550:Assign_L20_C4", "label": "rot = quaternion_from_matrix()", "type": "assigned_variable", "loc": [20, 20], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99550:FunctionDef_L18_C0", "vector": [14, 1, 0.1418, 0.0071, 1, 0.82, 0.1, 812, 3, 1, 0, 0, 61, 10, 1], "semantic": {"name": "rot", "arg_names": [], "import_names": [], "rhs_call_name": "quaternion_from_matrix", "annotation": ""}, "snippet": " rot = tr.quaternion_from_matrix(m)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99550:Assign_L21_C4", "label": "p = Pose()", "type": "assigned_variable", "loc": [21, 21], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99550:FunctionDef_L18_C0", "vector": [14, 1, 0.1489, 0.0071, 1, 0.82, 0.2, 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_99550:Assign_L22_C4", "label": "p.position.x =", "type": "assigned_variable", "loc": [22, 22], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99550:FunctionDef_L18_C0", "vector": [14, 1, 0.156, 0.0071, 1, 0.82, 0.3, 581, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "p.position.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p.position.x = trans[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99550:Assign_L23_C4", "label": "p.position.y =", "type": "assigned_variable", "loc": [23, 23], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99550:FunctionDef_L18_C0", "vector": [14, 1, 0.1631, 0.0071, 1, 0.82, 0.4, 503, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "p.position.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p.position.y = trans[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99550:Assign_L24_C4", "label": "p.position.z =", "type": "assigned_variable", "loc": [24, 24], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99550:FunctionDef_L18_C0", "vector": [14, 1, 0.1702, 0.0071, 1, 0.82, 0.5, 783, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "p.position.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p.position.z = trans[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99550:Assign_L25_C4", "label": "p.orientation.x =", "type": "assigned_variable", "loc": [25, 25], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99550:FunctionDef_L18_C0", "vector": [14, 1, 0.1773, 0.0071, 1, 0.82, 0.6, 650, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "p.orientation.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p.orientation.x = rot[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99550:Assign_L26_C4", "label": "p.orientation.y =", "type": "assigned_variable", "loc": [26, 26], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99550:FunctionDef_L18_C0", "vector": [14, 1, 0.1844, 0.0071, 1, 0.82, 0.7, 991, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "p.orientation.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p.orientation.y = rot[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99550:Assign_L27_C4", "label": "p.orientation.z =", "type": "assigned_variable", "loc": [27, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99550:FunctionDef_L18_C0", "vector": [14, 1, 0.1915, 0.0071, 1, 0.82, 0.8, 10, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "p.orientation.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p.orientation.z = rot[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99550:Assign_L28_C4", "label": "p.orientation.w =", "type": "assigned_variable", "loc": [28, 28], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99550:FunctionDef_L18_C0", "vector": [14, 1, 0.1986, 0.0071, 1, 0.82, 0.9, 975, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "p.orientation.w", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p.orientation.w = rot[3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99550:Return_L29_C4", "label": "return", "type": "return", "loc": [29, 29], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99550:FunctionDef_L18_C0", "vector": [13, 1, 0.2057, 0.0071, 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 p"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99550:Expr_L31_C0", "label": "init_node()", "type": "expression", "loc": [31, 31], "level": 0, "parent": null, "vector": [8, 0, 0.2199, 0.0071, 0, 0.66, 0.5714, 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(\"omni_potential_well\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99550:Assign_L32_C0", "label": "wpub = Publisher()", "type": "assigned_variable", "loc": [32, 32], "level": 0, "parent": null, "vector": [14, 0, 0.227, 0.0071, 0, 0.66, 0.619, 292, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "wpub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": "wpub = rospy.Publisher('force_feedback', Wrench)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99550:Assign_L33_C0", "label": "r = Rate()", "type": "assigned_variable", "loc": [33, 33], "level": 0, "parent": null, "vector": [14, 0, 0.234, 0.0071, 0, 0.66, 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(100)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99550:Assign_L35_C0", "label": "listener = TransformListener()", "type": "assigned_variable", "loc": [35, 35], "level": 0, "parent": null, "vector": [14, 0, 0.2482, 0.0071, 0, 0.66, 0.7143, 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_99550:Expr_L36_C0", "label": "waitForTransform()", "type": "expression", "loc": [36, 36], "level": 0, "parent": null, "vector": [8, 0, 0.2553, 0.0071, 0, 0.66, 0.7619, 900, 3, 4, 0, 0, 0, 0, 3], "semantic": {"name": "waitForTransform", "arg_names": [], "import_names": [], "rhs_call_name": "waitForTransform", "annotation": ""}, "snippet": "listener.waitForTransform(\"/world\", \"/omni1_link6\", rospy.Time(), rospy.Duration(4.0))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99550:Expr_L37_C0", "label": "waitForTransform()", "type": "expression", "loc": [37, 37], "level": 0, "parent": null, "vector": [8, 0, 0.2624, 0.0071, 0, 0.66, 0.8095, 900, 3, 4, 0, 0, 0, 0, 3], "semantic": {"name": "waitForTransform", "arg_names": [], "import_names": [], "rhs_call_name": "waitForTransform", "annotation": ""}, "snippet": "listener.waitForTransform(\"/world\", \"/sensable\", rospy.Time(), rospy.Duration(4.0))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99550:Expr_L38_C0", "label": "print()", "type": "expression", "loc": [38, 38], "level": 0, "parent": null, "vector": [8, 0, 0.2695, 0.0071, 0, 0.66, 0.8571, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "print('running.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99550:Assign_L40_C0", "label": "well_center =", "type": "assigned_variable", "loc": [40, 40], "level": 0, "parent": null, "vector": [14, 0, 0.2837, 0.0071, 0, 0.66, 0.9048, 936, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "well_center", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "well_center = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99550:Assign_L41_C0", "label": "angle =", "type": "assigned_variable", "loc": [41, 41], "level": 0, "parent": null, "vector": [14, 0, 0.2908, 0.0071, 0, 0.66, 0.9524, 418, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "angle", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "angle = 0.;"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99550:While_L42_C0", "label": "while", "type": "while", "loc": [42, 62], "level": 0, "parent": null, "vector": [5, 0, 0.3688, 0.1489, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 21], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "while not rospy.is_shutdown():\n w_T_6 = tf2mat(listener.lookupTransform('/world', '/omni1_link6', rospy.Time(0)))\n qm = np.matrix(tr.quaternion_matrix(tr.quaternion_from_euler(0, math.pi, 0)))\n tm = np.matrix(tr.translation_matrix([-.134, 0, 0]))\n tip_6 = tm * qm\n tip_world = w_T_6 * tip_6\n pos = np.matrix(tr.translation_from_matrix(tip_world)).T\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99550:Assign_L43_C4", "label": "w_T_6 = tf2mat()", "type": "assigned_variable", "loc": [43, 43], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99550:While_L42_C0", "vector": [14, 1, 0.305, 0.0071, 1, 0.42, 0.0, 17, 3, 1, 0, 0, 546, 10, 3], "semantic": {"name": "w_T_6", "arg_names": [], "import_names": [], "rhs_call_name": "tf2mat", "annotation": ""}, "snippet": " w_T_6 = tf2mat(listener.lookupTransform('/world', '/omni1_link6', rospy.Time(0)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99550:Assign_L44_C4", "label": "qm = matrix()", "type": "assigned_variable", "loc": [44, 44], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99550:While_L42_C0", "vector": [14, 1, 0.3121, 0.0071, 1, 0.42, 0.0588, 861, 3, 1, 0, 0, 162, 10, 3], "semantic": {"name": "qm", "arg_names": [], "import_names": [], "rhs_call_name": "matrix", "annotation": ""}, "snippet": " qm = np.matrix(tr.quaternion_matrix(tr.quaternion_from_euler(0, math.pi, 0)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99550:Assign_L45_C4", "label": "tm = matrix()", "type": "assigned_variable", "loc": [45, 45], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99550:While_L42_C0", "vector": [14, 1, 0.3191, 0.0071, 1, 0.42, 0.1176, 404, 3, 1, 0, 0, 162, 10, 2], "semantic": {"name": "tm", "arg_names": [], "import_names": [], "rhs_call_name": "matrix", "annotation": ""}, "snippet": " tm = np.matrix(tr.translation_matrix([-.134, 0, 0]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99550:Assign_L46_C4", "label": "tip_6 =", "type": "assigned_variable", "loc": [46, 46], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99550:While_L42_C0", "vector": [14, 1, 0.3262, 0.0071, 1, 0.42, 0.1765, 749, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "tip_6", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tip_6 = tm * qm"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99550:Assign_L47_C4", "label": "tip_world =", "type": "assigned_variable", "loc": [47, 47], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99550:While_L42_C0", "vector": [14, 1, 0.3333, 0.0071, 1, 0.42, 0.2353, 722, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "tip_world", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tip_world = w_T_6 * tip_6"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99550:Assign_L48_C4", "label": "pos =", "type": "assigned_variable", "loc": [48, 48], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99550:While_L42_C0", "vector": [14, 1, 0.3404, 0.0071, 1, 0.42, 0.2941, 627, 7, 0, 0, 0, 0, 0, 2], "semantic": {"name": "pos", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pos = np.matrix(tr.translation_from_matrix(tip_world)).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99550:Assign_L50_C4", "label": "force_world =", "type": "assigned_variable", "loc": [50, 50], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99550:While_L42_C0", "vector": [14, 1, 0.3546, 0.0071, 1, 0.42, 0.3529, 331, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "force_world", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " force_world = (w_T_6[0:3,0:3] * np.matrix([-2., 0, 0]).T)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99550:Assign_L51_C4", "label": "trans, rot = lookupTransform()", "type": "assigned_variable", "loc": [51, 51], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99550:While_L42_C0", "vector": [14, 1, 0.3617, 0.0071, 1, 0.42, 0.4118, 330, 3, 3, 0, 0, 926, 10, 2], "semantic": {"name": "trans, rot", "arg_names": [], "import_names": [], "rhs_call_name": "lookupTransform", "annotation": ""}, "snippet": " trans, rot = listener.lookupTransform('/sensable', '/world', rospy.Time(0))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99550:Assign_L52_C4", "label": "quat_mat = matrix()", "type": "assigned_variable", "loc": [52, 52], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99550:While_L42_C0", "vector": [14, 1, 0.3688, 0.0071, 1, 0.42, 0.4706, 688, 3, 1, 0, 0, 162, 10, 2], "semantic": {"name": "quat_mat", "arg_names": [], "import_names": [], "rhs_call_name": "matrix", "annotation": ""}, "snippet": " quat_mat = np.matrix(tr.quaternion_matrix(rot))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99550:Assign_L53_C4", "label": "force_sensable =", "type": "assigned_variable", "loc": [53, 53], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99550:While_L42_C0", "vector": [14, 1, 0.3759, 0.0071, 1, 0.42, 0.5294, 849, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "force_sensable", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " force_sensable = quat_mat[0:3, 0:3] * force_world"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99550:Assign_L55_C4", "label": "wr = Wrench()", "type": "assigned_variable", "loc": [55, 55], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99550:While_L42_C0", "vector": [14, 1, 0.3901, 0.0071, 1, 0.42, 0.5882, 464, 3, 0, 0, 0, 340, 10, 1], "semantic": {"name": "wr", "arg_names": [], "import_names": [], "rhs_call_name": "Wrench", "annotation": ""}, "snippet": " wr = Wrench()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99550:Assign_L56_C4", "label": "angle =", "type": "assigned_variable", "loc": [56, 56], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99550:While_L42_C0", "vector": [14, 1, 0.3972, 0.0071, 1, 0.42, 0.6471, 418, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "angle", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " angle = np.radians(.3) + angle"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99550:Assign_L57_C4", "label": "wr.force.x =", "type": "assigned_variable", "loc": [57, 57], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99550:While_L42_C0", "vector": [14, 1, 0.4043, 0.0071, 1, 0.42, 0.7059, 650, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "wr.force.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " wr.force.x = force_sensable[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99550:Assign_L58_C4", "label": "wr.force.y =", "type": "assigned_variable", "loc": [58, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99550:While_L42_C0", "vector": [14, 1, 0.4113, 0.0071, 1, 0.42, 0.7647, 59, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "wr.force.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " wr.force.y = force_sensable[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99550:Assign_L59_C4", "label": "wr.force.z =", "type": "assigned_variable", "loc": [59, 59], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99550:While_L42_C0", "vector": [14, 1, 0.4184, 0.0071, 1, 0.42, 0.8235, 485, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "wr.force.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " wr.force.z = force_sensable[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99550:Expr_L60_C4", "label": "print()", "type": "expression", "loc": [60, 60], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99550:While_L42_C0", "vector": [8, 1, 0.4255, 0.0071, 1, 0.42, 0.8824, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(wr.force.z)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99550:Expr_L61_C4", "label": "publish()", "type": "expression", "loc": [61, 61], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99550:While_L42_C0", "vector": [8, 1, 0.4326, 0.0071, 1, 0.42, 0.9412, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " wpub.publish(wr)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99550:Expr_L62_C4", "label": "sleep()", "type": "expression", "loc": [62, 62], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99550:While_L42_C0", "vector": [8, 1, 0.4397, 0.0071, 1, 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()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99550:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99550:Assign_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99550:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99550:Return_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99550:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99550:Assign_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99550:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99550:Assign_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99550:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99550:Assign_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99550:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99550:Assign_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99550:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99550:Assign_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99550:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99550:Assign_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99550:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99550:Assign_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99550:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99550:Assign_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99550:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99550:Assign_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99550:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99550:Assign_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99550:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99550:Return_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99550:While_L42_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99550:Assign_L43_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99550:While_L42_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99550:Assign_L44_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99550:While_L42_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99550:Assign_L45_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99550:While_L42_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99550:Assign_L46_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99550:While_L42_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99550:Assign_L47_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99550:While_L42_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99550:Assign_L48_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99550:While_L42_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99550:Assign_L50_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99550:While_L42_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99550:Assign_L51_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99550:While_L42_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99550:Assign_L52_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99550:While_L42_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99550:Assign_L53_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99550:While_L42_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99550:Assign_L55_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99550:While_L42_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99550:Assign_L56_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99550:While_L42_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99550:Assign_L57_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99550:While_L42_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99550:Assign_L58_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99550:While_L42_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99550:Assign_L59_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99550:While_L42_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99550:Expr_L60_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99550:While_L42_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99550:Expr_L61_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99550:While_L42_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99550:Expr_L62_C4"}]
import roslib roslib.load_manifest("phantom_omni") import rospy import tf import tf.transformations as tr from geometry_msgs.msg import PoseStamped from geometry_msgs.msg import Pose from geometry_msgs.msg import Wrench import math import numpy as np def tf2mat(tf_trans): (trans, rot) = tf_trans return np.matrix(tr.translation_matrix(trans)) * np.matrix(tr.quaternion_matrix(rot)) def mat2pose(m): trans = tr.translation_from_matrix(m) rot = tr.quaternion_from_matrix(m) p = Pose() p.position.x = trans[0] p.position.y = trans[1] p.position.z = trans[2] p.orientation.x = rot[0] p.orientation.y = rot[1] p.orientation.z = rot[2] p.orientation.w = rot[3] return p rospy.init_node("omni_potential_well") wpub = rospy.Publisher('force_feedback', Wrench) r = rospy.Rate(1000) #listener = tf.TransformListener() #listener.waitForTransform("/world", "/omni1_link6", rospy.Time(), rospy.Duration(4.0)) #listener.waitForTransform("/world", "/sensable", rospy.Time(), rospy.Duration(4.0)) print 'running.' well_center = None angle = 0.; while not rospy.is_shutdown(): #w_T_6 = tf2mat(listener.lookupTransform('/world', '/omni1_link6', rospy.Time(0))) #qm = np.matrix(tr.quaternion_matrix(tr.quaternion_from_euler(0, math.pi, 0))) #tm = np.matrix(tr.translation_matrix([-.134, 0, 0])) #tip_6 = tm * qm #tip_world = w_T_6 * tip_6 #pos = np.matrix(tr.translation_from_matrix(tip_world)).T #force_world = (w_T_6[0:3,0:3] * np.matrix([-2., 0, 0]).T) #trans, rot = listener.lookupTransform('/sensable', '/world', rospy.Time(0)) #quat_mat = np.matrix(tr.quaternion_matrix(rot)) #force_sensable = quat_mat[0:3, 0:3] * force_world wr = Wrench() angle = np.radians(.3) + angle wr.force.x = 0#force_sensable[0] wr.force.y = 0#force_sensable[1] wr.force.z = np.sin(angle) * 3#force_sensable[2] print wr.force.z wpub.publish(wr) r.sleep() #ps = PoseStamped() #ps.header.frame_id = 'sensable' #ps.header.stamp = rospy.get_rostime() #ps.pose = mat2pose(tip_world) #pub.publish(ps) #print force_sensable.T #if well_center == None: # well_center = pos #else: # trans, rot = listener.lookupTransform('/world', '/sensable', rospy.Time(0)) # quat_mat = np.matrix(tr.quaternion_matrix(rot)) # dir = -(well_center - pos) # mag = np.linalg.norm(dir) # dir = dir / mag # mag = np.min(mag*10., 5) # print dir.T, mag # force_world = dir * mag # force_sensable = quat_mat[0:3, 0:3] * force_world # wr = Wrench() # wr.force.x = force_sensable[0] # wr.force.y = force_sensable[1] # wr.force.z = force_sensable[2] # wpub.publish(wr) #ps = PoseStamped() #ps.header.frame_id = 'world' #ps.header.stamp = rospy.get_rostime() #ps.pose = mat2pose(tip_world) #pub.publish(ps) #r.sleep() #Input force in link6's frame #Output force in omni base frame #wr = Wrench() #wr.force.x = np.random.rand()*2 - 1 #wr.force.y = np.random.rand()*2 - 1 #wr.force.z = np.random.rand()*2 - 1 #wpub.publish(wr)
ajibawa-2023/Python-Code-Large/train/row_99551
40
169
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99551:Import_L1_C0", "label": "roslib import roslib", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0059, 0.0059, 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_99551:Expr_L2_C0", "label": "load_manifest()", "type": "expression", "loc": [2, 2], "level": 0, "parent": null, "vector": [8, 0, 0.0118, 0.0059, 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(\"phantom_omni\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99551:Import_L3_C0", "label": "rospy import rospy", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0178, 0.0059, 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_99551:Import_L4_C0", "label": "tf import tf", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0237, 0.0059, 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_99551:Import_L5_C0", "label": "tf.transformations import tr", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0296, 0.0059, 0, 0.66, 0.2222, 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_99551:ImportFrom_L7_C0", "label": "from geometry_msgs.msg import PoseStamped", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.0414, 0.0059, 0, 0.66, 0.2778, 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_99551:ImportFrom_L8_C0", "label": "from geometry_msgs.msg import Pose", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.0473, 0.0059, 0, 0.66, 0.3333, 951, 0, 1, 0, 0, 951, 0, 0], "semantic": {"name": "geometry_msgs.msg", "arg_names": [], "import_names": ["Pose"], "rhs_call_name": "", "annotation": ""}, "snippet": "from geometry_msgs.msg import Pose"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99551:ImportFrom_L9_C0", "label": "from geometry_msgs.msg import Wrench", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.0533, 0.0059, 0, 0.66, 0.3889, 951, 0, 1, 0, 0, 951, 0, 0], "semantic": {"name": "geometry_msgs.msg", "arg_names": [], "import_names": ["Wrench"], "rhs_call_name": "", "annotation": ""}, "snippet": "from geometry_msgs.msg import Wrench"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99551:Import_L11_C0", "label": "math import math", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.0651, 0.0059, 0, 0.66, 0.4444, 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_99551:Import_L12_C0", "label": "numpy import np", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.071, 0.0059, 0, 0.66, 0.5, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np"], "rhs_call_name": "", "annotation": ""}, "snippet": "import numpy as np"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99551:FunctionDef_L14_C0", "label": "tf2mat", "type": "function", "loc": [14, 16], "level": 0, "parent": null, "vector": [2, 0, 0.0888, 0.0178, 0, 0.66, 0.5556, 546, 0, 1, 1, 0, 0, 0, 4], "semantic": {"name": "tf2mat", "arg_names": ["tf_trans"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def tf2mat(tf_trans):\n (trans, rot) = tf_trans\n return np.matrix(tr.translation_matrix(trans)) * np.matrix(tr.quaternion_matrix(rot))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99551:Assign_L15_C4", "label": "trans, rot =", "type": "assigned_variable", "loc": [15, 15], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99551:FunctionDef_L14_C0", "vector": [14, 1, 0.0888, 0.0059, 1, 0.29, 0.0, 330, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "trans, rot", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " (trans, rot) = tf_trans"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99551:Return_L16_C4", "label": "return", "type": "return", "loc": [16, 16], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99551:FunctionDef_L14_C0", "vector": [13, 1, 0.0947, 0.0059, 1, 0.29, 1.0, 0, 4, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return np.matrix(tr.translation_matrix(trans)) * np.matrix(tr.quaternion_matrix(rot))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99551:FunctionDef_L18_C0", "label": "mat2pose", "type": "function", "loc": [18, 29], "level": 0, "parent": null, "vector": [2, 0, 0.1391, 0.071, 0, 0.66, 0.6111, 574, 0, 1, 1, 0, 0, 0, 3], "semantic": {"name": "mat2pose", "arg_names": ["m"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def mat2pose(m):\n trans = tr.translation_from_matrix(m)\n rot = tr.quaternion_from_matrix(m)\n p = Pose()\n p.position.x = trans[0]\n p.position.y = trans[1]\n p.position.z = trans[2]\n p.orientation.x = rot[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99551:Assign_L19_C4", "label": "trans = translation_from_matrix()", "type": "assigned_variable", "loc": [19, 19], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99551:FunctionDef_L18_C0", "vector": [14, 1, 0.1124, 0.0059, 1, 0.97, 0.0, 786, 3, 1, 0, 0, 449, 10, 1], "semantic": {"name": "trans", "arg_names": [], "import_names": [], "rhs_call_name": "translation_from_matrix", "annotation": ""}, "snippet": " trans = tr.translation_from_matrix(m)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99551:Assign_L20_C4", "label": "rot = quaternion_from_matrix()", "type": "assigned_variable", "loc": [20, 20], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99551:FunctionDef_L18_C0", "vector": [14, 1, 0.1183, 0.0059, 1, 0.97, 0.1, 812, 3, 1, 0, 0, 61, 10, 1], "semantic": {"name": "rot", "arg_names": [], "import_names": [], "rhs_call_name": "quaternion_from_matrix", "annotation": ""}, "snippet": " rot = tr.quaternion_from_matrix(m)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99551:Assign_L21_C4", "label": "p = Pose()", "type": "assigned_variable", "loc": [21, 21], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99551:FunctionDef_L18_C0", "vector": [14, 1, 0.1243, 0.0059, 1, 0.97, 0.2, 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_99551:Assign_L22_C4", "label": "p.position.x =", "type": "assigned_variable", "loc": [22, 22], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99551:FunctionDef_L18_C0", "vector": [14, 1, 0.1302, 0.0059, 1, 0.97, 0.3, 581, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "p.position.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p.position.x = trans[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99551:Assign_L23_C4", "label": "p.position.y =", "type": "assigned_variable", "loc": [23, 23], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99551:FunctionDef_L18_C0", "vector": [14, 1, 0.1361, 0.0059, 1, 0.97, 0.4, 503, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "p.position.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p.position.y = trans[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99551:Assign_L24_C4", "label": "p.position.z =", "type": "assigned_variable", "loc": [24, 24], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99551:FunctionDef_L18_C0", "vector": [14, 1, 0.142, 0.0059, 1, 0.97, 0.5, 783, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "p.position.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p.position.z = trans[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99551:Assign_L25_C4", "label": "p.orientation.x =", "type": "assigned_variable", "loc": [25, 25], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99551:FunctionDef_L18_C0", "vector": [14, 1, 0.1479, 0.0059, 1, 0.97, 0.6, 650, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "p.orientation.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p.orientation.x = rot[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99551:Assign_L26_C4", "label": "p.orientation.y =", "type": "assigned_variable", "loc": [26, 26], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99551:FunctionDef_L18_C0", "vector": [14, 1, 0.1538, 0.0059, 1, 0.97, 0.7, 991, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "p.orientation.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p.orientation.y = rot[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99551:Assign_L27_C4", "label": "p.orientation.z =", "type": "assigned_variable", "loc": [27, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99551:FunctionDef_L18_C0", "vector": [14, 1, 0.1598, 0.0059, 1, 0.97, 0.8, 10, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "p.orientation.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p.orientation.z = rot[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99551:Assign_L28_C4", "label": "p.orientation.w =", "type": "assigned_variable", "loc": [28, 28], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99551:FunctionDef_L18_C0", "vector": [14, 1, 0.1657, 0.0059, 1, 0.97, 0.9, 975, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "p.orientation.w", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p.orientation.w = rot[3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99551:Return_L29_C4", "label": "return", "type": "return", "loc": [29, 29], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99551:FunctionDef_L18_C0", "vector": [13, 1, 0.1716, 0.0059, 1, 0.97, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return p"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99551:Expr_L31_C0", "label": "init_node()", "type": "expression", "loc": [31, 31], "level": 0, "parent": null, "vector": [8, 0, 0.1834, 0.0059, 0, 0.66, 0.6667, 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(\"omni_potential_well\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99551:Assign_L32_C0", "label": "wpub = Publisher()", "type": "assigned_variable", "loc": [32, 32], "level": 0, "parent": null, "vector": [14, 0, 0.1893, 0.0059, 0, 0.66, 0.7222, 292, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "wpub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": "wpub = rospy.Publisher('force_feedback', Wrench)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99551:Assign_L33_C0", "label": "r = Rate()", "type": "assigned_variable", "loc": [33, 33], "level": 0, "parent": null, "vector": [14, 0, 0.1953, 0.0059, 0, 0.66, 0.7778, 436, 3, 1, 0, 0, 543, 10, 1], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "Rate", "annotation": ""}, "snippet": "r = rospy.Rate(1000)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99551:Expr_L38_C0", "label": "print()", "type": "expression", "loc": [38, 38], "level": 0, "parent": null, "vector": [8, 0, 0.2249, 0.0059, 0, 0.66, 0.8333, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "print('running.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99551:Assign_L40_C0", "label": "well_center =", "type": "assigned_variable", "loc": [40, 40], "level": 0, "parent": null, "vector": [14, 0, 0.2367, 0.0059, 0, 0.66, 0.8889, 936, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "well_center", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "well_center = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99551:Assign_L41_C0", "label": "angle =", "type": "assigned_variable", "loc": [41, 41], "level": 0, "parent": null, "vector": [14, 0, 0.2426, 0.0059, 0, 0.66, 0.9444, 418, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "angle", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "angle = 0.;"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99551:While_L42_C0", "label": "while", "type": "while", "loc": [42, 62], "level": 0, "parent": null, "vector": [5, 0, 0.3077, 0.1243, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "while not rospy.is_shutdown():\n #w_T_6 = tf2mat(listener.lookupTransform('/world', '/omni1_link6', rospy.Time(0)))\n #qm = np.matrix(tr.quaternion_matrix(tr.quaternion_from_euler(0, math.pi, 0)))\n #tm = np.matrix(tr.translation_matrix([-.134, 0, 0]))\n #tip_6 = tm * qm\n #tip_world = w_T_6 * tip_6\n #pos = np.matrix(tr.translation_from_matrix(tip_world)).T\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99551:Assign_L55_C4", "label": "wr = Wrench()", "type": "assigned_variable", "loc": [55, 55], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99551:While_L42_C0", "vector": [14, 1, 0.3254, 0.0059, 1, 0.16, 0.0, 464, 3, 0, 0, 0, 340, 10, 1], "semantic": {"name": "wr", "arg_names": [], "import_names": [], "rhs_call_name": "Wrench", "annotation": ""}, "snippet": " wr = Wrench()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99551:Assign_L56_C4", "label": "angle =", "type": "assigned_variable", "loc": [56, 56], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99551:While_L42_C0", "vector": [14, 1, 0.3314, 0.0059, 1, 0.16, 0.1429, 418, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "angle", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " angle = np.radians(.3) + angle"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99551:Assign_L57_C4", "label": "wr.force.x =", "type": "assigned_variable", "loc": [57, 57], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99551:While_L42_C0", "vector": [14, 1, 0.3373, 0.0059, 1, 0.16, 0.2857, 650, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "wr.force.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " wr.force.x = 0#force_sensable[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99551:Assign_L58_C4", "label": "wr.force.y =", "type": "assigned_variable", "loc": [58, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99551:While_L42_C0", "vector": [14, 1, 0.3432, 0.0059, 1, 0.16, 0.4286, 59, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "wr.force.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " wr.force.y = 0#force_sensable[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99551:Assign_L59_C4", "label": "wr.force.z =", "type": "assigned_variable", "loc": [59, 59], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99551:While_L42_C0", "vector": [14, 1, 0.3491, 0.0059, 1, 0.16, 0.5714, 485, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "wr.force.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " wr.force.z = np.sin(angle) * 3#force_sensable[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99551:Expr_L60_C4", "label": "print()", "type": "expression", "loc": [60, 60], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99551:While_L42_C0", "vector": [8, 1, 0.355, 0.0059, 1, 0.16, 0.7143, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(wr.force.z)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99551:Expr_L61_C4", "label": "publish()", "type": "expression", "loc": [61, 61], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99551:While_L42_C0", "vector": [8, 1, 0.3609, 0.0059, 1, 0.16, 0.8571, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " wpub.publish(wr)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99551:Expr_L62_C4", "label": "sleep()", "type": "expression", "loc": [62, 62], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99551:While_L42_C0", "vector": [8, 1, 0.3669, 0.0059, 1, 0.16, 1.0, 476, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " r.sleep()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99551:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99551:Assign_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99551:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99551:Return_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99551:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99551:Assign_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99551:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99551:Assign_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99551:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99551:Assign_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99551:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99551:Assign_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99551:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99551:Assign_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99551:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99551:Assign_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99551:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99551:Assign_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99551:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99551:Assign_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99551:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99551:Assign_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99551:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99551:Assign_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99551:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99551:Return_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99551:While_L42_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99551:Assign_L55_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99551:While_L42_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99551:Assign_L56_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99551:While_L42_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99551:Assign_L57_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99551:While_L42_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99551:Assign_L58_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99551:While_L42_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99551:Assign_L59_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99551:While_L42_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99551:Expr_L60_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99551:While_L42_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99551:Expr_L61_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99551:While_L42_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99551:Expr_L62_C4"}]
import roslib roslib.load_manifest("phantom_omni") import rospy import tf import tf.transformations as tr from geometry_msgs.msg import PoseStamped from geometry_msgs.msg import Pose from geometry_msgs.msg import Wrench import math import numpy as np def tf2mat(tf_trans): (trans, rot) = tf_trans return np.matrix(tr.translation_matrix(trans)) * np.matrix(tr.quaternion_matrix(rot)) def mat2pose(m): trans = tr.translation_from_matrix(m) rot = tr.quaternion_from_matrix(m) p = Pose() p.position.x = trans[0] p.position.y = trans[1] p.position.z = trans[2] p.orientation.x = rot[0] p.orientation.y = rot[1] p.orientation.z = rot[2] p.orientation.w = rot[3] return p rospy.init_node("pr2_force_feedback") pub = rospy.Publisher('pr2_master', PoseStamped) wpub = rospy.Publisher('force_feedback', Wrench) r = rospy.Rate(60) listener = tf.TransformListener() listener.waitForTransform("/world", "/omni1_link6", rospy.Time(), rospy.Duration(4.0)) print 'running.' while not rospy.is_shutdown(): w_T_6 = tf2mat(listener.lookupTransform('/world', '/omni1_link6', rospy.Time(0))) qm = np.matrix(tr.quaternion_matrix(tr.quaternion_from_euler(0, math.pi, 0))) tm = np.matrix(tr.translation_matrix([-.134, 0, 0])) tip_6 = tm * qm tip_world = w_T_6 * tip_6 ps = PoseStamped() ps.header.frame_id = 'world' ps.header.stamp = rospy.get_rostime() ps.pose = mat2pose(tip_world) pub.publish(ps) r.sleep() #Input force in link6's frame #Output force in omni base frame #wr = Wrench() #wr.force.x = np.random.rand()*2 - 1 #wr.force.y = np.random.rand()*2 - 1 #wr.force.z = np.random.rand()*2 - 1 #wpub.publish(wr) wr = Wrench() wr.force.x = 0 wr.force.y = 0 wr.force.z = 0 wpub.publish(wr)
ajibawa-2023/Python-Code-Large/train/row_99552
49
68
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99552:Import_L1_C0", "label": "roslib import roslib", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0147, 0.0147, 0, 0.66, 0.0, 796, 0, 1, 0, 0, 796, 0, 0], "semantic": {"name": "roslib", "arg_names": [], "import_names": ["roslib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import roslib"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99552:Expr_L2_C0", "label": "load_manifest()", "type": "expression", "loc": [2, 2], "level": 0, "parent": null, "vector": [8, 0, 0.0294, 0.0147, 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(\"phantom_omni\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99552:Import_L3_C0", "label": "rospy import rospy", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0441, 0.0147, 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_99552:Import_L4_C0", "label": "tf import tf", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0588, 0.0147, 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_99552:Import_L5_C0", "label": "tf.transformations import tr", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0735, 0.0147, 0, 0.66, 0.2105, 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_99552:ImportFrom_L7_C0", "label": "from geometry_msgs.msg import PoseStamped", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.1029, 0.0147, 0, 0.66, 0.2632, 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_99552:ImportFrom_L8_C0", "label": "from geometry_msgs.msg import Pose", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.1176, 0.0147, 0, 0.66, 0.3158, 951, 0, 1, 0, 0, 951, 0, 0], "semantic": {"name": "geometry_msgs.msg", "arg_names": [], "import_names": ["Pose"], "rhs_call_name": "", "annotation": ""}, "snippet": "from geometry_msgs.msg import Pose"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99552:ImportFrom_L9_C0", "label": "from geometry_msgs.msg import Wrench", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.1324, 0.0147, 0, 0.66, 0.3684, 951, 0, 1, 0, 0, 951, 0, 0], "semantic": {"name": "geometry_msgs.msg", "arg_names": [], "import_names": ["Wrench"], "rhs_call_name": "", "annotation": ""}, "snippet": "from geometry_msgs.msg import Wrench"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99552:Import_L11_C0", "label": "math import math", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.1618, 0.0147, 0, 0.66, 0.4211, 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_99552:Import_L12_C0", "label": "numpy import np", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.1765, 0.0147, 0, 0.66, 0.4737, 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_99552:FunctionDef_L14_C0", "label": "tf2mat", "type": "function", "loc": [14, 16], "level": 0, "parent": null, "vector": [2, 0, 0.2206, 0.0441, 0, 0.66, 0.5263, 546, 0, 1, 1, 0, 0, 0, 4], "semantic": {"name": "tf2mat", "arg_names": ["tf_trans"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def tf2mat(tf_trans):\n (trans, rot) = tf_trans\n return np.matrix(tr.translation_matrix(trans)) * np.matrix(tr.quaternion_matrix(rot))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99552:Assign_L15_C4", "label": "trans, rot =", "type": "assigned_variable", "loc": [15, 15], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99552:FunctionDef_L14_C0", "vector": [14, 1, 0.2206, 0.0147, 1, 0.2, 0.0, 330, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "trans, rot", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " (trans, rot) = tf_trans"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99552:Return_L16_C4", "label": "return", "type": "return", "loc": [16, 16], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99552:FunctionDef_L14_C0", "vector": [13, 1, 0.2353, 0.0147, 1, 0.2, 1.0, 0, 4, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return np.matrix(tr.translation_matrix(trans)) * np.matrix(tr.quaternion_matrix(rot))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99552:FunctionDef_L18_C0", "label": "mat2pose", "type": "function", "loc": [18, 29], "level": 0, "parent": null, "vector": [2, 0, 0.3456, 0.1765, 0, 0.66, 0.5789, 574, 0, 1, 1, 0, 0, 0, 3], "semantic": {"name": "mat2pose", "arg_names": ["m"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def mat2pose(m):\n trans = tr.translation_from_matrix(m)\n rot = tr.quaternion_from_matrix(m)\n p = Pose()\n p.position.x = trans[0]\n p.position.y = trans[1]\n p.position.z = trans[2]\n p.orientation.x = rot[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99552:Assign_L19_C4", "label": "trans = translation_from_matrix()", "type": "assigned_variable", "loc": [19, 19], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99552:FunctionDef_L18_C0", "vector": [14, 1, 0.2794, 0.0147, 1, 0.71, 0.0, 786, 3, 1, 0, 0, 449, 10, 1], "semantic": {"name": "trans", "arg_names": [], "import_names": [], "rhs_call_name": "translation_from_matrix", "annotation": ""}, "snippet": " trans = tr.translation_from_matrix(m)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99552:Assign_L20_C4", "label": "rot = quaternion_from_matrix()", "type": "assigned_variable", "loc": [20, 20], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99552:FunctionDef_L18_C0", "vector": [14, 1, 0.2941, 0.0147, 1, 0.71, 0.1, 812, 3, 1, 0, 0, 61, 10, 1], "semantic": {"name": "rot", "arg_names": [], "import_names": [], "rhs_call_name": "quaternion_from_matrix", "annotation": ""}, "snippet": " rot = tr.quaternion_from_matrix(m)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99552:Assign_L21_C4", "label": "p = Pose()", "type": "assigned_variable", "loc": [21, 21], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99552:FunctionDef_L18_C0", "vector": [14, 1, 0.3088, 0.0147, 1, 0.71, 0.2, 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_99552:Assign_L22_C4", "label": "p.position.x =", "type": "assigned_variable", "loc": [22, 22], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99552:FunctionDef_L18_C0", "vector": [14, 1, 0.3235, 0.0147, 1, 0.71, 0.3, 581, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "p.position.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p.position.x = trans[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99552:Assign_L23_C4", "label": "p.position.y =", "type": "assigned_variable", "loc": [23, 23], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99552:FunctionDef_L18_C0", "vector": [14, 1, 0.3382, 0.0147, 1, 0.71, 0.4, 503, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "p.position.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p.position.y = trans[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99552:Assign_L24_C4", "label": "p.position.z =", "type": "assigned_variable", "loc": [24, 24], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99552:FunctionDef_L18_C0", "vector": [14, 1, 0.3529, 0.0147, 1, 0.71, 0.5, 783, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "p.position.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p.position.z = trans[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99552:Assign_L25_C4", "label": "p.orientation.x =", "type": "assigned_variable", "loc": [25, 25], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99552:FunctionDef_L18_C0", "vector": [14, 1, 0.3676, 0.0147, 1, 0.71, 0.6, 650, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "p.orientation.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p.orientation.x = rot[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99552:Assign_L26_C4", "label": "p.orientation.y =", "type": "assigned_variable", "loc": [26, 26], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99552:FunctionDef_L18_C0", "vector": [14, 1, 0.3824, 0.0147, 1, 0.71, 0.7, 991, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "p.orientation.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p.orientation.y = rot[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99552:Assign_L27_C4", "label": "p.orientation.z =", "type": "assigned_variable", "loc": [27, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99552:FunctionDef_L18_C0", "vector": [14, 1, 0.3971, 0.0147, 1, 0.71, 0.8, 10, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "p.orientation.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p.orientation.z = rot[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99552:Assign_L28_C4", "label": "p.orientation.w =", "type": "assigned_variable", "loc": [28, 28], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99552:FunctionDef_L18_C0", "vector": [14, 1, 0.4118, 0.0147, 1, 0.71, 0.9, 975, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "p.orientation.w", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p.orientation.w = rot[3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99552:Return_L29_C4", "label": "return", "type": "return", "loc": [29, 29], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99552:FunctionDef_L18_C0", "vector": [13, 1, 0.4265, 0.0147, 1, 0.71, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return p"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99552:Expr_L31_C0", "label": "init_node()", "type": "expression", "loc": [31, 31], "level": 0, "parent": null, "vector": [8, 0, 0.4559, 0.0147, 0, 0.66, 0.6316, 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_force_feedback\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99552:Assign_L32_C0", "label": "pub = Publisher()", "type": "assigned_variable", "loc": [32, 32], "level": 0, "parent": null, "vector": [14, 0, 0.4706, 0.0147, 0, 0.66, 0.6842, 41, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": "pub = rospy.Publisher('pr2_master', PoseStamped)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99552:Assign_L33_C0", "label": "wpub = Publisher()", "type": "assigned_variable", "loc": [33, 33], "level": 0, "parent": null, "vector": [14, 0, 0.4853, 0.0147, 0, 0.66, 0.7368, 292, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "wpub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": "wpub = rospy.Publisher('force_feedback', Wrench)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99552:Assign_L34_C0", "label": "r = Rate()", "type": "assigned_variable", "loc": [34, 34], "level": 0, "parent": null, "vector": [14, 0, 0.5, 0.0147, 0, 0.66, 0.7895, 436, 3, 1, 0, 0, 543, 10, 1], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "Rate", "annotation": ""}, "snippet": "r = rospy.Rate(60)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99552:Assign_L36_C0", "label": "listener = TransformListener()", "type": "assigned_variable", "loc": [36, 36], "level": 0, "parent": null, "vector": [14, 0, 0.5294, 0.0147, 0, 0.66, 0.8421, 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_99552:Expr_L37_C0", "label": "waitForTransform()", "type": "expression", "loc": [37, 37], "level": 0, "parent": null, "vector": [8, 0, 0.5441, 0.0147, 0, 0.66, 0.8947, 900, 3, 4, 0, 0, 0, 0, 3], "semantic": {"name": "waitForTransform", "arg_names": [], "import_names": [], "rhs_call_name": "waitForTransform", "annotation": ""}, "snippet": "listener.waitForTransform(\"/world\", \"/omni1_link6\", rospy.Time(), rospy.Duration(4.0))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99552:Expr_L38_C0", "label": "print()", "type": "expression", "loc": [38, 38], "level": 0, "parent": null, "vector": [8, 0, 0.5588, 0.0147, 0, 0.66, 0.9474, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "print('running.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99552:While_L39_C0", "label": "while", "type": "while", "loc": [39, 65], "level": 0, "parent": null, "vector": [5, 0, 0.7647, 0.3971, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 16], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "while not rospy.is_shutdown():\n w_T_6 = tf2mat(listener.lookupTransform('/world', '/omni1_link6', rospy.Time(0)))\n qm = np.matrix(tr.quaternion_matrix(tr.quaternion_from_euler(0, math.pi, 0)))\n tm = np.matrix(tr.translation_matrix([-.134, 0, 0]))\n tip_6 = tm * qm\n tip_world = w_T_6 * tip_6\n\n ps = PoseStamped()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99552:Assign_L40_C4", "label": "w_T_6 = tf2mat()", "type": "assigned_variable", "loc": [40, 40], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99552:While_L39_C0", "vector": [14, 1, 0.5882, 0.0147, 1, 0.03, 0.0, 17, 3, 1, 0, 0, 546, 10, 3], "semantic": {"name": "w_T_6", "arg_names": [], "import_names": [], "rhs_call_name": "tf2mat", "annotation": ""}, "snippet": " w_T_6 = tf2mat(listener.lookupTransform('/world', '/omni1_link6', rospy.Time(0)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99552:Assign_L41_C4", "label": "qm = matrix()", "type": "assigned_variable", "loc": [41, 41], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99552:While_L39_C0", "vector": [14, 1, 0.6029, 0.0147, 1, 0.03, 0.0667, 861, 3, 1, 0, 0, 162, 10, 3], "semantic": {"name": "qm", "arg_names": [], "import_names": [], "rhs_call_name": "matrix", "annotation": ""}, "snippet": " qm = np.matrix(tr.quaternion_matrix(tr.quaternion_from_euler(0, math.pi, 0)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99552:Assign_L42_C4", "label": "tm = matrix()", "type": "assigned_variable", "loc": [42, 42], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99552:While_L39_C0", "vector": [14, 1, 0.6176, 0.0147, 1, 0.03, 0.1333, 404, 3, 1, 0, 0, 162, 10, 2], "semantic": {"name": "tm", "arg_names": [], "import_names": [], "rhs_call_name": "matrix", "annotation": ""}, "snippet": " tm = np.matrix(tr.translation_matrix([-.134, 0, 0]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99552:Assign_L43_C4", "label": "tip_6 =", "type": "assigned_variable", "loc": [43, 43], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99552:While_L39_C0", "vector": [14, 1, 0.6324, 0.0147, 1, 0.03, 0.2, 749, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "tip_6", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tip_6 = tm * qm"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99552:Assign_L44_C4", "label": "tip_world =", "type": "assigned_variable", "loc": [44, 44], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99552:While_L39_C0", "vector": [14, 1, 0.6471, 0.0147, 1, 0.03, 0.2667, 722, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "tip_world", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tip_world = w_T_6 * tip_6"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99552:Assign_L46_C4", "label": "ps = PoseStamped()", "type": "assigned_variable", "loc": [46, 46], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99552:While_L39_C0", "vector": [14, 1, 0.6765, 0.0147, 1, 0.03, 0.3333, 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_99552:Assign_L47_C4", "label": "ps.header.frame_id =", "type": "assigned_variable", "loc": [47, 47], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99552:While_L39_C0", "vector": [14, 1, 0.6912, 0.0147, 1, 0.03, 0.4, 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 = 'world'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99552:Assign_L48_C4", "label": "ps.header.stamp = get_rostime()", "type": "assigned_variable", "loc": [48, 48], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99552:While_L39_C0", "vector": [14, 1, 0.7059, 0.0147, 1, 0.03, 0.4667, 161, 3, 0, 0, 0, 173, 10, 1], "semantic": {"name": "ps.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "get_rostime", "annotation": ""}, "snippet": " ps.header.stamp = rospy.get_rostime()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99552:Assign_L49_C4", "label": "ps.pose = mat2pose()", "type": "assigned_variable", "loc": [49, 49], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99552:While_L39_C0", "vector": [14, 1, 0.7206, 0.0147, 1, 0.03, 0.5333, 529, 3, 1, 0, 0, 574, 10, 1], "semantic": {"name": "ps.pose", "arg_names": [], "import_names": [], "rhs_call_name": "mat2pose", "annotation": ""}, "snippet": " ps.pose = mat2pose(tip_world)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99552:Expr_L50_C4", "label": "publish()", "type": "expression", "loc": [50, 50], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99552:While_L39_C0", "vector": [8, 1, 0.7353, 0.0147, 1, 0.03, 0.6, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " pub.publish(ps)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99552:Expr_L51_C4", "label": "sleep()", "type": "expression", "loc": [51, 51], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99552:While_L39_C0", "vector": [8, 1, 0.75, 0.0147, 1, 0.03, 0.6667, 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_99552:Assign_L61_C4", "label": "wr = Wrench()", "type": "assigned_variable", "loc": [61, 61], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99552:While_L39_C0", "vector": [14, 1, 0.8971, 0.0147, 1, 0.03, 0.7333, 464, 3, 0, 0, 0, 340, 10, 1], "semantic": {"name": "wr", "arg_names": [], "import_names": [], "rhs_call_name": "Wrench", "annotation": ""}, "snippet": " wr = Wrench()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99552:Assign_L62_C4", "label": "wr.force.x =", "type": "assigned_variable", "loc": [62, 62], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99552:While_L39_C0", "vector": [14, 1, 0.9118, 0.0147, 1, 0.03, 0.8, 650, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "wr.force.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " wr.force.x = 0 "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99552:Assign_L63_C4", "label": "wr.force.y =", "type": "assigned_variable", "loc": [63, 63], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99552:While_L39_C0", "vector": [14, 1, 0.9265, 0.0147, 1, 0.03, 0.8667, 59, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "wr.force.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " wr.force.y = 0 "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99552:Assign_L64_C4", "label": "wr.force.z =", "type": "assigned_variable", "loc": [64, 64], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99552:While_L39_C0", "vector": [14, 1, 0.9412, 0.0147, 1, 0.03, 0.9333, 485, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "wr.force.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " wr.force.z = 0 "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99552:Expr_L65_C4", "label": "publish()", "type": "expression", "loc": [65, 65], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99552:While_L39_C0", "vector": [8, 1, 0.9559, 0.0147, 1, 0.03, 1.0, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " wpub.publish(wr)"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99552:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99552:Assign_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99552:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99552:Return_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99552:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99552:Assign_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99552:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99552:Assign_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99552:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99552:Assign_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99552:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99552:Assign_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99552:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99552:Assign_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99552:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99552:Assign_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99552:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99552:Assign_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99552:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99552:Assign_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99552:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99552:Assign_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99552:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99552:Assign_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99552:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99552:Return_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99552:While_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99552:Assign_L40_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99552:While_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99552:Assign_L41_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99552:While_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99552:Assign_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99552:While_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99552:Assign_L43_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99552:While_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99552:Assign_L44_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99552:While_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99552:Assign_L46_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99552:While_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99552:Assign_L47_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99552:While_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99552:Assign_L48_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99552:While_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99552:Assign_L49_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99552:While_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99552:Expr_L50_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99552:While_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99552:Expr_L51_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99552:While_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99552:Assign_L61_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99552:While_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99552:Assign_L62_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99552:While_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99552:Assign_L63_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99552:While_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99552:Assign_L64_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99552:While_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99552:Expr_L65_C4"}]
import roslib roslib.load_manifest("phantom_omni") import rospy import tf import tf.transformations as tr import hrl_lib.tf_utils as tfu from geometry_msgs.msg import PoseStamped from geometry_msgs.msg import Pose from geometry_msgs.msg import Wrench import math import numpy as np rospy.init_node("omni_potential_well") wpub = rospy.Publisher('omni1_force_feedback', Wrench) def pose_cb(ps): m_f, frame = tfu.posestamped_as_matrix(ps) m_o1 = tfu.transform('/omni1', frame, listener) * m_f ee_point = np.matrix(tr.translation_from_matrix(m_o1)).T center = np.matrix([-.10, 0, .30]).T dif = 30*(center - ee_point) #force_dir = dif / np.linalg.norm(dif) force_o1 = dif #force_dir * np.sum(np.power(dif, 2)) force_s = tfu.transform('/omni1_sensable', '/omni1', listener) * np.row_stack((force_o1, np.matrix([1.]))) print np.linalg.norm(center - ee_point) wr = Wrench() wr.force.x = force_s[0] wr.force.y = force_s[1] wr.force.z = force_s[2] wpub.publish(wr) rospy.Subscriber('/omni1_pose', PoseStamped, pose_cb) r = rospy.Rate(1) listener = tf.TransformListener() listener.waitForTransform("/omni1", "/omni1_sensable", rospy.Time(), rospy.Duration(4.0)) listener.waitForTransform("/omni1", "/omni1_link6", rospy.Time(), rospy.Duration(4.0)) print 'running.' well_center = None while not rospy.is_shutdown(): r.sleep() #get current pose of the tip, subtract it from a center, rotate this into the sensable frame #tip_omni1 = w_T_6 * tip_6 #force_omni1 = (w_T_6[0:3,0:3] * np.matrix([-2., 0, 0]).T) #force_sensable = transform('/omni1_sensable', '/omni1', listener) * force_omni1 #wr = Wrench() #wr.force.x = force_sensable[0] #wr.force.y = force_sensable[1] #wr.force.z = force_sensable[2] #print wr.force.z #wpub.publish(wr) #qm = tfu.quaternion_from_matrix(tr.quaternion_from_euler(0, math.pi, 0)) #tm = tfu.translation_matrix([-.134, 0, 0]) #tip_6 = tm * qm #tip_omni1 = w_T_6 * tip_6 #trans, rot = listener.lookupTransform('/omni1_sensable', '/omni1', rospy.Time(0)) #quat_mat = np.matrix(tr.quaternion_matrix(rot)) #force_sensable = quat_mat[0:3, 0:3] * force_omni1 #def tf2mat(tf_trans): # (trans, rot) = tf_trans # return np.matrix(tr.translation_matrix(trans)) * np.matrix(tr.quaternion_matrix(rot)) #def mat2pose(m): # trans = tr.translation_from_matrix(m) # rot = tr.quaternion_from_matrix(m) # p = Pose() # p.position.x = trans[0] # p.position.y = trans[1] # p.position.z = trans[2] # p.orientation.x = rot[0] # p.orientation.y = rot[1] # p.orientation.z = rot[2] # p.orientation.w = rot[3] # return p
ajibawa-2023/Python-Code-Large/train/row_99553
36
111
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99553:Import_L1_C0", "label": "roslib import roslib", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.009, 0.009, 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_99553:Expr_L2_C0", "label": "load_manifest()", "type": "expression", "loc": [2, 2], "level": 0, "parent": null, "vector": [8, 0, 0.018, 0.009, 0, 0.66, 0.0476, 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(\"phantom_omni\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99553:Import_L3_C0", "label": "rospy import rospy", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.027, 0.009, 0, 0.66, 0.0952, 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_99553:Import_L4_C0", "label": "tf import tf", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.036, 0.009, 0, 0.66, 0.1429, 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_99553:Import_L5_C0", "label": "tf.transformations import tr", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.045, 0.009, 0, 0.66, 0.1905, 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_99553:Import_L6_C0", "label": "hrl_lib.tf_utils import tfu", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0541, 0.009, 0, 0.66, 0.2381, 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_99553:ImportFrom_L8_C0", "label": "from geometry_msgs.msg import PoseStamped", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.0721, 0.009, 0, 0.66, 0.2857, 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_99553:ImportFrom_L9_C0", "label": "from geometry_msgs.msg import Pose", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.0811, 0.009, 0, 0.66, 0.3333, 951, 0, 1, 0, 0, 951, 0, 0], "semantic": {"name": "geometry_msgs.msg", "arg_names": [], "import_names": ["Pose"], "rhs_call_name": "", "annotation": ""}, "snippet": "from geometry_msgs.msg import Pose"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99553:ImportFrom_L10_C0", "label": "from geometry_msgs.msg import Wrench", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.0901, 0.009, 0, 0.66, 0.381, 951, 0, 1, 0, 0, 951, 0, 0], "semantic": {"name": "geometry_msgs.msg", "arg_names": [], "import_names": ["Wrench"], "rhs_call_name": "", "annotation": ""}, "snippet": "from geometry_msgs.msg import Wrench"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99553:Import_L12_C0", "label": "math import math", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.1081, 0.009, 0, 0.66, 0.4286, 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_99553:Import_L13_C0", "label": "numpy import np", "type": "import", "loc": [13, 13], "level": 0, "parent": null, "vector": [1, 0, 0.1171, 0.009, 0, 0.66, 0.4762, 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_99553:Expr_L15_C0", "label": "init_node()", "type": "expression", "loc": [15, 15], "level": 0, "parent": null, "vector": [8, 0, 0.1351, 0.009, 0, 0.66, 0.5238, 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(\"omni_potential_well\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99553:Assign_L16_C0", "label": "wpub = Publisher()", "type": "assigned_variable", "loc": [16, 16], "level": 0, "parent": null, "vector": [14, 0, 0.1441, 0.009, 0, 0.66, 0.5714, 292, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "wpub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": "wpub = rospy.Publisher('omni1_force_feedback', Wrench)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99553:FunctionDef_L18_C0", "label": "pose_cb", "type": "function", "loc": [18, 34], "level": 0, "parent": null, "vector": [2, 0, 0.2342, 0.1532, 0, 0.66, 0.619, 686, 0, 1, 0, 0, 0, 0, 12], "semantic": {"name": "pose_cb", "arg_names": ["ps"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def pose_cb(ps):\n m_f, frame = tfu.posestamped_as_matrix(ps)\n m_o1 = tfu.transform('/omni1', frame, listener) * m_f\n ee_point = np.matrix(tr.translation_from_matrix(m_o1)).T\n center = np.matrix([-.10, 0, .30]).T\n dif = 30*(center - ee_point)\n #force_dir = dif / np.linalg.norm(dif)\n force_o1 = dif #force_dir * np.sum(np.power(dif, 2))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99553:Assign_L19_C4", "label": "m_f, frame = posestamped_as_matrix()", "type": "assigned_variable", "loc": [19, 19], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99553:FunctionDef_L18_C0", "vector": [14, 1, 0.1712, 0.009, 1, 0.63, 0.0, 719, 3, 1, 0, 0, 92, 10, 1], "semantic": {"name": "m_f, frame", "arg_names": [], "import_names": [], "rhs_call_name": "posestamped_as_matrix", "annotation": ""}, "snippet": " m_f, frame = tfu.posestamped_as_matrix(ps)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99553:Assign_L20_C4", "label": "m_o1 =", "type": "assigned_variable", "loc": [20, 20], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99553:FunctionDef_L18_C0", "vector": [14, 1, 0.1802, 0.009, 1, 0.63, 0.0833, 478, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "m_o1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " m_o1 = tfu.transform('/omni1', frame, listener) * m_f"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99553:Assign_L21_C4", "label": "ee_point =", "type": "assigned_variable", "loc": [21, 21], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99553:FunctionDef_L18_C0", "vector": [14, 1, 0.1892, 0.009, 1, 0.63, 0.1667, 179, 7, 0, 0, 0, 0, 0, 2], "semantic": {"name": "ee_point", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ee_point = np.matrix(tr.translation_from_matrix(m_o1)).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99553:Assign_L22_C4", "label": "center =", "type": "assigned_variable", "loc": [22, 22], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99553:FunctionDef_L18_C0", "vector": [14, 1, 0.1982, 0.009, 1, 0.63, 0.25, 546, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "center", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " center = np.matrix([-.10, 0, .30]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99553:Assign_L23_C4", "label": "dif =", "type": "assigned_variable", "loc": [23, 23], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99553:FunctionDef_L18_C0", "vector": [14, 1, 0.2072, 0.009, 1, 0.63, 0.3333, 980, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "dif", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " dif = 30*(center - ee_point)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99553:Assign_L25_C4", "label": "force_o1 =", "type": "assigned_variable", "loc": [25, 25], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99553:FunctionDef_L18_C0", "vector": [14, 1, 0.2252, 0.009, 1, 0.63, 0.4167, 485, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "force_o1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " force_o1 = dif #force_dir * np.sum(np.power(dif, 2))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99553:Assign_L27_C4", "label": "force_s =", "type": "assigned_variable", "loc": [27, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99553:FunctionDef_L18_C0", "vector": [14, 1, 0.2432, 0.009, 1, 0.63, 0.5, 261, 4, 0, 0, 0, 0, 0, 3], "semantic": {"name": "force_s", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " force_s = tfu.transform('/omni1_sensable', '/omni1', listener) * np.row_stack((force_o1, np.matrix([1.])))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99553:Expr_L28_C4", "label": "print()", "type": "expression", "loc": [28, 28], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99553:FunctionDef_L18_C0", "vector": [8, 1, 0.2523, 0.009, 1, 0.63, 0.5833, 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(center - ee_point))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99553:Assign_L30_C4", "label": "wr = Wrench()", "type": "assigned_variable", "loc": [30, 30], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99553:FunctionDef_L18_C0", "vector": [14, 1, 0.2703, 0.009, 1, 0.63, 0.6667, 464, 3, 0, 0, 0, 340, 10, 1], "semantic": {"name": "wr", "arg_names": [], "import_names": [], "rhs_call_name": "Wrench", "annotation": ""}, "snippet": " wr = Wrench()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99553:Assign_L31_C4", "label": "wr.force.x =", "type": "assigned_variable", "loc": [31, 31], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99553:FunctionDef_L18_C0", "vector": [14, 1, 0.2793, 0.009, 1, 0.63, 0.75, 650, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "wr.force.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " wr.force.x = force_s[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99553:Assign_L32_C4", "label": "wr.force.y =", "type": "assigned_variable", "loc": [32, 32], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99553:FunctionDef_L18_C0", "vector": [14, 1, 0.2883, 0.009, 1, 0.63, 0.8333, 59, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "wr.force.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " wr.force.y = force_s[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99553:Assign_L33_C4", "label": "wr.force.z =", "type": "assigned_variable", "loc": [33, 33], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99553:FunctionDef_L18_C0", "vector": [14, 1, 0.2973, 0.009, 1, 0.63, 0.9167, 485, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "wr.force.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " wr.force.z = force_s[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99553:Expr_L34_C4", "label": "publish()", "type": "expression", "loc": [34, 34], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99553:FunctionDef_L18_C0", "vector": [8, 1, 0.3063, 0.009, 1, 0.63, 1.0, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " wpub.publish(wr)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99553:Expr_L36_C0", "label": "Subscriber()", "type": "expression", "loc": [36, 36], "level": 0, "parent": null, "vector": [8, 0, 0.3243, 0.009, 0, 0.66, 0.6667, 455, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "Subscriber", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": "rospy.Subscriber('/omni1_pose', PoseStamped, pose_cb)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99553:Assign_L37_C0", "label": "r = Rate()", "type": "assigned_variable", "loc": [37, 37], "level": 0, "parent": null, "vector": [14, 0, 0.3333, 0.009, 0, 0.66, 0.7143, 436, 3, 1, 0, 0, 543, 10, 1], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "Rate", "annotation": ""}, "snippet": "r = rospy.Rate(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99553:Assign_L39_C0", "label": "listener = TransformListener()", "type": "assigned_variable", "loc": [39, 39], "level": 0, "parent": null, "vector": [14, 0, 0.3514, 0.009, 0, 0.66, 0.7619, 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_99553:Expr_L40_C0", "label": "waitForTransform()", "type": "expression", "loc": [40, 40], "level": 0, "parent": null, "vector": [8, 0, 0.3604, 0.009, 0, 0.66, 0.8095, 900, 3, 4, 0, 0, 0, 0, 3], "semantic": {"name": "waitForTransform", "arg_names": [], "import_names": [], "rhs_call_name": "waitForTransform", "annotation": ""}, "snippet": "listener.waitForTransform(\"/omni1\", \"/omni1_sensable\", rospy.Time(), rospy.Duration(4.0))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99553:Expr_L41_C0", "label": "waitForTransform()", "type": "expression", "loc": [41, 41], "level": 0, "parent": null, "vector": [8, 0, 0.3694, 0.009, 0, 0.66, 0.8571, 900, 3, 4, 0, 0, 0, 0, 3], "semantic": {"name": "waitForTransform", "arg_names": [], "import_names": [], "rhs_call_name": "waitForTransform", "annotation": ""}, "snippet": "listener.waitForTransform(\"/omni1\", \"/omni1_link6\", rospy.Time(), rospy.Duration(4.0))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99553:Expr_L42_C0", "label": "print()", "type": "expression", "loc": [42, 42], "level": 0, "parent": null, "vector": [8, 0, 0.3784, 0.009, 0, 0.66, 0.9048, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "print('running.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99553:Assign_L45_C0", "label": "well_center =", "type": "assigned_variable", "loc": [45, 45], "level": 0, "parent": null, "vector": [14, 0, 0.4054, 0.009, 0, 0.66, 0.9524, 936, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "well_center", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "well_center = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99553:While_L46_C0", "label": "while", "type": "while", "loc": [46, 47], "level": 0, "parent": null, "vector": [5, 0, 0.4189, 0.018, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "while not rospy.is_shutdown():\n r.sleep()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99553:Expr_L47_C4", "label": "sleep()", "type": "expression", "loc": [47, 47], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99553:While_L46_C0", "vector": [8, 1, 0.4234, 0.009, 1, 0.36, 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()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99553:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99553:Assign_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99553:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99553:Assign_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99553:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99553:Assign_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99553:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99553:Assign_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99553:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99553:Assign_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99553:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99553:Assign_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99553:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99553:Assign_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99553:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99553:Expr_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99553:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99553:Assign_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99553:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99553:Assign_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99553:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99553:Assign_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99553:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99553:Assign_L33_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99553:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99553:Expr_L34_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99553:While_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99553:Expr_L47_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 (Healthcare Robotics Lab, Georgia Tech.) import roslib; roslib.load_manifest('hrl_tilting_hokuyo') from enthought.mayavi import mlab import sys,os,time import optparse import hrl_lib.util as ut import numpy as np, math color_list = [(1.,1.,1.),(1.,0.,0.),(0.,1.,0.),(0.,0.,1.),(1.,1.,0.),(1.,0.,1.),\ (0.,1.,1.),(0.5,1.,0.5),(1.,0.5,0.5)] ## # make a figure with a white background. def white_bg(): mlab.figure(fgcolor = (0,0,0), bgcolor = (1,1,1)) ## # save plot as a png # @param name - file name # size - (r,c) e.g. (1024, 768) def savefig(name, size): mlab.savefig(name, size=size) ## plot 3D points connected to each other # # Check mlab.points3d documentation for details. # @param pts - 3xN numpy matrix of points. # @param color - 3 tuple of color. (float b/w 0 and 1) # @param mode - how to display the points ('point','sphere','cube' etc.) # @param scale_fator - controls size of the spheres. not sure what it means. def plot(pts,color=(1.,1.,1.), scalar_list=None): if scalar_list != None: mlab.plot3d(pts[0,:].A1,pts[1,:].A1,pts[2,:].A1,scalar_list, representation = 'wireframe', tube_radius = None) mlab.colorbar() else: mlab.plot3d(pts[0,:].A1,pts[1,:].A1,pts[2,:].A1,color=color, representation = 'wireframe', tube_radius = None) ## plot 3D points as a cloud. # # Check mlab.points3d documentation for details. # @param pts - 3xN numpy matrix of points. # @param color - 3 tuple of color. (float b/w 0 and 1) # @param mode - how to display the points ('point','sphere','cube' etc.) # @param scale_fator - controls size of the spheres. not sure what it means. def plot_points(pts,color=(1.,1.,1.),mode='point',scale_factor=0.01,scalar_list=None): if scalar_list != None: mlab.points3d(pts[0,:].A1,pts[1,:].A1,pts[2,:].A1,scalar_list,mode=mode,scale_factor=scale_factor) mlab.colorbar() else: mlab.points3d(pts[0,:].A1,pts[1,:].A1,pts[2,:].A1,mode=mode,color=color,scale_factor=scale_factor) ## Use mayavi2 to plot normals, and curvature of a point cloud. # @param pts - 3xN np matrix # @param normals - 3xN np matrix of surface normals at the points in pts. # @param curvature - list of curvatures. # @param mask_points - how many point to skip while drawint the normals # @param color - of the arrows # @param scale_factor - modulate size of arrows. # # Surface normals are plotted as arrows at the pts, curvature is colormapped and # shown as spheres. The radius of the sphere also indicates the magnitude # of the curvature. If curvature is None then it is not plotted. The pts # are then displayed as pixels. def plot_normals(pts, normals, curvature=None, mask_points=1, color=(0.,1.,0.), scale_factor = 0.1): x = pts[0,:].A1 y = pts[1,:].A1 z = pts[2,:].A1 u = normals[0,:].A1 v = normals[1,:].A1 w = normals[2,:].A1 if curvature != None: curvature = np.array(curvature) #idxs = np.where(curvature>0.03) #mlab.points3d(x[idxs],y[idxs],z[idxs],curvature[idxs],mode='sphere',scale_factor=0.1,mask_points=1) mlab.points3d(x,y,z,curvature,mode='sphere',scale_factor=0.1,mask_points=1, color=color) # mlab.points3d(x,y,z,mode='point') mlab.colorbar() else: mlab.points3d(x,y,z,mode='point') mlab.quiver3d(x, y, z, u, v, w, mask_points=mask_points, scale_factor=scale_factor, color=color) # mlab.axes() ## Plot a yellow cuboid. # cuboid is defined by 12 tuples of corners that define the 12 edges, # as returned by occupancy_grig.grid_lines() function. def plot_cuboid(corner_tups): for tup in corner_tups: p1 = tup[0] p2 = tup[1] mlab.plot3d([p1[0,0],p2[0,0]],[p1[1,0],p2[1,0]], [p1[2,0],p2[2,0]],color=(1.,1.,0.), representation='wireframe',tube_radius=None) ## show the plot. # call this function after plotting everything. def show(): mlab.show() if __name__ == '__main__': p = optparse.OptionParser() p.add_option('-c', action='store', type='string', dest='pts_pkl', help='pkl file with 3D points') p.add_option('-f', action='store', type='string', dest='dict_pkl', help='pkl file with 3D dict') p.add_option('--save_cloud', action='store_true', dest='save_cloud', help='pickle the point cloud (3xN matrix)') p.add_option('--pan_angle', action='store', type='float', dest='max_pan_angle', default=60.0, help='angle in DEGREES. points b/w (-pan_angle and +pan_angle) are displayed. [default=60.]') p.add_option('--max_dist', action='store', type='float', dest='max_dist', default=3.0, help='maximum distance (meters). Points further than this are discarded. [default=3.]') opt, args = p.parse_args() pts_pkl_fname = opt.pts_pkl dict_pkl_fname = opt.dict_pkl save_cloud_flag = opt.save_cloud max_pan_angle = opt.max_pan_angle max_dist = opt.max_dist if pts_pkl_fname != None: pts = ut.load_pickle(pts_pkl_fname) elif dict_pkl_fname != None: import tilting_hokuyo.processing_3d as p3d dict = ut.load_pickle(dict_pkl_fname) pts = p3d.generate_pointcloud(dict['pos_list'],dict['scan_list'], math.radians(-max_pan_angle), math.radians(max_pan_angle), dict['l1'],dict['l2'], min_tilt=math.radians(-90),max_tilt=math.radians(90)) else: print 'Specify either a pts pkl or a dict pkl (-c or -f)' print 'Exiting...' sys.exit() dist_mat = ut.norm(pts) idxs = np.where(dist_mat<max_dist)[1] print 'pts.shape', pts.shape pts = pts[:,idxs.A1] print 'pts.shape', pts.shape if save_cloud_flag: ut.save_pickle(pts,'numpy_pc_'+ut.formatted_time()+'.pkl') plot_points(pts) mlab.show()
ajibawa-2023/Python-Code-Large/train/row_99554
73
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_99554:Import_L30_C0", "label": "roslib import roslib", "type": "import", "loc": [30, 30], "level": 0, "parent": null, "vector": [1, 0, 0.1562, 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; roslib.load_manifest('hrl_tilting_hokuyo')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99554:Expr_L30_C15", "label": "load_manifest()", "type": "expression", "loc": [30, 30], "level": 0, "parent": null, "vector": [8, 0, 0.1562, 0.0052, 0, 0.66, 0.0667, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('hrl_tilting_hokuyo')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99554:ImportFrom_L32_C0", "label": "from enthought.mayavi import mlab", "type": "import", "loc": [32, 32], "level": 0, "parent": null, "vector": [1, 0, 0.1667, 0.0052, 0, 0.66, 0.1333, 226, 0, 1, 0, 0, 226, 0, 0], "semantic": {"name": "enthought.mayavi", "arg_names": [], "import_names": ["mlab"], "rhs_call_name": "", "annotation": ""}, "snippet": "from enthought.mayavi import mlab"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99554:Import_L34_C0", "label": "sys import sys, os, time", "type": "import", "loc": [34, 34], "level": 0, "parent": null, "vector": [1, 0, 0.1771, 0.0052, 0, 0.66, 0.2, 509, 0, 3, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys", "os", "time"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys,os,time"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99554:Import_L35_C0", "label": "optparse import optparse", "type": "import", "loc": [35, 35], "level": 0, "parent": null, "vector": [1, 0, 0.1823, 0.0052, 0, 0.66, 0.2667, 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_99554:Import_L36_C0", "label": "hrl_lib.util import ut", "type": "import", "loc": [36, 36], "level": 0, "parent": null, "vector": [1, 0, 0.1875, 0.0052, 0, 0.66, 0.3333, 775, 0, 1, 0, 0, 775, 0, 0], "semantic": {"name": "hrl_lib.util", "arg_names": [], "import_names": ["ut"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.util as ut"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99554:Import_L37_C0", "label": "numpy import np, math", "type": "import", "loc": [37, 37], "level": 0, "parent": null, "vector": [1, 0, 0.1927, 0.0052, 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_99554:Assign_L40_C0", "label": "color_list =", "type": "assigned_variable", "loc": [40, 41], "level": 0, "parent": null, "vector": [14, 0, 0.2109, 0.0104, 0, 0.66, 0.4667, 570, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "color_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "color_list = [(1.,1.,1.),(1.,0.,0.),(0.,1.,0.),(0.,0.,1.),(1.,1.,0.),(1.,0.,1.),\\\n (0.,1.,1.),(0.5,1.,0.5),(1.,0.5,0.5)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99554:FunctionDef_L47_C0", "label": "white_bg", "type": "function", "loc": [47, 48], "level": 0, "parent": null, "vector": [2, 0, 0.2474, 0.0104, 0, 0.66, 0.5333, 652, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "white_bg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def white_bg():\n mlab.figure(fgcolor = (0,0,0), bgcolor = (1,1,1))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99554:Expr_L48_C4", "label": "figure()", "type": "expression", "loc": [48, 48], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99554:FunctionDef_L47_C0", "vector": [8, 1, 0.25, 0.0052, 1, 0.75, 0.0, 789, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "figure", "arg_names": [], "import_names": [], "rhs_call_name": "figure", "annotation": ""}, "snippet": " mlab.figure(fgcolor = (0,0,0), bgcolor = (1,1,1))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99554:FunctionDef_L54_C0", "label": "savefig", "type": "function", "loc": [54, 55], "level": 0, "parent": null, "vector": [2, 0, 0.2839, 0.0104, 0, 0.66, 0.6, 677, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "savefig", "arg_names": ["name", "size"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def savefig(name, size):\n mlab.savefig(name, size=size)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99554:Expr_L55_C4", "label": "savefig()", "type": "expression", "loc": [55, 55], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99554:FunctionDef_L54_C0", "vector": [8, 1, 0.2865, 0.0052, 1, 0.32, 0.0, 677, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "savefig", "arg_names": [], "import_names": [], "rhs_call_name": "savefig", "annotation": ""}, "snippet": " mlab.savefig(name, size=size)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99554:FunctionDef_L64_C0", "label": "plot", "type": "function", "loc": [64, 71], "level": 0, "parent": null, "vector": [2, 0, 0.3516, 0.0417, 0, 0.66, 0.6667, 929, 0, 3, 0, 0, 0, 0, 3], "semantic": {"name": "plot", "arg_names": ["pts", "color", "scalar_list"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def plot(pts,color=(1.,1.,1.), scalar_list=None):\n if scalar_list != None:\n mlab.plot3d(pts[0,:].A1,pts[1,:].A1,pts[2,:].A1,scalar_list,\n representation = 'wireframe', tube_radius = None)\n mlab.colorbar()\n else:\n mlab.plot3d(pts[0,:].A1,pts[1,:].A1,pts[2,:].A1,color=color,\n representation = 'wireframe', tube_radius = None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99554:If_L65_C4", "label": "if", "type": "if", "loc": [65, 71], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99554:FunctionDef_L64_C0", "vector": [4, 1, 0.3542, 0.0365, 1, 0.88, 0.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if scalar_list != None:\n mlab.plot3d(pts[0,:].A1,pts[1,:].A1,pts[2,:].A1,scalar_list,\n representation = 'wireframe', tube_radius = None)\n mlab.colorbar()\n else:\n mlab.plot3d(pts[0,:].A1,pts[1,:].A1,pts[2,:].A1,color=color,\n representation = 'wireframe', tube_radius = None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99554:Expr_L66_C8", "label": "plot3d()", "type": "expression", "loc": [66, 67], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99554:If_L65_C4", "vector": [8, 2, 0.3464, 0.0104, 2, 0.19, 0.0, 290, 3, 6, 0, 0, 0, 0, 1], "semantic": {"name": "plot3d", "arg_names": [], "import_names": [], "rhs_call_name": "plot3d", "annotation": ""}, "snippet": " mlab.plot3d(pts[0,:].A1,pts[1,:].A1,pts[2,:].A1,scalar_list,\n representation = 'wireframe', tube_radius = None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99554:Expr_L68_C8", "label": "colorbar()", "type": "expression", "loc": [68, 68], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99554:If_L65_C4", "vector": [8, 2, 0.3542, 0.0052, 2, 0.19, 0.5, 915, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "colorbar", "arg_names": [], "import_names": [], "rhs_call_name": "colorbar", "annotation": ""}, "snippet": " mlab.colorbar()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99554:Expr_L70_C8", "label": "plot3d()", "type": "expression", "loc": [70, 71], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99554:If_L65_C4", "vector": [8, 2, 0.3672, 0.0104, 2, 0.19, 1.0, 290, 3, 6, 0, 0, 0, 0, 1], "semantic": {"name": "plot3d", "arg_names": [], "import_names": [], "rhs_call_name": "plot3d", "annotation": ""}, "snippet": " mlab.plot3d(pts[0,:].A1,pts[1,:].A1,pts[2,:].A1,color=color,\n representation = 'wireframe', tube_radius = None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99554:FunctionDef_L80_C0", "label": "plot_points", "type": "function", "loc": [80, 85], "level": 0, "parent": null, "vector": [2, 0, 0.4297, 0.0312, 0, 0.66, 0.7333, 111, 0, 5, 0, 0, 0, 0, 3], "semantic": {"name": "plot_points", "arg_names": ["pts", "color", "mode", "scale_factor", "scalar_list"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def plot_points(pts,color=(1.,1.,1.),mode='point',scale_factor=0.01,scalar_list=None):\n if scalar_list != None:\n mlab.points3d(pts[0,:].A1,pts[1,:].A1,pts[2,:].A1,scalar_list,mode=mode,scale_factor=scale_factor)\n mlab.colorbar()\n else:\n mlab.points3d(pts[0,:].A1,pts[1,:].A1,pts[2,:].A1,mode=mode,color=color,scale_factor=scale_factor)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99554:If_L81_C4", "label": "if", "type": "if", "loc": [81, 85], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99554:FunctionDef_L80_C0", "vector": [4, 1, 0.4323, 0.026, 1, 0.29, 0.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if scalar_list != None:\n mlab.points3d(pts[0,:].A1,pts[1,:].A1,pts[2,:].A1,scalar_list,mode=mode,scale_factor=scale_factor)\n mlab.colorbar()\n else:\n mlab.points3d(pts[0,:].A1,pts[1,:].A1,pts[2,:].A1,mode=mode,color=color,scale_factor=scale_factor)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99554:Expr_L82_C8", "label": "points3d()", "type": "expression", "loc": [82, 82], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99554:If_L81_C4", "vector": [8, 2, 0.4271, 0.0052, 2, 0.87, 0.0, 243, 3, 6, 0, 0, 0, 0, 1], "semantic": {"name": "points3d", "arg_names": [], "import_names": [], "rhs_call_name": "points3d", "annotation": ""}, "snippet": " mlab.points3d(pts[0,:].A1,pts[1,:].A1,pts[2,:].A1,scalar_list,mode=mode,scale_factor=scale_factor)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99554:Expr_L83_C8", "label": "colorbar()", "type": "expression", "loc": [83, 83], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99554:If_L81_C4", "vector": [8, 2, 0.4323, 0.0052, 2, 0.87, 0.5, 915, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "colorbar", "arg_names": [], "import_names": [], "rhs_call_name": "colorbar", "annotation": ""}, "snippet": " mlab.colorbar()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99554:Expr_L85_C8", "label": "points3d()", "type": "expression", "loc": [85, 85], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99554:If_L81_C4", "vector": [8, 2, 0.4427, 0.0052, 2, 0.87, 1.0, 243, 3, 6, 0, 0, 0, 0, 1], "semantic": {"name": "points3d", "arg_names": [], "import_names": [], "rhs_call_name": "points3d", "annotation": ""}, "snippet": " mlab.points3d(pts[0,:].A1,pts[1,:].A1,pts[2,:].A1,mode=mode,color=color,scale_factor=scale_factor)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99554:FunctionDef_L100_C0", "label": "plot_normals", "type": "function", "loc": [100, 120], "level": 0, "parent": null, "vector": [2, 0, 0.5729, 0.1094, 0, 0.66, 0.8, 568, 0, 6, 0, 0, 0, 0, 5], "semantic": {"name": "plot_normals", "arg_names": ["pts", "normals", "curvature", "mask_points", "color", "scale_factor"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def plot_normals(pts, normals, curvature=None, mask_points=1,\n color=(0.,1.,0.), scale_factor = 0.1):\n x = pts[0,:].A1\n y = pts[1,:].A1\n z = pts[2,:].A1\n\n u = normals[0,:].A1\n v = normals[1,:].A1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99554:Assign_L102_C4", "label": "x =", "type": "assigned_variable", "loc": [102, 102], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99554:FunctionDef_L100_C0", "vector": [14, 1, 0.5312, 0.0052, 1, 0.3, 0.0, 190, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " x = pts[0,:].A1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99554:Assign_L103_C4", "label": "y =", "type": "assigned_variable", "loc": [103, 103], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99554:FunctionDef_L100_C0", "vector": [14, 1, 0.5365, 0.0052, 1, 0.3, 0.1429, 304, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " y = pts[1,:].A1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99554:Assign_L104_C4", "label": "z =", "type": "assigned_variable", "loc": [104, 104], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99554:FunctionDef_L100_C0", "vector": [14, 1, 0.5417, 0.0052, 1, 0.3, 0.2857, 859, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " z = pts[2,:].A1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99554:Assign_L106_C4", "label": "u =", "type": "assigned_variable", "loc": [106, 106], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99554:FunctionDef_L100_C0", "vector": [14, 1, 0.5521, 0.0052, 1, 0.3, 0.4286, 609, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "u", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " u = normals[0,:].A1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99554:Assign_L107_C4", "label": "v =", "type": "assigned_variable", "loc": [107, 107], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99554:FunctionDef_L100_C0", "vector": [14, 1, 0.5573, 0.0052, 1, 0.3, 0.5714, 553, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "v", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " v = normals[1,:].A1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99554:Assign_L108_C4", "label": "w =", "type": "assigned_variable", "loc": [108, 108], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99554:FunctionDef_L100_C0", "vector": [14, 1, 0.5625, 0.0052, 1, 0.3, 0.7143, 549, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "w", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " w = normals[2,:].A1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99554:If_L110_C4", "label": "if", "type": "if", "loc": [110, 118], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99554:FunctionDef_L100_C0", "vector": [4, 1, 0.5938, 0.0469, 1, 0.3, 0.8571, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if curvature != None:\n curvature = np.array(curvature)\n #idxs = np.where(curvature>0.03)\n #mlab.points3d(x[idxs],y[idxs],z[idxs],curvature[idxs],mode='sphere',scale_factor=0.1,mask_points=1)\n mlab.points3d(x,y,z,curvature,mode='sphere',scale_factor=0.1,mask_points=1, color=color)\n# mlab.points3d(x,y,z,mode='point')\n mlab.colorbar()\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99554:Assign_L111_C8", "label": "curvature = array()", "type": "assigned_variable", "loc": [111, 111], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99554:If_L110_C4", "vector": [14, 2, 0.5781, 0.0052, 2, 0.74, 0.0, 420, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "curvature", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " curvature = np.array(curvature)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99554:Expr_L114_C8", "label": "points3d()", "type": "expression", "loc": [114, 114], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99554:If_L110_C4", "vector": [8, 2, 0.5938, 0.0052, 2, 0.74, 0.3333, 243, 3, 8, 0, 0, 0, 0, 1], "semantic": {"name": "points3d", "arg_names": [], "import_names": [], "rhs_call_name": "points3d", "annotation": ""}, "snippet": " mlab.points3d(x,y,z,curvature,mode='sphere',scale_factor=0.1,mask_points=1, color=color)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99554:Expr_L116_C8", "label": "colorbar()", "type": "expression", "loc": [116, 116], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99554:If_L110_C4", "vector": [8, 2, 0.6042, 0.0052, 2, 0.74, 0.6667, 915, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "colorbar", "arg_names": [], "import_names": [], "rhs_call_name": "colorbar", "annotation": ""}, "snippet": " mlab.colorbar()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99554:Expr_L118_C8", "label": "points3d()", "type": "expression", "loc": [118, 118], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99554:If_L110_C4", "vector": [8, 2, 0.6146, 0.0052, 2, 0.74, 1.0, 243, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "points3d", "arg_names": [], "import_names": [], "rhs_call_name": "points3d", "annotation": ""}, "snippet": " mlab.points3d(x,y,z,mode='point')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99554:Expr_L119_C4", "label": "quiver3d()", "type": "expression", "loc": [119, 120], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99554:FunctionDef_L100_C0", "vector": [8, 1, 0.6224, 0.0104, 1, 0.3, 1.0, 147, 3, 9, 0, 0, 0, 0, 1], "semantic": {"name": "quiver3d", "arg_names": [], "import_names": [], "rhs_call_name": "quiver3d", "annotation": ""}, "snippet": " mlab.quiver3d(x, y, z, u, v, w, mask_points=mask_points,\n scale_factor=scale_factor, color=color)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99554:FunctionDef_L126_C0", "label": "plot_cuboid", "type": "function", "loc": [126, 132], "level": 0, "parent": null, "vector": [2, 0, 0.6719, 0.0365, 0, 0.66, 0.8667, 494, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "plot_cuboid", "arg_names": ["corner_tups"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def plot_cuboid(corner_tups):\n for tup in corner_tups:\n p1 = tup[0]\n p2 = tup[1]\n mlab.plot3d([p1[0,0],p2[0,0]],[p1[1,0],p2[1,0]],\n [p1[2,0],p2[2,0]],color=(1.,1.,0.),\n representation='wireframe',tube_radius=None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99554:For_L127_C4", "label": "for tup", "type": "for", "loc": [127, 132], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99554:FunctionDef_L126_C0", "vector": [6, 1, 0.6745, 0.0312, 1, 0.94, 0.0, 218, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "tup", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for tup in corner_tups:\n p1 = tup[0]\n p2 = tup[1]\n mlab.plot3d([p1[0,0],p2[0,0]],[p1[1,0],p2[1,0]],\n [p1[2,0],p2[2,0]],color=(1.,1.,0.),\n representation='wireframe',tube_radius=None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99554:Assign_L128_C8", "label": "p1 =", "type": "assigned_variable", "loc": [128, 128], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99554:For_L127_C4", "vector": [14, 2, 0.6667, 0.0052, 2, 0.98, 0.0, 87, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "p1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p1 = tup[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99554:Assign_L129_C8", "label": "p2 =", "type": "assigned_variable", "loc": [129, 129], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99554:For_L127_C4", "vector": [14, 2, 0.6719, 0.0052, 2, 0.98, 0.5, 843, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "p2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p2 = tup[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99554:Expr_L130_C8", "label": "plot3d()", "type": "expression", "loc": [130, 132], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99554:For_L127_C4", "vector": [8, 2, 0.6823, 0.0156, 2, 0.98, 1.0, 290, 3, 6, 0, 0, 0, 0, 1], "semantic": {"name": "plot3d", "arg_names": [], "import_names": [], "rhs_call_name": "plot3d", "annotation": ""}, "snippet": " mlab.plot3d([p1[0,0],p2[0,0]],[p1[1,0],p2[1,0]],\n [p1[2,0],p2[2,0]],color=(1.,1.,0.),\n representation='wireframe',tube_radius=None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99554:FunctionDef_L136_C0", "label": "show", "type": "function", "loc": [136, 137], "level": 0, "parent": null, "vector": [2, 0, 0.7109, 0.0104, 0, 0.66, 0.9333, 497, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "show", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def show():\n mlab.show()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99554:Expr_L137_C4", "label": "show()", "type": "expression", "loc": [137, 137], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99554:FunctionDef_L136_C0", "vector": [8, 1, 0.7135, 0.0052, 1, 0.16, 0.0, 497, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "show", "arg_names": [], "import_names": [], "rhs_call_name": "show", "annotation": ""}, "snippet": " mlab.show()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99554:If_L141_C0", "label": "if", "type": "if", "loc": [141, 190], "level": 0, "parent": null, "vector": [4, 0, 0.862, 0.2604, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 25], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n p = optparse.OptionParser()\n\n p.add_option('-c', action='store', type='string', dest='pts_pkl',\n help='pkl file with 3D points')\n p.add_option('-f', action='store', type='string', dest='dict_pkl',\n help='pkl file with 3D dict')\n p.add_option('--save_cloud', action='store_true', dest='save_cloud',"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99554:Assign_L142_C4", "label": "p = OptionParser()", "type": "assigned_variable", "loc": [142, 142], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99554:If_L141_C0", "vector": [14, 1, 0.7396, 0.0052, 1, 0.22, 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_99554:Expr_L144_C4", "label": "add_option()", "type": "expression", "loc": [144, 145], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99554:If_L141_C0", "vector": [8, 1, 0.7526, 0.0104, 1, 0.22, 0.05, 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', action='store', type='string', dest='pts_pkl',\n help='pkl file with 3D points')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99554:Expr_L146_C4", "label": "add_option()", "type": "expression", "loc": [146, 147], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99554:If_L141_C0", "vector": [8, 1, 0.763, 0.0104, 1, 0.22, 0.1, 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', action='store', type='string', dest='dict_pkl',\n help='pkl file with 3D dict')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99554:Expr_L148_C4", "label": "add_option()", "type": "expression", "loc": [148, 149], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99554:If_L141_C0", "vector": [8, 1, 0.7734, 0.0104, 1, 0.22, 0.15, 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('--save_cloud', action='store_true', dest='save_cloud',\n help='pickle the point cloud (3xN matrix)')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99554:Expr_L150_C4", "label": "add_option()", "type": "expression", "loc": [150, 152], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99554:If_L141_C0", "vector": [8, 1, 0.7865, 0.0156, 1, 0.22, 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('--pan_angle', action='store', type='float',\n dest='max_pan_angle', default=60.0,\n help='angle in DEGREES. points b/w (-pan_angle and +pan_angle) are displayed. [default=60.]')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99554:Expr_L153_C4", "label": "add_option()", "type": "expression", "loc": [153, 155], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99554:If_L141_C0", "vector": [8, 1, 0.8021, 0.0156, 1, 0.22, 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('--max_dist', action='store', type='float',\n dest='max_dist', default=3.0,\n help='maximum distance (meters). Points further than this are discarded. [default=3.]')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99554:Assign_L157_C4", "label": "opt, args = parse_args()", "type": "assigned_variable", "loc": [157, 157], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99554:If_L141_C0", "vector": [14, 1, 0.8177, 0.0052, 1, 0.22, 0.3, 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_99554:Assign_L159_C4", "label": "pts_pkl_fname =", "type": "assigned_variable", "loc": [159, 159], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99554:If_L141_C0", "vector": [14, 1, 0.8281, 0.0052, 1, 0.22, 0.35, 352, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pts_pkl_fname", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pts_pkl_fname = opt.pts_pkl"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99554:Assign_L160_C4", "label": "dict_pkl_fname =", "type": "assigned_variable", "loc": [160, 160], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99554:If_L141_C0", "vector": [14, 1, 0.8333, 0.0052, 1, 0.22, 0.4, 557, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "dict_pkl_fname", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " dict_pkl_fname = opt.dict_pkl"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99554:Assign_L161_C4", "label": "save_cloud_flag =", "type": "assigned_variable", "loc": [161, 161], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99554:If_L141_C0", "vector": [14, 1, 0.8385, 0.0052, 1, 0.22, 0.45, 347, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "save_cloud_flag", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " save_cloud_flag = opt.save_cloud"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99554:Assign_L162_C4", "label": "max_pan_angle =", "type": "assigned_variable", "loc": [162, 162], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99554:If_L141_C0", "vector": [14, 1, 0.8438, 0.0052, 1, 0.22, 0.5, 517, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "max_pan_angle", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " max_pan_angle = opt.max_pan_angle"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99554:Assign_L163_C4", "label": "max_dist =", "type": "assigned_variable", "loc": [163, 163], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99554:If_L141_C0", "vector": [14, 1, 0.849, 0.0052, 1, 0.22, 0.55, 822, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "max_dist", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " max_dist = opt.max_dist"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99554:If_L165_C4", "label": "if", "type": "if", "loc": [165, 178], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99554:If_L141_C0", "vector": [4, 1, 0.8932, 0.0729, 1, 0.22, 0.6, 0, 0, 0, 0, 0, 0, 0, 10], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if pts_pkl_fname != None:\n pts = ut.load_pickle(pts_pkl_fname)\n elif dict_pkl_fname != None:\n import tilting_hokuyo.processing_3d as p3d\n dict = ut.load_pickle(dict_pkl_fname)\n pts = p3d.generate_pointcloud(dict['pos_list'],dict['scan_list'],\n math.radians(-max_pan_angle),\n math.radians(max_pan_angle),"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99554:Assign_L166_C8", "label": "pts = load_pickle()", "type": "assigned_variable", "loc": [166, 166], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99554:If_L165_C4", "vector": [14, 2, 0.8646, 0.0052, 2, 0.25, 0.0, 195, 3, 1, 0, 0, 65, 10, 1], "semantic": {"name": "pts", "arg_names": [], "import_names": [], "rhs_call_name": "load_pickle", "annotation": ""}, "snippet": " pts = ut.load_pickle(pts_pkl_fname)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99554:If_L167_C4", "label": "if", "type": "if", "loc": [167, 178], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99554:If_L165_C4", "vector": [4, 2, 0.8984, 0.0625, 2, 0.25, 1.0, 0, 0, 0, 0, 0, 0, 0, 9], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif dict_pkl_fname != None:\n import tilting_hokuyo.processing_3d as p3d\n dict = ut.load_pickle(dict_pkl_fname)\n pts = p3d.generate_pointcloud(dict['pos_list'],dict['scan_list'],\n math.radians(-max_pan_angle),\n math.radians(max_pan_angle),\n dict['l1'],dict['l2'],\n min_tilt=math.radians(-90),max_tilt=math.radians(90))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99554:Import_L168_C8", "label": "tilting_hokuyo.processing_3d import p3d", "type": "import", "loc": [168, 168], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99554:If_L167_C4", "vector": [1, 3, 0.875, 0.0052, 3, 0.85, 0.0, 474, 0, 1, 0, 0, 474, 0, 0], "semantic": {"name": "tilting_hokuyo.processing_3d", "arg_names": [], "import_names": ["p3d"], "rhs_call_name": "", "annotation": ""}, "snippet": " import tilting_hokuyo.processing_3d as p3d"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99554:Assign_L169_C8", "label": "dict = load_pickle()", "type": "assigned_variable", "loc": [169, 169], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99554:If_L167_C4", "vector": [14, 3, 0.8802, 0.0052, 3, 0.85, 0.2, 827, 3, 1, 0, 0, 65, 10, 1], "semantic": {"name": "dict", "arg_names": [], "import_names": [], "rhs_call_name": "load_pickle", "annotation": ""}, "snippet": " dict = ut.load_pickle(dict_pkl_fname)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99554:Assign_L170_C8", "label": "pts = generate_pointcloud()", "type": "assigned_variable", "loc": [170, 174], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99554:If_L167_C4", "vector": [14, 3, 0.8958, 0.026, 3, 0.85, 0.4, 195, 3, 8, 0, 0, 989, 10, 5], "semantic": {"name": "pts", "arg_names": [], "import_names": [], "rhs_call_name": "generate_pointcloud", "annotation": ""}, "snippet": " pts = p3d.generate_pointcloud(dict['pos_list'],dict['scan_list'],\n math.radians(-max_pan_angle),\n math.radians(max_pan_angle),\n dict['l1'],dict['l2'],\n min_tilt=math.radians(-90),max_tilt=math.radians(90))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99554:Expr_L176_C8", "label": "print()", "type": "expression", "loc": [176, 176], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99554:If_L167_C4", "vector": [8, 3, 0.9167, 0.0052, 3, 0.85, 0.6, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Specify either a pts pkl or a dict pkl (-c or -f)')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99554:Expr_L177_C8", "label": "print()", "type": "expression", "loc": [177, 177], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99554:If_L167_C4", "vector": [8, 3, 0.9219, 0.0052, 3, 0.85, 0.8, 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_99554:Expr_L178_C8", "label": "exit()", "type": "expression", "loc": [178, 178], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99554:If_L167_C4", "vector": [8, 3, 0.9271, 0.0052, 3, 0.85, 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_99554:Assign_L180_C4", "label": "dist_mat = norm()", "type": "assigned_variable", "loc": [180, 180], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99554:If_L141_C0", "vector": [14, 1, 0.9375, 0.0052, 1, 0.22, 0.65, 752, 3, 1, 0, 0, 902, 10, 1], "semantic": {"name": "dist_mat", "arg_names": [], "import_names": [], "rhs_call_name": "norm", "annotation": ""}, "snippet": " dist_mat = ut.norm(pts)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99554:Assign_L181_C4", "label": "idxs =", "type": "assigned_variable", "loc": [181, 181], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99554:If_L141_C0", "vector": [14, 1, 0.9427, 0.0052, 1, 0.22, 0.7, 677, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "idxs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " idxs = np.where(dist_mat<max_dist)[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99554:Expr_L182_C4", "label": "print()", "type": "expression", "loc": [182, 182], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99554:If_L141_C0", "vector": [8, 1, 0.9479, 0.0052, 1, 0.22, 0.75, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('pts.shape', pts.shape)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99554:Assign_L183_C4", "label": "pts =", "type": "assigned_variable", "loc": [183, 183], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99554:If_L141_C0", "vector": [14, 1, 0.9531, 0.0052, 1, 0.22, 0.8, 195, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pts = pts[:,idxs.A1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99554:Expr_L184_C4", "label": "print()", "type": "expression", "loc": [184, 184], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99554:If_L141_C0", "vector": [8, 1, 0.9583, 0.0052, 1, 0.22, 0.85, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('pts.shape', pts.shape)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99554:If_L186_C4", "label": "if", "type": "if", "loc": [186, 187], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99554:If_L141_C0", "vector": [4, 1, 0.9714, 0.0104, 1, 0.22, 0.9, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if save_cloud_flag:\n ut.save_pickle(pts,'numpy_pc_'+ut.formatted_time()+'.pkl')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99554:Expr_L187_C8", "label": "save_pickle()", "type": "expression", "loc": [187, 187], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99554:If_L186_C4", "vector": [8, 2, 0.974, 0.0052, 2, 0.13, 0.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(pts,'numpy_pc_'+ut.formatted_time()+'.pkl')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99554:Expr_L189_C4", "label": "plot_points()", "type": "expression", "loc": [189, 189], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99554:If_L141_C0", "vector": [8, 1, 0.9844, 0.0052, 1, 0.22, 0.95, 111, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "plot_points", "arg_names": [], "import_names": [], "rhs_call_name": "plot_points", "annotation": ""}, "snippet": " plot_points(pts)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99554:Expr_L190_C4", "label": "show()", "type": "expression", "loc": [190, 190], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99554:If_L141_C0", "vector": [8, 1, 0.9896, 0.0052, 1, 0.22, 1.0, 497, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "show", "arg_names": [], "import_names": [], "rhs_call_name": "show", "annotation": ""}, "snippet": " mlab.show()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99554:FunctionDef_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99554:Expr_L48_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99554:FunctionDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99554:Expr_L55_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99554:FunctionDef_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99554:If_L65_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99554:If_L65_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99554:Expr_L66_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99554:If_L65_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99554:Expr_L68_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99554:If_L65_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99554:Expr_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99554:FunctionDef_L80_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99554:If_L81_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99554:If_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99554:Expr_L82_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99554:If_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99554:Expr_L83_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99554:If_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99554:Expr_L85_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99554:FunctionDef_L100_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99554:Assign_L102_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99554:FunctionDef_L100_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99554:Assign_L103_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99554:FunctionDef_L100_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99554:Assign_L104_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99554:FunctionDef_L100_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99554:Assign_L106_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99554:FunctionDef_L100_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99554:Assign_L107_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99554:FunctionDef_L100_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99554:Assign_L108_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99554:FunctionDef_L100_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99554:If_L110_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99554:If_L110_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99554:Assign_L111_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99554:If_L110_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99554:Expr_L114_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99554:If_L110_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99554:Expr_L116_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99554:If_L110_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99554:Expr_L118_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99554:FunctionDef_L100_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99554:Expr_L119_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99554:FunctionDef_L126_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99554:For_L127_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99554:For_L127_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99554:Assign_L128_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99554:For_L127_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99554:Assign_L129_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99554:For_L127_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99554:Expr_L130_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99554:FunctionDef_L136_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99554:Expr_L137_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99554:If_L141_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99554:Assign_L142_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99554:If_L141_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99554:Expr_L144_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99554:If_L141_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99554:Expr_L146_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99554:If_L141_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99554:Expr_L148_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99554:If_L141_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99554:Expr_L150_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99554:If_L141_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99554:Expr_L153_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99554:If_L141_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99554:Assign_L157_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99554:If_L141_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99554:Assign_L159_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99554:If_L141_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99554:Assign_L160_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99554:If_L141_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99554:Assign_L161_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99554:If_L141_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99554:Assign_L162_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99554:If_L141_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99554:Assign_L163_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99554:If_L141_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99554:If_L165_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99554:If_L165_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99554:Assign_L166_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99554:If_L165_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99554:If_L167_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99554:If_L167_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99554:Import_L168_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99554:If_L167_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99554:Assign_L169_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99554:If_L167_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99554:Assign_L170_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99554:If_L167_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99554:Expr_L176_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99554:If_L167_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99554:Expr_L177_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99554:If_L167_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99554:Expr_L178_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99554:If_L141_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99554:Assign_L180_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99554:If_L141_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99554:Assign_L181_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99554:If_L141_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99554:Expr_L182_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99554:If_L141_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99554:Assign_L183_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99554:If_L141_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99554:Expr_L184_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99554:If_L141_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99554:If_L186_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99554:If_L186_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99554:Expr_L187_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99554:If_L141_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99554:Expr_L189_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99554:If_L141_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99554:Expr_L190_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 (Healthcare Robotics Lab, Georgia Tech.) import roslib; roslib.load_manifest('hrl_tilting_hokuyo') import time import sys, optparse import numpy as np, math import hrl_lib.util as ut import robotis.robotis_servo as rs import hrl_hokuyo.hokuyo_scan as hs class tilt_hokuyo(): def __init__(self, dev_name, servo_id, hokuyo, baudrate=57600, l1=0.,l2=0.035, camera_name=None): ''' dev_name - name of serial device of the servo controller (e.g. '/dev/robot/servo0') servo_id - 2,3,4 ... (2 to 253) hokuyo - Hokuyo object. baudrate - for the servo controller. camera_name - name of the ''' self.servo = rs.robotis_servo(dev_name,servo_id,baudrate) self.hokuyo = hokuyo self.l1 = l1 self.l2 = l2 def scan(self, range, speed, save_scan=False,avg=1, _max_retries=0): ''' range - (start,end) in radians speed - scan speed in radians/sec save_scan - save a dict of pos_list,scan_list,l1,l2 avg - average scans from the hokuyo. returns pos_list,scan_list. list of angles and HokuyoScans ''' ramp_up_angle = math.radians(5) if abs(range[0])+ramp_up_angle > math.radians(95) or \ abs(range[1])+ramp_up_angle > math.radians(95): print 'tilt_hokuyo_servo.scan:bad angles- ',math.degrees(range[0]),math.degrees(range[1]) min_angle = min(range[0],range[1]) max_angle = max(range[0],range[1]) # if max_angle>math.radians(60.5): # print 'tilt_hokuyo_servo.scan: maximum angle is too high, will graze bottom plate of mount. angle:', math.degrees(max_angle) # sys.exit() self.servo.move_angle(range[0]+np.sign(range[0])*ramp_up_angle) # time.sleep(0.05) # while(self.servo.is_moving()): # continue self.servo.move_angle(range[1]+np.sign(range[1])*ramp_up_angle,speed,blocking=False) #self.servo.move_angle(range[1], speed) time.sleep(0.05) t1 = time.time() pos_list = [] scan_list = [] while self.servo.is_moving(): pos = self.servo.read_angle() #print 'h6', pos if pos < min_angle or pos > max_angle: continue pos_list.append(pos) plane_scan = self.hokuyo.get_scan(avoid_duplicate=True,remove_graze=True,avg=avg) scan_list.append(plane_scan) t2 = time.time() self.servo.move_angle(0) if save_scan: date_name = ut.formatted_time() dict = {'pos_list': pos_list,'scan_list': scan_list, 'l1': self.l1, 'l2': self.l2} ut.save_pickle(dict,date_name+'_dict.pkl') runtime = t2 - t1 expected_number_scans = 19.0 * runtime * (1.0/avg) scan_threshold = expected_number_scans - expected_number_scans*.2 if len(scan_list) < scan_threshold: print 'tilt_hokuyo_servo.scan: WARNING! Expected at least %d scans but got only %d scans.' % (expected_number_scans, len(scan_list)) print 'tilt_hokuyo_servo.scan: trying again.. retries:', _max_retries if _max_retries > 0: return self.scan(range, speed, save_scan, avg, _max_retries = _max_retries-1) else: print 'tilt_hokuyo_servo.scan: returning anyway' print 'tilt_hokuyo_servo.scan: got %d scans over range %f with speed %f.' % (len(scan_list), (max_angle - min_angle), speed) return pos_list,scan_list def scan_around_pt(self,pt,speed=math.radians(5)): ''' pt - in thok coord frame. this function scans in a fixed range. returns pos_lit,scan_list ''' ang1 = math.radians(40) ang2 = math.radians(0) tilt_angles = (ang1,ang2) pos_list,scan_list = self.scan(tilt_angles,speed=speed) return pos_list,scan_list if __name__ == '__main__': # urg mount - l1=0.06, l2=0.05 # utm - l1 = 0.0, l2 = 0.035 p = optparse.OptionParser() p.add_option('-d', action='store', type='string', dest='servo_dev_name', default='/dev/robot/servo0', help='servo device string. [default= /dev/robot/servo0]') p.add_option('-t', action='store', type='string', dest='hokuyo_type',default='utm', help='hokuyo_type. urg or utm [default=utm]') p.add_option('-n', action='store', type='int', dest='hokuyo_number', default=0, help='hokuyo number. 0,1,2 ... [default=0]') p.add_option('--save_scan',action='store_true',dest='save_scan', help='save the scan [dict and cloud]') p.add_option('--speed', action='store', type='float', dest='scan_speed', help='scan speed in deg/s.[default=5]',default=5.) p.add_option('--ang0', action='store', type='float', dest='ang0', help='starting tilt angle for scan (degrees). [default=20]', default=20.0) p.add_option('--ang1', action='store', type='float', dest='ang1', help='ending tilt angle for scan (degrees). default=[-20]', default=-20.0) p.add_option('--id', action='store', type='int', dest='servo_id', default=2, help='servo id 1,2 ... [default=2]') p.add_option('--l2', action='store', type='float', dest='l2', help='l2 (in meters) [0.035 for ElE, -0.055 for mekabot]') p.add_option('--flip', action='store_true', dest='flip',help='flip the hokuyo scan') opt, args = p.parse_args() hokuyo_type = opt.hokuyo_type hokuyo_number = opt.hokuyo_number servo_dev_name = opt.servo_dev_name save_scan = opt.save_scan scan_speed = math.radians(opt.scan_speed) ang0 = opt.ang0 ang1 = opt.ang1 servo_id = opt.servo_id l2 = opt.l2 if l2==None: print 'please specify l2. do -h for details.' print 'Exiting...' sys.exit() flip = opt.flip if hokuyo_type == 'utm': h = hs.Hokuyo('utm',hokuyo_number,flip=flip) elif hokuyo_type == 'urg': h = hs.Hokuyo('urg',hokuyo_number,flip=flip) else: print 'unknown hokuyo type: ', hokuyo_type thok = tilt_hokuyo(servo_dev_name,servo_id,h,l1=0.,l2=l2) tilt_angles = (math.radians(ang0),math.radians(ang1)) pos_list,scan_list = thok.scan(tilt_angles,speed=scan_speed,save_scan=save_scan) sys.exit() # to kill the hokuyo thread.
ajibawa-2023/Python-Code-Large/train/row_99555
94
191
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99555:Import_L30_C0", "label": "roslib import roslib", "type": "import", "loc": [30, 30], "level": 0, "parent": null, "vector": [1, 0, 0.1571, 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; roslib.load_manifest('hrl_tilting_hokuyo')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99555:Expr_L30_C15", "label": "load_manifest()", "type": "expression", "loc": [30, 30], "level": 0, "parent": null, "vector": [8, 0, 0.1571, 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": "import roslib; roslib.load_manifest('hrl_tilting_hokuyo')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99555:Import_L32_C0", "label": "time import time", "type": "import", "loc": [32, 32], "level": 0, "parent": null, "vector": [1, 0, 0.1675, 0.0052, 0, 0.66, 0.2222, 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_99555:Import_L33_C0", "label": "sys import sys, optparse", "type": "import", "loc": [33, 33], "level": 0, "parent": null, "vector": [1, 0, 0.1728, 0.0052, 0, 0.66, 0.3333, 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_99555:Import_L35_C0", "label": "numpy import np, math", "type": "import", "loc": [35, 35], "level": 0, "parent": null, "vector": [1, 0, 0.1832, 0.0052, 0, 0.66, 0.4444, 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_99555:Import_L37_C0", "label": "hrl_lib.util import ut", "type": "import", "loc": [37, 37], "level": 0, "parent": null, "vector": [1, 0, 0.1937, 0.0052, 0, 0.66, 0.5556, 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_99555:Import_L38_C0", "label": "robotis.robotis_servo import rs", "type": "import", "loc": [38, 38], "level": 0, "parent": null, "vector": [1, 0, 0.199, 0.0052, 0, 0.66, 0.6667, 891, 0, 1, 0, 0, 891, 0, 0], "semantic": {"name": "robotis.robotis_servo", "arg_names": [], "import_names": ["rs"], "rhs_call_name": "", "annotation": ""}, "snippet": "import robotis.robotis_servo as rs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99555:Import_L39_C0", "label": "hrl_hokuyo.hokuyo_scan import hs", "type": "import", "loc": [39, 39], "level": 0, "parent": null, "vector": [1, 0, 0.2042, 0.0052, 0, 0.66, 0.7778, 184, 0, 1, 0, 0, 184, 0, 0], "semantic": {"name": "hrl_hokuyo.hokuyo_scan", "arg_names": [], "import_names": ["hs"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_hokuyo.hokuyo_scan as hs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99555:ClassDef_L42_C0", "label": "tilt_hokuyo", "type": "class", "loc": [42, 128], "level": 0, "parent": null, "vector": [3, 0, 0.445, 0.4555, 0, 0.66, 0.8889, 577, 0, 3, 0, 0, 0, 0, 38], "semantic": {"name": "tilt_hokuyo", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class tilt_hokuyo():\n def __init__(self, dev_name, servo_id, hokuyo, baudrate=57600, l1=0.,l2=0.035, camera_name=None):\n ''' dev_name - name of serial device of the servo controller (e.g. '/dev/robot/servo0')\n servo_id - 2,3,4 ... (2 to 253)\n hokuyo - Hokuyo object.\n baudrate - for the servo controller.\n camera_name - name of the \n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99555:FunctionDef_L43_C4", "label": "__init__", "type": "function", "loc": [43, 54], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99555:ClassDef_L42_C0", "vector": [2, 1, 0.2539, 0.0628, 1, 0.86, 0.0, 555, 0, 8, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "dev_name", "servo_id", "hokuyo", "baudrate", "l1", "l2", "camera_name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, dev_name, servo_id, hokuyo, baudrate=57600, l1=0.,l2=0.035, camera_name=None):\n ''' dev_name - name of serial device of the servo controller (e.g. '/dev/robot/servo0')\n servo_id - 2,3,4 ... (2 to 253)\n hokuyo - Hokuyo object.\n baudrate - for the servo controller.\n camera_name - name of the \n '''\n self.servo = rs.robotis_servo(dev_name,servo_id,baudrate)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99555:Expr_L44_C8", "label": "expression", "type": "expression", "loc": [44, 49], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99555:FunctionDef_L43_C4", "vector": [8, 2, 0.2435, 0.0314, 2, 0.37, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' dev_name - name of serial device of the servo controller (e.g. '/dev/robot/servo0')\n servo_id - 2,3,4 ... (2 to 253)\n hokuyo - Hokuyo object.\n baudrate - for the servo controller.\n camera_name - name of the \n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99555:Assign_L50_C8", "label": "self.servo = robotis_servo()", "type": "assigned_variable", "loc": [50, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99555:FunctionDef_L43_C4", "vector": [14, 2, 0.2618, 0.0052, 2, 0.37, 0.25, 172, 3, 3, 0, 0, 169, 10, 1], "semantic": {"name": "self.servo", "arg_names": [], "import_names": [], "rhs_call_name": "robotis_servo", "annotation": ""}, "snippet": " self.servo = rs.robotis_servo(dev_name,servo_id,baudrate)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99555:Assign_L52_C8", "label": "self.hokuyo =", "type": "assigned_variable", "loc": [52, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99555:FunctionDef_L43_C4", "vector": [14, 2, 0.2723, 0.0052, 2, 0.37, 0.5, 640, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.hokuyo", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.hokuyo = hokuyo"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99555:Assign_L53_C8", "label": "self.l1 =", "type": "assigned_variable", "loc": [53, 53], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99555:FunctionDef_L43_C4", "vector": [14, 2, 0.2775, 0.0052, 2, 0.37, 0.75, 911, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.l1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.l1 = l1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99555:Assign_L54_C8", "label": "self.l2 =", "type": "assigned_variable", "loc": [54, 54], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99555:FunctionDef_L43_C4", "vector": [14, 2, 0.2827, 0.0052, 2, 0.37, 1.0, 435, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.l2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.l2 = l2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99555:FunctionDef_L56_C4", "label": "scan", "type": "function", "loc": [56, 116], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99555:ClassDef_L42_C0", "vector": [2, 1, 0.4503, 0.3194, 1, 0.86, 0.5, 202, 0, 6, 1, 0, 0, 0, 33], "semantic": {"name": "scan", "arg_names": ["self", "range", "speed", "save_scan", "avg", "_max_retries"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def scan(self, range, speed, save_scan=False,avg=1, _max_retries=0):\n ''' range - (start,end) in radians\n speed - scan speed in radians/sec\n save_scan - save a dict of pos_list,scan_list,l1,l2\n avg - average scans from the hokuyo.\n returns pos_list,scan_list. list of angles and HokuyoScans\n '''\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99555:Expr_L57_C8", "label": "expression", "type": "expression", "loc": [57, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99555:FunctionDef_L56_C4", "vector": [8, 2, 0.3115, 0.0314, 2, 0.34, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' range - (start,end) in radians\n speed - scan speed in radians/sec\n save_scan - save a dict of pos_list,scan_list,l1,l2\n avg - average scans from the hokuyo.\n returns pos_list,scan_list. list of angles and HokuyoScans\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99555:Assign_L64_C8", "label": "ramp_up_angle = radians()", "type": "assigned_variable", "loc": [64, 64], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99555:FunctionDef_L56_C4", "vector": [14, 2, 0.3351, 0.0052, 2, 0.34, 0.05, 455, 3, 1, 0, 0, 383, 10, 1], "semantic": {"name": "ramp_up_angle", "arg_names": [], "import_names": [], "rhs_call_name": "radians", "annotation": ""}, "snippet": " ramp_up_angle = math.radians(5)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99555:If_L65_C8", "label": "if", "type": "if", "loc": [65, 67], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99555:FunctionDef_L56_C4", "vector": [4, 2, 0.3455, 0.0157, 2, 0.34, 0.1, 0, 0, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if abs(range[0])+ramp_up_angle > math.radians(95) or \\\n abs(range[1])+ramp_up_angle > math.radians(95):\n print('tilt_hokuyo_servo.scan:bad angles- ',math.degrees(range[0]),math.degrees(range[1]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99555:Expr_L67_C12", "label": "print()", "type": "expression", "loc": [67, 67], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99555:If_L65_C8", "vector": [8, 3, 0.3508, 0.0052, 3, 0.95, 0.0, 535, 3, 3, 0, 0, 0, 0, 3], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('tilt_hokuyo_servo.scan:bad angles- ',math.degrees(range[0]),math.degrees(range[1]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99555:Assign_L69_C8", "label": "min_angle = min()", "type": "assigned_variable", "loc": [69, 69], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99555:FunctionDef_L56_C4", "vector": [14, 2, 0.3613, 0.0052, 2, 0.34, 0.15, 278, 3, 2, 0, 0, 867, 10, 1], "semantic": {"name": "min_angle", "arg_names": [], "import_names": [], "rhs_call_name": "min", "annotation": ""}, "snippet": " min_angle = min(range[0],range[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99555:Assign_L70_C8", "label": "max_angle = max()", "type": "assigned_variable", "loc": [70, 70], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99555:FunctionDef_L56_C4", "vector": [14, 2, 0.3665, 0.0052, 2, 0.34, 0.2, 451, 3, 2, 0, 0, 442, 10, 1], "semantic": {"name": "max_angle", "arg_names": [], "import_names": [], "rhs_call_name": "max", "annotation": ""}, "snippet": " max_angle = max(range[0],range[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99555:Expr_L75_C8", "label": "move_angle()", "type": "expression", "loc": [75, 75], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99555:FunctionDef_L56_C4", "vector": [8, 2, 0.3927, 0.0052, 2, 0.34, 0.25, 293, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "move_angle", "arg_names": [], "import_names": [], "rhs_call_name": "move_angle", "annotation": ""}, "snippet": " self.servo.move_angle(range[0]+np.sign(range[0])*ramp_up_angle)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99555:Expr_L80_C8", "label": "move_angle()", "type": "expression", "loc": [80, 80], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99555:FunctionDef_L56_C4", "vector": [8, 2, 0.4188, 0.0052, 2, 0.34, 0.3, 293, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "move_angle", "arg_names": [], "import_names": [], "rhs_call_name": "move_angle", "annotation": ""}, "snippet": " self.servo.move_angle(range[1]+np.sign(range[1])*ramp_up_angle,speed,blocking=False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99555:Expr_L82_C8", "label": "sleep()", "type": "expression", "loc": [82, 82], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99555:FunctionDef_L56_C4", "vector": [8, 2, 0.4293, 0.0052, 2, 0.34, 0.35, 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_99555:Assign_L83_C8", "label": "t1 = time()", "type": "assigned_variable", "loc": [83, 83], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99555:FunctionDef_L56_C4", "vector": [14, 2, 0.4346, 0.0052, 2, 0.34, 0.4, 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_99555:Assign_L85_C8", "label": "pos_list =", "type": "assigned_variable", "loc": [85, 85], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99555:FunctionDef_L56_C4", "vector": [14, 2, 0.445, 0.0052, 2, 0.34, 0.45, 279, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "pos_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pos_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99555:Assign_L86_C8", "label": "scan_list =", "type": "assigned_variable", "loc": [86, 86], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99555:FunctionDef_L56_C4", "vector": [14, 2, 0.4503, 0.0052, 2, 0.34, 0.5, 378, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "scan_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " scan_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99555:While_L87_C8", "label": "while", "type": "while", "loc": [87, 94], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99555:FunctionDef_L56_C4", "vector": [5, 2, 0.4738, 0.0419, 2, 0.34, 0.55, 0, 3, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while self.servo.is_moving():\n pos = self.servo.read_angle()\n #print 'h6', pos\n if pos < min_angle or pos > max_angle:\n continue\n pos_list.append(pos)\n plane_scan = self.hokuyo.get_scan(avoid_duplicate=True,remove_graze=True,avg=avg)\n scan_list.append(plane_scan)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99555:Assign_L88_C12", "label": "pos = read_angle()", "type": "assigned_variable", "loc": [88, 88], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99555:While_L87_C8", "vector": [14, 3, 0.4607, 0.0052, 3, 0.63, 0.0, 627, 3, 0, 0, 0, 27, 10, 1], "semantic": {"name": "pos", "arg_names": [], "import_names": [], "rhs_call_name": "read_angle", "annotation": ""}, "snippet": " pos = self.servo.read_angle()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99555:If_L90_C12", "label": "if", "type": "if", "loc": [90, 91], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99555:While_L87_C8", "vector": [4, 3, 0.4738, 0.0105, 3, 0.63, 0.25, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if pos < min_angle or pos > max_angle:\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99555:Expr_L92_C12", "label": "append()", "type": "expression", "loc": [92, 92], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99555:While_L87_C8", "vector": [8, 3, 0.4817, 0.0052, 3, 0.63, 0.5, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " pos_list.append(pos)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99555:Assign_L93_C12", "label": "plane_scan = get_scan()", "type": "assigned_variable", "loc": [93, 93], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99555:While_L87_C8", "vector": [14, 3, 0.4869, 0.0052, 3, 0.63, 0.75, 640, 3, 3, 0, 0, 630, 10, 1], "semantic": {"name": "plane_scan", "arg_names": [], "import_names": [], "rhs_call_name": "get_scan", "annotation": ""}, "snippet": " plane_scan = self.hokuyo.get_scan(avoid_duplicate=True,remove_graze=True,avg=avg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99555:Expr_L94_C12", "label": "append()", "type": "expression", "loc": [94, 94], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99555:While_L87_C8", "vector": [8, 3, 0.4921, 0.0052, 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": " scan_list.append(plane_scan)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99555:Assign_L95_C8", "label": "t2 = time()", "type": "assigned_variable", "loc": [95, 95], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99555:FunctionDef_L56_C4", "vector": [14, 2, 0.4974, 0.0052, 2, 0.34, 0.6, 469, 3, 0, 0, 0, 654, 10, 1], "semantic": {"name": "t2", "arg_names": [], "import_names": [], "rhs_call_name": "time", "annotation": ""}, "snippet": " t2 = time.time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99555:Expr_L97_C8", "label": "move_angle()", "type": "expression", "loc": [97, 97], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99555:FunctionDef_L56_C4", "vector": [8, 2, 0.5079, 0.0052, 2, 0.34, 0.65, 293, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "move_angle", "arg_names": [], "import_names": [], "rhs_call_name": "move_angle", "annotation": ""}, "snippet": " self.servo.move_angle(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99555:If_L98_C8", "label": "if", "type": "if", "loc": [98, 102], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99555:FunctionDef_L56_C4", "vector": [4, 2, 0.5236, 0.0262, 2, 0.34, 0.7, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if save_scan:\n date_name = ut.formatted_time()\n dict = {'pos_list': pos_list,'scan_list': scan_list,\n 'l1': self.l1, 'l2': self.l2}\n ut.save_pickle(dict,date_name+'_dict.pkl')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99555:Assign_L99_C12", "label": "date_name = formatted_time()", "type": "assigned_variable", "loc": [99, 99], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99555:If_L98_C8", "vector": [14, 3, 0.5183, 0.0052, 3, 0.77, 0.0, 532, 3, 0, 0, 0, 353, 10, 1], "semantic": {"name": "date_name", "arg_names": [], "import_names": [], "rhs_call_name": "formatted_time", "annotation": ""}, "snippet": " date_name = ut.formatted_time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99555:Assign_L100_C12", "label": "dict =", "type": "assigned_variable", "loc": [100, 101], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99555:If_L98_C8", "vector": [14, 3, 0.5262, 0.0105, 3, 0.77, 0.5, 827, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "dict", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " dict = {'pos_list': pos_list,'scan_list': scan_list,\n 'l1': self.l1, 'l2': self.l2}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99555:Expr_L102_C12", "label": "save_pickle()", "type": "expression", "loc": [102, 102], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99555:If_L98_C8", "vector": [8, 3, 0.534, 0.0052, 3, 0.77, 1.0, 390, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "save_pickle", "arg_names": [], "import_names": [], "rhs_call_name": "save_pickle", "annotation": ""}, "snippet": " ut.save_pickle(dict,date_name+'_dict.pkl')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99555:Assign_L104_C8", "label": "runtime =", "type": "assigned_variable", "loc": [104, 104], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99555:FunctionDef_L56_C4", "vector": [14, 2, 0.5445, 0.0052, 2, 0.34, 0.75, 762, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "runtime", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " runtime = t2 - t1 "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99555:Assign_L105_C8", "label": "expected_number_scans =", "type": "assigned_variable", "loc": [105, 105], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99555:FunctionDef_L56_C4", "vector": [14, 2, 0.5497, 0.0052, 2, 0.34, 0.8, 467, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "expected_number_scans", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " expected_number_scans = 19.0 * runtime * (1.0/avg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99555:Assign_L106_C8", "label": "scan_threshold =", "type": "assigned_variable", "loc": [106, 106], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99555:FunctionDef_L56_C4", "vector": [14, 2, 0.555, 0.0052, 2, 0.34, 0.85, 835, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "scan_threshold", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " scan_threshold = expected_number_scans - expected_number_scans*.2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99555:If_L107_C8", "label": "if", "type": "if", "loc": [107, 113], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99555:FunctionDef_L56_C4", "vector": [4, 2, 0.5759, 0.0366, 2, 0.34, 0.9, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(scan_list) < scan_threshold:\n print('tilt_hokuyo_servo.scan: WARNING! Expected at least %d scans but got only %d scans.' % (expected_number_scans, len(scan_list)))\n print('tilt_hokuyo_servo.scan: trying again.. retries:', _max_retries)\n if _max_retries > 0:\n return self.scan(range, speed, save_scan, avg, _max_retries = _max_retries-1)\n else:\n print('tilt_hokuyo_servo.scan: returning anyway')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99555:Expr_L108_C12", "label": "print()", "type": "expression", "loc": [108, 108], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99555:If_L107_C8", "vector": [8, 3, 0.5654, 0.0052, 3, 0.83, 0.0, 535, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('tilt_hokuyo_servo.scan: WARNING! Expected at least %d scans but got only %d scans.' % (expected_number_scans, len(scan_list)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99555:Expr_L109_C12", "label": "print()", "type": "expression", "loc": [109, 109], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99555:If_L107_C8", "vector": [8, 3, 0.5707, 0.0052, 3, 0.83, 0.5, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('tilt_hokuyo_servo.scan: trying again.. retries:', _max_retries)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99555:If_L110_C12", "label": "if", "type": "if", "loc": [110, 113], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99555:If_L107_C8", "vector": [4, 3, 0.5838, 0.0209, 3, 0.83, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if _max_retries > 0:\n return self.scan(range, speed, save_scan, avg, _max_retries = _max_retries-1)\n else:\n print('tilt_hokuyo_servo.scan: returning anyway')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99555:Return_L111_C16", "label": "return", "type": "return", "loc": [111, 111], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99555:If_L110_C12", "vector": [13, 4, 0.5812, 0.0052, 4, 0.35, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.scan(range, speed, save_scan, avg, _max_retries = _max_retries-1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99555:Expr_L113_C16", "label": "print()", "type": "expression", "loc": [113, 113], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99555:If_L110_C12", "vector": [8, 4, 0.5916, 0.0052, 4, 0.35, 1.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('tilt_hokuyo_servo.scan: returning anyway')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99555:Expr_L115_C8", "label": "print()", "type": "expression", "loc": [115, 115], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99555:FunctionDef_L56_C4", "vector": [8, 2, 0.6021, 0.0052, 2, 0.34, 0.95, 535, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('tilt_hokuyo_servo.scan: got %d scans over range %f with speed %f.' % (len(scan_list), (max_angle - min_angle), speed))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99555:Return_L116_C8", "label": "return", "type": "return", "loc": [116, 116], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99555:FunctionDef_L56_C4", "vector": [13, 2, 0.6073, 0.0052, 2, 0.34, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return pos_list,scan_list"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99555:FunctionDef_L118_C4", "label": "scan_around_pt", "type": "function", "loc": [118, 128], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99555:ClassDef_L42_C0", "vector": [2, 1, 0.644, 0.0576, 1, 0.86, 1.0, 412, 0, 3, 1, 0, 0, 0, 4], "semantic": {"name": "scan_around_pt", "arg_names": ["self", "pt", "speed"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def scan_around_pt(self,pt,speed=math.radians(5)):\n ''' pt - in thok coord frame.\n this function scans in a fixed range.\n returns pos_lit,scan_list\n '''\n ang1 = math.radians(40)\n ang2 = math.radians(0)\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99555:Expr_L119_C8", "label": "expression", "type": "expression", "loc": [119, 122], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99555:FunctionDef_L118_C4", "vector": [8, 2, 0.6309, 0.0209, 2, 0.2, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' pt - in thok coord frame.\n this function scans in a fixed range.\n returns pos_lit,scan_list\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99555:Assign_L123_C8", "label": "ang1 = radians()", "type": "assigned_variable", "loc": [123, 123], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99555:FunctionDef_L118_C4", "vector": [14, 2, 0.644, 0.0052, 2, 0.2, 0.2, 800, 3, 1, 0, 0, 383, 10, 1], "semantic": {"name": "ang1", "arg_names": [], "import_names": [], "rhs_call_name": "radians", "annotation": ""}, "snippet": " ang1 = math.radians(40)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99555:Assign_L124_C8", "label": "ang2 = radians()", "type": "assigned_variable", "loc": [124, 124], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99555:FunctionDef_L118_C4", "vector": [14, 2, 0.6492, 0.0052, 2, 0.2, 0.4, 365, 3, 1, 0, 0, 383, 10, 1], "semantic": {"name": "ang2", "arg_names": [], "import_names": [], "rhs_call_name": "radians", "annotation": ""}, "snippet": " ang2 = math.radians(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99555:Assign_L126_C8", "label": "tilt_angles =", "type": "assigned_variable", "loc": [126, 126], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99555:FunctionDef_L118_C4", "vector": [14, 2, 0.6597, 0.0052, 2, 0.2, 0.6, 609, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "tilt_angles", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tilt_angles = (ang1,ang2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99555:Assign_L127_C8", "label": "pos_list, scan_list = scan()", "type": "assigned_variable", "loc": [127, 127], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99555:FunctionDef_L118_C4", "vector": [14, 2, 0.6649, 0.0052, 2, 0.2, 0.8, 818, 3, 2, 0, 0, 202, 10, 1], "semantic": {"name": "pos_list, scan_list", "arg_names": [], "import_names": [], "rhs_call_name": "scan", "annotation": ""}, "snippet": " pos_list,scan_list = self.scan(tilt_angles,speed=speed)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99555:Return_L128_C8", "label": "return", "type": "return", "loc": [128, 128], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99555:FunctionDef_L118_C4", "vector": [13, 2, 0.6702, 0.0052, 2, 0.2, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return pos_list,scan_list"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99555:If_L131_C0", "label": "if", "type": "if", "loc": [131, 189], "level": 0, "parent": null, "vector": [4, 0, 0.8377, 0.3089, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 24], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n\n# urg mount - l1=0.06, l2=0.05\n# utm - l1 = 0.0, l2 = 0.035\n\n p = optparse.OptionParser()\n p.add_option('-d', action='store', type='string', dest='servo_dev_name',\n default='/dev/robot/servo0', help='servo device string. [default= /dev/robot/servo0]')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99555:Assign_L136_C4", "label": "p = OptionParser()", "type": "assigned_variable", "loc": [136, 136], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99555:If_L131_C0", "vector": [14, 1, 0.712, 0.0052, 1, 0.91, 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_99555:Expr_L137_C4", "label": "add_option()", "type": "expression", "loc": [137, 138], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99555:If_L131_C0", "vector": [8, 1, 0.7199, 0.0105, 1, 0.91, 0.037, 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='servo_dev_name',\n default='/dev/robot/servo0', help='servo device string. [default= /dev/robot/servo0]')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99555:Expr_L139_C4", "label": "add_option()", "type": "expression", "loc": [139, 140], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99555:If_L131_C0", "vector": [8, 1, 0.7304, 0.0105, 1, 0.91, 0.0741, 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', action='store', type='string', dest='hokuyo_type',default='utm',\n help='hokuyo_type. urg or utm [default=utm]')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99555:Expr_L141_C4", "label": "add_option()", "type": "expression", "loc": [141, 142], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99555:If_L131_C0", "vector": [8, 1, 0.7408, 0.0105, 1, 0.91, 0.1111, 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='int', dest='hokuyo_number', default=0,\n help='hokuyo number. 0,1,2 ... [default=0]')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99555:Expr_L143_C4", "label": "add_option()", "type": "expression", "loc": [143, 144], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99555:If_L131_C0", "vector": [8, 1, 0.7513, 0.0105, 1, 0.91, 0.1481, 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('--save_scan',action='store_true',dest='save_scan',\n help='save the scan [dict and cloud]')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99555:Expr_L145_C4", "label": "add_option()", "type": "expression", "loc": [145, 146], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99555:If_L131_C0", "vector": [8, 1, 0.7618, 0.0105, 1, 0.91, 0.1852, 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('--speed', action='store', type='float', dest='scan_speed',\n help='scan speed in deg/s.[default=5]',default=5.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99555:Expr_L147_C4", "label": "add_option()", "type": "expression", "loc": [147, 148], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99555:If_L131_C0", "vector": [8, 1, 0.7723, 0.0105, 1, 0.91, 0.2222, 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('--ang0', action='store', type='float', dest='ang0',\n help='starting tilt angle for scan (degrees). [default=20]', default=20.0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99555:Expr_L149_C4", "label": "add_option()", "type": "expression", "loc": [149, 150], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99555:If_L131_C0", "vector": [8, 1, 0.7827, 0.0105, 1, 0.91, 0.2593, 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('--ang1', action='store', type='float', dest='ang1',\n help='ending tilt angle for scan (degrees). default=[-20]', default=-20.0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99555:Expr_L151_C4", "label": "add_option()", "type": "expression", "loc": [151, 152], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99555:If_L131_C0", "vector": [8, 1, 0.7932, 0.0105, 1, 0.91, 0.2963, 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('--id', action='store', type='int', dest='servo_id', default=2,\n help='servo id 1,2 ... [default=2]')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99555:Expr_L153_C4", "label": "add_option()", "type": "expression", "loc": [153, 153], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99555:If_L131_C0", "vector": [8, 1, 0.801, 0.0052, 1, 0.91, 0.3333, 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('--l2', action='store', type='float', dest='l2', help='l2 (in meters) [0.035 for ElE, -0.055 for mekabot]')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99555:Expr_L154_C4", "label": "add_option()", "type": "expression", "loc": [154, 154], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99555:If_L131_C0", "vector": [8, 1, 0.8063, 0.0052, 1, 0.91, 0.3704, 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('--flip', action='store_true', dest='flip',help='flip the hokuyo scan')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99555:Assign_L157_C4", "label": "opt, args = parse_args()", "type": "assigned_variable", "loc": [157, 157], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99555:If_L131_C0", "vector": [14, 1, 0.822, 0.0052, 1, 0.91, 0.4074, 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_99555:Assign_L158_C4", "label": "hokuyo_type =", "type": "assigned_variable", "loc": [158, 158], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99555:If_L131_C0", "vector": [14, 1, 0.8272, 0.0052, 1, 0.91, 0.4444, 119, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "hokuyo_type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " hokuyo_type = opt.hokuyo_type"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99555:Assign_L159_C4", "label": "hokuyo_number =", "type": "assigned_variable", "loc": [159, 159], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99555:If_L131_C0", "vector": [14, 1, 0.8325, 0.0052, 1, 0.91, 0.4815, 128, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "hokuyo_number", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " hokuyo_number = opt.hokuyo_number"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99555:Assign_L160_C4", "label": "servo_dev_name =", "type": "assigned_variable", "loc": [160, 160], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99555:If_L131_C0", "vector": [14, 1, 0.8377, 0.0052, 1, 0.91, 0.5185, 801, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "servo_dev_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " servo_dev_name = opt.servo_dev_name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99555:Assign_L162_C4", "label": "save_scan =", "type": "assigned_variable", "loc": [162, 162], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99555:If_L131_C0", "vector": [14, 1, 0.8482, 0.0052, 1, 0.91, 0.5556, 922, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "save_scan", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " save_scan = opt.save_scan"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99555:Assign_L163_C4", "label": "scan_speed = radians()", "type": "assigned_variable", "loc": [163, 163], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99555:If_L131_C0", "vector": [14, 1, 0.8534, 0.0052, 1, 0.91, 0.5926, 873, 3, 1, 0, 0, 383, 10, 1], "semantic": {"name": "scan_speed", "arg_names": [], "import_names": [], "rhs_call_name": "radians", "annotation": ""}, "snippet": " scan_speed = math.radians(opt.scan_speed)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99555:Assign_L165_C4", "label": "ang0 =", "type": "assigned_variable", "loc": [165, 165], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99555:If_L131_C0", "vector": [14, 1, 0.8639, 0.0052, 1, 0.91, 0.6296, 147, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ang0", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ang0 = opt.ang0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99555:Assign_L166_C4", "label": "ang1 =", "type": "assigned_variable", "loc": [166, 166], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99555:If_L131_C0", "vector": [14, 1, 0.8691, 0.0052, 1, 0.91, 0.6667, 800, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ang1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ang1 = opt.ang1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99555:Assign_L168_C4", "label": "servo_id =", "type": "assigned_variable", "loc": [168, 168], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99555:If_L131_C0", "vector": [14, 1, 0.8796, 0.0052, 1, 0.91, 0.7037, 522, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "servo_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " servo_id = opt.servo_id"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99555:Assign_L169_C4", "label": "l2 =", "type": "assigned_variable", "loc": [169, 169], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99555:If_L131_C0", "vector": [14, 1, 0.8848, 0.0052, 1, 0.91, 0.7407, 40, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "l2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " l2 = opt.l2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99555:If_L170_C4", "label": "if", "type": "if", "loc": [170, 173], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99555:If_L131_C0", "vector": [4, 1, 0.8979, 0.0209, 1, 0.91, 0.7778, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if l2==None:\n print('please specify l2. do -h for details.')\n print('Exiting...')\n sys.exit()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99555:Expr_L171_C8", "label": "print()", "type": "expression", "loc": [171, 171], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99555:If_L170_C4", "vector": [8, 2, 0.8953, 0.0052, 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('please specify l2. do -h for details.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99555:Expr_L172_C8", "label": "print()", "type": "expression", "loc": [172, 172], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99555:If_L170_C4", "vector": [8, 2, 0.9005, 0.0052, 2, 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('Exiting...')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99555:Expr_L173_C8", "label": "exit()", "type": "expression", "loc": [173, 173], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99555:If_L170_C4", "vector": [8, 2, 0.9058, 0.0052, 2, 0.6, 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_99555:Assign_L175_C4", "label": "flip =", "type": "assigned_variable", "loc": [175, 175], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99555:If_L131_C0", "vector": [14, 1, 0.9162, 0.0052, 1, 0.91, 0.8148, 677, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "flip", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " flip = opt.flip"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99555:If_L177_C4", "label": "if", "type": "if", "loc": [177, 182], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99555:If_L131_C0", "vector": [4, 1, 0.9398, 0.0314, 1, 0.91, 0.8519, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if hokuyo_type == 'utm':\n h = hs.Hokuyo('utm',hokuyo_number,flip=flip)\n elif hokuyo_type == 'urg':\n h = hs.Hokuyo('urg',hokuyo_number,flip=flip)\n else:\n print('unknown hokuyo type: ', hokuyo_type)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99555:Assign_L178_C8", "label": "h = Hokuyo()", "type": "assigned_variable", "loc": [178, 178], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99555:If_L177_C4", "vector": [14, 2, 0.9319, 0.0052, 2, 0.74, 0.0, 686, 3, 3, 0, 0, 66, 10, 1], "semantic": {"name": "h", "arg_names": [], "import_names": [], "rhs_call_name": "Hokuyo", "annotation": ""}, "snippet": " h = hs.Hokuyo('utm',hokuyo_number,flip=flip)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99555:If_L179_C4", "label": "if", "type": "if", "loc": [179, 182], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99555:If_L177_C4", "vector": [4, 2, 0.945, 0.0209, 2, 0.74, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif hokuyo_type == 'urg':\n h = hs.Hokuyo('urg',hokuyo_number,flip=flip)\n else:\n print('unknown hokuyo type: ', hokuyo_type)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99555:Assign_L180_C8", "label": "h = Hokuyo()", "type": "assigned_variable", "loc": [180, 180], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99555:If_L179_C4", "vector": [14, 3, 0.9424, 0.0052, 3, 0.2, 0.0, 686, 3, 3, 0, 0, 66, 10, 1], "semantic": {"name": "h", "arg_names": [], "import_names": [], "rhs_call_name": "Hokuyo", "annotation": ""}, "snippet": " h = hs.Hokuyo('urg',hokuyo_number,flip=flip)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99555:Expr_L182_C8", "label": "print()", "type": "expression", "loc": [182, 182], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99555:If_L179_C4", "vector": [8, 3, 0.9529, 0.0052, 3, 0.2, 1.0, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('unknown hokuyo type: ', hokuyo_type)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99555:Assign_L184_C4", "label": "thok = tilt_hokuyo()", "type": "assigned_variable", "loc": [184, 184], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99555:If_L131_C0", "vector": [14, 1, 0.9634, 0.0052, 1, 0.91, 0.8889, 171, 3, 5, 0, 0, 577, 10, 1], "semantic": {"name": "thok", "arg_names": [], "import_names": [], "rhs_call_name": "tilt_hokuyo", "annotation": ""}, "snippet": " thok = tilt_hokuyo(servo_dev_name,servo_id,h,l1=0.,l2=l2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99555:Assign_L186_C4", "label": "tilt_angles =", "type": "assigned_variable", "loc": [186, 186], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99555:If_L131_C0", "vector": [14, 1, 0.9738, 0.0052, 1, 0.91, 0.9259, 609, 0, 0, 0, 0, 0, 8, 2], "semantic": {"name": "tilt_angles", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tilt_angles = (math.radians(ang0),math.radians(ang1))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99555:Assign_L187_C4", "label": "pos_list, scan_list = scan()", "type": "assigned_variable", "loc": [187, 187], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99555:If_L131_C0", "vector": [14, 1, 0.9791, 0.0052, 1, 0.91, 0.963, 818, 3, 3, 0, 0, 202, 10, 1], "semantic": {"name": "pos_list, scan_list", "arg_names": [], "import_names": [], "rhs_call_name": "scan", "annotation": ""}, "snippet": " pos_list,scan_list = thok.scan(tilt_angles,speed=scan_speed,save_scan=save_scan)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99555:Expr_L189_C4", "label": "exit()", "type": "expression", "loc": [189, 189], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99555:If_L131_C0", "vector": [8, 1, 0.9895, 0.0052, 1, 0.91, 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() # to kill the hokuyo thread."}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99555:ClassDef_L42_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99555:FunctionDef_L43_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99555:FunctionDef_L43_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99555:Expr_L44_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99555:FunctionDef_L43_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99555:Assign_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99555:FunctionDef_L43_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99555:Assign_L52_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99555:FunctionDef_L43_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99555:Assign_L53_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99555:FunctionDef_L43_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99555:Assign_L54_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99555:ClassDef_L42_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99555:FunctionDef_L56_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99555:FunctionDef_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99555:Expr_L57_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99555:FunctionDef_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99555:Assign_L64_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99555:FunctionDef_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99555:If_L65_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99555:If_L65_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99555:Expr_L67_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99555:FunctionDef_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99555:Assign_L69_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99555:FunctionDef_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99555:Assign_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99555:FunctionDef_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99555:Expr_L75_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99555:FunctionDef_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99555:Expr_L80_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99555:FunctionDef_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99555:Expr_L82_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99555:FunctionDef_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99555:Assign_L83_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99555:FunctionDef_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99555:Assign_L85_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99555:FunctionDef_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99555:Assign_L86_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99555:FunctionDef_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99555:While_L87_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99555:While_L87_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99555:Assign_L88_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99555:While_L87_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99555:If_L90_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99555:While_L87_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99555:Expr_L92_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99555:While_L87_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99555:Assign_L93_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99555:While_L87_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99555:Expr_L94_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99555:FunctionDef_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99555:Assign_L95_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99555:FunctionDef_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99555:Expr_L97_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99555:FunctionDef_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99555:If_L98_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99555:If_L98_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99555:Assign_L99_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99555:If_L98_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99555:Assign_L100_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99555:If_L98_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99555:Expr_L102_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99555:FunctionDef_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99555:Assign_L104_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99555:FunctionDef_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99555:Assign_L105_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99555:FunctionDef_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99555:Assign_L106_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99555:FunctionDef_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99555:If_L107_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99555:If_L107_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99555:Expr_L108_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99555:If_L107_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99555:Expr_L109_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99555:If_L107_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99555:If_L110_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99555:If_L110_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99555:Return_L111_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99555:If_L110_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99555:Expr_L113_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99555:FunctionDef_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99555:Expr_L115_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99555:FunctionDef_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99555:Return_L116_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99555:ClassDef_L42_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99555:FunctionDef_L118_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99555:FunctionDef_L118_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99555:Expr_L119_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99555:FunctionDef_L118_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99555:Assign_L123_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99555:FunctionDef_L118_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99555:Assign_L124_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99555:FunctionDef_L118_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99555:Assign_L126_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99555:FunctionDef_L118_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99555:Assign_L127_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99555:FunctionDef_L118_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99555:Return_L128_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99555:If_L131_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99555:Assign_L136_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99555:If_L131_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99555:Expr_L137_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99555:If_L131_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99555:Expr_L139_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99555:If_L131_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99555:Expr_L141_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99555:If_L131_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99555:Expr_L143_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99555:If_L131_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99555:Expr_L145_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99555:If_L131_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99555:Expr_L147_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99555:If_L131_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99555:Expr_L149_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99555:If_L131_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99555:Expr_L151_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99555:If_L131_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99555:Expr_L153_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99555:If_L131_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99555:Expr_L154_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99555:If_L131_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99555:Assign_L157_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99555:If_L131_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99555:Assign_L158_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99555:If_L131_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99555:Assign_L159_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99555:If_L131_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99555:Assign_L160_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99555:If_L131_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99555:Assign_L162_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99555:If_L131_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99555:Assign_L163_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99555:If_L131_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99555:Assign_L165_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99555:If_L131_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99555:Assign_L166_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99555:If_L131_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99555:Assign_L168_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99555:If_L131_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99555:Assign_L169_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99555:If_L131_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99555:If_L170_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99555:If_L170_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99555:Expr_L171_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99555:If_L170_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99555:Expr_L172_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99555:If_L170_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99555:Expr_L173_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99555:If_L131_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99555:Assign_L175_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99555:If_L131_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99555:If_L177_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99555:If_L177_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99555:Assign_L178_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99555:If_L177_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99555:If_L179_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99555:If_L179_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99555:Assign_L180_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99555:If_L179_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99555:Expr_L182_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99555:If_L131_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99555:Assign_L184_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99555:If_L131_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99555:Assign_L186_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99555:If_L131_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99555:Assign_L187_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99555:If_L131_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99555:Expr_L189_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 (Healthcare Robotics Lab, Georgia Tech.) import roslib; roslib.load_manifest('hrl_tilting_hokuyo') import hrl_hokuyo.hokuyo_processing as hp import sys, optparse, os import hrl_lib.util as ut import hrl_lib.transforms as tr import numpy as np,math import time import display_3d_mayavi as d3m import occupancy_grid_3d as og3d import scipy.ndimage as ni import copy import pylab as pl color_list = [(1.,1.,0),(1.,0,0),(0,1.,1.),(0,1.,0),(0,0,1.),(0,0.4,0.4),(0.4,0.4,0), (0.4,0,0.4),(0.4,0.8,0.4),(0.8,0.4,0.4),(0.4,0.4,0.8),(0.4,0,0.8),(0,0.8,0.4), (0,0.4,0.8),(0.8,0,0.4),(0.4,0,0.4),(1.,0.6,0.02) ] #--------------------- utility functions ------------- ##returns points that are within the cuboid formed by tlb and brf. # @param pts - 3xN numpy matrix # @param tlb, brf - 3x1 np matrix. bottom-right-front and top-left-back # @return 3xM numpy matrix def points_within_cuboid(pts,brf,tlb): idx = np.where(np.min(np.multiply(pts>brf,pts<tlb),0))[1] if idx.shape[1] == 0: within_pts = np.empty((3,0)) else: within_pts = pts[:,idx.A1.tolist()] return within_pts def generate_pointcloud(pos_list, scan_list, min_angle, max_angle, l1, l2,save_scan=False, max_dist=np.Inf, min_dist=-np.Inf,min_tilt=-np.Inf,max_tilt=np.Inf, get_intensities=False, reject_zero_ten=True): ''' pos_list - list of motor positions (in steps) scan_list - list of UrgScan objects at the corres positions. l1,l2 - parameterizing the transformation (doc/ folder) save_scan - pickle 3xN numpy matrix of points. max_dist - ignore points at distance > max_dist min_dist - ignore points at distance < max_dist min_tilt, max_tilt - min and max tilt angles (radians) +ve tilts the hokuyo down. get_intensites - additionally return intensity values returns 3xN numpy matrix of 3d coords of the points, returns (3xN, 1xN) including the intensity values if get_intensites=True ''' t0 = time.time() allpts = [] allintensities = [] pos_arr = np.array(pos_list) scan_arr = np.array(scan_list) idxs = np.where(np.multiply(pos_arr<=max_tilt,pos_arr>=min_tilt)) pos_list = pos_arr[idxs].tolist() scan_list = scan_arr[idxs].tolist() n_scans = len(scan_list) if n_scans>1: scan_list = copy.deepcopy(scan_list) # remove graze in across scans. ranges_mat = [] for s in scan_list: ranges_mat.append(s.ranges.T) ranges_mat = np.column_stack(ranges_mat) start_index = hp.angle_to_index(scan_list[0],min_angle) end_index = hp.angle_to_index(scan_list[0],max_angle) for r in ranges_mat[start_index:end_index+1]: hp.remove_graze_effect(r,np.matrix(pos_list),skip=1,graze_angle_threshold=math.radians(169.)) for i,s in enumerate(scan_list): s.ranges = ranges_mat[:,i].T for p,s in zip(pos_list,scan_list): mapxydata = hp.get_xy_map(s,min_angle,max_angle,max_dist=max_dist,min_dist=min_dist,reject_zero_ten=reject_zero_ten,sigmoid_hack=True,get_intensities=get_intensities) # pts is 2xN if get_intensities == True: pts, intensities = mapxydata allintensities.append(intensities) else: pts = mapxydata pts = np.row_stack((pts,np.zeros(pts.shape[1]))) # pts is now 3xN pts = tr.Ry(-p)*(pts+np.matrix((l1,0,-l2)).T) allpts.append(pts) allpts = np.column_stack(allpts) if save_scan: date_name = ut.formatted_time() ut.save_pickle(allpts,date_name+'_cloud.pkl') t1 = time.time() # print 'Time to generate point cloud:', t1-t0 # allpts = tr.rotZ(math.radians(5))*allpts if get_intensities == True: allintensities = np.column_stack(allintensities) return allpts, allintensities else: return allpts #----------------------- navigation functions ----------------- def max_fwd_without_collision(all_pts,z_height,max_dist,display_list=None): ''' find the max distance that it is possible to move fwd by without collision. all_pts - 3xN matrix of 3D points in thok frame. z - height of zenither while taking the scan. max_dist - how far do I want to check for a possible collision. returns max_dist that the thok can be moved fwd without collision. ''' brf = np.matrix([0.2,-0.4,-z_height-0.1]).T tlb = np.matrix([max_dist, 0.4,-z_height+1.8]).T resolution = np.matrix([0.05,0.05,0.02]).T gr = og3d.occupancy_grid_3d(brf,tlb,resolution) gr.fill_grid(all_pts) gr.to_binary(4) ground_z = tr.thok0Tglobal(np.matrix([0,0,-z_height]).T)[2,0] # gr.remove_horizontal_plane(hmax=ground_z+0.1) gr.remove_horizontal_plane(extra_layers=2) collide_pts = np.row_stack(np.where(gr.grid!=0)) x_coords = collide_pts[0] # print x_coords if x_coords.shape[0] == 0: max_x = max_dist # height_mat = np.arrary([np.Inf]) else: max_x_gr = np.min(x_coords) # height_mat = collide_pts[1,np.where(x_coords==max_x_gr)[0]] # height_mat = height_mat*gr.resolution[2,0]+gr.brf[2,0] max_x = max_x_gr*gr.resolution[0,0]+gr.brf[0,0] if display_list != None: collide_grid = gr.grid_to_points() display_list.append(pu.PointCloud(all_pts,(200,200,200))) display_list.append(pu.CubeCloud(collide_grid,(200,200,200),resolution)) display_list.append(pu.CubeCloud(np.matrix((max_x,0.,0.)).T,(0,0,200),size=np.matrix([0.05,.05,0.05]).T)) # return max_x,np.matrix(height_mat) return max_x def find_goto_point_surface_1(grid,pt,display_list=None): ''' returns p_erratic,p_edge,surface_height p_erratic - point where the erratic's origin should go to. (in thok0 frame) p_edge - point on the edge closest to pt. p_erratic,p_edge are 3x1 matrices. surface_height - in thok0 coord frame. ''' pt_thok = pt # everything is happening in the thok coord frame. close_pt,approach_vector = find_approach_direction(grid,pt_thok,display_list) if close_pt == None: return None,None,None # move perpendicular to approach direction. # lam = -(close_pt[0:2,0].T*approach_vector)[0,0] # lam = min(lam,-0.3) # atleast 0.3m from the edge. lam = -0.4 goto_pt = close_pt[0:2,0] + lam*approach_vector # this is where I want the utm # to be err_to_thok = tr.erraticTglobal(tr.globalTthok0(np.matrix([0,0,0]).T)) goto_pt_erratic = -err_to_thok[0,0]*approach_vector + goto_pt # this is NOT # general. It uses info about the two frames. If frames move, bad # things can happen. if display_list != None: display_list.append(pu.CubeCloud(np.row_stack((goto_pt,close_pt[2,0])),color=(0,250,250), size=(0.012,0.012,0.012))) display_list.append(pu.Line(np.row_stack((goto_pt,close_pt[2,0])).A1,close_pt.A1,color=(255,20,0))) p_erratic = np.row_stack((goto_pt_erratic,np.matrix((close_pt[2,0])))) print 'p_erratic in thok0:', p_erratic.T return p_erratic,close_pt,close_pt[2,0] #------------------ surface orientation ---------------- def find_closest_pt_index(pts2d,pt): ''' returns index (of pts2d) of closest point to pt. pts2d - 2xN matrix, pt - 2x1 matrix ''' pt_to_edge_dists = ut.norm(pts2d-pt) closest_pt_index = np.argmin(pt_to_edge_dists) return closest_pt_index def find_closest_pt(pts2d,pt,pt_closer=False): ''' returns closest point to edge (2x1 matrix) can return None also ''' dist_pt = np.linalg.norm(pt[0:2,0]) pts2d_r = ut.norm(pts2d) pts2d_a = np.arctan2(pts2d[1,:],pts2d[0,:]) if pt_closer == False: k_idxs = np.where(pts2d_r<=dist_pt) else: k_idxs = np.where(pts2d_r>dist_pt) pts2d_r = pts2d_r[k_idxs] pts2d_a = pts2d_a[k_idxs] pts2d = ut.cart_of_pol(np.matrix(np.row_stack((pts2d_r,pts2d_a)))) if pt_closer == False: edge_to_pt = pt[0:2,0]-pts2d else: edge_to_pt = pts2d-pt[0:2,0] edge_to_pt_a = np.arctan2(edge_to_pt[1,:],edge_to_pt[0,:]) keep_idxs = np.where(np.abs(edge_to_pt_a)<math.radians(70))[1].A1 if keep_idxs.shape[0] == 0: return None pts2d = pts2d[:,keep_idxs] # pt_to_edge_dists = ut.norm(pts2d-pt[0:2,0]) # closest_pt_index = np.argmin(pt_to_edge_dists) closest_pt_index = find_closest_pt_index(pts2d,pt[0:2,0]) closest_pt = pts2d[:,closest_pt_index] return closest_pt def pushback_edge(pts2d,pt): ''' push pt away from the edge defined by pts2d. pt - 2x1, pts2d - 2xN returns the pushed point. ''' closest_idx = find_closest_pt_index(pts2d,pt) n_push_points = min(min(5,pts2d.shape[1]-closest_idx-1),closest_idx) if closest_idx<n_push_points or (pts2d.shape[1]-closest_idx-1)<n_push_points: print 'processing_3d.pushback_edge: pt is too close to the ends of the pts2d array.' return None edge_to_pt = pt-pts2d[:,closest_idx-n_push_points:closest_idx+n_push_points] edge_to_pt_r = ut.norm(edge_to_pt) edge_to_pt_a = np.arctan2(edge_to_pt[1,:],edge_to_pt[0,:]) non_zero_idxs = np.where(edge_to_pt_r>0.005) edge_to_pt_r = edge_to_pt_r[non_zero_idxs] edge_to_pt_r[0,:] = 1 edge_to_pt_a = edge_to_pt_a[non_zero_idxs] edge_to_pt_unit = ut.cart_of_pol(np.row_stack((edge_to_pt_r,edge_to_pt_a))) push_vector = edge_to_pt_unit.mean(1) push_vector = push_vector/np.linalg.norm(push_vector) print 'push_vector:', push_vector.T pt_pushed = pt + push_vector*0.05 return pt_pushed ## figure out a good direction to approach the surface. # @param grid - occupancy grid (binary) around the point of interest. # assumes that it has a surface. # @param pt - 3d point which has to be approached. # @param display_list - if display_list are lists then point clouds etc. are added # for visualisation. # # @return - closest_pt,approach_vector. def find_approach_direction(grid,pt,display_list=None): z_plane,max_count = grid.argmax_z(search_up=True) z_plane_meters = z_plane*grid.resolution[2,0]+grid.brf[2,0] l = grid.find_plane_indices(assume_plane=True) print '------------ min(l)',min(l) z_plane_argmax,max_count = grid.argmax_z(search_up=False) z_plane_below = max(0,z_plane_argmax-5) print 'z_plane_argmax',z_plane_argmax print 'z_plane_below',z_plane_below print 'l:',l # l = range(z_plane_below,z_plane)+l copy_grid = copy.deepcopy(grid) plane_slices = grid.grid[:,:,l] copy_grid.grid[:,:,:] = 0 copy_grid.grid[:,:,l] = copy.copy(plane_slices) #display_list.append(pu.PointCloud(copy_grid.grid_to_points(),color=(0,0,255))) #plane_pts = copy_grid.grid_to_points() grid_2d = np.max(grid.grid[:,:,l],2) grid_2d = ni.binary_dilation(grid_2d,iterations=4) # I want 4-connectivity while filling holes. grid_2d = ni.binary_fill_holes(grid_2d) # I want 4-connectivity while filling holes. labeled_arr,n_labels = ni.label(grid_2d) labels_list = range(1,n_labels+1) count_objects = ni.sum(grid_2d,labeled_arr,labels_list) if n_labels == 1: count_objects = [count_objects] max_label = np.argmax(np.matrix(count_objects)) grid_2d[np.where(labeled_arr!=max_label+1)] = 0 # connect_structure = np.empty((3,3),dtype='int') # connect_structure[:,:] = 1 # eroded_2d = ni.binary_erosion(grid_2d,connect_structure,iterations=4) # eroded_2d = ni.binary_erosion(grid_2d) # grid_2d = grid_2d-eroded_2d labeled_arr_3d = copy_grid.grid.swapaxes(2,0) labeled_arr_3d = labeled_arr_3d.swapaxes(1,2) labeled_arr_3d = labeled_arr_3d*grid_2d labeled_arr_3d = labeled_arr_3d.swapaxes(2,0) labeled_arr_3d = labeled_arr_3d.swapaxes(1,0) copy_grid.grid = labeled_arr_3d pts3d = copy_grid.grid_to_points() pts2d = pts3d[0:2,:] dist_pt = np.linalg.norm(pt[0:2,0]) pts2d_r = ut.norm(pts2d) pts2d_a = np.arctan2(pts2d[1,:],pts2d[0,:]) max_angle = np.max(pts2d_a) min_angle = np.min(pts2d_a) max_angle = min(max_angle,math.radians(50)) min_angle = max(min_angle,math.radians(-50)) ang_res = math.radians(1.) n_bins = int((max_angle-min_angle)/ang_res) print 'n_bins:', n_bins n_bins = min(50,n_bins) # n_bins=50 ang_res = (max_angle-min_angle)/n_bins print 'n_bins:', n_bins angle_list = [] range_list = [] for i in range(n_bins): angle = min_angle+ang_res*i idxs = np.where(np.multiply(pts2d_a<(angle+ang_res/2.),pts2d_a>(angle-ang_res/2.))) r_mat = pts2d_r[idxs] a_mat = pts2d_a[idxs] if r_mat.shape[1] == 0: continue min_idx = np.argmin(r_mat.A1) range_list.append(r_mat[0,min_idx]) angle_list.append(a_mat[0,min_idx]) if range_list == []: print 'processing_3d.find_approach_direction: No edge points found' return None,None pts2d = ut.cart_of_pol(np.matrix(np.row_stack((range_list,angle_list)))) closest_pt_1 = find_closest_pt(pts2d,pt,pt_closer=False) if closest_pt_1 == None: dist1 = np.Inf else: approach_vector_1 = pt[0:2,0] - closest_pt_1 dist1 = np.linalg.norm(approach_vector_1) approach_vector_1 = approach_vector_1/dist1 closest_pt_2 = find_closest_pt(pts2d,pt,pt_closer=True) if closest_pt_2 == None: dist2 = np.Inf else: approach_vector_2 = closest_pt_2 - pt[0:2,0] dist2 = np.linalg.norm(approach_vector_2) approach_vector_2 = approach_vector_2/dist2 if dist1 == np.Inf and dist2 == np.Inf: approach_vector_1 = np.matrix([1.,0.,0.]).T approach_vector_2 = np.matrix([1.,0.,0.]).T print 'VERY STRANGE: processing_3d.find_approach_direction: both distances are Inf' if dist1<0.05 or dist2<0.05: print 'dist1,dist2:',dist1,dist2 t_pt = copy.copy(pt) if dist1<dist2 and dist1<0.02: t_pt[0,0] += 0.05 elif dist2<0.02: t_pt[0,0] -= 0.05 #pt_new = pushback_edge(pts2d,pt[0:2,0]) pt_new = pushback_edge(pts2d,t_pt[0:2,0]) if display_list != None: pt_new_3d = np.row_stack((pt_new,np.matrix([z_plane_meters]))) display_list.append(pu.CubeCloud(pt_new_3d,color=(200,000,0),size=(0.009,0.009,0.009))) closest_pt_1 = find_closest_pt(pts2d,pt_new,pt_closer=False) if closest_pt_1 == None: dist1 = np.Inf else: approach_vector_1 = pt_new - closest_pt_1 dist1 = np.linalg.norm(approach_vector_1) approach_vector_1 = approach_vector_1/dist1 closest_pt_2 = find_closest_pt(pts2d,pt_new,pt_closer=True) if closest_pt_2 == None: dist2 = np.Inf else: approach_vector_2 = closest_pt_2 - pt_new dist2 = np.linalg.norm(approach_vector_2) approach_vector_2 = approach_vector_2/dist2 print '----------- dist1,dist2:',dist1,dist2 if dist2<dist1: closest_pt = closest_pt_2 approach_vector = approach_vector_2 else: closest_pt = closest_pt_1 approach_vector = approach_vector_1 print '----------- approach_vector:',approach_vector.T closest_pt = np.row_stack((closest_pt,np.matrix([z_plane_meters]))) if display_list != None: z = np.matrix(np.empty((1,pts2d.shape[1]))) z[:,:] = z_plane_meters pts3d_front = np.row_stack((pts2d,z)) display_list.append(pu.CubeCloud(closest_pt,color=(255,255,0),size=(0.020,0.020,0.020))) display_list.append(pu.CubeCloud(pts3d_front,color=(255,0,255),size=grid.resolution)) #display_list.append(pu.CubeCloud(pts3d,color=(0,255,0))) return closest_pt,approach_vector #------------------- for doors --------------------- def vertical_plane_points(grid): ''' changes grid ''' plane_indices,ver_plane_slice = grid.remove_vertical_plane() grid.grid[:,:,:] = 0 grid.grid[plane_indices,:,:] = ver_plane_slice ## returns door handle points in the thok coord frame. def find_door_handle(grid,pt,list = None,rotation_angle=math.radians(0.), occupancy_threshold=None,resolution=None): grid.remove_vertical_plane() pts = grid.grid_to_points() rot_mat = tr.Rz(rotation_angle) t_pt = rot_mat*pt brf = t_pt+np.matrix([-0.2,-0.3,-0.2]).T tlb = t_pt+np.matrix([0.2, 0.3,0.2]).T #resolution = np.matrix([0.02,0.0025,0.02]).T grid = og3d.occupancy_grid_3d(brf,tlb,resolution,rotation_z=rotation_angle) if pts.shape[1] == 0: return None grid.fill_grid(tr.Rz(rotation_angle)*pts) grid.to_binary(occupancy_threshold) labeled_arr,n_labels = grid.find_objects() if list == None: object_points_list = [] else: object_points_list = list for l in range(n_labels): pts = grid.labeled_array_to_points(labeled_arr,l+1) obj_height = np.max(pts[2,:])-np.min(pts[2,:]) print 'object_height:', obj_height if obj_height > 0.1: #remove the big objects grid.grid[np.where(labeled_arr==l+1)] = 0 connect_structure = np.empty((3,3,3),dtype='int') connect_structure[:,:,:] = 0 connect_structure[1,:,1] = 1 # dilate away - actual width of the door handle is not affected # because that I will get from the actual point cloud! grid.grid = ni.binary_dilation(grid.grid,connect_structure,iterations=7) labeled_arr,n_labels = grid.find_objects() for l in range(n_labels): pts = grid.labeled_array_to_points(labeled_arr,l+1) pts2d = pts[1:3,:] # only the y-z coordinates. obj_width = (pts2d.max(1)-pts2d.min(1))[0,0] print 'processing_3d.find_door_handle: object width = ', obj_width if obj_width < 0.05: continue pts2d_zeromean = pts2d-pts2d.mean(1) e_vals,e_vecs = np.linalg.eig(pts2d_zeromean*pts2d_zeromean.T) max_index = np.argmax(e_vals) max_evec = e_vecs[:,max_index] ang = math.atan2(max_evec[1,0],max_evec[0,0]) print 'processing_3d.find_door_handle: ang = ', math.degrees(ang) if (ang>math.radians(45) and ang<math.radians(135)) or \ (ang>math.radians(-135) and ang<math.radians(-45)): # assumption is that door handles are horizontal. continue object_points_list.append(pts) print 'processing_3d.find_door_handle: found %d objects'%(len(object_points_list)) closest_obj = find_closest_object(object_points_list,pt) return closest_obj #--------------------- segmentation --------------------- def find_closest_object(obj_pts_list,pt,return_idx=False): ''' obj_pts_list - list of 3xNi matrices of points. pt - point of interest. (3x1) matrix. return_idx - whether to return the index (in obj_pts_list) of the closest object. returns 3xNj matrix of points which is the closest object to pt. None if obj_pts_list is empty. ''' min_dist_list = [] for obj_pts in obj_pts_list: min_dist_list.append(np.min(ut.norm(obj_pts-pt))) if obj_pts_list == []: return None min_idx = np.argmin(np.matrix(min_dist_list)) cl_obj = obj_pts_list[min_idx] print 'processing_3d.find_closest_object: closest_object\'s centroid',cl_obj.mean(1).T if return_idx: return cl_obj,min_idx return cl_obj def segment_objects_points(grid,return_labels_list=False, twod=False): ''' grid - binary occupancy grid. returns list of 3xNi numpy matrices where Ni is the number of points in the ith object. Point refers to center of the cell of occupancy grid. return_labels_list - return a list of labels of the objects in the grid. returns None if there is no horizontal surface ''' labeled_arr,n_labels = grid.segment_objects(twod=twod) if n_labels == None: # there is no surface, so segmentation does not make sense. return None object_points_list = [] labels_list = [] for l in range(n_labels): pts = grid.labeled_array_to_points(labeled_arr,l+1) pts_zeromean = pts-pts.mean(1) e_vals,e_vecs = np.linalg.eig(pts_zeromean*pts_zeromean.T) max_index = np.argmax(e_vals) max_evec = e_vecs[:,max_index] print 'max eigen vector:', max_evec.T pts_1d = max_evec.T * pts size = pts_1d.max() - pts_1d.min() print 'size:', size print 'n_points:', pts.shape[1] ppsoe = pts.shape[1]/(e_vals[0]+e_vals[1]+e_vals[2]) print 'points per sum of eigenvalues:',ppsoe # if ppsoe<5000: # continue if size<0.05 or size>0.5: #TODO - figure out a good threshold. continue object_points_list.append(pts) labels_list.append(l+1) if return_labels_list: return object_points_list, labels_list return object_points_list def create_grid(brf,tlb,resolution,pos_list,scan_list,l1,l2, display_flag=False,show_pts=True,rotation_angle=0., occupancy_threshold=1): ''' rotation angle - about the Z axis. ''' max_dist = np.linalg.norm(tlb) + 0.2 min_dist = brf[0,0] min_angle,max_angle=math.radians(-60),math.radians(60) all_pts = generate_pointcloud(pos_list, scan_list, min_angle, max_angle, l1, l2, max_dist=max_dist,min_dist=min_dist) rot_mat = tr.Rz(rotation_angle) all_pts_rot = rot_mat*all_pts gr = og3d.occupancy_grid_3d(brf,tlb,resolution,rotation_z=rotation_angle) gr.fill_grid(all_pts_rot) gr.to_binary(occupancy_threshold) if display_flag == True: if show_pts: d3m.plot_points(all_pts,color=(0.,0.,0.)) cube_tups = gr.grid_lines(rotation_angle=rotation_angle) d3m.plot_cuboid(cube_tups) return gr def create_vertical_plane_grid(pt,pos_list,scan_list,l1,l2,rotation_angle,display_list=None): rot_mat = tr.Rz(rotation_angle) t_pt = rot_mat*pt brf = t_pt+np.matrix([-0.2,-0.3,-0.2]).T tlb = t_pt+np.matrix([0.2, 0.3,0.2]).T resolution = np.matrix([0.005,0.02,0.02]).T return create_grid(brf,tlb,resolution,pos_list,scan_list,l1,l2,display_list,rotation_angle=rotation_angle,occupancy_threshold=1) def create_scooping_grid(pt,pos_list,scan_list,l1,l2,display_flag=False): brf = pt+np.matrix([-0.15,-0.4,-0.2]).T brf[0,0] = max(0.07,brf[0,0]) tlb = pt+np.matrix([0.25, 0.4,0.2]).T resolution = np.matrix([0.01,0.01,0.0025]).T return create_grid(brf,tlb,resolution,pos_list,scan_list,l1,l2,display_flag) def create_segmentation_grid(pt,pos_list,scan_list,l1,l2,display_flag=False): brf = pt+np.matrix([-0.15,-0.2,-0.2]).T brf[0,0] = max(0.07,brf[0,0]) tlb = pt+np.matrix([0.25, 0.2,0.2]).T # brf = np.matrix([0.05,-0.3,-0.2]).T # tlb = np.matrix([0.5, 0.3,0.1]).T # resolution = np.matrix([0.005,0.005,0.005]).T # resolution = np.matrix([0.005,0.005,0.0025]).T resolution = np.matrix([0.01,0.01,0.0025]).T # resolution = np.matrix([0.01,0.01,0.001]).T return create_grid(brf,tlb,resolution,pos_list,scan_list,l1,l2,display_flag) def create_approach_grid(pt,pos_list,scan_list,l1,l2,display_list=None,show_pts=True): brf = pt + np.matrix([-0.5,-0.2,-0.3]).T brf[0,0] = max(0.10,brf[0,0]) tlb = pt + np.matrix([0.3, 0.2,0.2]).T # resolution = np.matrix([0.005,0.005,0.005]).T resolution = np.matrix([0.01,0.01,0.0025]).T # resolution = np.matrix([0.01,0.01,0.001]).T return create_grid(brf,tlb,resolution,pos_list,scan_list,l1,l2,display_list,show_pts) def create_overhead_grasp_choice_grid(pt,pos_list,scan_list,l1,l2,far_dist,display_list=None): # y_pos = max(pt[1,0]+0.1,0.1) # y_neg = min(pt[1,0]-0.1,-0.1) # # brf = np.matrix([0.2,y_neg,0.0]).T # tlb = np.matrix([pt[0,0]+far_dist,y_pos,pt[2,0]+0.75]).T # # resolution = np.matrix([0.02,0.02,0.02]).T y_pos = 0.1 y_neg = -0.1 r = np.linalg.norm(pt[0:2,0]) brf = np.matrix([0.25,y_neg,0.0]).T tlb = np.matrix([r+far_dist,y_pos,pt[2,0]+0.75]).T resolution = np.matrix([0.02,0.02,0.02]).T rotation_angle = math.atan2(pt[1,0],pt[0,0]) print 'rotation_angle:', math.degrees(rotation_angle) gr = create_grid(brf,tlb,resolution,pos_list,scan_list,l1,l2,display_list,rotation_angle=rotation_angle) if display_list != None: collide_pts = gr.grid_to_points() if collide_pts.shape[1] > 0: collide_pts = tr.Rz(rotation_angle).T*gr.grid_to_points() display_list.insert(0,pu.PointCloud(collide_pts,color=(0,0,0))) return gr def overhead_grasp_collision(pt,grid): print 'collision points:', grid.grid.sum() if grid.grid.sum()>15: return True else: return False def grasp_location_on_object(obj,display_list=None): ''' obj - 3xN numpy matrix of points of the object. ''' pts_2d = obj[0:2,:] centroid_2d = pts_2d.mean(1) pts_2d_zeromean = pts_2d-centroid_2d e_vals,e_vecs = np.linalg.eig(pts_2d_zeromean*pts_2d_zeromean.T) # get the min size min_index = np.argmin(e_vals) min_evec = e_vecs[:,min_index] print 'min eigenvector:', min_evec.T pts_1d = min_evec.T * pts_2d min_size = pts_1d.max() - pts_1d.min() print 'spread along min eigenvector:', min_size max_height = obj[2,:].max() tlb = obj.max(1) brf = obj.min(1) print 'tlb:', tlb.T print 'brf:', brf.T resolution = np.matrix([0.005,0.005,0.005]).T gr = og3d.occupancy_grid_3d(brf,tlb,resolution) gr.fill_grid(obj) gr.to_binary(1) obj = gr.grid_to_points() grid_2d = gr.grid.max(2) grid_2d_filled = ni.binary_fill_holes(grid_2d) gr.grid[:,:,0] = gr.grid[:,:,0]+grid_2d_filled-grid_2d p = np.matrix(np.row_stack(np.where(grid_2d_filled==1))).astype('float') p[0,:] = p[0,:]*gr.resolution[0,0] p[1,:] = p[1,:]*gr.resolution[1,0] p += gr.brf[0:2,0] print 'new mean:', p.mean(1).T print 'centroid_2d:', centroid_2d.T centroid_2d = p.mean(1) if min_size<0.12: # grasp at centroid. grasp_point = np.row_stack((centroid_2d,np.matrix([max_height+gr.resolution[2,0]*2]))) # grasp_point[2,0] = max_height gripper_angle = -math.atan2(-min_evec[0,0],min_evec[1,0]) grasp_vec = min_evec if display_list != None: max_index = np.argmax(e_vals) max_evec = e_vecs[:,max_index] pts_1d = max_evec.T * pts_2d max_size = pts_1d.max() - pts_1d.min() v = np.row_stack((max_evec,np.matrix([0.]))) max_end_pt1 = grasp_point + v*max_size/2. max_end_pt2 = grasp_point - v*max_size/2. display_list.append(pu.Line(max_end_pt1,max_end_pt2,color=(0,0,0))) else: #----- more complicated grasping location finder. for i in range(gr.grid_shape[2,0]): gr.grid[:,:,i] = gr.grid[:,:,i]*(i+1) height_map = gr.grid.max(2) * gr.resolution[2,0] # print height_map print 'height std deviation:',math.sqrt(height_map[np.where(height_map>0.)].var()) # connect_structure = np.empty((3,3),dtype='int') # connect_structure[:,:] = 1 # for i in range(gr.grid_shape[2,0]): # slice = gr.grid[:,:,i] # slice_filled = ni.binary_fill_holes(slice) # slice_edge = slice_filled - ni.binary_erosion(slice_filled,connect_structure) # gr.grid[:,:,i] = slice_edge*(i+1) # # height_map = gr.grid.max(2) * gr.resolution[2,0] # # print height_map # print 'contoured height std deviation:',math.sqrt(height_map[np.where(height_map>0.)].var()) # high_pts_2d = obj[0:2,np.where(obj[2,:]>max_height-0.005)[1].A1] #high_pts_1d = min_evec.T * high_pts_2d high_pts_1d = ut.norm(high_pts_2d) idx1 = np.argmin(high_pts_1d) pt1 = high_pts_2d[:,idx1] idx2 = np.argmax(high_pts_1d) pt2 = high_pts_2d[:,idx2] if np.linalg.norm(pt1)<np.linalg.norm(pt2): grasp_point = np.row_stack((pt1,np.matrix([max_height]))) else: grasp_point = np.row_stack((pt2,np.matrix([max_height]))) vec = centroid_2d-grasp_point[0:2,0] gripper_angle = -math.atan2(-vec[0,0],vec[1,0]) grasp_vec = vec/np.linalg.norm(vec) if display_list != None: pt1 = np.row_stack((pt1,np.matrix([max_height]))) pt2 = np.row_stack((pt2,np.matrix([max_height]))) # display_list.insert(0,pu.CubeCloud(pt1,(0,0,200),size=(0.005,0.005,0.005))) # display_list.insert(0,pu.CubeCloud(pt2,(200,0,200),size=(0.005,0.005,0.005))) if display_list != None: pts = gr.grid_to_points() size = resolution # size = resolution*2 # size[2,0] = size[2,0]*2 #display_list.insert(0,pu.PointCloud(pts,(200,0,0))) display_list.append(pu.CubeCloud(pts,color=(200,0,0),size=size)) display_list.append(pu.CubeCloud(grasp_point,(0,200,200),size=(0.007,0.007,0.007))) v = np.row_stack((grasp_vec,np.matrix([0.]))) min_end_pt1 = grasp_point + v*min_size/2. min_end_pt2 = grasp_point - v*min_size/2. max_evec = np.matrix((min_evec[1,0],-min_evec[0,0])).T pts_1d = max_evec.T * pts_2d max_size = pts_1d.max() - pts_1d.min() display_list.append(pu.Line(min_end_pt1,min_end_pt2,color=(0,255,0))) return grasp_point,gripper_angle #---------------------- testing functions ------------------- def test_vertical_plane_finding(): display_list = [] rot_angle = dict['rot_angle'] gr = create_vertical_plane_grid(pt,pos_list,scan_list,l1,l2,rotation_angle=rot_angle, display_list=display_list) vertical_plane_points(gr) plane_cloud = pu.PointCloud(gr.grid_to_points(),color=(0,150,0)) display_list.insert(0,plane_cloud) po3d.run(display_list) def test_find_door_handle(): display_list = [] rot_angle = dict['rot_angle'] # pt[2,0] += 0.15 print 'pt:',pt.A1.tolist() gr = create_vertical_plane_grid(pt,pos_list,scan_list,l1,l2,rotation_angle=rot_angle, display_list=display_list) grid_pts_cloud = pu.PointCloud(gr.grid_to_points(),(0,0,255)) display_list.insert(0,grid_pts_cloud) copy_gr = copy.deepcopy(gr) obj_pts_list = [] print 'pt:',pt.A1.tolist() # Do I want to change the occupancy threshold when I'm closer? (see the old function test_find_door_handle_close) handle_object = find_door_handle(gr,pt,obj_pts_list,rotation_angle=rot_angle, occupancy_threshold=1,resolution=np.matrix([0.02,0.0025,0.02]).T) copy_gr.remove_vertical_plane() stickout_pts_cloud = pu.PointCloud(copy_gr.grid_to_points(),(100,100,100)) display_list.insert(0,stickout_pts_cloud) for i,obj_pts in enumerate(obj_pts_list): print 'mean:', obj_pts.mean(1).A1.tolist() size = [0.02,0.0025,0.02] # look at param for find_door_handle # size=gr.resolution.A1.tolist() size[0] = size[0]*2 size[1] = size[1]*2 # size[2] = size[2]*2 display_list.append(pu.CubeCloud(obj_pts,color=color_list[i%len(color_list)],size=size)) laser_point_cloud = pu.CubeCloud(pt,color=(0,200,0),size=(0.005,0.005,0.005)) po3d.run(display_list) #po3d.save(display_list, raw_name+'.png') def test_segmentation(): gr = create_segmentation_grid(pt,pos_list,scan_list,l1,l2, display_flag=True) obj_pts_list = segment_objects_points(gr) if obj_pts_list == None: print 'There is no plane' obj_pts_list = [] pts = gr.grid_to_points() d3m.plot_points(pts,color=(1.,1.,1.)) d3m.plot_points(pt,color=(0,1,0.),mode='sphere') for i,obj_pts in enumerate(obj_pts_list): size=gr.resolution.A1.tolist() size[2] = size[2]*2 d3m.plot_points(obj_pts,color=color_list[i%len(color_list)]) # display_list.append(pu.CubeCloud(obj_pts,color=color_list[i%len(color_list)],size=size)) #display_list.insert(0,pu.PointCloud(obj_pts,color=color_list[i%len(color_list)])) print 'mean:', obj_pts.mean(1).T d3m.show() def test_grasp_location_on_object(): display_list = [] # display_list = None gr = create_segmentation_grid(pt,pos_list,scan_list,l1,l2,display_list=display_list) obj_pts_list = segment_objects_points(gr) closest_obj = find_closest_object(obj_pts_list,pt) grasp_location_on_object(closest_obj,display_list) po3d.run(display_list) def test_plane_finding(): ''' visualize plane finding. ''' # brf = pt + np.matrix([-0.4,-0.2,-0.3]).T # brf[0,0] = max(brf[0,0],0.05) # print 'brf:', brf.T # # tlb = pt + np.matrix([0.3, 0.2,0.3]).T # resolution = np.matrix([0.01,0.01,0.0025]).T brf = pt+np.matrix([-0.15,-0.25,-0.2]).T brf[0,0] = max(0.07,brf[0,0]) tlb = pt+np.matrix([0.25, 0.25,0.2]).T resolution = np.matrix([0.01,0.01,0.0025]).T max_dist = np.linalg.norm(tlb) + 0.2 min_dist = brf[0,0] all_pts = generate_pointcloud(pos_list, scan_list, min_angle, max_angle, l1, l2,save_scan=False, max_dist=max_dist,min_dist=min_dist) #max_dist=2.0,min_dist=min_dist) gr = og3d.occupancy_grid_3d(brf,tlb,resolution) gr.fill_grid(all_pts) gr.to_binary(1) l = gr.find_plane_indices(assume_plane=True) z_min = min(l)*gr.resolution[2,0]+gr.brf[2,0] z_max = max(l)*gr.resolution[2,0]+gr.brf[2,0] print 'height of plane:', (z_max+z_min)/2 pts = gr.grid_to_points() plane_pts_bool = np.multiply(pts[2,:]>=z_min,pts[2,:]<=z_max) plane_pts = pts[:,np.where(plane_pts_bool)[1].A1.tolist()] above_pts =pts[:,np.where(pts[2,:]>z_max)[1].A1.tolist()] below_pts =pts[:,np.where(pts[2,:]<z_min)[1].A1.tolist()] d3m.plot_points(pt,color=(0,1,0.),mode='sphere') d3m.plot_points(plane_pts,color=(0,0,1.)) d3m.plot_points(above_pts,color=(1.0,1.0,1.0)) d3m.plot_points(below_pts,color=(1.,0.,0.)) cube_tups = gr.grid_lines() d3m.plot_cuboid(cube_tups) d3m.show() def test_approach(): display_list=[] # gr = create_approach_grid(pt,pos_list,scan_list,l1,l2,display_list=display_list,show_pts=False) gr = create_approach_grid(pt,pos_list,scan_list,l1,l2,display_list=display_list,show_pts=True) t0 = time.time() p_erratic,p_edge,h = find_goto_point_surface_1(gr,pt,display_list) t1 = time.time() print 'aaaaaaaaaaaaaah:', t1-t0 l = gr.find_plane_indices(assume_plane=True) z_min = min(l)*gr.resolution[2,0]+gr.brf[2,0] z_max = max(l)*gr.resolution[2,0]+gr.brf[2,0] print 'height of plane:', (z_max+z_min)/2 print 'height of surface in thok0 coord frame:', h print 'p_erratic in thok0:', p_erratic.T display_list.append(pu.CubeCloud(pt,color=(0,255,0),size=(0.018,0.018,0.018))) # display_list.append(pu.CubeCloud(p_erratic,color=(0,250,250),size=(0.007,0.007,0.007))) display_list.insert(0,pu.PointCloud(gr.grid_to_points(),color=(100,100,100))) po3d.run(display_list) def test_max_forward(): max_dist = math.sqrt(pt[0,0]**2+pt[1,0]**2+2.0**1) + 0.3 # max_dist = np.linalg.norm(pt[0:2]+0.3) min_angle,max_angle=math.radians(-40),math.radians(40) all_pts = generate_pointcloud(pos_list, scan_list, min_angle, max_angle, l1, l2, max_dist=max_dist, min_tilt=math.radians(-90)) display_list = [] max_x = max_fwd_without_collision(all_pts,0.20,max_dist,display_list) po3d.run(display_list) # print 'height_mat:', height_mat print 'max_x:', max_x dict = {'pos_list':pos_list, 'scan_list':scan_list,'l1':l1, 'l2':l2, 'pt':pt} # ut.save_pickle(dict,ut.formatted_time()+'_fwd_dict.pkl') def test_choose_grasp_strategy(): display_list = [] far_dist = 0.15 pt[1,0] += 0.0 gr = create_overhead_grasp_choice_grid(pt,pos_list,scan_list,l1,l2,far_dist,display_list) print 'overhead collide?',overhead_grasp_collision(pt,gr) display_list.append(pu.CubeCloud(pt,color=(0,200,0),size=(0.005,0.005,0.005))) # pts = generate_pointcloud(pos_list, scan_list, min_angle, max_angle, l1, l2,save_scan=False, # #max_dist=max_dist,min_dist=min_dist) # max_dist=2.0,min_dist=0.1) # display_list.append(pu.PointCloud(pts,color=(100,100,100))) po3d.run(display_list) def test_different_surfaces(): display_list = [] # all_pts = generate_pointcloud(pos_list, scan_list, math.radians(-40), math.radians(40), l1, l2,save_scan=False, # max_dist=np.Inf, min_dist=-np.Inf,min_tilt=-np.Inf,max_tilt=np.Inf) ## pts = all_pts[:,np.where(np.multiply(all_pts[0,:]>0.1,all_pts[0,:]<0.4))[1].A1] ## pts = pts[:,np.where(np.multiply(pts[1,:]<0.3,pts[1,:]>-0.3))[1].A1] ## pts = pts[:,np.where(pts[2,:]>-0.2)[1].A1] ## display_list.append(pu.PointCloud(pts,color=(0,200,0))) # display_list.append(pu.PointCloud(all_pts,color=(200,0,0))) # # brf = np.matrix([0.05,-0.35,-0.2]).T # tlb = np.matrix([0.5, 0.35,0.0]).T # resolution = np.matrix([0.01,0.01,0.0025]).T # gr = og3d.occupancy_grid_3d(brf,tlb,resolution) # gr.fill_grid(all_pts) # gr.to_binary(1) # gr = create_segmentation_grid(pt,pos_list,scan_list,l1,l2,display_list) gr = create_approach_grid(pt,pos_list,scan_list,l1,l2,display_list) l = gr.find_plane_indices(assume_plane=True) max_index = min(max(l)+5,gr.grid_shape[2,0]-1) min_index = max(min(l)-5,0) l = range(min_index,max_index+1) n_points_list = [] height_list = [] for idx in l: n_points_list.append(gr.grid[:,:,idx].sum()) height_list.append(idx*gr.resolution[2,0]+gr.brf[2,0]) pl.bar(height_list,n_points_list,width=gr.resolution[2,0],linewidth=0,align='center',color='y') max_occ = max(n_points_list) thresh = max_occ/5 xmin,xmax = pl.xlim() t = pl.axis() t = (xmin+0.0017,xmax-0.001,t[2],t[3]+50) # pl.plot([height_list[0],height_list[-1]],[thresh,thresh],c='r') pl.plot([xmin,xmax],[thresh,thresh],c='b') pl.title('Histogram of number of points vs z-coordinate of points') pl.xlabel('z-coordinate (relative to the laser range finder) (meters)') pl.ylabel('Number of points') pl.axis(t) pl.savefig(pkl_file_name+'.png') # pl.show() # print 'Mean:', pts.mean(1).T # pts_zeromean = pts-pts.mean(1) # n_points = pts.shape[1] # print 'n_points:', n_points # e_vals,e_vecs = np.linalg.eig(pts_zeromean*pts_zeromean.T/n_points) # # min_index = np.argmin(e_vals) # min_evec = e_vecs[:,min_index] # print 'min eigenvector:', min_evec.T # print 'min eigenvalue:', e_vals[min_index] # pts_1d = min_evec.T * pts # size = pts_1d.max() - pts_1d.min() # print 'spread along min eigenvector:', size # po3d.run(display_list) def test_occ_grid(): gr = create_approach_grid(pt,pos_list,scan_list,l1,l2,display_list=None,show_pts=True) pts = gr.grid_to_points() display_list=[] display_list.append(pu.CubeCloud(pt,color=(0,255,0),size=(0.007,0.007,0.007))) display_list.append(pu.PointCloud(pts,color=(200,0,0))) po3d.run(display_list) if __name__ == '__main__': p = optparse.OptionParser() p.add_option('-f', action='store', type='string', dest='pkl_file_name', help='file.pkl File with the scan,pos dict.') p.add_option('--all_pts', action='store_true', dest='show_all_pts', help='show all the points in light grey') opt, args = p.parse_args() pkl_file_name = opt.pkl_file_name show_full_cloud = opt.show_all_pts str_parts = pkl_file_name.split('.') raw_name = str_parts[-2] str_parts = raw_name.split('/') raw_name = str_parts[-1] dict = ut.load_pickle(pkl_file_name) pos_list = dict['pos_list'] scan_list = dict['scan_list'] min_angle = math.radians(-40) max_angle = math.radians(40) l1 = dict['l1'] l2 = dict['l2'] # l2 = -0.055 # l2 = 0.035 if dict.has_key('pt'): pt = dict['pt'] print 'dict has key pt' else: print 'dict does NOT have key pt' pt = np.matrix([0.35,0.0,-0.3]).T dict['pt'] = pt ut.save_pickle(dict,pkl_file_name) # charlie_nih() # test_grasp_location_on_object() # test_find_door_handle() # test_vertical_plane_finding_close() # test_vertical_plane_finding() test_segmentation() # test_plane_finding() # test_max_forward() # test_approach() # test_choose_grasp_strategy() # test_different_surfaces() # test_occ_grid()
ajibawa-2023/Python-Code-Large/train/row_99556
654
1,148
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Import_L30_C0", "label": "roslib import roslib", "type": "import", "loc": [30, 30], "level": 0, "parent": null, "vector": [1, 0, 0.0261, 0.0009, 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_tilting_hokuyo')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L30_C15", "label": "load_manifest()", "type": "expression", "loc": [30, 30], "level": 0, "parent": null, "vector": [8, 0, 0.0261, 0.0009, 0, 0.66, 0.0227, 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_tilting_hokuyo')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Import_L31_C0", "label": "hrl_hokuyo.hokuyo_processing import hp", "type": "import", "loc": [31, 31], "level": 0, "parent": null, "vector": [1, 0, 0.027, 0.0009, 0, 0.66, 0.0455, 513, 0, 1, 0, 0, 513, 0, 0], "semantic": {"name": "hrl_hokuyo.hokuyo_processing", "arg_names": [], "import_names": ["hp"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_hokuyo.hokuyo_processing as hp"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Import_L32_C0", "label": "sys import sys, optparse, os", "type": "import", "loc": [32, 32], "level": 0, "parent": null, "vector": [1, 0, 0.0279, 0.0009, 0, 0.66, 0.0682, 509, 0, 3, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys", "optparse", "os"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys, optparse, os"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Import_L33_C0", "label": "hrl_lib.util import ut", "type": "import", "loc": [33, 33], "level": 0, "parent": null, "vector": [1, 0, 0.0287, 0.0009, 0, 0.66, 0.0909, 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_99556:Import_L34_C0", "label": "hrl_lib.transforms import tr", "type": "import", "loc": [34, 34], "level": 0, "parent": null, "vector": [1, 0, 0.0296, 0.0009, 0, 0.66, 0.1136, 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_99556:Import_L35_C0", "label": "numpy import np, math", "type": "import", "loc": [35, 35], "level": 0, "parent": null, "vector": [1, 0, 0.0305, 0.0009, 0, 0.66, 0.1364, 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_99556:Import_L36_C0", "label": "time import time", "type": "import", "loc": [36, 36], "level": 0, "parent": null, "vector": [1, 0, 0.0314, 0.0009, 0, 0.66, 0.1591, 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_99556:Import_L38_C0", "label": "display_3d_mayavi import d3m", "type": "import", "loc": [38, 38], "level": 0, "parent": null, "vector": [1, 0, 0.0331, 0.0009, 0, 0.66, 0.1818, 373, 0, 1, 0, 0, 373, 0, 0], "semantic": {"name": "display_3d_mayavi", "arg_names": [], "import_names": ["d3m"], "rhs_call_name": "", "annotation": ""}, "snippet": "import display_3d_mayavi as d3m"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Import_L40_C0", "label": "occupancy_grid_3d import og3d", "type": "import", "loc": [40, 40], "level": 0, "parent": null, "vector": [1, 0, 0.0348, 0.0009, 0, 0.66, 0.2045, 222, 0, 1, 0, 0, 222, 0, 0], "semantic": {"name": "occupancy_grid_3d", "arg_names": [], "import_names": ["og3d"], "rhs_call_name": "", "annotation": ""}, "snippet": "import occupancy_grid_3d as og3d"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Import_L41_C0", "label": "scipy.ndimage import ni", "type": "import", "loc": [41, 41], "level": 0, "parent": null, "vector": [1, 0, 0.0357, 0.0009, 0, 0.66, 0.2273, 348, 0, 1, 0, 0, 348, 0, 0], "semantic": {"name": "scipy.ndimage", "arg_names": [], "import_names": ["ni"], "rhs_call_name": "", "annotation": ""}, "snippet": "import scipy.ndimage as ni"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Import_L43_C0", "label": "copy import copy", "type": "import", "loc": [43, 43], "level": 0, "parent": null, "vector": [1, 0, 0.0375, 0.0009, 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_99556:Import_L44_C0", "label": "pylab import pl", "type": "import", "loc": [44, 44], "level": 0, "parent": null, "vector": [1, 0, 0.0383, 0.0009, 0, 0.66, 0.2727, 735, 0, 1, 0, 0, 735, 0, 0], "semantic": {"name": "pylab", "arg_names": [], "import_names": ["pl"], "rhs_call_name": "", "annotation": ""}, "snippet": "import pylab as pl"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L46_C0", "label": "color_list =", "type": "assigned_variable", "loc": [46, 48], "level": 0, "parent": null, "vector": [14, 0, 0.0409, 0.0026, 0, 0.66, 0.2955, 570, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "color_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "color_list = [(1.,1.,0),(1.,0,0),(0,1.,1.),(0,1.,0),(0,0,1.),(0,0.4,0.4),(0.4,0.4,0),\n (0.4,0,0.4),(0.4,0.8,0.4),(0.8,0.4,0.4),(0.4,0.4,0.8),(0.4,0,0.8),(0,0.8,0.4),\n (0,0.4,0.8),(0.8,0,0.4),(0.4,0,0.4),(1.,0.6,0.02) ]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L56_C0", "label": "points_within_cuboid", "type": "function", "loc": [56, 63], "level": 0, "parent": null, "vector": [2, 0, 0.0518, 0.007, 0, 0.66, 0.3182, 173, 0, 3, 1, 0, 0, 0, 5], "semantic": {"name": "points_within_cuboid", "arg_names": ["pts", "brf", "tlb"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def points_within_cuboid(pts,brf,tlb):\n idx = np.where(np.min(np.multiply(pts>brf,pts<tlb),0))[1]\n if idx.shape[1] == 0:\n within_pts = np.empty((3,0))\n else:\n within_pts = pts[:,idx.A1.tolist()]\n\n return within_pts"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L57_C4", "label": "idx =", "type": "assigned_variable", "loc": [57, 57], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L56_C0", "vector": [14, 1, 0.0497, 0.0009, 1, 0.7, 0.0, 187, 6, 0, 0, 0, 0, 0, 3], "semantic": {"name": "idx", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " idx = np.where(np.min(np.multiply(pts>brf,pts<tlb),0))[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L58_C4", "label": "if", "type": "if", "loc": [58, 61], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L56_C0", "vector": [4, 1, 0.0518, 0.0035, 1, 0.7, 0.5, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if idx.shape[1] == 0:\n within_pts = np.empty((3,0))\n else:\n within_pts = pts[:,idx.A1.tolist()]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L59_C8", "label": "within_pts = empty()", "type": "assigned_variable", "loc": [59, 59], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L58_C4", "vector": [14, 2, 0.0514, 0.0009, 2, 0.3, 0.0, 716, 3, 1, 0, 0, 365, 10, 1], "semantic": {"name": "within_pts", "arg_names": [], "import_names": [], "rhs_call_name": "empty", "annotation": ""}, "snippet": " within_pts = np.empty((3,0))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L61_C8", "label": "within_pts =", "type": "assigned_variable", "loc": [61, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L58_C4", "vector": [14, 2, 0.0531, 0.0009, 2, 0.3, 1.0, 716, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "within_pts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " within_pts = pts[:,idx.A1.tolist()]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Return_L63_C4", "label": "return", "type": "return", "loc": [63, 63], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L56_C0", "vector": [13, 1, 0.0549, 0.0009, 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 within_pts"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L66_C0", "label": "generate_pointcloud", "type": "function", "loc": [66, 137], "level": 0, "parent": null, "vector": [2, 0, 0.0884, 0.0627, 0, 0.66, 0.3409, 989, 0, 13, 1, 0, 0, 0, 30], "semantic": {"name": "generate_pointcloud", "arg_names": ["pos_list", "scan_list", "min_angle", "max_angle", "l1", "l2", "save_scan", "max_dist", "min_dist", "min_tilt", "max_tilt", "get_intensities", "reject_zero_ten"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def generate_pointcloud(pos_list, scan_list, min_angle, max_angle, l1, l2,save_scan=False,\n max_dist=np.Inf, min_dist=-np.Inf,min_tilt=-np.Inf,max_tilt=np.Inf, get_intensities=False, reject_zero_ten=True):\n ''' pos_list - list of motor positions (in steps)\n scan_list - list of UrgScan objects at the corres positions.\n l1,l2 - parameterizing the transformation (doc/ folder)\n save_scan - pickle 3xN numpy matrix of points.\n max_dist - ignore points at distance > max_dist\n min_dist - ignore points at distance < max_dist"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L68_C4", "label": "expression", "type": "expression", "loc": [68, 79], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L66_C0", "vector": [8, 1, 0.064, 0.0105, 1, 0.11, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' pos_list - list of motor positions (in steps)\n scan_list - list of UrgScan objects at the corres positions.\n l1,l2 - parameterizing the transformation (doc/ folder)\n save_scan - pickle 3xN numpy matrix of points.\n max_dist - ignore points at distance > max_dist\n min_dist - ignore points at distance < max_dist\n\n min_tilt, max_tilt - min and max tilt angles (radians)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L80_C4", "label": "t0 = time()", "type": "assigned_variable", "loc": [80, 80], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L66_C0", "vector": [14, 1, 0.0697, 0.0009, 1, 0.11, 0.0667, 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_99556:Assign_L81_C4", "label": "allpts =", "type": "assigned_variable", "loc": [81, 81], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L66_C0", "vector": [14, 1, 0.0706, 0.0009, 1, 0.11, 0.1333, 515, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "allpts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " allpts = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L82_C4", "label": "allintensities =", "type": "assigned_variable", "loc": [82, 82], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L66_C0", "vector": [14, 1, 0.0714, 0.0009, 1, 0.11, 0.2, 515, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "allintensities", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " allintensities = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L84_C4", "label": "pos_arr = array()", "type": "assigned_variable", "loc": [84, 84], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L66_C0", "vector": [14, 1, 0.0732, 0.0009, 1, 0.11, 0.2667, 412, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "pos_arr", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " pos_arr = np.array(pos_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L85_C4", "label": "scan_arr = array()", "type": "assigned_variable", "loc": [85, 85], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L66_C0", "vector": [14, 1, 0.074, 0.0009, 1, 0.11, 0.3333, 596, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "scan_arr", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " scan_arr = np.array(scan_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L86_C4", "label": "idxs = where()", "type": "assigned_variable", "loc": [86, 86], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L66_C0", "vector": [14, 1, 0.0749, 0.0009, 1, 0.11, 0.4, 677, 3, 1, 0, 0, 169, 10, 2], "semantic": {"name": "idxs", "arg_names": [], "import_names": [], "rhs_call_name": "where", "annotation": ""}, "snippet": " idxs = np.where(np.multiply(pos_arr<=max_tilt,pos_arr>=min_tilt))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L87_C4", "label": "pos_list = tolist()", "type": "assigned_variable", "loc": [87, 87], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L66_C0", "vector": [14, 1, 0.0758, 0.0009, 1, 0.11, 0.4667, 279, 3, 0, 0, 0, 185, 10, 1], "semantic": {"name": "pos_list", "arg_names": [], "import_names": [], "rhs_call_name": "tolist", "annotation": ""}, "snippet": " pos_list = pos_arr[idxs].tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L88_C4", "label": "scan_list = tolist()", "type": "assigned_variable", "loc": [88, 88], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L66_C0", "vector": [14, 1, 0.0767, 0.0009, 1, 0.11, 0.5333, 378, 3, 0, 0, 0, 185, 10, 1], "semantic": {"name": "scan_list", "arg_names": [], "import_names": [], "rhs_call_name": "tolist", "annotation": ""}, "snippet": " scan_list = scan_arr[idxs].tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L90_C4", "label": "n_scans = len()", "type": "assigned_variable", "loc": [90, 90], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L66_C0", "vector": [14, 1, 0.0784, 0.0009, 1, 0.11, 0.6, 777, 3, 1, 0, 0, 890, 10, 1], "semantic": {"name": "n_scans", "arg_names": [], "import_names": [], "rhs_call_name": "len", "annotation": ""}, "snippet": " n_scans = len(scan_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L92_C4", "label": "if", "type": "if", "loc": [92, 107], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L66_C0", "vector": [4, 1, 0.0867, 0.0139, 1, 0.11, 0.6667, 0, 0, 0, 0, 0, 0, 0, 9], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if n_scans>1:\n scan_list = copy.deepcopy(scan_list)\n\n # remove graze in across scans.\n ranges_mat = []\n for s in scan_list:\n ranges_mat.append(s.ranges.T)\n ranges_mat = np.column_stack(ranges_mat)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L93_C8", "label": "scan_list = deepcopy()", "type": "assigned_variable", "loc": [93, 93], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L92_C4", "vector": [14, 2, 0.081, 0.0009, 2, 0.76, 0.0, 378, 3, 1, 0, 0, 44, 10, 1], "semantic": {"name": "scan_list", "arg_names": [], "import_names": [], "rhs_call_name": "deepcopy", "annotation": ""}, "snippet": " scan_list = copy.deepcopy(scan_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L96_C8", "label": "ranges_mat =", "type": "assigned_variable", "loc": [96, 96], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L92_C4", "vector": [14, 2, 0.0836, 0.0009, 2, 0.76, 0.1429, 900, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "ranges_mat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ranges_mat = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L97_C8", "label": "for s", "type": "for", "loc": [97, 98], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L92_C4", "vector": [6, 2, 0.0849, 0.0017, 2, 0.76, 0.2857, 553, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "s", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for s in scan_list:\n ranges_mat.append(s.ranges.T)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L98_C12", "label": "append()", "type": "expression", "loc": [98, 98], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L97_C8", "vector": [8, 3, 0.0854, 0.0009, 3, 0.43, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " ranges_mat.append(s.ranges.T)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L99_C8", "label": "ranges_mat = column_stack()", "type": "assigned_variable", "loc": [99, 99], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L92_C4", "vector": [14, 2, 0.0862, 0.0009, 2, 0.76, 0.4286, 900, 3, 1, 0, 0, 724, 10, 1], "semantic": {"name": "ranges_mat", "arg_names": [], "import_names": [], "rhs_call_name": "column_stack", "annotation": ""}, "snippet": " ranges_mat = np.column_stack(ranges_mat)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L101_C8", "label": "start_index = angle_to_index()", "type": "assigned_variable", "loc": [101, 101], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L92_C4", "vector": [14, 2, 0.088, 0.0009, 2, 0.76, 0.5714, 553, 3, 2, 0, 0, 126, 10, 1], "semantic": {"name": "start_index", "arg_names": [], "import_names": [], "rhs_call_name": "angle_to_index", "annotation": ""}, "snippet": " start_index = hp.angle_to_index(scan_list[0],min_angle)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L102_C8", "label": "end_index = angle_to_index()", "type": "assigned_variable", "loc": [102, 102], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L92_C4", "vector": [14, 2, 0.0889, 0.0009, 2, 0.76, 0.7143, 48, 3, 2, 0, 0, 126, 10, 1], "semantic": {"name": "end_index", "arg_names": [], "import_names": [], "rhs_call_name": "angle_to_index", "annotation": ""}, "snippet": " end_index = hp.angle_to_index(scan_list[0],max_angle)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L103_C8", "label": "for r", "type": "for", "loc": [103, 104], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L92_C4", "vector": [6, 2, 0.0902, 0.0017, 2, 0.76, 0.8571, 436, 6, 0, 0, 0, 0, 0, 3], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for r in ranges_mat[start_index:end_index+1]:\n hp.remove_graze_effect(r,np.matrix(pos_list),skip=1,graze_angle_threshold=math.radians(169.))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L104_C12", "label": "remove_graze_effect()", "type": "expression", "loc": [104, 104], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L103_C8", "vector": [8, 3, 0.0906, 0.0009, 3, 0.27, 0.0, 924, 3, 4, 0, 0, 0, 0, 3], "semantic": {"name": "remove_graze_effect", "arg_names": [], "import_names": [], "rhs_call_name": "remove_graze_effect", "annotation": ""}, "snippet": " hp.remove_graze_effect(r,np.matrix(pos_list),skip=1,graze_angle_threshold=math.radians(169.))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L106_C8", "label": "for i, s", "type": "for", "loc": [106, 107], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L92_C4", "vector": [6, 2, 0.0928, 0.0017, 2, 0.76, 1.0, 856, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "i, s", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i,s in enumerate(scan_list):\n s.ranges = ranges_mat[:,i].T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L107_C12", "label": "s.ranges =", "type": "assigned_variable", "loc": [107, 107], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L106_C8", "vector": [14, 3, 0.0932, 0.0009, 3, 0.84, 0.0, 711, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "s.ranges", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " s.ranges = ranges_mat[:,i].T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L109_C4", "label": "for p, s", "type": "for", "loc": [109, 120], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L66_C0", "vector": [6, 1, 0.0997, 0.0105, 1, 0.11, 0.7333, 942, 3, 0, 0, 0, 0, 0, 8], "semantic": {"name": "p, s", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for p,s in zip(pos_list,scan_list):\n mapxydata = hp.get_xy_map(s,min_angle,max_angle,max_dist=max_dist,min_dist=min_dist,reject_zero_ten=reject_zero_ten,sigmoid_hack=True,get_intensities=get_intensities) # pts is 2xN\n \n if get_intensities == True:\n pts, intensities = mapxydata\n allintensities.append(intensities)\n else:\n pts = mapxydata"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L110_C8", "label": "mapxydata = get_xy_map()", "type": "assigned_variable", "loc": [110, 110], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L109_C4", "vector": [14, 2, 0.0958, 0.0009, 2, 0.59, 0.0, 217, 3, 8, 0, 0, 476, 10, 1], "semantic": {"name": "mapxydata", "arg_names": [], "import_names": [], "rhs_call_name": "get_xy_map", "annotation": ""}, "snippet": " mapxydata = hp.get_xy_map(s,min_angle,max_angle,max_dist=max_dist,min_dist=min_dist,reject_zero_ten=reject_zero_ten,sigmoid_hack=True,get_intensities=get_intensities) # pts is 2xN"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L112_C8", "label": "if", "type": "if", "loc": [112, 116], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L109_C4", "vector": [4, 2, 0.0993, 0.0044, 2, 0.59, 0.25, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if get_intensities == True:\n pts, intensities = mapxydata\n allintensities.append(intensities)\n else:\n pts = mapxydata"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L113_C12", "label": "pts, intensities =", "type": "assigned_variable", "loc": [113, 113], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L112_C8", "vector": [14, 3, 0.0984, 0.0009, 3, 0.89, 0.0, 782, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pts, intensities", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pts, intensities = mapxydata"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L114_C12", "label": "append()", "type": "expression", "loc": [114, 114], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L112_C8", "vector": [8, 3, 0.0993, 0.0009, 3, 0.89, 0.5, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " allintensities.append(intensities)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L116_C12", "label": "pts =", "type": "assigned_variable", "loc": [116, 116], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L112_C8", "vector": [14, 3, 0.101, 0.0009, 3, 0.89, 1.0, 195, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pts = mapxydata"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L118_C8", "label": "pts = row_stack()", "type": "assigned_variable", "loc": [118, 118], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L109_C4", "vector": [14, 2, 0.1028, 0.0009, 2, 0.59, 0.5, 195, 3, 1, 0, 0, 612, 10, 2], "semantic": {"name": "pts", "arg_names": [], "import_names": [], "rhs_call_name": "row_stack", "annotation": ""}, "snippet": " pts = np.row_stack((pts,np.zeros(pts.shape[1]))) # pts is now 3xN"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L119_C8", "label": "pts =", "type": "assigned_variable", "loc": [119, 119], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L109_C4", "vector": [14, 2, 0.1037, 0.0009, 2, 0.59, 0.75, 195, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "pts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pts = tr.Ry(-p)*(pts+np.matrix((l1,0,-l2)).T)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L120_C8", "label": "append()", "type": "expression", "loc": [120, 120], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L109_C4", "vector": [8, 2, 0.1045, 0.0009, 2, 0.59, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " allpts.append(pts)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L123_C4", "label": "allpts = column_stack()", "type": "assigned_variable", "loc": [123, 123], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L66_C0", "vector": [14, 1, 0.1071, 0.0009, 1, 0.11, 0.8, 515, 3, 1, 0, 0, 724, 10, 1], "semantic": {"name": "allpts", "arg_names": [], "import_names": [], "rhs_call_name": "column_stack", "annotation": ""}, "snippet": " allpts = np.column_stack(allpts)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L126_C4", "label": "if", "type": "if", "loc": [126, 128], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L66_C0", "vector": [4, 1, 0.1106, 0.0026, 1, 0.11, 0.8667, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if save_scan:\n date_name = ut.formatted_time()\n ut.save_pickle(allpts,date_name+'_cloud.pkl')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L127_C8", "label": "date_name = formatted_time()", "type": "assigned_variable", "loc": [127, 127], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L126_C4", "vector": [14, 2, 0.1106, 0.0009, 2, 0.02, 0.0, 532, 3, 0, 0, 0, 353, 10, 1], "semantic": {"name": "date_name", "arg_names": [], "import_names": [], "rhs_call_name": "formatted_time", "annotation": ""}, "snippet": " date_name = ut.formatted_time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L128_C8", "label": "save_pickle()", "type": "expression", "loc": [128, 128], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L126_C4", "vector": [8, 2, 0.1115, 0.0009, 2, 0.02, 1.0, 390, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "save_pickle", "arg_names": [], "import_names": [], "rhs_call_name": "save_pickle", "annotation": ""}, "snippet": " ut.save_pickle(allpts,date_name+'_cloud.pkl')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L130_C4", "label": "t1 = time()", "type": "assigned_variable", "loc": [130, 130], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L66_C0", "vector": [14, 1, 0.1132, 0.0009, 1, 0.11, 0.9333, 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_99556:If_L133_C4", "label": "if", "type": "if", "loc": [133, 137], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L66_C0", "vector": [4, 1, 0.1176, 0.0044, 1, 0.11, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if get_intensities == True:\n allintensities = np.column_stack(allintensities)\n return allpts, allintensities\n else:\n return allpts"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L134_C8", "label": "allintensities = column_stack()", "type": "assigned_variable", "loc": [134, 134], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L133_C4", "vector": [14, 2, 0.1167, 0.0009, 2, 0.6, 0.0, 515, 3, 1, 0, 0, 724, 10, 1], "semantic": {"name": "allintensities", "arg_names": [], "import_names": [], "rhs_call_name": "column_stack", "annotation": ""}, "snippet": " allintensities = np.column_stack(allintensities)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Return_L135_C8", "label": "return", "type": "return", "loc": [135, 135], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L133_C4", "vector": [13, 2, 0.1176, 0.0009, 2, 0.6, 0.5, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return allpts, allintensities"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Return_L137_C8", "label": "return", "type": "return", "loc": [137, 137], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L133_C4", "vector": [13, 2, 0.1193, 0.0009, 2, 0.6, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return allpts"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L141_C0", "label": "max_fwd_without_collision", "type": "function", "loc": [141, 179], "level": 0, "parent": null, "vector": [2, 0, 0.1394, 0.034, 0, 0.66, 0.3636, 118, 0, 4, 1, 0, 0, 0, 21], "semantic": {"name": "max_fwd_without_collision", "arg_names": ["all_pts", "z_height", "max_dist", "display_list"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def max_fwd_without_collision(all_pts,z_height,max_dist,display_list=None):\n ''' find the max distance that it is possible to move fwd by\n without collision.\n all_pts - 3xN matrix of 3D points in thok frame.\n z - height of zenither while taking the scan.\n max_dist - how far do I want to check for a possible collision.\n returns max_dist that the thok can be moved fwd without collision.\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L142_C4", "label": "expression", "type": "expression", "loc": [142, 148], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L141_C0", "vector": [8, 1, 0.1263, 0.0061, 1, 0.43, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' find the max distance that it is possible to move fwd by\n without collision.\n all_pts - 3xN matrix of 3D points in thok frame.\n z - height of zenither while taking the scan.\n max_dist - how far do I want to check for a possible collision.\n returns max_dist that the thok can be moved fwd without collision.\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L149_C4", "label": "brf =", "type": "assigned_variable", "loc": [149, 149], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L141_C0", "vector": [14, 1, 0.1298, 0.0009, 1, 0.43, 0.0769, 17, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "brf", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " brf = np.matrix([0.2,-0.4,-z_height-0.1]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L150_C4", "label": "tlb =", "type": "assigned_variable", "loc": [150, 150], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L141_C0", "vector": [14, 1, 0.1307, 0.0009, 1, 0.43, 0.1538, 90, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "tlb", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tlb = np.matrix([max_dist, 0.4,-z_height+1.8]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L151_C4", "label": "resolution =", "type": "assigned_variable", "loc": [151, 151], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L141_C0", "vector": [14, 1, 0.1315, 0.0009, 1, 0.43, 0.2308, 615, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "resolution", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " resolution = np.matrix([0.05,0.05,0.02]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L153_C4", "label": "gr = occupancy_grid_3d()", "type": "assigned_variable", "loc": [153, 153], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L141_C0", "vector": [14, 1, 0.1333, 0.0009, 1, 0.43, 0.3077, 8, 3, 3, 0, 0, 222, 10, 1], "semantic": {"name": "gr", "arg_names": [], "import_names": [], "rhs_call_name": "occupancy_grid_3d", "annotation": ""}, "snippet": " gr = og3d.occupancy_grid_3d(brf,tlb,resolution)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L154_C4", "label": "fill_grid()", "type": "expression", "loc": [154, 154], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L141_C0", "vector": [8, 1, 0.1341, 0.0009, 1, 0.43, 0.3846, 619, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "fill_grid", "arg_names": [], "import_names": [], "rhs_call_name": "fill_grid", "annotation": ""}, "snippet": " gr.fill_grid(all_pts)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L156_C4", "label": "to_binary()", "type": "expression", "loc": [156, 156], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L141_C0", "vector": [8, 1, 0.1359, 0.0009, 1, 0.43, 0.4615, 206, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "to_binary", "arg_names": [], "import_names": [], "rhs_call_name": "to_binary", "annotation": ""}, "snippet": " gr.to_binary(4)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L157_C4", "label": "ground_z =", "type": "assigned_variable", "loc": [157, 157], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L141_C0", "vector": [14, 1, 0.1368, 0.0009, 1, 0.43, 0.5385, 221, 6, 0, 0, 0, 0, 0, 2], "semantic": {"name": "ground_z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ground_z = tr.thok0Tglobal(np.matrix([0,0,-z_height]).T)[2,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L159_C4", "label": "remove_horizontal_plane()", "type": "expression", "loc": [159, 159], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L141_C0", "vector": [8, 1, 0.1385, 0.0009, 1, 0.43, 0.6154, 651, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "remove_horizontal_plane", "arg_names": [], "import_names": [], "rhs_call_name": "remove_horizontal_plane", "annotation": ""}, "snippet": " gr.remove_horizontal_plane(extra_layers=2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L160_C4", "label": "collide_pts = row_stack()", "type": "assigned_variable", "loc": [160, 160], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L141_C0", "vector": [14, 1, 0.1394, 0.0009, 1, 0.43, 0.6923, 80, 3, 1, 0, 0, 612, 10, 2], "semantic": {"name": "collide_pts", "arg_names": [], "import_names": [], "rhs_call_name": "row_stack", "annotation": ""}, "snippet": " collide_pts = np.row_stack(np.where(gr.grid!=0))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L161_C4", "label": "x_coords =", "type": "assigned_variable", "loc": [161, 161], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L141_C0", "vector": [14, 1, 0.1402, 0.0009, 1, 0.43, 0.7692, 968, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "x_coords", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " x_coords = collide_pts[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L163_C4", "label": "if", "type": "if", "loc": [163, 170], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L141_C0", "vector": [4, 1, 0.145, 0.007, 1, 0.43, 0.8462, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if x_coords.shape[0] == 0:\n max_x = max_dist\n# height_mat = np.arrary([np.Inf])\n else:\n max_x_gr = np.min(x_coords)\n# height_mat = collide_pts[1,np.where(x_coords==max_x_gr)[0]]\n# height_mat = height_mat*gr.resolution[2,0]+gr.brf[2,0]\n max_x = max_x_gr*gr.resolution[0,0]+gr.brf[0,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L164_C8", "label": "max_x =", "type": "assigned_variable", "loc": [164, 164], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L163_C4", "vector": [14, 2, 0.1429, 0.0009, 2, 0.62, 0.0, 64, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "max_x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " max_x = max_dist"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L167_C8", "label": "max_x_gr = min()", "type": "assigned_variable", "loc": [167, 167], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L163_C4", "vector": [14, 2, 0.1455, 0.0009, 2, 0.62, 0.5, 746, 3, 1, 0, 0, 867, 10, 1], "semantic": {"name": "max_x_gr", "arg_names": [], "import_names": [], "rhs_call_name": "min", "annotation": ""}, "snippet": " max_x_gr = np.min(x_coords)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L170_C8", "label": "max_x =", "type": "assigned_variable", "loc": [170, 170], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L163_C4", "vector": [14, 2, 0.1481, 0.0009, 2, 0.62, 1.0, 64, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "max_x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " max_x = max_x_gr*gr.resolution[0,0]+gr.brf[0,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L172_C4", "label": "if", "type": "if", "loc": [172, 176], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L141_C0", "vector": [4, 1, 0.1516, 0.0044, 1, 0.43, 0.9231, 0, 0, 0, 0, 0, 0, 0, 9], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if display_list != None:\n collide_grid = gr.grid_to_points()\n display_list.append(pu.PointCloud(all_pts,(200,200,200)))\n display_list.append(pu.CubeCloud(collide_grid,(200,200,200),resolution))\n display_list.append(pu.CubeCloud(np.matrix((max_x,0.,0.)).T,(0,0,200),size=np.matrix([0.05,.05,0.05]).T))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L173_C8", "label": "collide_grid = grid_to_points()", "type": "assigned_variable", "loc": [173, 173], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L172_C4", "vector": [14, 2, 0.1507, 0.0009, 2, 0.38, 0.0, 718, 3, 0, 0, 0, 558, 10, 1], "semantic": {"name": "collide_grid", "arg_names": [], "import_names": [], "rhs_call_name": "grid_to_points", "annotation": ""}, "snippet": " collide_grid = gr.grid_to_points()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L174_C8", "label": "append()", "type": "expression", "loc": [174, 174], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L172_C4", "vector": [8, 2, 0.1516, 0.0009, 2, 0.38, 0.3333, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " display_list.append(pu.PointCloud(all_pts,(200,200,200)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L175_C8", "label": "append()", "type": "expression", "loc": [175, 175], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L172_C4", "vector": [8, 2, 0.1524, 0.0009, 2, 0.38, 0.6667, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " display_list.append(pu.CubeCloud(collide_grid,(200,200,200),resolution))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L176_C8", "label": "append()", "type": "expression", "loc": [176, 176], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L172_C4", "vector": [8, 2, 0.1533, 0.0009, 2, 0.38, 1.0, 243, 3, 1, 0, 0, 0, 0, 4], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " display_list.append(pu.CubeCloud(np.matrix((max_x,0.,0.)).T,(0,0,200),size=np.matrix([0.05,.05,0.05]).T))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Return_L179_C4", "label": "return", "type": "return", "loc": [179, 179], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L141_C0", "vector": [13, 1, 0.1559, 0.0009, 1, 0.43, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return max_x"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L181_C0", "label": "find_goto_point_surface_1", "type": "function", "loc": [181, 213], "level": 0, "parent": null, "vector": [2, 0, 0.1716, 0.0287, 0, 0.66, 0.3864, 438, 0, 3, 1, 0, 0, 0, 13], "semantic": {"name": "find_goto_point_surface_1", "arg_names": ["grid", "pt", "display_list"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def find_goto_point_surface_1(grid,pt,display_list=None):\n ''' returns p_erratic,p_edge,surface_height\n p_erratic - point where the erratic's origin should go to. (in thok0 frame)\n p_edge - point on the edge closest to pt.\n p_erratic,p_edge are 3x1 matrices.\n surface_height - in thok0 coord frame.\n '''\n pt_thok = pt"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L182_C4", "label": "expression", "type": "expression", "loc": [182, 187], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L181_C0", "vector": [8, 1, 0.1607, 0.0052, 1, 0.74, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' returns p_erratic,p_edge,surface_height\n p_erratic - point where the erratic's origin should go to. (in thok0 frame)\n p_edge - point on the edge closest to pt.\n p_erratic,p_edge are 3x1 matrices.\n surface_height - in thok0 coord frame.\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L188_C4", "label": "pt_thok =", "type": "assigned_variable", "loc": [188, 188], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L181_C0", "vector": [14, 1, 0.1638, 0.0009, 1, 0.74, 0.0909, 149, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pt_thok", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pt_thok = pt"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L191_C4", "label": "close_pt, approach_vector = find_approach_direction()", "type": "assigned_variable", "loc": [191, 191], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L181_C0", "vector": [14, 1, 0.1664, 0.0009, 1, 0.74, 0.1818, 157, 3, 3, 0, 0, 852, 10, 1], "semantic": {"name": "close_pt, approach_vector", "arg_names": [], "import_names": [], "rhs_call_name": "find_approach_direction", "annotation": ""}, "snippet": " close_pt,approach_vector = find_approach_direction(grid,pt_thok,display_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L192_C4", "label": "if", "type": "if", "loc": [192, 193], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L181_C0", "vector": [4, 1, 0.1677, 0.0017, 1, 0.74, 0.2727, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if close_pt == None:\n return None,None,None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Return_L193_C8", "label": "return", "type": "return", "loc": [193, 193], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L192_C4", "vector": [13, 2, 0.1681, 0.0009, 2, 0.37, 0.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return None,None,None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L198_C4", "label": "lam =", "type": "assigned_variable", "loc": [198, 198], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L181_C0", "vector": [14, 1, 0.1725, 0.0009, 1, 0.74, 0.3636, 704, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "lam", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " lam = -0.4"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L199_C4", "label": "goto_pt =", "type": "assigned_variable", "loc": [199, 199], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L181_C0", "vector": [14, 1, 0.1733, 0.0009, 1, 0.74, 0.4545, 133, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "goto_pt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " goto_pt = close_pt[0:2,0] + lam*approach_vector # this is where I want the utm"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L201_C4", "label": "err_to_thok = erraticTglobal()", "type": "assigned_variable", "loc": [201, 201], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L181_C0", "vector": [14, 1, 0.1751, 0.0009, 1, 0.74, 0.5455, 264, 3, 1, 0, 0, 812, 10, 3], "semantic": {"name": "err_to_thok", "arg_names": [], "import_names": [], "rhs_call_name": "erraticTglobal", "annotation": ""}, "snippet": " err_to_thok = tr.erraticTglobal(tr.globalTthok0(np.matrix([0,0,0]).T))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L202_C4", "label": "goto_pt_erratic =", "type": "assigned_variable", "loc": [202, 202], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L181_C0", "vector": [14, 1, 0.176, 0.0009, 1, 0.74, 0.6364, 805, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "goto_pt_erratic", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " goto_pt_erratic = -err_to_thok[0,0]*approach_vector + goto_pt # this is NOT"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L206_C4", "label": "if", "type": "if", "loc": [206, 208], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L181_C0", "vector": [4, 1, 0.1803, 0.0026, 1, 0.74, 0.7273, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if display_list != None:\n display_list.append(pu.CubeCloud(np.row_stack((goto_pt,close_pt[2,0])),color=(0,250,250), size=(0.012,0.012,0.012)))\n display_list.append(pu.Line(np.row_stack((goto_pt,close_pt[2,0])).A1,close_pt.A1,color=(255,20,0)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L207_C8", "label": "append()", "type": "expression", "loc": [207, 207], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L206_C4", "vector": [8, 2, 0.1803, 0.0009, 2, 0.64, 0.0, 243, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " display_list.append(pu.CubeCloud(np.row_stack((goto_pt,close_pt[2,0])),color=(0,250,250), size=(0.012,0.012,0.012)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L208_C8", "label": "append()", "type": "expression", "loc": [208, 208], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L206_C4", "vector": [8, 2, 0.1812, 0.0009, 2, 0.64, 1.0, 243, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " display_list.append(pu.Line(np.row_stack((goto_pt,close_pt[2,0])).A1,close_pt.A1,color=(255,20,0)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L210_C4", "label": "p_erratic = row_stack()", "type": "assigned_variable", "loc": [210, 210], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L181_C0", "vector": [14, 1, 0.1829, 0.0009, 1, 0.74, 0.8182, 129, 3, 1, 0, 0, 612, 10, 2], "semantic": {"name": "p_erratic", "arg_names": [], "import_names": [], "rhs_call_name": "row_stack", "annotation": ""}, "snippet": " p_erratic = np.row_stack((goto_pt_erratic,np.matrix((close_pt[2,0]))))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L211_C4", "label": "print()", "type": "expression", "loc": [211, 211], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L181_C0", "vector": [8, 1, 0.1838, 0.0009, 1, 0.74, 0.9091, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('p_erratic in thok0:', p_erratic.T)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Return_L213_C4", "label": "return", "type": "return", "loc": [213, 213], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L181_C0", "vector": [13, 1, 0.1855, 0.0009, 1, 0.74, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return p_erratic,close_pt,close_pt[2,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L217_C0", "label": "find_closest_pt_index", "type": "function", "loc": [217, 223], "level": 0, "parent": null, "vector": [2, 0, 0.1916, 0.0061, 0, 0.66, 0.4091, 364, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "find_closest_pt_index", "arg_names": ["pts2d", "pt"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def find_closest_pt_index(pts2d,pt):\n ''' returns index (of pts2d) of closest point to pt.\n pts2d - 2xN matrix, pt - 2x1 matrix\n '''\n pt_to_edge_dists = ut.norm(pts2d-pt)\n closest_pt_index = np.argmin(pt_to_edge_dists)\n return closest_pt_index"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L218_C4", "label": "expression", "type": "expression", "loc": [218, 220], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L217_C0", "vector": [8, 1, 0.1908, 0.0026, 1, 0.26, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' returns index (of pts2d) of closest point to pt.\n pts2d - 2xN matrix, pt - 2x1 matrix\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L221_C4", "label": "pt_to_edge_dists = norm()", "type": "assigned_variable", "loc": [221, 221], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L217_C0", "vector": [14, 1, 0.1925, 0.0009, 1, 0.26, 0.3333, 722, 3, 1, 0, 0, 902, 10, 1], "semantic": {"name": "pt_to_edge_dists", "arg_names": [], "import_names": [], "rhs_call_name": "norm", "annotation": ""}, "snippet": " pt_to_edge_dists = ut.norm(pts2d-pt)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L222_C4", "label": "closest_pt_index = argmin()", "type": "assigned_variable", "loc": [222, 222], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L217_C0", "vector": [14, 1, 0.1934, 0.0009, 1, 0.26, 0.6667, 611, 3, 1, 0, 0, 879, 10, 1], "semantic": {"name": "closest_pt_index", "arg_names": [], "import_names": [], "rhs_call_name": "argmin", "annotation": ""}, "snippet": " closest_pt_index = np.argmin(pt_to_edge_dists)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Return_L223_C4", "label": "return", "type": "return", "loc": [223, 223], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L217_C0", "vector": [13, 1, 0.1943, 0.0009, 1, 0.26, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return closest_pt_index"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L225_C0", "label": "find_closest_pt", "type": "function", "loc": [225, 258], "level": 0, "parent": null, "vector": [2, 0, 0.2104, 0.0296, 0, 0.66, 0.4318, 861, 0, 3, 1, 0, 0, 0, 13], "semantic": {"name": "find_closest_pt", "arg_names": ["pts2d", "pt", "pt_closer"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def find_closest_pt(pts2d,pt,pt_closer=False):\n ''' returns closest point to edge (2x1 matrix)\n can return None also\n '''\n dist_pt = np.linalg.norm(pt[0:2,0])\n pts2d_r = ut.norm(pts2d)\n pts2d_a = np.arctan2(pts2d[1,:],pts2d[0,:])\n if pt_closer == False:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L226_C4", "label": "expression", "type": "expression", "loc": [226, 228], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L225_C0", "vector": [8, 1, 0.1977, 0.0026, 1, 0.35, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' returns closest point to edge (2x1 matrix)\n can return None also\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L229_C4", "label": "dist_pt = norm()", "type": "assigned_variable", "loc": [229, 229], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L225_C0", "vector": [14, 1, 0.1995, 0.0009, 1, 0.35, 0.0667, 689, 3, 1, 0, 0, 902, 10, 1], "semantic": {"name": "dist_pt", "arg_names": [], "import_names": [], "rhs_call_name": "norm", "annotation": ""}, "snippet": " dist_pt = np.linalg.norm(pt[0:2,0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L230_C4", "label": "pts2d_r = norm()", "type": "assigned_variable", "loc": [230, 230], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L225_C0", "vector": [14, 1, 0.2003, 0.0009, 1, 0.35, 0.1333, 250, 3, 1, 0, 0, 902, 10, 1], "semantic": {"name": "pts2d_r", "arg_names": [], "import_names": [], "rhs_call_name": "norm", "annotation": ""}, "snippet": " pts2d_r = ut.norm(pts2d)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L231_C4", "label": "pts2d_a = arctan2()", "type": "assigned_variable", "loc": [231, 231], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L225_C0", "vector": [14, 1, 0.2012, 0.0009, 1, 0.35, 0.2, 661, 3, 2, 0, 0, 895, 10, 1], "semantic": {"name": "pts2d_a", "arg_names": [], "import_names": [], "rhs_call_name": "arctan2", "annotation": ""}, "snippet": " pts2d_a = np.arctan2(pts2d[1,:],pts2d[0,:])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L232_C4", "label": "if", "type": "if", "loc": [232, 235], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L225_C0", "vector": [4, 1, 0.2034, 0.0035, 1, 0.35, 0.2667, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if pt_closer == False:\n k_idxs = np.where(pts2d_r<=dist_pt)\n else:\n k_idxs = np.where(pts2d_r>dist_pt)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L233_C8", "label": "k_idxs = where()", "type": "assigned_variable", "loc": [233, 233], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L232_C4", "vector": [14, 2, 0.203, 0.0009, 2, 0.31, 0.0, 0, 3, 1, 0, 0, 169, 10, 1], "semantic": {"name": "k_idxs", "arg_names": [], "import_names": [], "rhs_call_name": "where", "annotation": ""}, "snippet": " k_idxs = np.where(pts2d_r<=dist_pt)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L235_C8", "label": "k_idxs = where()", "type": "assigned_variable", "loc": [235, 235], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L232_C4", "vector": [14, 2, 0.2047, 0.0009, 2, 0.31, 1.0, 0, 3, 1, 0, 0, 169, 10, 1], "semantic": {"name": "k_idxs", "arg_names": [], "import_names": [], "rhs_call_name": "where", "annotation": ""}, "snippet": " k_idxs = np.where(pts2d_r>dist_pt)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L237_C4", "label": "pts2d_r =", "type": "assigned_variable", "loc": [237, 237], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L225_C0", "vector": [14, 1, 0.2064, 0.0009, 1, 0.35, 0.3333, 250, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pts2d_r", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pts2d_r = pts2d_r[k_idxs]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L238_C4", "label": "pts2d_a =", "type": "assigned_variable", "loc": [238, 238], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L225_C0", "vector": [14, 1, 0.2073, 0.0009, 1, 0.35, 0.4, 661, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pts2d_a", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pts2d_a = pts2d_a[k_idxs]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L239_C4", "label": "pts2d = cart_of_pol()", "type": "assigned_variable", "loc": [239, 239], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L225_C0", "vector": [14, 1, 0.2082, 0.0009, 1, 0.35, 0.4667, 871, 3, 1, 0, 0, 212, 10, 3], "semantic": {"name": "pts2d", "arg_names": [], "import_names": [], "rhs_call_name": "cart_of_pol", "annotation": ""}, "snippet": " pts2d = ut.cart_of_pol(np.matrix(np.row_stack((pts2d_r,pts2d_a))))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L241_C4", "label": "if", "type": "if", "loc": [241, 244], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L225_C0", "vector": [4, 1, 0.2112, 0.0035, 1, 0.35, 0.5333, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if pt_closer == False:\n edge_to_pt = pt[0:2,0]-pts2d\n else:\n edge_to_pt = pts2d-pt[0:2,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L242_C8", "label": "edge_to_pt =", "type": "assigned_variable", "loc": [242, 242], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L241_C4", "vector": [14, 2, 0.2108, 0.0009, 2, 0.29, 0.0, 633, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "edge_to_pt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " edge_to_pt = pt[0:2,0]-pts2d"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L244_C8", "label": "edge_to_pt =", "type": "assigned_variable", "loc": [244, 244], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L241_C4", "vector": [14, 2, 0.2125, 0.0009, 2, 0.29, 1.0, 633, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "edge_to_pt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " edge_to_pt = pts2d-pt[0:2,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L246_C4", "label": "edge_to_pt_a = arctan2()", "type": "assigned_variable", "loc": [246, 246], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L225_C0", "vector": [14, 1, 0.2143, 0.0009, 1, 0.35, 0.6, 615, 3, 2, 0, 0, 895, 10, 1], "semantic": {"name": "edge_to_pt_a", "arg_names": [], "import_names": [], "rhs_call_name": "arctan2", "annotation": ""}, "snippet": " edge_to_pt_a = np.arctan2(edge_to_pt[1,:],edge_to_pt[0,:])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L247_C4", "label": "keep_idxs =", "type": "assigned_variable", "loc": [247, 247], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L225_C0", "vector": [14, 1, 0.2152, 0.0009, 1, 0.35, 0.6667, 738, 7, 0, 0, 0, 0, 0, 3], "semantic": {"name": "keep_idxs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " keep_idxs = np.where(np.abs(edge_to_pt_a)<math.radians(70))[1].A1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L249_C4", "label": "if", "type": "if", "loc": [249, 250], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L225_C0", "vector": [4, 1, 0.2173, 0.0017, 1, 0.35, 0.7333, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if keep_idxs.shape[0] == 0:\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Return_L250_C8", "label": "return", "type": "return", "loc": [250, 250], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L249_C4", "vector": [13, 2, 0.2178, 0.0009, 2, 0.43, 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_99556:Assign_L252_C4", "label": "pts2d =", "type": "assigned_variable", "loc": [252, 252], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L225_C0", "vector": [14, 1, 0.2195, 0.0009, 1, 0.35, 0.8, 871, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pts2d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pts2d = pts2d[:,keep_idxs]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L256_C4", "label": "closest_pt_index = find_closest_pt_index()", "type": "assigned_variable", "loc": [256, 256], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L225_C0", "vector": [14, 1, 0.223, 0.0009, 1, 0.35, 0.8667, 611, 3, 2, 0, 0, 364, 10, 1], "semantic": {"name": "closest_pt_index", "arg_names": [], "import_names": [], "rhs_call_name": "find_closest_pt_index", "annotation": ""}, "snippet": " closest_pt_index = find_closest_pt_index(pts2d,pt[0:2,0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L257_C4", "label": "closest_pt =", "type": "assigned_variable", "loc": [257, 257], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L225_C0", "vector": [14, 1, 0.2239, 0.0009, 1, 0.35, 0.9333, 463, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "closest_pt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " closest_pt = pts2d[:,closest_pt_index]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Return_L258_C4", "label": "return", "type": "return", "loc": [258, 258], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L225_C0", "vector": [13, 1, 0.2247, 0.0009, 1, 0.35, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return closest_pt"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L260_C0", "label": "pushback_edge", "type": "function", "loc": [260, 285], "level": 0, "parent": null, "vector": [2, 0, 0.2374, 0.0226, 0, 0.66, 0.4545, 2, 0, 2, 1, 0, 0, 0, 12], "semantic": {"name": "pushback_edge", "arg_names": ["pts2d", "pt"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def pushback_edge(pts2d,pt):\n ''' push pt away from the edge defined by pts2d.\n pt - 2x1, pts2d - 2xN\n returns the pushed point.\n '''\n closest_idx = find_closest_pt_index(pts2d,pt)\n n_push_points = min(min(5,pts2d.shape[1]-closest_idx-1),closest_idx)\n if closest_idx<n_push_points or (pts2d.shape[1]-closest_idx-1)<n_push_points:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L261_C4", "label": "expression", "type": "expression", "loc": [261, 264], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L260_C0", "vector": [8, 1, 0.2287, 0.0035, 1, 0.16, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' push pt away from the edge defined by pts2d.\n pt - 2x1, pts2d - 2xN\n returns the pushed point.\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L265_C4", "label": "closest_idx = find_closest_pt_index()", "type": "assigned_variable", "loc": [265, 265], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L260_C0", "vector": [14, 1, 0.2308, 0.0009, 1, 0.16, 0.0625, 694, 3, 2, 0, 0, 364, 10, 1], "semantic": {"name": "closest_idx", "arg_names": [], "import_names": [], "rhs_call_name": "find_closest_pt_index", "annotation": ""}, "snippet": " closest_idx = find_closest_pt_index(pts2d,pt)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L266_C4", "label": "n_push_points = min()", "type": "assigned_variable", "loc": [266, 266], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L260_C0", "vector": [14, 1, 0.2317, 0.0009, 1, 0.16, 0.125, 857, 3, 2, 0, 0, 867, 10, 2], "semantic": {"name": "n_push_points", "arg_names": [], "import_names": [], "rhs_call_name": "min", "annotation": ""}, "snippet": " n_push_points = min(min(5,pts2d.shape[1]-closest_idx-1),closest_idx)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L267_C4", "label": "if", "type": "if", "loc": [267, 269], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L260_C0", "vector": [4, 1, 0.2334, 0.0026, 1, 0.16, 0.1875, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if closest_idx<n_push_points or (pts2d.shape[1]-closest_idx-1)<n_push_points:\n print('processing_3d.pushback_edge: pt is too close to the ends of the pts2d array.')\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L268_C8", "label": "print()", "type": "expression", "loc": [268, 268], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L267_C4", "vector": [8, 2, 0.2334, 0.0009, 2, 0.48, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('processing_3d.pushback_edge: pt is too close to the ends of the pts2d array.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Return_L269_C8", "label": "return", "type": "return", "loc": [269, 269], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L267_C4", "vector": [13, 2, 0.2343, 0.0009, 2, 0.48, 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_99556:Assign_L271_C4", "label": "edge_to_pt =", "type": "assigned_variable", "loc": [271, 271], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L260_C0", "vector": [14, 1, 0.2361, 0.0009, 1, 0.16, 0.25, 633, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "edge_to_pt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " edge_to_pt = pt-pts2d[:,closest_idx-n_push_points:closest_idx+n_push_points]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L272_C4", "label": "edge_to_pt_r = norm()", "type": "assigned_variable", "loc": [272, 272], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L260_C0", "vector": [14, 1, 0.2369, 0.0009, 1, 0.16, 0.3125, 434, 3, 1, 0, 0, 902, 10, 1], "semantic": {"name": "edge_to_pt_r", "arg_names": [], "import_names": [], "rhs_call_name": "norm", "annotation": ""}, "snippet": " edge_to_pt_r = ut.norm(edge_to_pt)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L273_C4", "label": "edge_to_pt_a = arctan2()", "type": "assigned_variable", "loc": [273, 273], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L260_C0", "vector": [14, 1, 0.2378, 0.0009, 1, 0.16, 0.375, 615, 3, 2, 0, 0, 895, 10, 1], "semantic": {"name": "edge_to_pt_a", "arg_names": [], "import_names": [], "rhs_call_name": "arctan2", "annotation": ""}, "snippet": " edge_to_pt_a = np.arctan2(edge_to_pt[1,:],edge_to_pt[0,:])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L275_C4", "label": "non_zero_idxs = where()", "type": "assigned_variable", "loc": [275, 275], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L260_C0", "vector": [14, 1, 0.2395, 0.0009, 1, 0.16, 0.4375, 508, 3, 1, 0, 0, 169, 10, 1], "semantic": {"name": "non_zero_idxs", "arg_names": [], "import_names": [], "rhs_call_name": "where", "annotation": ""}, "snippet": " non_zero_idxs = np.where(edge_to_pt_r>0.005)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L276_C4", "label": "edge_to_pt_r =", "type": "assigned_variable", "loc": [276, 276], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L260_C0", "vector": [14, 1, 0.2404, 0.0009, 1, 0.16, 0.5, 434, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "edge_to_pt_r", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " edge_to_pt_r = edge_to_pt_r[non_zero_idxs]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L277_C4", "label": "assign", "type": "assigned_variable", "loc": [277, 277], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L260_C0", "vector": [14, 1, 0.2413, 0.0009, 1, 0.16, 0.5625, 0, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " edge_to_pt_r[0,:] = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L278_C4", "label": "edge_to_pt_a =", "type": "assigned_variable", "loc": [278, 278], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L260_C0", "vector": [14, 1, 0.2422, 0.0009, 1, 0.16, 0.625, 615, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "edge_to_pt_a", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " edge_to_pt_a = edge_to_pt_a[non_zero_idxs]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L279_C4", "label": "edge_to_pt_unit = cart_of_pol()", "type": "assigned_variable", "loc": [279, 279], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L260_C0", "vector": [14, 1, 0.243, 0.0009, 1, 0.16, 0.6875, 649, 3, 1, 0, 0, 212, 10, 2], "semantic": {"name": "edge_to_pt_unit", "arg_names": [], "import_names": [], "rhs_call_name": "cart_of_pol", "annotation": ""}, "snippet": " edge_to_pt_unit = ut.cart_of_pol(np.row_stack((edge_to_pt_r,edge_to_pt_a)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L280_C4", "label": "push_vector = mean()", "type": "assigned_variable", "loc": [280, 280], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L260_C0", "vector": [14, 1, 0.2439, 0.0009, 1, 0.16, 0.75, 422, 3, 1, 0, 0, 856, 10, 1], "semantic": {"name": "push_vector", "arg_names": [], "import_names": [], "rhs_call_name": "mean", "annotation": ""}, "snippet": " push_vector = edge_to_pt_unit.mean(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L281_C4", "label": "push_vector =", "type": "assigned_variable", "loc": [281, 281], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L260_C0", "vector": [14, 1, 0.2448, 0.0009, 1, 0.16, 0.8125, 422, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "push_vector", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " push_vector = push_vector/np.linalg.norm(push_vector)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L282_C4", "label": "print()", "type": "expression", "loc": [282, 282], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L260_C0", "vector": [8, 1, 0.2456, 0.0009, 1, 0.16, 0.875, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('push_vector:', push_vector.T)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L283_C4", "label": "pt_pushed =", "type": "assigned_variable", "loc": [283, 283], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L260_C0", "vector": [14, 1, 0.2465, 0.0009, 1, 0.16, 0.9375, 808, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pt_pushed", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pt_pushed = pt + push_vector*0.05"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Return_L285_C4", "label": "return", "type": "return", "loc": [285, 285], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L260_C0", "vector": [13, 1, 0.2483, 0.0009, 1, 0.16, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return pt_pushed"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "label": "find_approach_direction", "type": "function", "loc": [295, 451], "level": 0, "parent": null, "vector": [2, 0, 0.3249, 0.1368, 0, 0.66, 0.4773, 852, 0, 3, 1, 0, 0, 0, 78], "semantic": {"name": "find_approach_direction", "arg_names": ["grid", "pt", "display_list"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def find_approach_direction(grid,pt,display_list=None):\n z_plane,max_count = grid.argmax_z(search_up=True)\n z_plane_meters = z_plane*grid.resolution[2,0]+grid.brf[2,0]\n\n l = grid.find_plane_indices(assume_plane=True)\n print('------------ min(l)',min(l))\n\n z_plane_argmax,max_count = grid.argmax_z(search_up=False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L296_C4", "label": "z_plane, max_count = argmax_z()", "type": "assigned_variable", "loc": [296, 296], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "vector": [14, 1, 0.2578, 0.0009, 1, 0.65, 0.0, 246, 3, 1, 0, 0, 859, 10, 1], "semantic": {"name": "z_plane, max_count", "arg_names": [], "import_names": [], "rhs_call_name": "argmax_z", "annotation": ""}, "snippet": " z_plane,max_count = grid.argmax_z(search_up=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L297_C4", "label": "z_plane_meters =", "type": "assigned_variable", "loc": [297, 297], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "vector": [14, 1, 0.2587, 0.0009, 1, 0.65, 0.0169, 787, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "z_plane_meters", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " z_plane_meters = z_plane*grid.resolution[2,0]+grid.brf[2,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L299_C4", "label": "l = find_plane_indices()", "type": "assigned_variable", "loc": [299, 299], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "vector": [14, 1, 0.2605, 0.0009, 1, 0.65, 0.0339, 810, 3, 1, 0, 0, 383, 10, 1], "semantic": {"name": "l", "arg_names": [], "import_names": [], "rhs_call_name": "find_plane_indices", "annotation": ""}, "snippet": " l = grid.find_plane_indices(assume_plane=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L300_C4", "label": "print()", "type": "expression", "loc": [300, 300], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "vector": [8, 1, 0.2613, 0.0009, 1, 0.65, 0.0508, 535, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('------------ min(l)',min(l))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L302_C4", "label": "z_plane_argmax, max_count = argmax_z()", "type": "assigned_variable", "loc": [302, 302], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "vector": [14, 1, 0.2631, 0.0009, 1, 0.65, 0.0678, 569, 3, 1, 0, 0, 859, 10, 1], "semantic": {"name": "z_plane_argmax, max_count", "arg_names": [], "import_names": [], "rhs_call_name": "argmax_z", "annotation": ""}, "snippet": " z_plane_argmax,max_count = grid.argmax_z(search_up=False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L303_C4", "label": "z_plane_below = max()", "type": "assigned_variable", "loc": [303, 303], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "vector": [14, 1, 0.2639, 0.0009, 1, 0.65, 0.0847, 672, 3, 2, 0, 0, 442, 10, 1], "semantic": {"name": "z_plane_below", "arg_names": [], "import_names": [], "rhs_call_name": "max", "annotation": ""}, "snippet": " z_plane_below = max(0,z_plane_argmax-5)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L304_C4", "label": "print()", "type": "expression", "loc": [304, 304], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "vector": [8, 1, 0.2648, 0.0009, 1, 0.65, 0.1017, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('z_plane_argmax',z_plane_argmax)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L305_C4", "label": "print()", "type": "expression", "loc": [305, 305], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "vector": [8, 1, 0.2657, 0.0009, 1, 0.65, 0.1186, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('z_plane_below',z_plane_below)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L306_C4", "label": "print()", "type": "expression", "loc": [306, 306], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "vector": [8, 1, 0.2666, 0.0009, 1, 0.65, 0.1356, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('l:',l)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L308_C4", "label": "copy_grid = deepcopy()", "type": "assigned_variable", "loc": [308, 308], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "vector": [14, 1, 0.2683, 0.0009, 1, 0.65, 0.1525, 233, 3, 1, 0, 0, 44, 10, 1], "semantic": {"name": "copy_grid", "arg_names": [], "import_names": [], "rhs_call_name": "deepcopy", "annotation": ""}, "snippet": " copy_grid = copy.deepcopy(grid)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L309_C4", "label": "plane_slices =", "type": "assigned_variable", "loc": [309, 309], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "vector": [14, 1, 0.2692, 0.0009, 1, 0.65, 0.1695, 246, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "plane_slices", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " plane_slices = grid.grid[:,:,l]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L310_C4", "label": "assign", "type": "assigned_variable", "loc": [310, 310], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "vector": [14, 1, 0.27, 0.0009, 1, 0.65, 0.1864, 0, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " copy_grid.grid[:,:,:] = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L311_C4", "label": " = copy()", "type": "assigned_variable", "loc": [311, 311], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "vector": [14, 1, 0.2709, 0.0009, 1, 0.65, 0.2034, 0, 3, 1, 0, 0, 739, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " copy_grid.grid[:,:,l] = copy.copy(plane_slices)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L315_C4", "label": "grid_2d = max()", "type": "assigned_variable", "loc": [315, 315], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "vector": [14, 1, 0.2744, 0.0009, 1, 0.65, 0.2203, 804, 3, 2, 0, 0, 442, 10, 1], "semantic": {"name": "grid_2d", "arg_names": [], "import_names": [], "rhs_call_name": "max", "annotation": ""}, "snippet": " grid_2d = np.max(grid.grid[:,:,l],2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L316_C4", "label": "grid_2d = binary_dilation()", "type": "assigned_variable", "loc": [316, 316], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "vector": [14, 1, 0.2753, 0.0009, 1, 0.65, 0.2373, 804, 3, 2, 0, 0, 202, 10, 1], "semantic": {"name": "grid_2d", "arg_names": [], "import_names": [], "rhs_call_name": "binary_dilation", "annotation": ""}, "snippet": " grid_2d = ni.binary_dilation(grid_2d,iterations=4) # I want 4-connectivity while filling holes."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L317_C4", "label": "grid_2d = binary_fill_holes()", "type": "assigned_variable", "loc": [317, 317], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "vector": [14, 1, 0.2761, 0.0009, 1, 0.65, 0.2542, 804, 3, 1, 0, 0, 385, 10, 1], "semantic": {"name": "grid_2d", "arg_names": [], "import_names": [], "rhs_call_name": "binary_fill_holes", "annotation": ""}, "snippet": " grid_2d = ni.binary_fill_holes(grid_2d) # I want 4-connectivity while filling holes."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L319_C4", "label": "labeled_arr, n_labels = label()", "type": "assigned_variable", "loc": [319, 319], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "vector": [14, 1, 0.2779, 0.0009, 1, 0.65, 0.2712, 952, 3, 1, 0, 0, 811, 10, 1], "semantic": {"name": "labeled_arr, n_labels", "arg_names": [], "import_names": [], "rhs_call_name": "label", "annotation": ""}, "snippet": " labeled_arr,n_labels = ni.label(grid_2d)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L320_C4", "label": "labels_list = range()", "type": "assigned_variable", "loc": [320, 320], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "vector": [14, 1, 0.2787, 0.0009, 1, 0.65, 0.2881, 325, 3, 2, 0, 0, 816, 10, 1], "semantic": {"name": "labels_list", "arg_names": [], "import_names": [], "rhs_call_name": "range", "annotation": ""}, "snippet": " labels_list = range(1,n_labels+1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L321_C4", "label": "count_objects = sum()", "type": "assigned_variable", "loc": [321, 321], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "vector": [14, 1, 0.2796, 0.0009, 1, 0.65, 0.3051, 769, 3, 3, 0, 0, 824, 10, 1], "semantic": {"name": "count_objects", "arg_names": [], "import_names": [], "rhs_call_name": "sum", "annotation": ""}, "snippet": " count_objects = ni.sum(grid_2d,labeled_arr,labels_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L322_C4", "label": "if", "type": "if", "loc": [322, 323], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "vector": [4, 1, 0.2809, 0.0017, 1, 0.65, 0.322, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if n_labels == 1:\n count_objects = [count_objects]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L323_C8", "label": "count_objects =", "type": "assigned_variable", "loc": [323, 323], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L322_C4", "vector": [14, 2, 0.2814, 0.0009, 2, 0.85, 0.0, 769, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "count_objects", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " count_objects = [count_objects]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L324_C4", "label": "max_label = argmax()", "type": "assigned_variable", "loc": [324, 324], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "vector": [14, 1, 0.2822, 0.0009, 1, 0.65, 0.339, 574, 3, 1, 0, 0, 593, 10, 2], "semantic": {"name": "max_label", "arg_names": [], "import_names": [], "rhs_call_name": "argmax", "annotation": ""}, "snippet": " max_label = np.argmax(np.matrix(count_objects))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L325_C4", "label": "assign", "type": "assigned_variable", "loc": [325, 325], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "vector": [14, 1, 0.2831, 0.0009, 1, 0.65, 0.3559, 0, 1, 0, 0, 0, 0, 1, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " grid_2d[np.where(labeled_arr!=max_label+1)] = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L334_C4", "label": "labeled_arr_3d = swapaxes()", "type": "assigned_variable", "loc": [334, 334], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "vector": [14, 1, 0.2909, 0.0009, 1, 0.65, 0.3729, 689, 3, 2, 0, 0, 289, 10, 1], "semantic": {"name": "labeled_arr_3d", "arg_names": [], "import_names": [], "rhs_call_name": "swapaxes", "annotation": ""}, "snippet": " labeled_arr_3d = copy_grid.grid.swapaxes(2,0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L335_C4", "label": "labeled_arr_3d = swapaxes()", "type": "assigned_variable", "loc": [335, 335], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "vector": [14, 1, 0.2918, 0.0009, 1, 0.65, 0.3898, 689, 3, 2, 0, 0, 289, 10, 1], "semantic": {"name": "labeled_arr_3d", "arg_names": [], "import_names": [], "rhs_call_name": "swapaxes", "annotation": ""}, "snippet": " labeled_arr_3d = labeled_arr_3d.swapaxes(1,2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L336_C4", "label": "labeled_arr_3d =", "type": "assigned_variable", "loc": [336, 336], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "vector": [14, 1, 0.2927, 0.0009, 1, 0.65, 0.4068, 689, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "labeled_arr_3d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " labeled_arr_3d = labeled_arr_3d*grid_2d"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L337_C4", "label": "labeled_arr_3d = swapaxes()", "type": "assigned_variable", "loc": [337, 337], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "vector": [14, 1, 0.2936, 0.0009, 1, 0.65, 0.4237, 689, 3, 2, 0, 0, 289, 10, 1], "semantic": {"name": "labeled_arr_3d", "arg_names": [], "import_names": [], "rhs_call_name": "swapaxes", "annotation": ""}, "snippet": " labeled_arr_3d = labeled_arr_3d.swapaxes(2,0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L338_C4", "label": "labeled_arr_3d = swapaxes()", "type": "assigned_variable", "loc": [338, 338], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "vector": [14, 1, 0.2944, 0.0009, 1, 0.65, 0.4407, 689, 3, 2, 0, 0, 289, 10, 1], "semantic": {"name": "labeled_arr_3d", "arg_names": [], "import_names": [], "rhs_call_name": "swapaxes", "annotation": ""}, "snippet": " labeled_arr_3d = labeled_arr_3d.swapaxes(1,0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L339_C4", "label": "copy_grid.grid =", "type": "assigned_variable", "loc": [339, 339], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "vector": [14, 1, 0.2953, 0.0009, 1, 0.65, 0.4576, 151, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "copy_grid.grid", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " copy_grid.grid = labeled_arr_3d"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L340_C4", "label": "pts3d = grid_to_points()", "type": "assigned_variable", "loc": [340, 340], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "vector": [14, 1, 0.2962, 0.0009, 1, 0.65, 0.4746, 646, 3, 0, 0, 0, 558, 10, 1], "semantic": {"name": "pts3d", "arg_names": [], "import_names": [], "rhs_call_name": "grid_to_points", "annotation": ""}, "snippet": " pts3d = copy_grid.grid_to_points()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L341_C4", "label": "pts2d =", "type": "assigned_variable", "loc": [341, 341], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "vector": [14, 1, 0.297, 0.0009, 1, 0.65, 0.4915, 871, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pts2d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pts2d = pts3d[0:2,:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L343_C4", "label": "dist_pt = norm()", "type": "assigned_variable", "loc": [343, 343], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "vector": [14, 1, 0.2988, 0.0009, 1, 0.65, 0.5085, 689, 3, 1, 0, 0, 902, 10, 1], "semantic": {"name": "dist_pt", "arg_names": [], "import_names": [], "rhs_call_name": "norm", "annotation": ""}, "snippet": " dist_pt = np.linalg.norm(pt[0:2,0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L344_C4", "label": "pts2d_r = norm()", "type": "assigned_variable", "loc": [344, 344], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "vector": [14, 1, 0.2997, 0.0009, 1, 0.65, 0.5254, 250, 3, 1, 0, 0, 902, 10, 1], "semantic": {"name": "pts2d_r", "arg_names": [], "import_names": [], "rhs_call_name": "norm", "annotation": ""}, "snippet": " pts2d_r = ut.norm(pts2d)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L345_C4", "label": "pts2d_a = arctan2()", "type": "assigned_variable", "loc": [345, 345], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "vector": [14, 1, 0.3005, 0.0009, 1, 0.65, 0.5424, 661, 3, 2, 0, 0, 895, 10, 1], "semantic": {"name": "pts2d_a", "arg_names": [], "import_names": [], "rhs_call_name": "arctan2", "annotation": ""}, "snippet": " pts2d_a = np.arctan2(pts2d[1,:],pts2d[0,:])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L347_C4", "label": "max_angle = max()", "type": "assigned_variable", "loc": [347, 347], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "vector": [14, 1, 0.3023, 0.0009, 1, 0.65, 0.5593, 451, 3, 1, 0, 0, 442, 10, 1], "semantic": {"name": "max_angle", "arg_names": [], "import_names": [], "rhs_call_name": "max", "annotation": ""}, "snippet": " max_angle = np.max(pts2d_a)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L348_C4", "label": "min_angle = min()", "type": "assigned_variable", "loc": [348, 348], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "vector": [14, 1, 0.3031, 0.0009, 1, 0.65, 0.5763, 278, 3, 1, 0, 0, 867, 10, 1], "semantic": {"name": "min_angle", "arg_names": [], "import_names": [], "rhs_call_name": "min", "annotation": ""}, "snippet": " min_angle = np.min(pts2d_a)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L350_C4", "label": "max_angle = min()", "type": "assigned_variable", "loc": [350, 350], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "vector": [14, 1, 0.3049, 0.0009, 1, 0.65, 0.5932, 451, 3, 2, 0, 0, 867, 10, 2], "semantic": {"name": "max_angle", "arg_names": [], "import_names": [], "rhs_call_name": "min", "annotation": ""}, "snippet": " max_angle = min(max_angle,math.radians(50))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L351_C4", "label": "min_angle = max()", "type": "assigned_variable", "loc": [351, 351], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "vector": [14, 1, 0.3057, 0.0009, 1, 0.65, 0.6102, 278, 3, 2, 0, 0, 442, 10, 2], "semantic": {"name": "min_angle", "arg_names": [], "import_names": [], "rhs_call_name": "max", "annotation": ""}, "snippet": " min_angle = max(min_angle,math.radians(-50))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L353_C4", "label": "ang_res = radians()", "type": "assigned_variable", "loc": [353, 353], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "vector": [14, 1, 0.3075, 0.0009, 1, 0.65, 0.6271, 430, 3, 1, 0, 0, 383, 10, 1], "semantic": {"name": "ang_res", "arg_names": [], "import_names": [], "rhs_call_name": "radians", "annotation": ""}, "snippet": " ang_res = math.radians(1.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L354_C4", "label": "n_bins = int()", "type": "assigned_variable", "loc": [354, 354], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "vector": [14, 1, 0.3084, 0.0009, 1, 0.65, 0.6441, 77, 3, 1, 0, 0, 901, 10, 1], "semantic": {"name": "n_bins", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": " n_bins = int((max_angle-min_angle)/ang_res)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L355_C4", "label": "print()", "type": "expression", "loc": [355, 355], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "vector": [8, 1, 0.3092, 0.0009, 1, 0.65, 0.661, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('n_bins:', n_bins)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L356_C4", "label": "n_bins = min()", "type": "assigned_variable", "loc": [356, 356], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "vector": [14, 1, 0.3101, 0.0009, 1, 0.65, 0.678, 77, 3, 2, 0, 0, 867, 10, 1], "semantic": {"name": "n_bins", "arg_names": [], "import_names": [], "rhs_call_name": "min", "annotation": ""}, "snippet": " n_bins = min(50,n_bins)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L358_C4", "label": "ang_res =", "type": "assigned_variable", "loc": [358, 358], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "vector": [14, 1, 0.3118, 0.0009, 1, 0.65, 0.6949, 430, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ang_res", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ang_res = (max_angle-min_angle)/n_bins"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L359_C4", "label": "print()", "type": "expression", "loc": [359, 359], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "vector": [8, 1, 0.3127, 0.0009, 1, 0.65, 0.7119, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('n_bins:', n_bins)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L362_C4", "label": "angle_list =", "type": "assigned_variable", "loc": [362, 362], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "vector": [14, 1, 0.3153, 0.0009, 1, 0.65, 0.7288, 569, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "angle_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " angle_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L363_C4", "label": "range_list =", "type": "assigned_variable", "loc": [363, 363], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "vector": [14, 1, 0.3162, 0.0009, 1, 0.65, 0.7458, 773, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "range_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " range_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L364_C4", "label": "for i", "type": "for", "loc": [364, 373], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "vector": [6, 1, 0.321, 0.0087, 1, 0.65, 0.7627, 826, 3, 0, 0, 0, 0, 0, 6], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(n_bins):\n angle = min_angle+ang_res*i\n idxs = np.where(np.multiply(pts2d_a<(angle+ang_res/2.),pts2d_a>(angle-ang_res/2.)))\n r_mat = pts2d_r[idxs]\n a_mat = pts2d_a[idxs]\n if r_mat.shape[1] == 0:\n continue\n min_idx = np.argmin(r_mat.A1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L365_C8", "label": "angle =", "type": "assigned_variable", "loc": [365, 365], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L364_C4", "vector": [14, 2, 0.3179, 0.0009, 2, 0.78, 0.0, 418, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "angle", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " angle = min_angle+ang_res*i"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L366_C8", "label": "idxs = where()", "type": "assigned_variable", "loc": [366, 366], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L364_C4", "vector": [14, 2, 0.3188, 0.0009, 2, 0.78, 0.1429, 677, 3, 1, 0, 0, 169, 10, 2], "semantic": {"name": "idxs", "arg_names": [], "import_names": [], "rhs_call_name": "where", "annotation": ""}, "snippet": " idxs = np.where(np.multiply(pts2d_a<(angle+ang_res/2.),pts2d_a>(angle-ang_res/2.)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L367_C8", "label": "r_mat =", "type": "assigned_variable", "loc": [367, 367], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L364_C4", "vector": [14, 2, 0.3197, 0.0009, 2, 0.78, 0.2857, 266, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "r_mat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " r_mat = pts2d_r[idxs]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L368_C8", "label": "a_mat =", "type": "assigned_variable", "loc": [368, 368], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L364_C4", "vector": [14, 2, 0.3206, 0.0009, 2, 0.78, 0.4286, 589, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "a_mat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " a_mat = pts2d_a[idxs]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L369_C8", "label": "if", "type": "if", "loc": [369, 370], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L364_C4", "vector": [4, 2, 0.3219, 0.0017, 2, 0.78, 0.5714, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if r_mat.shape[1] == 0:\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L371_C8", "label": "min_idx = argmin()", "type": "assigned_variable", "loc": [371, 371], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L364_C4", "vector": [14, 2, 0.3232, 0.0009, 2, 0.78, 0.7143, 912, 3, 1, 0, 0, 879, 10, 1], "semantic": {"name": "min_idx", "arg_names": [], "import_names": [], "rhs_call_name": "argmin", "annotation": ""}, "snippet": " min_idx = np.argmin(r_mat.A1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L372_C8", "label": "append()", "type": "expression", "loc": [372, 372], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L364_C4", "vector": [8, 2, 0.324, 0.0009, 2, 0.78, 0.8571, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " range_list.append(r_mat[0,min_idx])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L373_C8", "label": "append()", "type": "expression", "loc": [373, 373], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L364_C4", "vector": [8, 2, 0.3249, 0.0009, 2, 0.78, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " angle_list.append(a_mat[0,min_idx])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L375_C4", "label": "if", "type": "if", "loc": [375, 377], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "vector": [4, 1, 0.3275, 0.0026, 1, 0.65, 0.7797, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if range_list == []:\n print('processing_3d.find_approach_direction: No edge points found')\n return None,None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L376_C8", "label": "print()", "type": "expression", "loc": [376, 376], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L375_C4", "vector": [8, 2, 0.3275, 0.0009, 2, 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": " print('processing_3d.find_approach_direction: No edge points found')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Return_L377_C8", "label": "return", "type": "return", "loc": [377, 377], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L375_C4", "vector": [13, 2, 0.3284, 0.0009, 2, 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"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L379_C4", "label": "pts2d = cart_of_pol()", "type": "assigned_variable", "loc": [379, 379], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "vector": [14, 1, 0.3301, 0.0009, 1, 0.65, 0.7966, 871, 3, 1, 0, 0, 212, 10, 3], "semantic": {"name": "pts2d", "arg_names": [], "import_names": [], "rhs_call_name": "cart_of_pol", "annotation": ""}, "snippet": " pts2d = ut.cart_of_pol(np.matrix(np.row_stack((range_list,angle_list))))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L381_C4", "label": "closest_pt_1 = find_closest_pt()", "type": "assigned_variable", "loc": [381, 381], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "vector": [14, 1, 0.3319, 0.0009, 1, 0.65, 0.8136, 680, 3, 3, 0, 0, 861, 10, 1], "semantic": {"name": "closest_pt_1", "arg_names": [], "import_names": [], "rhs_call_name": "find_closest_pt", "annotation": ""}, "snippet": " closest_pt_1 = find_closest_pt(pts2d,pt,pt_closer=False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L382_C4", "label": "if", "type": "if", "loc": [382, 387], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "vector": [4, 1, 0.3349, 0.0052, 1, 0.65, 0.8305, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if closest_pt_1 == None:\n dist1 = np.Inf\n else:\n approach_vector_1 = pt[0:2,0] - closest_pt_1\n dist1 = np.linalg.norm(approach_vector_1)\n approach_vector_1 = approach_vector_1/dist1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L383_C8", "label": "dist1 =", "type": "assigned_variable", "loc": [383, 383], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L382_C4", "vector": [14, 2, 0.3336, 0.0009, 2, 0.14, 0.0, 119, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "dist1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " dist1 = np.Inf"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L385_C8", "label": "approach_vector_1 =", "type": "assigned_variable", "loc": [385, 385], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L382_C4", "vector": [14, 2, 0.3354, 0.0009, 2, 0.14, 0.3333, 429, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "approach_vector_1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " approach_vector_1 = pt[0:2,0] - closest_pt_1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L386_C8", "label": "dist1 = norm()", "type": "assigned_variable", "loc": [386, 386], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L382_C4", "vector": [14, 2, 0.3362, 0.0009, 2, 0.14, 0.6667, 119, 3, 1, 0, 0, 902, 10, 1], "semantic": {"name": "dist1", "arg_names": [], "import_names": [], "rhs_call_name": "norm", "annotation": ""}, "snippet": " dist1 = np.linalg.norm(approach_vector_1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L387_C8", "label": "approach_vector_1 =", "type": "assigned_variable", "loc": [387, 387], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L382_C4", "vector": [14, 2, 0.3371, 0.0009, 2, 0.14, 1.0, 429, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "approach_vector_1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " approach_vector_1 = approach_vector_1/dist1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L389_C4", "label": "closest_pt_2 = find_closest_pt()", "type": "assigned_variable", "loc": [389, 389], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "vector": [14, 1, 0.3389, 0.0009, 1, 0.65, 0.8475, 648, 3, 3, 0, 0, 861, 10, 1], "semantic": {"name": "closest_pt_2", "arg_names": [], "import_names": [], "rhs_call_name": "find_closest_pt", "annotation": ""}, "snippet": " closest_pt_2 = find_closest_pt(pts2d,pt,pt_closer=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L390_C4", "label": "if", "type": "if", "loc": [390, 395], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "vector": [4, 1, 0.3419, 0.0052, 1, 0.65, 0.8644, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if closest_pt_2 == None:\n dist2 = np.Inf\n else:\n approach_vector_2 = closest_pt_2 - pt[0:2,0]\n dist2 = np.linalg.norm(approach_vector_2)\n approach_vector_2 = approach_vector_2/dist2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L391_C8", "label": "dist2 =", "type": "assigned_variable", "loc": [391, 391], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L390_C4", "vector": [14, 2, 0.3406, 0.0009, 2, 0.46, 0.0, 533, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "dist2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " dist2 = np.Inf"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L393_C8", "label": "approach_vector_2 =", "type": "assigned_variable", "loc": [393, 393], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L390_C4", "vector": [14, 2, 0.3423, 0.0009, 2, 0.46, 0.3333, 644, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "approach_vector_2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " approach_vector_2 = closest_pt_2 - pt[0:2,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L394_C8", "label": "dist2 = norm()", "type": "assigned_variable", "loc": [394, 394], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L390_C4", "vector": [14, 2, 0.3432, 0.0009, 2, 0.46, 0.6667, 533, 3, 1, 0, 0, 902, 10, 1], "semantic": {"name": "dist2", "arg_names": [], "import_names": [], "rhs_call_name": "norm", "annotation": ""}, "snippet": " dist2 = np.linalg.norm(approach_vector_2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L395_C8", "label": "approach_vector_2 =", "type": "assigned_variable", "loc": [395, 395], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L390_C4", "vector": [14, 2, 0.3441, 0.0009, 2, 0.46, 1.0, 644, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "approach_vector_2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " approach_vector_2 = approach_vector_2/dist2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L397_C4", "label": "if", "type": "if", "loc": [397, 400], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "vector": [4, 1, 0.3471, 0.0035, 1, 0.65, 0.8814, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if dist1 == np.Inf and dist2 == np.Inf:\n approach_vector_1 = np.matrix([1.,0.,0.]).T\n approach_vector_2 = np.matrix([1.,0.,0.]).T\n print('VERY STRANGE: processing_3d.find_approach_direction: both distances are Inf')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L398_C8", "label": "approach_vector_1 =", "type": "assigned_variable", "loc": [398, 398], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L397_C4", "vector": [14, 2, 0.3467, 0.0009, 2, 0.62, 0.0, 429, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "approach_vector_1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " approach_vector_1 = np.matrix([1.,0.,0.]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L399_C8", "label": "approach_vector_2 =", "type": "assigned_variable", "loc": [399, 399], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L397_C4", "vector": [14, 2, 0.3476, 0.0009, 2, 0.62, 0.5, 644, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "approach_vector_2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " approach_vector_2 = np.matrix([1.,0.,0.]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L400_C8", "label": "print()", "type": "expression", "loc": [400, 400], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L397_C4", "vector": [8, 2, 0.3484, 0.0009, 2, 0.62, 1.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('VERY STRANGE: processing_3d.find_approach_direction: both distances are Inf')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L402_C4", "label": "if", "type": "if", "loc": [402, 429], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "vector": [4, 1, 0.3619, 0.0244, 1, 0.65, 0.8983, 0, 0, 0, 0, 0, 0, 0, 11], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if dist1<0.05 or dist2<0.05:\n print('dist1,dist2:',dist1,dist2)\n t_pt = copy.copy(pt)\n if dist1<dist2 and dist1<0.02:\n t_pt[0,0] += 0.05\n elif dist2<0.02:\n t_pt[0,0] -= 0.05\n #pt_new = pushback_edge(pts2d,pt[0:2,0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L403_C8", "label": "print()", "type": "expression", "loc": [403, 403], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L402_C4", "vector": [8, 2, 0.351, 0.0009, 2, 0.92, 0.0, 535, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('dist1,dist2:',dist1,dist2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L404_C8", "label": "t_pt = copy()", "type": "assigned_variable", "loc": [404, 404], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L402_C4", "vector": [14, 2, 0.3519, 0.0009, 2, 0.92, 0.125, 176, 3, 1, 0, 0, 739, 10, 1], "semantic": {"name": "t_pt", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " t_pt = copy.copy(pt)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L405_C8", "label": "if", "type": "if", "loc": [405, 408], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L402_C4", "vector": [4, 2, 0.3541, 0.0035, 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 dist1<dist2 and dist1<0.02:\n t_pt[0,0] += 0.05\n elif dist2<0.02:\n t_pt[0,0] -= 0.05"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L407_C8", "label": "if", "type": "if", "loc": [407, 408], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L405_C8", "vector": [4, 3, 0.355, 0.0017, 3, 0.32, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif dist2<0.02:\n t_pt[0,0] -= 0.05"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L410_C8", "label": "pt_new = pushback_edge()", "type": "assigned_variable", "loc": [410, 410], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L402_C4", "vector": [14, 2, 0.3571, 0.0009, 2, 0.92, 0.375, 882, 3, 2, 0, 0, 2, 10, 1], "semantic": {"name": "pt_new", "arg_names": [], "import_names": [], "rhs_call_name": "pushback_edge", "annotation": ""}, "snippet": " pt_new = pushback_edge(pts2d,t_pt[0:2,0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L411_C8", "label": "if", "type": "if", "loc": [411, 413], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L402_C4", "vector": [4, 2, 0.3589, 0.0026, 2, 0.92, 0.5, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if display_list != None:\n pt_new_3d = np.row_stack((pt_new,np.matrix([z_plane_meters])))\n display_list.append(pu.CubeCloud(pt_new_3d,color=(200,000,0),size=(0.009,0.009,0.009)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L412_C12", "label": "pt_new_3d = row_stack()", "type": "assigned_variable", "loc": [412, 412], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L411_C8", "vector": [14, 3, 0.3589, 0.0009, 3, 0.56, 0.0, 844, 3, 1, 0, 0, 612, 10, 2], "semantic": {"name": "pt_new_3d", "arg_names": [], "import_names": [], "rhs_call_name": "row_stack", "annotation": ""}, "snippet": " pt_new_3d = np.row_stack((pt_new,np.matrix([z_plane_meters])))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L413_C12", "label": "append()", "type": "expression", "loc": [413, 413], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L411_C8", "vector": [8, 3, 0.3598, 0.0009, 3, 0.56, 1.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " display_list.append(pu.CubeCloud(pt_new_3d,color=(200,000,0),size=(0.009,0.009,0.009)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L415_C8", "label": "closest_pt_1 = find_closest_pt()", "type": "assigned_variable", "loc": [415, 415], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L402_C4", "vector": [14, 2, 0.3615, 0.0009, 2, 0.92, 0.625, 680, 3, 3, 0, 0, 861, 10, 1], "semantic": {"name": "closest_pt_1", "arg_names": [], "import_names": [], "rhs_call_name": "find_closest_pt", "annotation": ""}, "snippet": " closest_pt_1 = find_closest_pt(pts2d,pt_new,pt_closer=False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L416_C8", "label": "if", "type": "if", "loc": [416, 421], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L402_C4", "vector": [4, 2, 0.3645, 0.0052, 2, 0.92, 0.75, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if closest_pt_1 == None:\n dist1 = np.Inf\n else:\n approach_vector_1 = pt_new - closest_pt_1\n dist1 = np.linalg.norm(approach_vector_1)\n approach_vector_1 = approach_vector_1/dist1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L417_C12", "label": "dist1 =", "type": "assigned_variable", "loc": [417, 417], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L416_C8", "vector": [14, 3, 0.3632, 0.0009, 3, 0.29, 0.0, 119, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "dist1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " dist1 = np.Inf"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L419_C12", "label": "approach_vector_1 =", "type": "assigned_variable", "loc": [419, 419], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L416_C8", "vector": [14, 3, 0.365, 0.0009, 3, 0.29, 0.3333, 429, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "approach_vector_1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " approach_vector_1 = pt_new - closest_pt_1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L420_C12", "label": "dist1 = norm()", "type": "assigned_variable", "loc": [420, 420], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L416_C8", "vector": [14, 3, 0.3659, 0.0009, 3, 0.29, 0.6667, 119, 3, 1, 0, 0, 902, 10, 1], "semantic": {"name": "dist1", "arg_names": [], "import_names": [], "rhs_call_name": "norm", "annotation": ""}, "snippet": " dist1 = np.linalg.norm(approach_vector_1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L421_C12", "label": "approach_vector_1 =", "type": "assigned_variable", "loc": [421, 421], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L416_C8", "vector": [14, 3, 0.3667, 0.0009, 3, 0.29, 1.0, 429, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "approach_vector_1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " approach_vector_1 = approach_vector_1/dist1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L423_C8", "label": "closest_pt_2 = find_closest_pt()", "type": "assigned_variable", "loc": [423, 423], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L402_C4", "vector": [14, 2, 0.3685, 0.0009, 2, 0.92, 0.875, 648, 3, 3, 0, 0, 861, 10, 1], "semantic": {"name": "closest_pt_2", "arg_names": [], "import_names": [], "rhs_call_name": "find_closest_pt", "annotation": ""}, "snippet": " closest_pt_2 = find_closest_pt(pts2d,pt_new,pt_closer=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L424_C8", "label": "if", "type": "if", "loc": [424, 429], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L402_C4", "vector": [4, 2, 0.3715, 0.0052, 2, 0.92, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if closest_pt_2 == None:\n dist2 = np.Inf\n else:\n approach_vector_2 = closest_pt_2 - pt_new\n dist2 = np.linalg.norm(approach_vector_2)\n approach_vector_2 = approach_vector_2/dist2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L425_C12", "label": "dist2 =", "type": "assigned_variable", "loc": [425, 425], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L424_C8", "vector": [14, 3, 0.3702, 0.0009, 3, 0.17, 0.0, 533, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "dist2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " dist2 = np.Inf"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L427_C12", "label": "approach_vector_2 =", "type": "assigned_variable", "loc": [427, 427], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L424_C8", "vector": [14, 3, 0.372, 0.0009, 3, 0.17, 0.3333, 644, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "approach_vector_2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " approach_vector_2 = closest_pt_2 - pt_new"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L428_C12", "label": "dist2 = norm()", "type": "assigned_variable", "loc": [428, 428], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L424_C8", "vector": [14, 3, 0.3728, 0.0009, 3, 0.17, 0.6667, 533, 3, 1, 0, 0, 902, 10, 1], "semantic": {"name": "dist2", "arg_names": [], "import_names": [], "rhs_call_name": "norm", "annotation": ""}, "snippet": " dist2 = np.linalg.norm(approach_vector_2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L429_C12", "label": "approach_vector_2 =", "type": "assigned_variable", "loc": [429, 429], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L424_C8", "vector": [14, 3, 0.3737, 0.0009, 3, 0.17, 1.0, 644, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "approach_vector_2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " approach_vector_2 = approach_vector_2/dist2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L431_C4", "label": "print()", "type": "expression", "loc": [431, 431], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "vector": [8, 1, 0.3754, 0.0009, 1, 0.65, 0.9153, 535, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('----------- dist1,dist2:',dist1,dist2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L432_C4", "label": "if", "type": "if", "loc": [432, 437], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "vector": [4, 1, 0.3785, 0.0052, 1, 0.65, 0.9322, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if dist2<dist1:\n closest_pt = closest_pt_2\n approach_vector = approach_vector_2\n else:\n closest_pt = closest_pt_1\n approach_vector = approach_vector_1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L433_C8", "label": "closest_pt =", "type": "assigned_variable", "loc": [433, 433], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L432_C4", "vector": [14, 2, 0.3772, 0.0009, 2, 0.03, 0.0, 463, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "closest_pt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " closest_pt = closest_pt_2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L434_C8", "label": "approach_vector =", "type": "assigned_variable", "loc": [434, 434], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L432_C4", "vector": [14, 2, 0.378, 0.0009, 2, 0.03, 0.3333, 682, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "approach_vector", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " approach_vector = approach_vector_2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L436_C8", "label": "closest_pt =", "type": "assigned_variable", "loc": [436, 436], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L432_C4", "vector": [14, 2, 0.3798, 0.0009, 2, 0.03, 0.6667, 463, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "closest_pt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " closest_pt = closest_pt_1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L437_C8", "label": "approach_vector =", "type": "assigned_variable", "loc": [437, 437], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L432_C4", "vector": [14, 2, 0.3807, 0.0009, 2, 0.03, 1.0, 682, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "approach_vector", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " approach_vector = approach_vector_1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L439_C4", "label": "print()", "type": "expression", "loc": [439, 439], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "vector": [8, 1, 0.3824, 0.0009, 1, 0.65, 0.9492, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('----------- approach_vector:',approach_vector.T)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L440_C4", "label": "closest_pt = row_stack()", "type": "assigned_variable", "loc": [440, 440], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "vector": [14, 1, 0.3833, 0.0009, 1, 0.65, 0.9661, 463, 3, 1, 0, 0, 612, 10, 2], "semantic": {"name": "closest_pt", "arg_names": [], "import_names": [], "rhs_call_name": "row_stack", "annotation": ""}, "snippet": " closest_pt = np.row_stack((closest_pt,np.matrix([z_plane_meters])))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L442_C4", "label": "if", "type": "if", "loc": [442, 448], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "vector": [4, 1, 0.3876, 0.0061, 1, 0.65, 0.9831, 0, 0, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if display_list != None:\n z = np.matrix(np.empty((1,pts2d.shape[1])))\n z[:,:] = z_plane_meters\n pts3d_front = np.row_stack((pts2d,z))\n\n display_list.append(pu.CubeCloud(closest_pt,color=(255,255,0),size=(0.020,0.020,0.020)))\n display_list.append(pu.CubeCloud(pts3d_front,color=(255,0,255),size=grid.resolution))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L443_C8", "label": "z = matrix()", "type": "assigned_variable", "loc": [443, 443], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L442_C4", "vector": [14, 2, 0.3859, 0.0009, 2, 0.26, 0.0, 859, 3, 1, 0, 0, 162, 10, 2], "semantic": {"name": "z", "arg_names": [], "import_names": [], "rhs_call_name": "matrix", "annotation": ""}, "snippet": " z = np.matrix(np.empty((1,pts2d.shape[1])))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L444_C8", "label": "assign", "type": "assigned_variable", "loc": [444, 444], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L442_C4", "vector": [14, 2, 0.3868, 0.0009, 2, 0.26, 0.25, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " z[:,:] = z_plane_meters"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L445_C8", "label": "pts3d_front = row_stack()", "type": "assigned_variable", "loc": [445, 445], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L442_C4", "vector": [14, 2, 0.3876, 0.0009, 2, 0.26, 0.5, 88, 3, 1, 0, 0, 612, 10, 1], "semantic": {"name": "pts3d_front", "arg_names": [], "import_names": [], "rhs_call_name": "row_stack", "annotation": ""}, "snippet": " pts3d_front = np.row_stack((pts2d,z))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L447_C8", "label": "append()", "type": "expression", "loc": [447, 447], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L442_C4", "vector": [8, 2, 0.3894, 0.0009, 2, 0.26, 0.75, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " display_list.append(pu.CubeCloud(closest_pt,color=(255,255,0),size=(0.020,0.020,0.020)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L448_C8", "label": "append()", "type": "expression", "loc": [448, 448], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L442_C4", "vector": [8, 2, 0.3902, 0.0009, 2, 0.26, 1.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " display_list.append(pu.CubeCloud(pts3d_front,color=(255,0,255),size=grid.resolution))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Return_L451_C4", "label": "return", "type": "return", "loc": [451, 451], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "vector": [13, 1, 0.3929, 0.0009, 1, 0.65, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return closest_pt,approach_vector"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L454_C0", "label": "vertical_plane_points", "type": "function", "loc": [454, 459], "level": 0, "parent": null, "vector": [2, 0, 0.3976, 0.0052, 0, 0.66, 0.5, 968, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "vertical_plane_points", "arg_names": ["grid"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def vertical_plane_points(grid):\n ''' changes grid\n '''\n plane_indices,ver_plane_slice = grid.remove_vertical_plane()\n grid.grid[:,:,:] = 0\n grid.grid[plane_indices,:,:] = ver_plane_slice"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L455_C4", "label": "expression", "type": "expression", "loc": [455, 456], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L454_C0", "vector": [8, 1, 0.3968, 0.0017, 1, 0.72, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' changes grid\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L457_C4", "label": "plane_indices, ver_plane_slice = remove_vertical_plane()", "type": "assigned_variable", "loc": [457, 457], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L454_C0", "vector": [14, 1, 0.3981, 0.0009, 1, 0.72, 0.3333, 174, 3, 0, 0, 0, 627, 10, 1], "semantic": {"name": "plane_indices, ver_plane_slice", "arg_names": [], "import_names": [], "rhs_call_name": "remove_vertical_plane", "annotation": ""}, "snippet": " plane_indices,ver_plane_slice = grid.remove_vertical_plane()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L458_C4", "label": "assign", "type": "assigned_variable", "loc": [458, 458], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L454_C0", "vector": [14, 1, 0.399, 0.0009, 1, 0.72, 0.6667, 0, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " grid.grid[:,:,:] = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L459_C4", "label": "assign", "type": "assigned_variable", "loc": [459, 459], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L454_C0", "vector": [14, 1, 0.3998, 0.0009, 1, 0.72, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " grid.grid[plane_indices,:,:] = ver_plane_slice"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L462_C0", "label": "find_door_handle", "type": "function", "loc": [462, 528], "level": 0, "parent": null, "vector": [2, 0, 0.4312, 0.0584, 0, 0.66, 0.5227, 854, 0, 6, 1, 0, 0, 0, 39], "semantic": {"name": "find_door_handle", "arg_names": ["grid", "pt", "list", "rotation_angle", "occupancy_threshold", "resolution"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def find_door_handle(grid,pt,list = None,rotation_angle=math.radians(0.),\n occupancy_threshold=None,resolution=None):\n grid.remove_vertical_plane()\n pts = grid.grid_to_points()\n\n rot_mat = tr.Rz(rotation_angle)\n t_pt = rot_mat*pt\n brf = t_pt+np.matrix([-0.2,-0.3,-0.2]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L464_C4", "label": "remove_vertical_plane()", "type": "expression", "loc": [464, 464], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L462_C0", "vector": [8, 1, 0.4042, 0.0009, 1, 0.37, 0.0, 627, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "remove_vertical_plane", "arg_names": [], "import_names": [], "rhs_call_name": "remove_vertical_plane", "annotation": ""}, "snippet": " grid.remove_vertical_plane()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L465_C4", "label": "pts = grid_to_points()", "type": "assigned_variable", "loc": [465, 465], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L462_C0", "vector": [14, 1, 0.4051, 0.0009, 1, 0.37, 0.0476, 195, 3, 0, 0, 0, 558, 10, 1], "semantic": {"name": "pts", "arg_names": [], "import_names": [], "rhs_call_name": "grid_to_points", "annotation": ""}, "snippet": " pts = grid.grid_to_points()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L467_C4", "label": "rot_mat = Rz()", "type": "assigned_variable", "loc": [467, 467], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L462_C0", "vector": [14, 1, 0.4068, 0.0009, 1, 0.37, 0.0952, 968, 3, 1, 0, 0, 936, 10, 1], "semantic": {"name": "rot_mat", "arg_names": [], "import_names": [], "rhs_call_name": "Rz", "annotation": ""}, "snippet": " rot_mat = tr.Rz(rotation_angle)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L468_C4", "label": "t_pt =", "type": "assigned_variable", "loc": [468, 468], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L462_C0", "vector": [14, 1, 0.4077, 0.0009, 1, 0.37, 0.1429, 176, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "t_pt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " t_pt = rot_mat*pt"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L469_C4", "label": "brf =", "type": "assigned_variable", "loc": [469, 469], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L462_C0", "vector": [14, 1, 0.4085, 0.0009, 1, 0.37, 0.1905, 17, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "brf", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " brf = t_pt+np.matrix([-0.2,-0.3,-0.2]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L470_C4", "label": "tlb =", "type": "assigned_variable", "loc": [470, 470], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L462_C0", "vector": [14, 1, 0.4094, 0.0009, 1, 0.37, 0.2381, 90, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "tlb", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tlb = t_pt+np.matrix([0.2, 0.3,0.2]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L472_C4", "label": "grid = occupancy_grid_3d()", "type": "assigned_variable", "loc": [472, 472], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L462_C0", "vector": [14, 1, 0.4111, 0.0009, 1, 0.37, 0.2857, 690, 3, 4, 0, 0, 222, 10, 1], "semantic": {"name": "grid", "arg_names": [], "import_names": [], "rhs_call_name": "occupancy_grid_3d", "annotation": ""}, "snippet": " grid = og3d.occupancy_grid_3d(brf,tlb,resolution,rotation_z=rotation_angle)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L474_C4", "label": "if", "type": "if", "loc": [474, 475], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L462_C0", "vector": [4, 1, 0.4133, 0.0017, 1, 0.37, 0.3333, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if pts.shape[1] == 0:\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Return_L475_C8", "label": "return", "type": "return", "loc": [475, 475], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L474_C4", "vector": [13, 2, 0.4138, 0.0009, 2, 0.26, 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_99556:Expr_L477_C4", "label": "fill_grid()", "type": "expression", "loc": [477, 477], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L462_C0", "vector": [8, 1, 0.4155, 0.0009, 1, 0.37, 0.381, 619, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "fill_grid", "arg_names": [], "import_names": [], "rhs_call_name": "fill_grid", "annotation": ""}, "snippet": " grid.fill_grid(tr.Rz(rotation_angle)*pts)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L478_C4", "label": "to_binary()", "type": "expression", "loc": [478, 478], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L462_C0", "vector": [8, 1, 0.4164, 0.0009, 1, 0.37, 0.4286, 206, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "to_binary", "arg_names": [], "import_names": [], "rhs_call_name": "to_binary", "annotation": ""}, "snippet": " grid.to_binary(occupancy_threshold)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L480_C4", "label": "labeled_arr, n_labels = find_objects()", "type": "assigned_variable", "loc": [480, 480], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L462_C0", "vector": [14, 1, 0.4181, 0.0009, 1, 0.37, 0.4762, 952, 3, 0, 0, 0, 936, 10, 1], "semantic": {"name": "labeled_arr, n_labels", "arg_names": [], "import_names": [], "rhs_call_name": "find_objects", "annotation": ""}, "snippet": " labeled_arr,n_labels = grid.find_objects()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L482_C4", "label": "if", "type": "if", "loc": [482, 485], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L462_C0", "vector": [4, 1, 0.4212, 0.0035, 1, 0.37, 0.5238, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if list == None:\n object_points_list = []\n else:\n object_points_list = list"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L483_C8", "label": "object_points_list =", "type": "assigned_variable", "loc": [483, 483], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L482_C4", "vector": [14, 2, 0.4207, 0.0009, 2, 0.09, 0.0, 241, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "object_points_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " object_points_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L485_C8", "label": "object_points_list =", "type": "assigned_variable", "loc": [485, 485], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L482_C4", "vector": [14, 2, 0.4225, 0.0009, 2, 0.09, 1.0, 241, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "object_points_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " object_points_list = list"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L487_C4", "label": "for l", "type": "for", "loc": [487, 493], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L462_C0", "vector": [6, 1, 0.4268, 0.0061, 1, 0.37, 0.5714, 810, 3, 0, 0, 0, 0, 0, 6], "semantic": {"name": "l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for l in range(n_labels):\n pts = grid.labeled_array_to_points(labeled_arr,l+1)\n obj_height = np.max(pts[2,:])-np.min(pts[2,:])\n print('object_height:', obj_height)\n if obj_height > 0.1:\n #remove the big objects\n grid.grid[np.where(labeled_arr==l+1)] = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L488_C8", "label": "pts = labeled_array_to_points()", "type": "assigned_variable", "loc": [488, 488], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L487_C4", "vector": [14, 2, 0.4251, 0.0009, 2, 0.79, 0.0, 195, 3, 2, 0, 0, 366, 10, 1], "semantic": {"name": "pts", "arg_names": [], "import_names": [], "rhs_call_name": "labeled_array_to_points", "annotation": ""}, "snippet": " pts = grid.labeled_array_to_points(labeled_arr,l+1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L489_C8", "label": "obj_height =", "type": "assigned_variable", "loc": [489, 489], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L487_C4", "vector": [14, 2, 0.426, 0.0009, 2, 0.79, 0.3333, 589, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "obj_height", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " obj_height = np.max(pts[2,:])-np.min(pts[2,:])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L490_C8", "label": "print()", "type": "expression", "loc": [490, 490], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L487_C4", "vector": [8, 2, 0.4268, 0.0009, 2, 0.79, 0.6667, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('object_height:', obj_height)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L491_C8", "label": "if", "type": "if", "loc": [491, 493], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L487_C4", "vector": [4, 2, 0.4286, 0.0026, 2, 0.79, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if obj_height > 0.1:\n #remove the big objects\n grid.grid[np.where(labeled_arr==l+1)] = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L493_C12", "label": "assign", "type": "assigned_variable", "loc": [493, 493], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L491_C8", "vector": [14, 3, 0.4294, 0.0009, 3, 0.6, 0.0, 0, 1, 0, 0, 0, 0, 1, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " grid.grid[np.where(labeled_arr==l+1)] = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L495_C4", "label": "connect_structure = empty()", "type": "assigned_variable", "loc": [495, 495], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L462_C0", "vector": [14, 1, 0.4312, 0.0009, 1, 0.37, 0.619, 297, 3, 2, 0, 0, 365, 10, 1], "semantic": {"name": "connect_structure", "arg_names": [], "import_names": [], "rhs_call_name": "empty", "annotation": ""}, "snippet": " connect_structure = np.empty((3,3,3),dtype='int')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L496_C4", "label": "assign", "type": "assigned_variable", "loc": [496, 496], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L462_C0", "vector": [14, 1, 0.4321, 0.0009, 1, 0.37, 0.6667, 0, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " connect_structure[:,:,:] = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L497_C4", "label": "assign", "type": "assigned_variable", "loc": [497, 497], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L462_C0", "vector": [14, 1, 0.4329, 0.0009, 1, 0.37, 0.7143, 0, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " connect_structure[1,:,1] = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L500_C4", "label": "grid.grid = binary_dilation()", "type": "assigned_variable", "loc": [500, 500], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L462_C0", "vector": [14, 1, 0.4355, 0.0009, 1, 0.37, 0.7619, 58, 3, 3, 0, 0, 202, 10, 1], "semantic": {"name": "grid.grid", "arg_names": [], "import_names": [], "rhs_call_name": "binary_dilation", "annotation": ""}, "snippet": " grid.grid = ni.binary_dilation(grid.grid,connect_structure,iterations=7)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L502_C4", "label": "labeled_arr, n_labels = find_objects()", "type": "assigned_variable", "loc": [502, 502], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L462_C0", "vector": [14, 1, 0.4373, 0.0009, 1, 0.37, 0.8095, 952, 3, 0, 0, 0, 936, 10, 1], "semantic": {"name": "labeled_arr, n_labels", "arg_names": [], "import_names": [], "rhs_call_name": "find_objects", "annotation": ""}, "snippet": " labeled_arr,n_labels = grid.find_objects()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L503_C4", "label": "for l", "type": "for", "loc": [503, 524], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L462_C0", "vector": [6, 1, 0.4473, 0.0192, 1, 0.37, 0.8571, 810, 3, 0, 0, 0, 0, 0, 16], "semantic": {"name": "l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for l in range(n_labels):\n pts = grid.labeled_array_to_points(labeled_arr,l+1)\n \n pts2d = pts[1:3,:] # only the y-z coordinates.\n\n obj_width = (pts2d.max(1)-pts2d.min(1))[0,0]\n print('processing_3d.find_door_handle: object width = ', obj_width)\n if obj_width < 0.05:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L504_C8", "label": "pts = labeled_array_to_points()", "type": "assigned_variable", "loc": [504, 504], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L503_C4", "vector": [14, 2, 0.439, 0.0009, 2, 0.63, 0.0, 195, 3, 2, 0, 0, 366, 10, 1], "semantic": {"name": "pts", "arg_names": [], "import_names": [], "rhs_call_name": "labeled_array_to_points", "annotation": ""}, "snippet": " pts = grid.labeled_array_to_points(labeled_arr,l+1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L506_C8", "label": "pts2d =", "type": "assigned_variable", "loc": [506, 506], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L503_C4", "vector": [14, 2, 0.4408, 0.0009, 2, 0.63, 0.0833, 871, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pts2d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pts2d = pts[1:3,:] # only the y-z coordinates."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L508_C8", "label": "obj_width =", "type": "assigned_variable", "loc": [508, 508], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L503_C4", "vector": [14, 2, 0.4425, 0.0009, 2, 0.63, 0.1667, 176, 6, 0, 0, 0, 0, 0, 2], "semantic": {"name": "obj_width", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " obj_width = (pts2d.max(1)-pts2d.min(1))[0,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L509_C8", "label": "print()", "type": "expression", "loc": [509, 509], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L503_C4", "vector": [8, 2, 0.4434, 0.0009, 2, 0.63, 0.25, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('processing_3d.find_door_handle: object width = ', obj_width)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L510_C8", "label": "if", "type": "if", "loc": [510, 511], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L503_C4", "vector": [4, 2, 0.4447, 0.0017, 2, 0.63, 0.3333, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if obj_width < 0.05:\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L513_C8", "label": "pts2d_zeromean =", "type": "assigned_variable", "loc": [513, 513], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L503_C4", "vector": [14, 2, 0.4469, 0.0009, 2, 0.63, 0.4167, 861, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "pts2d_zeromean", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pts2d_zeromean = pts2d-pts2d.mean(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L514_C8", "label": "e_vals, e_vecs = eig()", "type": "assigned_variable", "loc": [514, 514], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L503_C4", "vector": [14, 2, 0.4477, 0.0009, 2, 0.63, 0.5, 206, 3, 1, 0, 0, 971, 10, 1], "semantic": {"name": "e_vals, e_vecs", "arg_names": [], "import_names": [], "rhs_call_name": "eig", "annotation": ""}, "snippet": " e_vals,e_vecs = np.linalg.eig(pts2d_zeromean*pts2d_zeromean.T)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L515_C8", "label": "max_index = argmax()", "type": "assigned_variable", "loc": [515, 515], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L503_C4", "vector": [14, 2, 0.4486, 0.0009, 2, 0.63, 0.5833, 277, 3, 1, 0, 0, 593, 10, 1], "semantic": {"name": "max_index", "arg_names": [], "import_names": [], "rhs_call_name": "argmax", "annotation": ""}, "snippet": " max_index = np.argmax(e_vals)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L516_C8", "label": "max_evec =", "type": "assigned_variable", "loc": [516, 516], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L503_C4", "vector": [14, 2, 0.4495, 0.0009, 2, 0.63, 0.6667, 69, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "max_evec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " max_evec = e_vecs[:,max_index]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L517_C8", "label": "ang = atan2()", "type": "assigned_variable", "loc": [517, 517], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L503_C4", "vector": [14, 2, 0.4503, 0.0009, 2, 0.63, 0.75, 762, 3, 2, 0, 0, 572, 10, 1], "semantic": {"name": "ang", "arg_names": [], "import_names": [], "rhs_call_name": "atan2", "annotation": ""}, "snippet": " ang = math.atan2(max_evec[1,0],max_evec[0,0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L518_C8", "label": "print()", "type": "expression", "loc": [518, 518], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L503_C4", "vector": [8, 2, 0.4512, 0.0009, 2, 0.63, 0.8333, 535, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('processing_3d.find_door_handle: ang = ', math.degrees(ang))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L519_C8", "label": "if", "type": "if", "loc": [519, 522], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L503_C4", "vector": [4, 2, 0.4534, 0.0035, 2, 0.63, 0.9167, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (ang>math.radians(45) and ang<math.radians(135)) or \\\n (ang>math.radians(-135) and ang<math.radians(-45)):\n # assumption is that door handles are horizontal.\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L524_C8", "label": "append()", "type": "expression", "loc": [524, 524], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L503_C4", "vector": [8, 2, 0.4564, 0.0009, 2, 0.63, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " object_points_list.append(pts)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L525_C4", "label": "print()", "type": "expression", "loc": [525, 525], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L462_C0", "vector": [8, 1, 0.4573, 0.0009, 1, 0.37, 0.9048, 535, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('processing_3d.find_door_handle: found %d objects'%(len(object_points_list)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L527_C4", "label": "closest_obj = find_closest_object()", "type": "assigned_variable", "loc": [527, 527], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L462_C0", "vector": [14, 1, 0.4591, 0.0009, 1, 0.37, 0.9524, 232, 3, 2, 0, 0, 121, 10, 1], "semantic": {"name": "closest_obj", "arg_names": [], "import_names": [], "rhs_call_name": "find_closest_object", "annotation": ""}, "snippet": " closest_obj = find_closest_object(object_points_list,pt)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Return_L528_C4", "label": "return", "type": "return", "loc": [528, 528], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L462_C0", "vector": [13, 1, 0.4599, 0.0009, 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 closest_obj"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L532_C0", "label": "find_closest_object", "type": "function", "loc": [532, 552], "level": 0, "parent": null, "vector": [2, 0, 0.4721, 0.0183, 0, 0.66, 0.5455, 121, 0, 3, 1, 0, 0, 0, 7], "semantic": {"name": "find_closest_object", "arg_names": ["obj_pts_list", "pt", "return_idx"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def find_closest_object(obj_pts_list,pt,return_idx=False):\n ''' obj_pts_list - list of 3xNi matrices of points.\n pt - point of interest. (3x1) matrix.\n return_idx - whether to return the index (in obj_pts_list) of\n the closest object.\n returns 3xNj matrix of points which is the closest object to pt.\n None if obj_pts_list is empty.\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L533_C4", "label": "expression", "type": "expression", "loc": [533, 539], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L532_C0", "vector": [8, 1, 0.4669, 0.0061, 1, 0.69, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' obj_pts_list - list of 3xNi matrices of points.\n pt - point of interest. (3x1) matrix.\n return_idx - whether to return the index (in obj_pts_list) of\n the closest object.\n returns 3xNj matrix of points which is the closest object to pt.\n None if obj_pts_list is empty.\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L540_C4", "label": "min_dist_list =", "type": "assigned_variable", "loc": [540, 540], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L532_C0", "vector": [14, 1, 0.4704, 0.0009, 1, 0.69, 0.125, 450, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "min_dist_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " min_dist_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L541_C4", "label": "for obj_pts", "type": "for", "loc": [541, 542], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L532_C0", "vector": [6, 1, 0.4717, 0.0017, 1, 0.69, 0.25, 527, 2, 0, 0, 0, 0, 0, 3], "semantic": {"name": "obj_pts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for obj_pts in obj_pts_list:\n min_dist_list.append(np.min(ut.norm(obj_pts-pt)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L542_C8", "label": "append()", "type": "expression", "loc": [542, 542], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L541_C4", "vector": [8, 2, 0.4721, 0.0009, 2, 0.82, 0.0, 243, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " min_dist_list.append(np.min(ut.norm(obj_pts-pt)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L544_C4", "label": "if", "type": "if", "loc": [544, 545], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L532_C0", "vector": [4, 1, 0.4743, 0.0017, 1, 0.69, 0.375, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if obj_pts_list == []:\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Return_L545_C8", "label": "return", "type": "return", "loc": [545, 545], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L544_C4", "vector": [13, 2, 0.4747, 0.0009, 2, 0.21, 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_99556:Assign_L546_C4", "label": "min_idx = argmin()", "type": "assigned_variable", "loc": [546, 546], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L532_C0", "vector": [14, 1, 0.4756, 0.0009, 1, 0.69, 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(np.matrix(min_dist_list))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L547_C4", "label": "cl_obj =", "type": "assigned_variable", "loc": [547, 547], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L532_C0", "vector": [14, 1, 0.4765, 0.0009, 1, 0.69, 0.625, 726, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "cl_obj", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cl_obj = obj_pts_list[min_idx]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L548_C4", "label": "print()", "type": "expression", "loc": [548, 548], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L532_C0", "vector": [8, 1, 0.4774, 0.0009, 1, 0.69, 0.75, 535, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('processing_3d.find_closest_object: closest_object\\'s centroid',cl_obj.mean(1).T)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L550_C4", "label": "if", "type": "if", "loc": [550, 551], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L532_C0", "vector": [4, 1, 0.4795, 0.0017, 1, 0.69, 0.875, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if return_idx:\n return cl_obj,min_idx"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Return_L551_C8", "label": "return", "type": "return", "loc": [551, 551], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L550_C4", "vector": [13, 2, 0.48, 0.0009, 2, 0.28, 0.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return cl_obj,min_idx"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Return_L552_C4", "label": "return", "type": "return", "loc": [552, 552], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L532_C0", "vector": [13, 1, 0.4808, 0.0009, 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 cl_obj"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L554_C0", "label": "segment_objects_points", "type": "function", "loc": [554, 596], "level": 0, "parent": null, "vector": [2, 0, 0.5009, 0.0375, 0, 0.66, 0.5682, 879, 0, 3, 1, 0, 0, 0, 14], "semantic": {"name": "segment_objects_points", "arg_names": ["grid", "return_labels_list", "twod"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def segment_objects_points(grid,return_labels_list=False,\n twod=False):\n ''' grid - binary occupancy grid.\n returns list of 3xNi numpy matrices where Ni is the number of points\n in the ith object. Point refers to center of the cell of occupancy grid.\n return_labels_list - return a list of labels of the objects in\n the grid.\n returns None if there is no horizontal surface"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L556_C4", "label": "expression", "type": "expression", "loc": [556, 562], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L554_C0", "vector": [8, 1, 0.4869, 0.0061, 1, 0.52, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' grid - binary occupancy grid.\n returns list of 3xNi numpy matrices where Ni is the number of points\n in the ith object. Point refers to center of the cell of occupancy grid.\n return_labels_list - return a list of labels of the objects in\n the grid.\n returns None if there is no horizontal surface\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L563_C4", "label": "labeled_arr, n_labels = segment_objects()", "type": "assigned_variable", "loc": [563, 563], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L554_C0", "vector": [14, 1, 0.4904, 0.0009, 1, 0.52, 0.1429, 952, 3, 1, 0, 0, 295, 10, 1], "semantic": {"name": "labeled_arr, n_labels", "arg_names": [], "import_names": [], "rhs_call_name": "segment_objects", "annotation": ""}, "snippet": " labeled_arr,n_labels = grid.segment_objects(twod=twod)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L564_C4", "label": "if", "type": "if", "loc": [564, 566], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L554_C0", "vector": [4, 1, 0.4922, 0.0026, 1, 0.52, 0.2857, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if n_labels == None:\n # there is no surface, so segmentation does not make sense.\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Return_L566_C8", "label": "return", "type": "return", "loc": [566, 566], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L564_C4", "vector": [13, 2, 0.493, 0.0009, 2, 0.54, 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_99556:Assign_L568_C4", "label": "object_points_list =", "type": "assigned_variable", "loc": [568, 568], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L554_C0", "vector": [14, 1, 0.4948, 0.0009, 1, 0.52, 0.4286, 241, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "object_points_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " object_points_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L569_C4", "label": "labels_list =", "type": "assigned_variable", "loc": [569, 569], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L554_C0", "vector": [14, 1, 0.4956, 0.0009, 1, 0.52, 0.5714, 325, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "labels_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " labels_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L571_C4", "label": "for l", "type": "for", "loc": [571, 591], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L554_C0", "vector": [6, 1, 0.5061, 0.0183, 1, 0.52, 0.7143, 810, 3, 0, 0, 0, 0, 0, 13], "semantic": {"name": "l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for l in range(n_labels):\n pts = grid.labeled_array_to_points(labeled_arr,l+1)\n\n pts_zeromean = pts-pts.mean(1)\n e_vals,e_vecs = np.linalg.eig(pts_zeromean*pts_zeromean.T)\n\n max_index = np.argmax(e_vals)\n max_evec = e_vecs[:,max_index]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L572_C8", "label": "pts = labeled_array_to_points()", "type": "assigned_variable", "loc": [572, 572], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L571_C4", "vector": [14, 2, 0.4983, 0.0009, 2, 0.21, 0.0, 195, 3, 2, 0, 0, 366, 10, 1], "semantic": {"name": "pts", "arg_names": [], "import_names": [], "rhs_call_name": "labeled_array_to_points", "annotation": ""}, "snippet": " pts = grid.labeled_array_to_points(labeled_arr,l+1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L574_C8", "label": "pts_zeromean =", "type": "assigned_variable", "loc": [574, 574], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L571_C4", "vector": [14, 2, 0.5, 0.0009, 2, 0.21, 0.0714, 268, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "pts_zeromean", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pts_zeromean = pts-pts.mean(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L575_C8", "label": "e_vals, e_vecs = eig()", "type": "assigned_variable", "loc": [575, 575], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L571_C4", "vector": [14, 2, 0.5009, 0.0009, 2, 0.21, 0.1429, 206, 3, 1, 0, 0, 971, 10, 1], "semantic": {"name": "e_vals, e_vecs", "arg_names": [], "import_names": [], "rhs_call_name": "eig", "annotation": ""}, "snippet": " e_vals,e_vecs = np.linalg.eig(pts_zeromean*pts_zeromean.T)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L577_C8", "label": "max_index = argmax()", "type": "assigned_variable", "loc": [577, 577], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L571_C4", "vector": [14, 2, 0.5026, 0.0009, 2, 0.21, 0.2143, 277, 3, 1, 0, 0, 593, 10, 1], "semantic": {"name": "max_index", "arg_names": [], "import_names": [], "rhs_call_name": "argmax", "annotation": ""}, "snippet": " max_index = np.argmax(e_vals)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L578_C8", "label": "max_evec =", "type": "assigned_variable", "loc": [578, 578], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L571_C4", "vector": [14, 2, 0.5035, 0.0009, 2, 0.21, 0.2857, 69, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "max_evec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " max_evec = e_vecs[:,max_index]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L579_C8", "label": "print()", "type": "expression", "loc": [579, 579], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L571_C4", "vector": [8, 2, 0.5044, 0.0009, 2, 0.21, 0.3571, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('max eigen vector:', max_evec.T)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L580_C8", "label": "pts_1d =", "type": "assigned_variable", "loc": [580, 580], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L571_C4", "vector": [14, 2, 0.5052, 0.0009, 2, 0.21, 0.4286, 504, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pts_1d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pts_1d = max_evec.T * pts"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L581_C8", "label": "size =", "type": "assigned_variable", "loc": [581, 581], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L571_C4", "vector": [14, 2, 0.5061, 0.0009, 2, 0.21, 0.5, 714, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "size", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " size = pts_1d.max() - pts_1d.min()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L582_C8", "label": "print()", "type": "expression", "loc": [582, 582], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L571_C4", "vector": [8, 2, 0.507, 0.0009, 2, 0.21, 0.5714, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('size:', size)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L583_C8", "label": "print()", "type": "expression", "loc": [583, 583], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L571_C4", "vector": [8, 2, 0.5078, 0.0009, 2, 0.21, 0.6429, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('n_points:', pts.shape[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L584_C8", "label": "ppsoe =", "type": "assigned_variable", "loc": [584, 584], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L571_C4", "vector": [14, 2, 0.5087, 0.0009, 2, 0.21, 0.7143, 729, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ppsoe", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ppsoe = pts.shape[1]/(e_vals[0]+e_vals[1]+e_vals[2])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L585_C8", "label": "print()", "type": "expression", "loc": [585, 585], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L571_C4", "vector": [8, 2, 0.5096, 0.0009, 2, 0.21, 0.7857, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('points per sum of eigenvalues:',ppsoe)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L588_C8", "label": "if", "type": "if", "loc": [588, 589], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L571_C4", "vector": [4, 2, 0.5126, 0.0017, 2, 0.21, 0.8571, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if size<0.05 or size>0.5: #TODO - figure out a good threshold.\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L590_C8", "label": "append()", "type": "expression", "loc": [590, 590], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L571_C4", "vector": [8, 2, 0.5139, 0.0009, 2, 0.21, 0.9286, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " object_points_list.append(pts)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L591_C8", "label": "append()", "type": "expression", "loc": [591, 591], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L571_C4", "vector": [8, 2, 0.5148, 0.0009, 2, 0.21, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " labels_list.append(l+1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L593_C4", "label": "if", "type": "if", "loc": [593, 594], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L554_C0", "vector": [4, 1, 0.517, 0.0017, 1, 0.52, 0.8571, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if return_labels_list:\n return object_points_list, labels_list"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Return_L594_C8", "label": "return", "type": "return", "loc": [594, 594], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L593_C4", "vector": [13, 2, 0.5174, 0.0009, 2, 0.24, 0.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return object_points_list, labels_list"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Return_L596_C4", "label": "return", "type": "return", "loc": [596, 596], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L554_C0", "vector": [13, 1, 0.5192, 0.0009, 1, 0.52, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return object_points_list"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L598_C0", "label": "create_grid", "type": "function", "loc": [598, 623], "level": 0, "parent": null, "vector": [2, 0, 0.5318, 0.0226, 0, 0.66, 0.5909, 416, 0, 11, 1, 0, 0, 0, 11], "semantic": {"name": "create_grid", "arg_names": ["brf", "tlb", "resolution", "pos_list", "scan_list", "l1", "l2", "display_flag", "show_pts", "rotation_angle", "occupancy_threshold"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def create_grid(brf,tlb,resolution,pos_list,scan_list,l1,l2,\n display_flag=False,show_pts=True,rotation_angle=0.,\n occupancy_threshold=1):\n ''' rotation angle - about the Z axis.\n '''\n max_dist = np.linalg.norm(tlb) + 0.2\n min_dist = brf[0,0]\n min_angle,max_angle=math.radians(-60),math.radians(60)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L601_C4", "label": "expression", "type": "expression", "loc": [601, 602], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L598_C0", "vector": [8, 1, 0.524, 0.0017, 1, 0.99, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' rotation angle - about the Z axis.\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L603_C4", "label": "max_dist =", "type": "assigned_variable", "loc": [603, 603], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L598_C0", "vector": [14, 1, 0.5253, 0.0009, 1, 0.99, 0.0909, 822, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "max_dist", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " max_dist = np.linalg.norm(tlb) + 0.2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L604_C4", "label": "min_dist =", "type": "assigned_variable", "loc": [604, 604], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L598_C0", "vector": [14, 1, 0.5261, 0.0009, 1, 0.99, 0.1818, 109, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "min_dist", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " min_dist = brf[0,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L605_C4", "label": "min_angle, max_angle =", "type": "assigned_variable", "loc": [605, 605], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L598_C0", "vector": [14, 1, 0.527, 0.0009, 1, 0.99, 0.2727, 579, 0, 0, 0, 0, 0, 8, 2], "semantic": {"name": "min_angle, max_angle", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " min_angle,max_angle=math.radians(-60),math.radians(60)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L607_C4", "label": "all_pts = generate_pointcloud()", "type": "assigned_variable", "loc": [607, 608], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L598_C0", "vector": [14, 1, 0.5292, 0.0017, 1, 0.99, 0.3636, 45, 3, 8, 0, 0, 989, 10, 1], "semantic": {"name": "all_pts", "arg_names": [], "import_names": [], "rhs_call_name": "generate_pointcloud", "annotation": ""}, "snippet": " all_pts = generate_pointcloud(pos_list, scan_list, min_angle, max_angle, l1, l2,\n max_dist=max_dist,min_dist=min_dist)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L609_C4", "label": "rot_mat = Rz()", "type": "assigned_variable", "loc": [609, 609], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L598_C0", "vector": [14, 1, 0.5305, 0.0009, 1, 0.99, 0.4545, 968, 3, 1, 0, 0, 936, 10, 1], "semantic": {"name": "rot_mat", "arg_names": [], "import_names": [], "rhs_call_name": "Rz", "annotation": ""}, "snippet": " rot_mat = tr.Rz(rotation_angle)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L610_C4", "label": "all_pts_rot =", "type": "assigned_variable", "loc": [610, 610], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L598_C0", "vector": [14, 1, 0.5314, 0.0009, 1, 0.99, 0.5455, 315, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "all_pts_rot", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " all_pts_rot = rot_mat*all_pts"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L612_C4", "label": "gr = occupancy_grid_3d()", "type": "assigned_variable", "loc": [612, 612], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L598_C0", "vector": [14, 1, 0.5331, 0.0009, 1, 0.99, 0.6364, 8, 3, 4, 0, 0, 222, 10, 1], "semantic": {"name": "gr", "arg_names": [], "import_names": [], "rhs_call_name": "occupancy_grid_3d", "annotation": ""}, "snippet": " gr = og3d.occupancy_grid_3d(brf,tlb,resolution,rotation_z=rotation_angle)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L614_C4", "label": "fill_grid()", "type": "expression", "loc": [614, 614], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L598_C0", "vector": [8, 1, 0.5348, 0.0009, 1, 0.99, 0.7273, 619, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "fill_grid", "arg_names": [], "import_names": [], "rhs_call_name": "fill_grid", "annotation": ""}, "snippet": " gr.fill_grid(all_pts_rot)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L615_C4", "label": "to_binary()", "type": "expression", "loc": [615, 615], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L598_C0", "vector": [8, 1, 0.5357, 0.0009, 1, 0.99, 0.8182, 206, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "to_binary", "arg_names": [], "import_names": [], "rhs_call_name": "to_binary", "annotation": ""}, "snippet": " gr.to_binary(occupancy_threshold)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L617_C4", "label": "if", "type": "if", "loc": [617, 621], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L598_C0", "vector": [4, 1, 0.5392, 0.0044, 1, 0.99, 0.9091, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if display_flag == True:\n if show_pts:\n d3m.plot_points(all_pts,color=(0.,0.,0.))\n cube_tups = gr.grid_lines(rotation_angle=rotation_angle)\n d3m.plot_cuboid(cube_tups)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L618_C8", "label": "if", "type": "if", "loc": [618, 619], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L617_C4", "vector": [4, 2, 0.5388, 0.0017, 2, 0.09, 0.0, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if show_pts:\n d3m.plot_points(all_pts,color=(0.,0.,0.))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L619_C12", "label": "plot_points()", "type": "expression", "loc": [619, 619], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L618_C8", "vector": [8, 3, 0.5392, 0.0009, 3, 0.59, 0.0, 111, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "plot_points", "arg_names": [], "import_names": [], "rhs_call_name": "plot_points", "annotation": ""}, "snippet": " d3m.plot_points(all_pts,color=(0.,0.,0.))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L620_C8", "label": "cube_tups = grid_lines()", "type": "assigned_variable", "loc": [620, 620], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L617_C4", "vector": [14, 2, 0.5401, 0.0009, 2, 0.09, 0.5, 94, 3, 1, 0, 0, 457, 10, 1], "semantic": {"name": "cube_tups", "arg_names": [], "import_names": [], "rhs_call_name": "grid_lines", "annotation": ""}, "snippet": " cube_tups = gr.grid_lines(rotation_angle=rotation_angle)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L621_C8", "label": "plot_cuboid()", "type": "expression", "loc": [621, 621], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L617_C4", "vector": [8, 2, 0.5409, 0.0009, 2, 0.09, 1.0, 494, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "plot_cuboid", "arg_names": [], "import_names": [], "rhs_call_name": "plot_cuboid", "annotation": ""}, "snippet": " d3m.plot_cuboid(cube_tups)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Return_L623_C4", "label": "return", "type": "return", "loc": [623, 623], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L598_C0", "vector": [13, 1, 0.5427, 0.0009, 1, 0.99, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return gr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L625_C0", "label": "create_vertical_plane_grid", "type": "function", "loc": [625, 631], "level": 0, "parent": null, "vector": [2, 0, 0.547, 0.0061, 0, 0.66, 0.6136, 870, 0, 7, 1, 0, 0, 0, 5], "semantic": {"name": "create_vertical_plane_grid", "arg_names": ["pt", "pos_list", "scan_list", "l1", "l2", "rotation_angle", "display_list"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def create_vertical_plane_grid(pt,pos_list,scan_list,l1,l2,rotation_angle,display_list=None):\n rot_mat = tr.Rz(rotation_angle)\n t_pt = rot_mat*pt\n brf = t_pt+np.matrix([-0.2,-0.3,-0.2]).T\n tlb = t_pt+np.matrix([0.2, 0.3,0.2]).T\n resolution = np.matrix([0.005,0.02,0.02]).T\n return create_grid(brf,tlb,resolution,pos_list,scan_list,l1,l2,display_list,rotation_angle=rotation_angle,occupancy_threshold=1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L626_C4", "label": "rot_mat = Rz()", "type": "assigned_variable", "loc": [626, 626], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L625_C0", "vector": [14, 1, 0.5453, 0.0009, 1, 0.09, 0.0, 968, 3, 1, 0, 0, 936, 10, 1], "semantic": {"name": "rot_mat", "arg_names": [], "import_names": [], "rhs_call_name": "Rz", "annotation": ""}, "snippet": " rot_mat = tr.Rz(rotation_angle)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L627_C4", "label": "t_pt =", "type": "assigned_variable", "loc": [627, 627], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L625_C0", "vector": [14, 1, 0.5462, 0.0009, 1, 0.09, 0.2, 176, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "t_pt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " t_pt = rot_mat*pt"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L628_C4", "label": "brf =", "type": "assigned_variable", "loc": [628, 628], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L625_C0", "vector": [14, 1, 0.547, 0.0009, 1, 0.09, 0.4, 17, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "brf", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " brf = t_pt+np.matrix([-0.2,-0.3,-0.2]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L629_C4", "label": "tlb =", "type": "assigned_variable", "loc": [629, 629], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L625_C0", "vector": [14, 1, 0.5479, 0.0009, 1, 0.09, 0.6, 90, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "tlb", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tlb = t_pt+np.matrix([0.2, 0.3,0.2]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L630_C4", "label": "resolution =", "type": "assigned_variable", "loc": [630, 630], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L625_C0", "vector": [14, 1, 0.5488, 0.0009, 1, 0.09, 0.8, 615, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "resolution", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " resolution = np.matrix([0.005,0.02,0.02]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Return_L631_C4", "label": "return", "type": "return", "loc": [631, 631], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L625_C0", "vector": [13, 1, 0.5497, 0.0009, 1, 0.09, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return create_grid(brf,tlb,resolution,pos_list,scan_list,l1,l2,display_list,rotation_angle=rotation_angle,occupancy_threshold=1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L633_C0", "label": "create_scooping_grid", "type": "function", "loc": [633, 638], "level": 0, "parent": null, "vector": [2, 0, 0.5536, 0.0052, 0, 0.66, 0.6364, 643, 0, 6, 1, 0, 0, 0, 5], "semantic": {"name": "create_scooping_grid", "arg_names": ["pt", "pos_list", "scan_list", "l1", "l2", "display_flag"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def create_scooping_grid(pt,pos_list,scan_list,l1,l2,display_flag=False):\n brf = pt+np.matrix([-0.15,-0.4,-0.2]).T\n brf[0,0] = max(0.07,brf[0,0])\n tlb = pt+np.matrix([0.25, 0.4,0.2]).T\n resolution = np.matrix([0.01,0.01,0.0025]).T\n return create_grid(brf,tlb,resolution,pos_list,scan_list,l1,l2,display_flag)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L634_C4", "label": "brf =", "type": "assigned_variable", "loc": [634, 634], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L633_C0", "vector": [14, 1, 0.5523, 0.0009, 1, 0.86, 0.0, 17, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "brf", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " brf = pt+np.matrix([-0.15,-0.4,-0.2]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L635_C4", "label": " = max()", "type": "assigned_variable", "loc": [635, 635], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L633_C0", "vector": [14, 1, 0.5531, 0.0009, 1, 0.86, 0.25, 0, 3, 2, 0, 0, 442, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "max", "annotation": ""}, "snippet": " brf[0,0] = max(0.07,brf[0,0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L636_C4", "label": "tlb =", "type": "assigned_variable", "loc": [636, 636], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L633_C0", "vector": [14, 1, 0.554, 0.0009, 1, 0.86, 0.5, 90, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "tlb", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tlb = pt+np.matrix([0.25, 0.4,0.2]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L637_C4", "label": "resolution =", "type": "assigned_variable", "loc": [637, 637], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L633_C0", "vector": [14, 1, 0.5549, 0.0009, 1, 0.86, 0.75, 615, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "resolution", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " resolution = np.matrix([0.01,0.01,0.0025]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Return_L638_C4", "label": "return", "type": "return", "loc": [638, 638], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L633_C0", "vector": [13, 1, 0.5557, 0.0009, 1, 0.86, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return create_grid(brf,tlb,resolution,pos_list,scan_list,l1,l2,display_flag)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L640_C0", "label": "create_segmentation_grid", "type": "function", "loc": [640, 653], "level": 0, "parent": null, "vector": [2, 0, 0.5632, 0.0122, 0, 0.66, 0.6591, 225, 0, 6, 1, 0, 0, 0, 5], "semantic": {"name": "create_segmentation_grid", "arg_names": ["pt", "pos_list", "scan_list", "l1", "l2", "display_flag"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def create_segmentation_grid(pt,pos_list,scan_list,l1,l2,display_flag=False):\n brf = pt+np.matrix([-0.15,-0.2,-0.2]).T\n brf[0,0] = max(0.07,brf[0,0])\n tlb = pt+np.matrix([0.25, 0.2,0.2]).T\n\n# brf = np.matrix([0.05,-0.3,-0.2]).T\n# tlb = np.matrix([0.5, 0.3,0.1]).T\n# resolution = np.matrix([0.005,0.005,0.005]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L641_C4", "label": "brf =", "type": "assigned_variable", "loc": [641, 641], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L640_C0", "vector": [14, 1, 0.5584, 0.0009, 1, 0.92, 0.0, 17, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "brf", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " brf = pt+np.matrix([-0.15,-0.2,-0.2]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L642_C4", "label": " = max()", "type": "assigned_variable", "loc": [642, 642], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L640_C0", "vector": [14, 1, 0.5592, 0.0009, 1, 0.92, 0.25, 0, 3, 2, 0, 0, 442, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "max", "annotation": ""}, "snippet": " brf[0,0] = max(0.07,brf[0,0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L643_C4", "label": "tlb =", "type": "assigned_variable", "loc": [643, 643], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L640_C0", "vector": [14, 1, 0.5601, 0.0009, 1, 0.92, 0.5, 90, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "tlb", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tlb = pt+np.matrix([0.25, 0.2,0.2]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L650_C4", "label": "resolution =", "type": "assigned_variable", "loc": [650, 650], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L640_C0", "vector": [14, 1, 0.5662, 0.0009, 1, 0.92, 0.75, 615, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "resolution", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " resolution = np.matrix([0.01,0.01,0.0025]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Return_L653_C4", "label": "return", "type": "return", "loc": [653, 653], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L640_C0", "vector": [13, 1, 0.5688, 0.0009, 1, 0.92, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return create_grid(brf,tlb,resolution,pos_list,scan_list,l1,l2,display_flag)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L655_C0", "label": "create_approach_grid", "type": "function", "loc": [655, 663], "level": 0, "parent": null, "vector": [2, 0, 0.574, 0.0078, 0, 0.66, 0.6818, 775, 0, 7, 1, 0, 0, 0, 5], "semantic": {"name": "create_approach_grid", "arg_names": ["pt", "pos_list", "scan_list", "l1", "l2", "display_list", "show_pts"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def create_approach_grid(pt,pos_list,scan_list,l1,l2,display_list=None,show_pts=True):\n brf = pt + np.matrix([-0.5,-0.2,-0.3]).T\n brf[0,0] = max(0.10,brf[0,0])\n\n tlb = pt + np.matrix([0.3, 0.2,0.2]).T\n# resolution = np.matrix([0.005,0.005,0.005]).T\n resolution = np.matrix([0.01,0.01,0.0025]).T\n# resolution = np.matrix([0.01,0.01,0.001]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L656_C4", "label": "brf =", "type": "assigned_variable", "loc": [656, 656], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L655_C0", "vector": [14, 1, 0.5714, 0.0009, 1, 0.19, 0.0, 17, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "brf", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " brf = pt + np.matrix([-0.5,-0.2,-0.3]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L657_C4", "label": " = max()", "type": "assigned_variable", "loc": [657, 657], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L655_C0", "vector": [14, 1, 0.5723, 0.0009, 1, 0.19, 0.25, 0, 3, 2, 0, 0, 442, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "max", "annotation": ""}, "snippet": " brf[0,0] = max(0.10,brf[0,0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L659_C4", "label": "tlb =", "type": "assigned_variable", "loc": [659, 659], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L655_C0", "vector": [14, 1, 0.574, 0.0009, 1, 0.19, 0.5, 90, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "tlb", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tlb = pt + np.matrix([0.3, 0.2,0.2]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L661_C4", "label": "resolution =", "type": "assigned_variable", "loc": [661, 661], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L655_C0", "vector": [14, 1, 0.5758, 0.0009, 1, 0.19, 0.75, 615, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "resolution", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " resolution = np.matrix([0.01,0.01,0.0025]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Return_L663_C4", "label": "return", "type": "return", "loc": [663, 663], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L655_C0", "vector": [13, 1, 0.5775, 0.0009, 1, 0.19, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return create_grid(brf,tlb,resolution,pos_list,scan_list,l1,l2,display_list,show_pts)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L665_C0", "label": "create_overhead_grasp_choice_grid", "type": "function", "loc": [665, 693], "level": 0, "parent": null, "vector": [2, 0, 0.5915, 0.0253, 0, 0.66, 0.7045, 497, 0, 7, 1, 0, 0, 0, 13], "semantic": {"name": "create_overhead_grasp_choice_grid", "arg_names": ["pt", "pos_list", "scan_list", "l1", "l2", "far_dist", "display_list"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def create_overhead_grasp_choice_grid(pt,pos_list,scan_list,l1,l2,far_dist,display_list=None):\n\n# y_pos = max(pt[1,0]+0.1,0.1)\n# y_neg = min(pt[1,0]-0.1,-0.1)\n#\n# brf = np.matrix([0.2,y_neg,0.0]).T\n# tlb = np.matrix([pt[0,0]+far_dist,y_pos,pt[2,0]+0.75]).T\n#"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L675_C4", "label": "y_pos =", "type": "assigned_variable", "loc": [675, 675], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L665_C0", "vector": [14, 1, 0.588, 0.0009, 1, 0.11, 0.0, 908, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "y_pos", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " y_pos = 0.1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L676_C4", "label": "y_neg =", "type": "assigned_variable", "loc": [676, 676], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L665_C0", "vector": [14, 1, 0.5889, 0.0009, 1, 0.11, 0.1, 816, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "y_neg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " y_neg = -0.1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L678_C4", "label": "r = norm()", "type": "assigned_variable", "loc": [678, 678], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L665_C0", "vector": [14, 1, 0.5906, 0.0009, 1, 0.11, 0.2, 436, 3, 1, 0, 0, 902, 10, 1], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "norm", "annotation": ""}, "snippet": " r = np.linalg.norm(pt[0:2,0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L679_C4", "label": "brf =", "type": "assigned_variable", "loc": [679, 679], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L665_C0", "vector": [14, 1, 0.5915, 0.0009, 1, 0.11, 0.3, 17, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "brf", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " brf = np.matrix([0.25,y_neg,0.0]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L680_C4", "label": "tlb =", "type": "assigned_variable", "loc": [680, 680], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L665_C0", "vector": [14, 1, 0.5923, 0.0009, 1, 0.11, 0.4, 90, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "tlb", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tlb = np.matrix([r+far_dist,y_pos,pt[2,0]+0.75]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L682_C4", "label": "resolution =", "type": "assigned_variable", "loc": [682, 682], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L665_C0", "vector": [14, 1, 0.5941, 0.0009, 1, 0.11, 0.5, 615, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "resolution", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " resolution = np.matrix([0.02,0.02,0.02]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L683_C4", "label": "rotation_angle = atan2()", "type": "assigned_variable", "loc": [683, 683], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L665_C0", "vector": [14, 1, 0.5949, 0.0009, 1, 0.11, 0.6, 579, 3, 2, 0, 0, 572, 10, 1], "semantic": {"name": "rotation_angle", "arg_names": [], "import_names": [], "rhs_call_name": "atan2", "annotation": ""}, "snippet": " rotation_angle = math.atan2(pt[1,0],pt[0,0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L684_C4", "label": "print()", "type": "expression", "loc": [684, 684], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L665_C0", "vector": [8, 1, 0.5958, 0.0009, 1, 0.11, 0.7, 535, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('rotation_angle:', math.degrees(rotation_angle))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L686_C4", "label": "gr = create_grid()", "type": "assigned_variable", "loc": [686, 686], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L665_C0", "vector": [14, 1, 0.5976, 0.0009, 1, 0.11, 0.8, 8, 3, 9, 0, 0, 416, 10, 1], "semantic": {"name": "gr", "arg_names": [], "import_names": [], "rhs_call_name": "create_grid", "annotation": ""}, "snippet": " gr = create_grid(brf,tlb,resolution,pos_list,scan_list,l1,l2,display_list,rotation_angle=rotation_angle)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L688_C4", "label": "if", "type": "if", "loc": [688, 692], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L665_C0", "vector": [4, 1, 0.601, 0.0044, 1, 0.11, 0.9, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if display_list != None:\n collide_pts = gr.grid_to_points()\n if collide_pts.shape[1] > 0:\n collide_pts = tr.Rz(rotation_angle).T*gr.grid_to_points()\n display_list.insert(0,pu.PointCloud(collide_pts,color=(0,0,0)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L689_C8", "label": "collide_pts = grid_to_points()", "type": "assigned_variable", "loc": [689, 689], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L688_C4", "vector": [14, 2, 0.6002, 0.0009, 2, 0.56, 0.0, 80, 3, 0, 0, 0, 558, 10, 1], "semantic": {"name": "collide_pts", "arg_names": [], "import_names": [], "rhs_call_name": "grid_to_points", "annotation": ""}, "snippet": " collide_pts = gr.grid_to_points()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L690_C8", "label": "if", "type": "if", "loc": [690, 692], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L688_C4", "vector": [4, 2, 0.6019, 0.0026, 2, 0.56, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if collide_pts.shape[1] > 0:\n collide_pts = tr.Rz(rotation_angle).T*gr.grid_to_points()\n display_list.insert(0,pu.PointCloud(collide_pts,color=(0,0,0)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L691_C12", "label": "collide_pts =", "type": "assigned_variable", "loc": [691, 691], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L690_C8", "vector": [14, 3, 0.6019, 0.0009, 3, 0.58, 0.0, 80, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "collide_pts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " collide_pts = tr.Rz(rotation_angle).T*gr.grid_to_points()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L692_C12", "label": "insert()", "type": "expression", "loc": [692, 692], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L690_C8", "vector": [8, 3, 0.6028, 0.0009, 3, 0.58, 1.0, 368, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "insert", "arg_names": [], "import_names": [], "rhs_call_name": "insert", "annotation": ""}, "snippet": " display_list.insert(0,pu.PointCloud(collide_pts,color=(0,0,0)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Return_L693_C4", "label": "return", "type": "return", "loc": [693, 693], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L665_C0", "vector": [13, 1, 0.6037, 0.0009, 1, 0.11, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return gr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L696_C0", "label": "overhead_grasp_collision", "type": "function", "loc": [696, 701], "level": 0, "parent": null, "vector": [2, 0, 0.6084, 0.0052, 0, 0.66, 0.7273, 547, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "overhead_grasp_collision", "arg_names": ["pt", "grid"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def overhead_grasp_collision(pt,grid):\n print('collision points:', grid.grid.sum())\n if grid.grid.sum()>15:\n return True\n else:\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L697_C4", "label": "print()", "type": "expression", "loc": [697, 697], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L696_C0", "vector": [8, 1, 0.6071, 0.0009, 1, 0.11, 0.0, 535, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('collision points:', grid.grid.sum())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L698_C4", "label": "if", "type": "if", "loc": [698, 701], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L696_C0", "vector": [4, 1, 0.6093, 0.0035, 1, 0.11, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if grid.grid.sum()>15:\n return True\n else:\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Return_L699_C8", "label": "return", "type": "return", "loc": [699, 699], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L698_C4", "vector": [13, 2, 0.6089, 0.0009, 2, 0.11, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Return_L701_C8", "label": "return", "type": "return", "loc": [701, 701], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L698_C4", "vector": [13, 2, 0.6106, 0.0009, 2, 0.11, 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_99556:FunctionDef_L704_C0", "label": "grasp_location_on_object", "type": "function", "loc": [704, 832], "level": 0, "parent": null, "vector": [2, 0, 0.669, 0.1124, 0, 0.66, 0.75, 920, 0, 2, 1, 0, 0, 0, 71], "semantic": {"name": "grasp_location_on_object", "arg_names": ["obj", "display_list"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def grasp_location_on_object(obj,display_list=None):\n ''' obj - 3xN numpy matrix of points of the object.\n '''\n\n pts_2d = obj[0:2,:]\n centroid_2d = pts_2d.mean(1)\n pts_2d_zeromean = pts_2d-centroid_2d\n e_vals,e_vecs = np.linalg.eig(pts_2d_zeromean*pts_2d_zeromean.T)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L705_C4", "label": "expression", "type": "expression", "loc": [705, 706], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L704_C0", "vector": [8, 1, 0.6145, 0.0017, 1, 0.82, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' obj - 3xN numpy matrix of points of the object.\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L708_C4", "label": "pts_2d =", "type": "assigned_variable", "loc": [708, 708], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L704_C0", "vector": [14, 1, 0.6167, 0.0009, 1, 0.82, 0.0312, 945, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pts_2d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pts_2d = obj[0:2,:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L709_C4", "label": "centroid_2d = mean()", "type": "assigned_variable", "loc": [709, 709], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L704_C0", "vector": [14, 1, 0.6176, 0.0009, 1, 0.82, 0.0625, 73, 3, 1, 0, 0, 856, 10, 1], "semantic": {"name": "centroid_2d", "arg_names": [], "import_names": [], "rhs_call_name": "mean", "annotation": ""}, "snippet": " centroid_2d = pts_2d.mean(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L710_C4", "label": "pts_2d_zeromean =", "type": "assigned_variable", "loc": [710, 710], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L704_C0", "vector": [14, 1, 0.6185, 0.0009, 1, 0.82, 0.0938, 806, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pts_2d_zeromean", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pts_2d_zeromean = pts_2d-centroid_2d"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L711_C4", "label": "e_vals, e_vecs = eig()", "type": "assigned_variable", "loc": [711, 711], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L704_C0", "vector": [14, 1, 0.6193, 0.0009, 1, 0.82, 0.125, 206, 3, 1, 0, 0, 971, 10, 1], "semantic": {"name": "e_vals, e_vecs", "arg_names": [], "import_names": [], "rhs_call_name": "eig", "annotation": ""}, "snippet": " e_vals,e_vecs = np.linalg.eig(pts_2d_zeromean*pts_2d_zeromean.T)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L714_C4", "label": "min_index = argmin()", "type": "assigned_variable", "loc": [714, 714], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L704_C0", "vector": [14, 1, 0.622, 0.0009, 1, 0.82, 0.1562, 727, 3, 1, 0, 0, 879, 10, 1], "semantic": {"name": "min_index", "arg_names": [], "import_names": [], "rhs_call_name": "argmin", "annotation": ""}, "snippet": " min_index = np.argmin(e_vals)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L715_C4", "label": "min_evec =", "type": "assigned_variable", "loc": [715, 715], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L704_C0", "vector": [14, 1, 0.6228, 0.0009, 1, 0.82, 0.1875, 193, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "min_evec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " min_evec = e_vecs[:,min_index]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L717_C4", "label": "print()", "type": "expression", "loc": [717, 717], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L704_C0", "vector": [8, 1, 0.6246, 0.0009, 1, 0.82, 0.2188, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('min eigenvector:', min_evec.T)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L718_C4", "label": "pts_1d =", "type": "assigned_variable", "loc": [718, 718], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L704_C0", "vector": [14, 1, 0.6254, 0.0009, 1, 0.82, 0.25, 504, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pts_1d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pts_1d = min_evec.T * pts_2d"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L719_C4", "label": "min_size =", "type": "assigned_variable", "loc": [719, 719], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L704_C0", "vector": [14, 1, 0.6263, 0.0009, 1, 0.82, 0.2812, 724, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "min_size", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " min_size = pts_1d.max() - pts_1d.min()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L720_C4", "label": "print()", "type": "expression", "loc": [720, 720], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L704_C0", "vector": [8, 1, 0.6272, 0.0009, 1, 0.82, 0.3125, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('spread along min eigenvector:', min_size)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L722_C4", "label": "max_height = max()", "type": "assigned_variable", "loc": [722, 722], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L704_C0", "vector": [14, 1, 0.6289, 0.0009, 1, 0.82, 0.3438, 648, 3, 0, 0, 0, 442, 10, 1], "semantic": {"name": "max_height", "arg_names": [], "import_names": [], "rhs_call_name": "max", "annotation": ""}, "snippet": " max_height = obj[2,:].max()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L724_C4", "label": "tlb = max()", "type": "assigned_variable", "loc": [724, 724], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L704_C0", "vector": [14, 1, 0.6307, 0.0009, 1, 0.82, 0.375, 90, 3, 1, 0, 0, 442, 10, 1], "semantic": {"name": "tlb", "arg_names": [], "import_names": [], "rhs_call_name": "max", "annotation": ""}, "snippet": " tlb = obj.max(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L725_C4", "label": "brf = min()", "type": "assigned_variable", "loc": [725, 725], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L704_C0", "vector": [14, 1, 0.6315, 0.0009, 1, 0.82, 0.4062, 17, 3, 1, 0, 0, 867, 10, 1], "semantic": {"name": "brf", "arg_names": [], "import_names": [], "rhs_call_name": "min", "annotation": ""}, "snippet": " brf = obj.min(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L726_C4", "label": "print()", "type": "expression", "loc": [726, 726], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L704_C0", "vector": [8, 1, 0.6324, 0.0009, 1, 0.82, 0.4375, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('tlb:', tlb.T)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L727_C4", "label": "print()", "type": "expression", "loc": [727, 727], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L704_C0", "vector": [8, 1, 0.6333, 0.0009, 1, 0.82, 0.4688, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('brf:', brf.T)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L729_C4", "label": "resolution =", "type": "assigned_variable", "loc": [729, 729], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L704_C0", "vector": [14, 1, 0.635, 0.0009, 1, 0.82, 0.5, 615, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "resolution", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " resolution = np.matrix([0.005,0.005,0.005]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L730_C4", "label": "gr = occupancy_grid_3d()", "type": "assigned_variable", "loc": [730, 730], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L704_C0", "vector": [14, 1, 0.6359, 0.0009, 1, 0.82, 0.5312, 8, 3, 3, 0, 0, 222, 10, 1], "semantic": {"name": "gr", "arg_names": [], "import_names": [], "rhs_call_name": "occupancy_grid_3d", "annotation": ""}, "snippet": " gr = og3d.occupancy_grid_3d(brf,tlb,resolution)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L731_C4", "label": "fill_grid()", "type": "expression", "loc": [731, 731], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L704_C0", "vector": [8, 1, 0.6368, 0.0009, 1, 0.82, 0.5625, 619, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "fill_grid", "arg_names": [], "import_names": [], "rhs_call_name": "fill_grid", "annotation": ""}, "snippet": " gr.fill_grid(obj)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L732_C4", "label": "to_binary()", "type": "expression", "loc": [732, 732], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L704_C0", "vector": [8, 1, 0.6376, 0.0009, 1, 0.82, 0.5938, 206, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "to_binary", "arg_names": [], "import_names": [], "rhs_call_name": "to_binary", "annotation": ""}, "snippet": " gr.to_binary(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L733_C4", "label": "obj = grid_to_points()", "type": "assigned_variable", "loc": [733, 733], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L704_C0", "vector": [14, 1, 0.6385, 0.0009, 1, 0.82, 0.625, 505, 3, 0, 0, 0, 558, 10, 1], "semantic": {"name": "obj", "arg_names": [], "import_names": [], "rhs_call_name": "grid_to_points", "annotation": ""}, "snippet": " obj = gr.grid_to_points()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L735_C4", "label": "grid_2d = max()", "type": "assigned_variable", "loc": [735, 735], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L704_C0", "vector": [14, 1, 0.6402, 0.0009, 1, 0.82, 0.6562, 804, 3, 1, 0, 0, 442, 10, 1], "semantic": {"name": "grid_2d", "arg_names": [], "import_names": [], "rhs_call_name": "max", "annotation": ""}, "snippet": " grid_2d = gr.grid.max(2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L736_C4", "label": "grid_2d_filled = binary_fill_holes()", "type": "assigned_variable", "loc": [736, 736], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L704_C0", "vector": [14, 1, 0.6411, 0.0009, 1, 0.82, 0.6875, 928, 3, 1, 0, 0, 385, 10, 1], "semantic": {"name": "grid_2d_filled", "arg_names": [], "import_names": [], "rhs_call_name": "binary_fill_holes", "annotation": ""}, "snippet": " grid_2d_filled = ni.binary_fill_holes(grid_2d)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L737_C4", "label": "assign", "type": "assigned_variable", "loc": [737, 737], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L704_C0", "vector": [14, 1, 0.642, 0.0009, 1, 0.82, 0.7188, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " gr.grid[:,:,0] = gr.grid[:,:,0]+grid_2d_filled-grid_2d"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L739_C4", "label": "p = astype()", "type": "assigned_variable", "loc": [739, 739], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L704_C0", "vector": [14, 1, 0.6437, 0.0009, 1, 0.82, 0.75, 491, 3, 1, 0, 0, 32, 10, 4], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "astype", "annotation": ""}, "snippet": " p = np.matrix(np.row_stack(np.where(grid_2d_filled==1))).astype('float')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L740_C4", "label": "assign", "type": "assigned_variable", "loc": [740, 740], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L704_C0", "vector": [14, 1, 0.6446, 0.0009, 1, 0.82, 0.7812, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p[0,:] = p[0,:]*gr.resolution[0,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L741_C4", "label": "assign", "type": "assigned_variable", "loc": [741, 741], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L704_C0", "vector": [14, 1, 0.6455, 0.0009, 1, 0.82, 0.8125, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p[1,:] = p[1,:]*gr.resolution[1,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L743_C4", "label": "print()", "type": "expression", "loc": [743, 743], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L704_C0", "vector": [8, 1, 0.6472, 0.0009, 1, 0.82, 0.8438, 535, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('new mean:', p.mean(1).T)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L744_C4", "label": "print()", "type": "expression", "loc": [744, 744], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L704_C0", "vector": [8, 1, 0.6481, 0.0009, 1, 0.82, 0.875, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('centroid_2d:', centroid_2d.T)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L745_C4", "label": "centroid_2d = mean()", "type": "assigned_variable", "loc": [745, 745], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L704_C0", "vector": [14, 1, 0.649, 0.0009, 1, 0.82, 0.9062, 73, 3, 1, 0, 0, 856, 10, 1], "semantic": {"name": "centroid_2d", "arg_names": [], "import_names": [], "rhs_call_name": "mean", "annotation": ""}, "snippet": " centroid_2d = p.mean(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L748_C4", "label": "if", "type": "if", "loc": [748, 808], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L704_C0", "vector": [4, 1, 0.6777, 0.0531, 1, 0.82, 0.9375, 0, 0, 0, 0, 0, 0, 0, 32], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if min_size<0.12:\n # grasp at centroid.\n grasp_point = np.row_stack((centroid_2d,np.matrix([max_height+gr.resolution[2,0]*2])))\n# grasp_point[2,0] = max_height\n gripper_angle = -math.atan2(-min_evec[0,0],min_evec[1,0])\n grasp_vec = min_evec\n\n if display_list != None:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L750_C8", "label": "grasp_point = row_stack()", "type": "assigned_variable", "loc": [750, 750], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L748_C4", "vector": [14, 2, 0.6533, 0.0009, 2, 0.16, 0.0, 249, 3, 1, 0, 0, 612, 10, 2], "semantic": {"name": "grasp_point", "arg_names": [], "import_names": [], "rhs_call_name": "row_stack", "annotation": ""}, "snippet": " grasp_point = np.row_stack((centroid_2d,np.matrix([max_height+gr.resolution[2,0]*2])))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L752_C8", "label": "gripper_angle =", "type": "assigned_variable", "loc": [752, 752], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L748_C4", "vector": [14, 2, 0.6551, 0.0009, 2, 0.16, 0.0588, 740, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "gripper_angle", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " gripper_angle = -math.atan2(-min_evec[0,0],min_evec[1,0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L753_C8", "label": "grasp_vec =", "type": "assigned_variable", "loc": [753, 753], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L748_C4", "vector": [14, 2, 0.6559, 0.0009, 2, 0.16, 0.1176, 955, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "grasp_vec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " grasp_vec = min_evec"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L755_C8", "label": "if", "type": "if", "loc": [755, 764], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L748_C4", "vector": [4, 2, 0.6616, 0.0087, 2, 0.16, 0.1765, 0, 0, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if display_list != None:\n max_index = np.argmax(e_vals)\n max_evec = e_vecs[:,max_index]\n pts_1d = max_evec.T * pts_2d\n max_size = pts_1d.max() - pts_1d.min()\n\n v = np.row_stack((max_evec,np.matrix([0.])))\n max_end_pt1 = grasp_point + v*max_size/2."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L756_C12", "label": "max_index = argmax()", "type": "assigned_variable", "loc": [756, 756], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L755_C8", "vector": [14, 3, 0.6585, 0.0009, 3, 0.48, 0.0, 277, 3, 1, 0, 0, 593, 10, 1], "semantic": {"name": "max_index", "arg_names": [], "import_names": [], "rhs_call_name": "argmax", "annotation": ""}, "snippet": " max_index = np.argmax(e_vals)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L757_C12", "label": "max_evec =", "type": "assigned_variable", "loc": [757, 757], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L755_C8", "vector": [14, 3, 0.6594, 0.0009, 3, 0.48, 0.1429, 69, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "max_evec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " max_evec = e_vecs[:,max_index]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L758_C12", "label": "pts_1d =", "type": "assigned_variable", "loc": [758, 758], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L755_C8", "vector": [14, 3, 0.6603, 0.0009, 3, 0.48, 0.2857, 504, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pts_1d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pts_1d = max_evec.T * pts_2d"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L759_C12", "label": "max_size =", "type": "assigned_variable", "loc": [759, 759], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L755_C8", "vector": [14, 3, 0.6611, 0.0009, 3, 0.48, 0.4286, 831, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "max_size", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " max_size = pts_1d.max() - pts_1d.min()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L761_C12", "label": "v = row_stack()", "type": "assigned_variable", "loc": [761, 761], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L755_C8", "vector": [14, 3, 0.6629, 0.0009, 3, 0.48, 0.5714, 553, 3, 1, 0, 0, 612, 10, 2], "semantic": {"name": "v", "arg_names": [], "import_names": [], "rhs_call_name": "row_stack", "annotation": ""}, "snippet": " v = np.row_stack((max_evec,np.matrix([0.])))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L762_C12", "label": "max_end_pt1 =", "type": "assigned_variable", "loc": [762, 762], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L755_C8", "vector": [14, 3, 0.6638, 0.0009, 3, 0.48, 0.7143, 851, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "max_end_pt1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " max_end_pt1 = grasp_point + v*max_size/2."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L763_C12", "label": "max_end_pt2 =", "type": "assigned_variable", "loc": [763, 763], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L755_C8", "vector": [14, 3, 0.6646, 0.0009, 3, 0.48, 0.8571, 125, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "max_end_pt2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " max_end_pt2 = grasp_point - v*max_size/2."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L764_C12", "label": "append()", "type": "expression", "loc": [764, 764], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L755_C8", "vector": [8, 3, 0.6655, 0.0009, 3, 0.48, 1.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " display_list.append(pu.Line(max_end_pt1,max_end_pt2,color=(0,0,0)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L768_C8", "label": "for i", "type": "for", "loc": [768, 769], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L748_C4", "vector": [6, 2, 0.6694, 0.0017, 2, 0.16, 0.2353, 826, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(gr.grid_shape[2,0]):\n gr.grid[:,:,i] = gr.grid[:,:,i]*(i+1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L769_C12", "label": "assign", "type": "assigned_variable", "loc": [769, 769], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L768_C8", "vector": [14, 3, 0.6699, 0.0009, 3, 0.09, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " gr.grid[:,:,i] = gr.grid[:,:,i]*(i+1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L771_C8", "label": "height_map =", "type": "assigned_variable", "loc": [771, 771], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L748_C4", "vector": [14, 2, 0.6716, 0.0009, 2, 0.16, 0.2941, 869, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "height_map", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " height_map = gr.grid.max(2) * gr.resolution[2,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L773_C8", "label": "print()", "type": "expression", "loc": [773, 773], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L748_C4", "vector": [8, 2, 0.6733, 0.0009, 2, 0.16, 0.3529, 535, 3, 2, 0, 0, 0, 0, 4], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('height std deviation:',math.sqrt(height_map[np.where(height_map>0.)].var()))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L788_C8", "label": "high_pts_2d =", "type": "assigned_variable", "loc": [788, 788], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L748_C4", "vector": [14, 2, 0.6864, 0.0009, 2, 0.16, 0.4118, 577, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "high_pts_2d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " high_pts_2d = obj[0:2,np.where(obj[2,:]>max_height-0.005)[1].A1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L790_C8", "label": "high_pts_1d = norm()", "type": "assigned_variable", "loc": [790, 790], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L748_C4", "vector": [14, 2, 0.6882, 0.0009, 2, 0.16, 0.4706, 977, 3, 1, 0, 0, 902, 10, 1], "semantic": {"name": "high_pts_1d", "arg_names": [], "import_names": [], "rhs_call_name": "norm", "annotation": ""}, "snippet": " high_pts_1d = ut.norm(high_pts_2d)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L791_C8", "label": "idx1 = argmin()", "type": "assigned_variable", "loc": [791, 791], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L748_C4", "vector": [14, 2, 0.689, 0.0009, 2, 0.16, 0.5294, 409, 3, 1, 0, 0, 879, 10, 1], "semantic": {"name": "idx1", "arg_names": [], "import_names": [], "rhs_call_name": "argmin", "annotation": ""}, "snippet": " idx1 = np.argmin(high_pts_1d)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L792_C8", "label": "pt1 =", "type": "assigned_variable", "loc": [792, 792], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L748_C4", "vector": [14, 2, 0.6899, 0.0009, 2, 0.16, 0.5882, 211, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pt1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pt1 = high_pts_2d[:,idx1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L794_C8", "label": "idx2 = argmax()", "type": "assigned_variable", "loc": [794, 794], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L748_C4", "vector": [14, 2, 0.6916, 0.0009, 2, 0.16, 0.6471, 566, 3, 1, 0, 0, 593, 10, 1], "semantic": {"name": "idx2", "arg_names": [], "import_names": [], "rhs_call_name": "argmax", "annotation": ""}, "snippet": " idx2 = np.argmax(high_pts_1d)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L795_C8", "label": "pt2 =", "type": "assigned_variable", "loc": [795, 795], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L748_C4", "vector": [14, 2, 0.6925, 0.0009, 2, 0.16, 0.7059, 351, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pt2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pt2 = high_pts_2d[:,idx2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L797_C8", "label": "if", "type": "if", "loc": [797, 800], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L748_C4", "vector": [4, 2, 0.6956, 0.0035, 2, 0.16, 0.7647, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if np.linalg.norm(pt1)<np.linalg.norm(pt2):\n grasp_point = np.row_stack((pt1,np.matrix([max_height])))\n else:\n grasp_point = np.row_stack((pt2,np.matrix([max_height])))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L798_C12", "label": "grasp_point = row_stack()", "type": "assigned_variable", "loc": [798, 798], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L797_C8", "vector": [14, 3, 0.6951, 0.0009, 3, 0.88, 0.0, 249, 3, 1, 0, 0, 612, 10, 2], "semantic": {"name": "grasp_point", "arg_names": [], "import_names": [], "rhs_call_name": "row_stack", "annotation": ""}, "snippet": " grasp_point = np.row_stack((pt1,np.matrix([max_height])))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L800_C12", "label": "grasp_point = row_stack()", "type": "assigned_variable", "loc": [800, 800], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L797_C8", "vector": [14, 3, 0.6969, 0.0009, 3, 0.88, 1.0, 249, 3, 1, 0, 0, 612, 10, 2], "semantic": {"name": "grasp_point", "arg_names": [], "import_names": [], "rhs_call_name": "row_stack", "annotation": ""}, "snippet": " grasp_point = np.row_stack((pt2,np.matrix([max_height])))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L802_C8", "label": "vec =", "type": "assigned_variable", "loc": [802, 802], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L748_C4", "vector": [14, 2, 0.6986, 0.0009, 2, 0.16, 0.8235, 132, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "vec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " vec = centroid_2d-grasp_point[0:2,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L803_C8", "label": "gripper_angle =", "type": "assigned_variable", "loc": [803, 803], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L748_C4", "vector": [14, 2, 0.6995, 0.0009, 2, 0.16, 0.8824, 740, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "gripper_angle", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " gripper_angle = -math.atan2(-vec[0,0],vec[1,0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L804_C8", "label": "grasp_vec =", "type": "assigned_variable", "loc": [804, 804], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L748_C4", "vector": [14, 2, 0.7003, 0.0009, 2, 0.16, 0.9412, 955, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "grasp_vec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " grasp_vec = vec/np.linalg.norm(vec)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L806_C8", "label": "if", "type": "if", "loc": [806, 808], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L748_C4", "vector": [4, 2, 0.703, 0.0026, 2, 0.16, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if display_list != None:\n pt1 = np.row_stack((pt1,np.matrix([max_height])))\n pt2 = np.row_stack((pt2,np.matrix([max_height])))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L807_C12", "label": "pt1 = row_stack()", "type": "assigned_variable", "loc": [807, 807], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L806_C8", "vector": [14, 3, 0.703, 0.0009, 3, 0.46, 0.0, 211, 3, 1, 0, 0, 612, 10, 2], "semantic": {"name": "pt1", "arg_names": [], "import_names": [], "rhs_call_name": "row_stack", "annotation": ""}, "snippet": " pt1 = np.row_stack((pt1,np.matrix([max_height])))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L808_C12", "label": "pt2 = row_stack()", "type": "assigned_variable", "loc": [808, 808], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L806_C8", "vector": [14, 3, 0.7038, 0.0009, 3, 0.46, 1.0, 351, 3, 1, 0, 0, 612, 10, 2], "semantic": {"name": "pt2", "arg_names": [], "import_names": [], "rhs_call_name": "row_stack", "annotation": ""}, "snippet": " pt2 = np.row_stack((pt2,np.matrix([max_height])))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L813_C4", "label": "if", "type": "if", "loc": [813, 830], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L704_C0", "vector": [4, 1, 0.7156, 0.0157, 1, 0.82, 0.9688, 0, 0, 0, 0, 0, 0, 0, 12], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if display_list != None:\n pts = gr.grid_to_points()\n size = resolution\n# size = resolution*2\n# size[2,0] = size[2,0]*2\n #display_list.insert(0,pu.PointCloud(pts,(200,0,0)))\n display_list.append(pu.CubeCloud(pts,color=(200,0,0),size=size))\n display_list.append(pu.CubeCloud(grasp_point,(0,200,200),size=(0.007,0.007,0.007)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L814_C8", "label": "pts = grid_to_points()", "type": "assigned_variable", "loc": [814, 814], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L813_C4", "vector": [14, 2, 0.7091, 0.0009, 2, 0.11, 0.0, 195, 3, 0, 0, 0, 558, 10, 1], "semantic": {"name": "pts", "arg_names": [], "import_names": [], "rhs_call_name": "grid_to_points", "annotation": ""}, "snippet": " pts = gr.grid_to_points()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L815_C8", "label": "size =", "type": "assigned_variable", "loc": [815, 815], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L813_C4", "vector": [14, 2, 0.7099, 0.0009, 2, 0.11, 0.1, 714, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "size", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " size = resolution"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L819_C8", "label": "append()", "type": "expression", "loc": [819, 819], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L813_C4", "vector": [8, 2, 0.7134, 0.0009, 2, 0.11, 0.2, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " display_list.append(pu.CubeCloud(pts,color=(200,0,0),size=size))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L820_C8", "label": "append()", "type": "expression", "loc": [820, 820], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L813_C4", "vector": [8, 2, 0.7143, 0.0009, 2, 0.11, 0.3, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " display_list.append(pu.CubeCloud(grasp_point,(0,200,200),size=(0.007,0.007,0.007)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L822_C8", "label": "v = row_stack()", "type": "assigned_variable", "loc": [822, 822], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L813_C4", "vector": [14, 2, 0.716, 0.0009, 2, 0.11, 0.4, 553, 3, 1, 0, 0, 612, 10, 2], "semantic": {"name": "v", "arg_names": [], "import_names": [], "rhs_call_name": "row_stack", "annotation": ""}, "snippet": " v = np.row_stack((grasp_vec,np.matrix([0.])))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L823_C8", "label": "min_end_pt1 =", "type": "assigned_variable", "loc": [823, 823], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L813_C4", "vector": [14, 2, 0.7169, 0.0009, 2, 0.11, 0.5, 891, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "min_end_pt1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " min_end_pt1 = grasp_point + v*min_size/2."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L824_C8", "label": "min_end_pt2 =", "type": "assigned_variable", "loc": [824, 824], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L813_C4", "vector": [14, 2, 0.7178, 0.0009, 2, 0.11, 0.6, 242, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "min_end_pt2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " min_end_pt2 = grasp_point - v*min_size/2."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L826_C8", "label": "max_evec =", "type": "assigned_variable", "loc": [826, 826], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L813_C4", "vector": [14, 2, 0.7195, 0.0009, 2, 0.11, 0.7, 69, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "max_evec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " max_evec = np.matrix((min_evec[1,0],-min_evec[0,0])).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L827_C8", "label": "pts_1d =", "type": "assigned_variable", "loc": [827, 827], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L813_C4", "vector": [14, 2, 0.7204, 0.0009, 2, 0.11, 0.8, 504, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pts_1d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pts_1d = max_evec.T * pts_2d"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L828_C8", "label": "max_size =", "type": "assigned_variable", "loc": [828, 828], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L813_C4", "vector": [14, 2, 0.7213, 0.0009, 2, 0.11, 0.9, 831, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "max_size", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " max_size = pts_1d.max() - pts_1d.min()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L830_C8", "label": "append()", "type": "expression", "loc": [830, 830], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L813_C4", "vector": [8, 2, 0.723, 0.0009, 2, 0.11, 1.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " display_list.append(pu.Line(min_end_pt1,min_end_pt2,color=(0,255,0)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Return_L832_C4", "label": "return", "type": "return", "loc": [832, 832], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L704_C0", "vector": [13, 1, 0.7247, 0.0009, 1, 0.82, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return grasp_point,gripper_angle"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L838_C0", "label": "test_vertical_plane_finding", "type": "function", "loc": [838, 847], "level": 0, "parent": null, "vector": [2, 0, 0.7339, 0.0087, 0, 0.66, 0.7727, 810, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "test_vertical_plane_finding", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def test_vertical_plane_finding():\n display_list = []\n rot_angle = dict['rot_angle']\n gr = create_vertical_plane_grid(pt,pos_list,scan_list,l1,l2,rotation_angle=rot_angle,\n display_list=display_list)\n\n vertical_plane_points(gr)\n plane_cloud = pu.PointCloud(gr.grid_to_points(),color=(0,150,0))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L839_C4", "label": "display_list =", "type": "assigned_variable", "loc": [839, 839], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L838_C0", "vector": [14, 1, 0.7308, 0.0009, 1, 0.97, 0.0, 230, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "display_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " display_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L840_C4", "label": "rot_angle =", "type": "assigned_variable", "loc": [840, 840], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L838_C0", "vector": [14, 1, 0.7317, 0.0009, 1, 0.97, 0.1667, 748, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "rot_angle", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rot_angle = dict['rot_angle']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L841_C4", "label": "gr = create_vertical_plane_grid()", "type": "assigned_variable", "loc": [841, 842], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L838_C0", "vector": [14, 1, 0.733, 0.0017, 1, 0.97, 0.3333, 8, 3, 7, 0, 0, 870, 10, 1], "semantic": {"name": "gr", "arg_names": [], "import_names": [], "rhs_call_name": "create_vertical_plane_grid", "annotation": ""}, "snippet": " gr = create_vertical_plane_grid(pt,pos_list,scan_list,l1,l2,rotation_angle=rot_angle,\n display_list=display_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L844_C4", "label": "vertical_plane_points()", "type": "expression", "loc": [844, 844], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L838_C0", "vector": [8, 1, 0.7352, 0.0009, 1, 0.97, 0.5, 968, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "vertical_plane_points", "arg_names": [], "import_names": [], "rhs_call_name": "vertical_plane_points", "annotation": ""}, "snippet": " vertical_plane_points(gr)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L845_C4", "label": "plane_cloud = PointCloud()", "type": "assigned_variable", "loc": [845, 845], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L838_C0", "vector": [14, 1, 0.7361, 0.0009, 1, 0.97, 0.6667, 416, 3, 2, 0, 0, 428, 10, 2], "semantic": {"name": "plane_cloud", "arg_names": [], "import_names": [], "rhs_call_name": "PointCloud", "annotation": ""}, "snippet": " plane_cloud = pu.PointCloud(gr.grid_to_points(),color=(0,150,0))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L846_C4", "label": "insert()", "type": "expression", "loc": [846, 846], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L838_C0", "vector": [8, 1, 0.7369, 0.0009, 1, 0.97, 0.8333, 368, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "insert", "arg_names": [], "import_names": [], "rhs_call_name": "insert", "annotation": ""}, "snippet": " display_list.insert(0,plane_cloud)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L847_C4", "label": "run()", "type": "expression", "loc": [847, 847], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L838_C0", "vector": [8, 1, 0.7378, 0.0009, 1, 0.97, 1.0, 679, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "run", "arg_names": [], "import_names": [], "rhs_call_name": "run", "annotation": ""}, "snippet": " po3d.run(display_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L849_C0", "label": "test_find_door_handle", "type": "function", "loc": [849, 882], "level": 0, "parent": null, "vector": [2, 0, 0.7539, 0.0296, 0, 0.66, 0.7955, 629, 0, 0, 0, 0, 0, 0, 24], "semantic": {"name": "test_find_door_handle", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def test_find_door_handle():\n display_list = []\n rot_angle = dict['rot_angle']\n# pt[2,0] += 0.15\n print('pt:',pt.A1.tolist())\n gr = create_vertical_plane_grid(pt,pos_list,scan_list,l1,l2,rotation_angle=rot_angle,\n display_list=display_list)\n grid_pts_cloud = pu.PointCloud(gr.grid_to_points(),(0,0,255))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L850_C4", "label": "display_list =", "type": "assigned_variable", "loc": [850, 850], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L849_C0", "vector": [14, 1, 0.7404, 0.0009, 1, 0.49, 0.0, 230, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "display_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " display_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L851_C4", "label": "rot_angle =", "type": "assigned_variable", "loc": [851, 851], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L849_C0", "vector": [14, 1, 0.7413, 0.0009, 1, 0.49, 0.0667, 748, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "rot_angle", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rot_angle = dict['rot_angle']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L853_C4", "label": "print()", "type": "expression", "loc": [853, 853], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L849_C0", "vector": [8, 1, 0.743, 0.0009, 1, 0.49, 0.1333, 535, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('pt:',pt.A1.tolist())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L854_C4", "label": "gr = create_vertical_plane_grid()", "type": "assigned_variable", "loc": [854, 855], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L849_C0", "vector": [14, 1, 0.7443, 0.0017, 1, 0.49, 0.2, 8, 3, 7, 0, 0, 870, 10, 1], "semantic": {"name": "gr", "arg_names": [], "import_names": [], "rhs_call_name": "create_vertical_plane_grid", "annotation": ""}, "snippet": " gr = create_vertical_plane_grid(pt,pos_list,scan_list,l1,l2,rotation_angle=rot_angle,\n display_list=display_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L856_C4", "label": "grid_pts_cloud = PointCloud()", "type": "assigned_variable", "loc": [856, 856], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L849_C0", "vector": [14, 1, 0.7456, 0.0009, 1, 0.49, 0.2667, 714, 3, 2, 0, 0, 428, 10, 2], "semantic": {"name": "grid_pts_cloud", "arg_names": [], "import_names": [], "rhs_call_name": "PointCloud", "annotation": ""}, "snippet": " grid_pts_cloud = pu.PointCloud(gr.grid_to_points(),(0,0,255))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L857_C4", "label": "insert()", "type": "expression", "loc": [857, 857], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L849_C0", "vector": [8, 1, 0.7465, 0.0009, 1, 0.49, 0.3333, 368, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "insert", "arg_names": [], "import_names": [], "rhs_call_name": "insert", "annotation": ""}, "snippet": " display_list.insert(0,grid_pts_cloud)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L858_C4", "label": "copy_gr = deepcopy()", "type": "assigned_variable", "loc": [858, 858], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L849_C0", "vector": [14, 1, 0.7474, 0.0009, 1, 0.49, 0.4, 591, 3, 1, 0, 0, 44, 10, 1], "semantic": {"name": "copy_gr", "arg_names": [], "import_names": [], "rhs_call_name": "deepcopy", "annotation": ""}, "snippet": " copy_gr = copy.deepcopy(gr)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L860_C4", "label": "obj_pts_list =", "type": "assigned_variable", "loc": [860, 860], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L849_C0", "vector": [14, 1, 0.7491, 0.0009, 1, 0.49, 0.4667, 157, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "obj_pts_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " obj_pts_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L861_C4", "label": "print()", "type": "expression", "loc": [861, 861], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L849_C0", "vector": [8, 1, 0.75, 0.0009, 1, 0.49, 0.5333, 535, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('pt:',pt.A1.tolist())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L864_C4", "label": "handle_object = find_door_handle()", "type": "assigned_variable", "loc": [864, 865], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L849_C0", "vector": [14, 1, 0.753, 0.0017, 1, 0.49, 0.6, 559, 3, 6, 0, 0, 854, 10, 2], "semantic": {"name": "handle_object", "arg_names": [], "import_names": [], "rhs_call_name": "find_door_handle", "annotation": ""}, "snippet": " handle_object = find_door_handle(gr,pt,obj_pts_list,rotation_angle=rot_angle,\n occupancy_threshold=1,resolution=np.matrix([0.02,0.0025,0.02]).T)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L867_C4", "label": "remove_vertical_plane()", "type": "expression", "loc": [867, 867], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L849_C0", "vector": [8, 1, 0.7552, 0.0009, 1, 0.49, 0.6667, 627, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "remove_vertical_plane", "arg_names": [], "import_names": [], "rhs_call_name": "remove_vertical_plane", "annotation": ""}, "snippet": " copy_gr.remove_vertical_plane()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L868_C4", "label": "stickout_pts_cloud = PointCloud()", "type": "assigned_variable", "loc": [868, 868], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L849_C0", "vector": [14, 1, 0.7561, 0.0009, 1, 0.49, 0.7333, 320, 3, 2, 0, 0, 428, 10, 2], "semantic": {"name": "stickout_pts_cloud", "arg_names": [], "import_names": [], "rhs_call_name": "PointCloud", "annotation": ""}, "snippet": " stickout_pts_cloud = pu.PointCloud(copy_gr.grid_to_points(),(100,100,100))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L869_C4", "label": "insert()", "type": "expression", "loc": [869, 869], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L849_C0", "vector": [8, 1, 0.757, 0.0009, 1, 0.49, 0.8, 368, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "insert", "arg_names": [], "import_names": [], "rhs_call_name": "insert", "annotation": ""}, "snippet": " display_list.insert(0,stickout_pts_cloud)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L872_C4", "label": "for i, obj_pts", "type": "for", "loc": [872, 879], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L849_C0", "vector": [6, 1, 0.7626, 0.007, 1, 0.49, 0.8667, 852, 3, 0, 0, 0, 0, 0, 7], "semantic": {"name": "i, obj_pts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i,obj_pts in enumerate(obj_pts_list):\n print('mean:', obj_pts.mean(1).A1.tolist())\n size = [0.02,0.0025,0.02] # look at param for find_door_handle\n# size=gr.resolution.A1.tolist()\n size[0] = size[0]*2\n size[1] = size[1]*2\n# size[2] = size[2]*2\n display_list.append(pu.CubeCloud(obj_pts,color=color_list[i%len(color_list)],size=size))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L873_C8", "label": "print()", "type": "expression", "loc": [873, 873], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L872_C4", "vector": [8, 2, 0.7605, 0.0009, 2, 0.82, 0.0, 535, 3, 2, 0, 0, 0, 0, 3], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('mean:', obj_pts.mean(1).A1.tolist())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L874_C8", "label": "size =", "type": "assigned_variable", "loc": [874, 874], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L872_C4", "vector": [14, 2, 0.7613, 0.0009, 2, 0.82, 0.25, 714, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "size", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " size = [0.02,0.0025,0.02] # look at param for find_door_handle"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L876_C8", "label": "assign", "type": "assigned_variable", "loc": [876, 876], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L872_C4", "vector": [14, 2, 0.7631, 0.0009, 2, 0.82, 0.5, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " size[0] = size[0]*2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L877_C8", "label": "assign", "type": "assigned_variable", "loc": [877, 877], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L872_C4", "vector": [14, 2, 0.7639, 0.0009, 2, 0.82, 0.75, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " size[1] = size[1]*2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L879_C8", "label": "append()", "type": "expression", "loc": [879, 879], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L872_C4", "vector": [8, 2, 0.7657, 0.0009, 2, 0.82, 1.0, 243, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " display_list.append(pu.CubeCloud(obj_pts,color=color_list[i%len(color_list)],size=size))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L881_C4", "label": "laser_point_cloud = CubeCloud()", "type": "assigned_variable", "loc": [881, 881], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L849_C0", "vector": [14, 1, 0.7674, 0.0009, 1, 0.49, 0.9333, 189, 3, 3, 0, 0, 751, 10, 1], "semantic": {"name": "laser_point_cloud", "arg_names": [], "import_names": [], "rhs_call_name": "CubeCloud", "annotation": ""}, "snippet": " laser_point_cloud = pu.CubeCloud(pt,color=(0,200,0),size=(0.005,0.005,0.005))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L882_C4", "label": "run()", "type": "expression", "loc": [882, 882], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L849_C0", "vector": [8, 1, 0.7683, 0.0009, 1, 0.49, 1.0, 679, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "run", "arg_names": [], "import_names": [], "rhs_call_name": "run", "annotation": ""}, "snippet": " po3d.run(display_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L885_C0", "label": "test_segmentation", "type": "function", "loc": [885, 906], "level": 0, "parent": null, "vector": [2, 0, 0.7801, 0.0192, 0, 0.66, 0.8182, 791, 0, 0, 0, 0, 0, 0, 13], "semantic": {"name": "test_segmentation", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def test_segmentation():\n gr = create_segmentation_grid(pt,pos_list,scan_list,l1,l2,\n display_flag=True)\n obj_pts_list = segment_objects_points(gr)\n if obj_pts_list == None:\n print('There is no plane')\n obj_pts_list = []\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L886_C4", "label": "gr = create_segmentation_grid()", "type": "assigned_variable", "loc": [886, 887], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L885_C0", "vector": [14, 1, 0.7722, 0.0017, 1, 0.41, 0.0, 8, 3, 6, 0, 0, 225, 10, 1], "semantic": {"name": "gr", "arg_names": [], "import_names": [], "rhs_call_name": "create_segmentation_grid", "annotation": ""}, "snippet": " gr = create_segmentation_grid(pt,pos_list,scan_list,l1,l2,\n display_flag=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L888_C4", "label": "obj_pts_list = segment_objects_points()", "type": "assigned_variable", "loc": [888, 888], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L885_C0", "vector": [14, 1, 0.7735, 0.0009, 1, 0.41, 0.1429, 157, 3, 1, 0, 0, 879, 10, 1], "semantic": {"name": "obj_pts_list", "arg_names": [], "import_names": [], "rhs_call_name": "segment_objects_points", "annotation": ""}, "snippet": " obj_pts_list = segment_objects_points(gr)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L889_C4", "label": "if", "type": "if", "loc": [889, 891], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L885_C0", "vector": [4, 1, 0.7753, 0.0026, 1, 0.41, 0.2857, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if obj_pts_list == None:\n print('There is no plane')\n obj_pts_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L890_C8", "label": "print()", "type": "expression", "loc": [890, 890], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L889_C4", "vector": [8, 2, 0.7753, 0.0009, 2, 0.39, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('There is no plane')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L891_C8", "label": "obj_pts_list =", "type": "assigned_variable", "loc": [891, 891], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L889_C4", "vector": [14, 2, 0.7761, 0.0009, 2, 0.39, 1.0, 157, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "obj_pts_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " obj_pts_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L894_C4", "label": "pts = grid_to_points()", "type": "assigned_variable", "loc": [894, 894], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L885_C0", "vector": [14, 1, 0.7787, 0.0009, 1, 0.41, 0.4286, 195, 3, 0, 0, 0, 558, 10, 1], "semantic": {"name": "pts", "arg_names": [], "import_names": [], "rhs_call_name": "grid_to_points", "annotation": ""}, "snippet": " pts = gr.grid_to_points()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L895_C4", "label": "plot_points()", "type": "expression", "loc": [895, 895], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L885_C0", "vector": [8, 1, 0.7796, 0.0009, 1, 0.41, 0.5714, 111, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "plot_points", "arg_names": [], "import_names": [], "rhs_call_name": "plot_points", "annotation": ""}, "snippet": " d3m.plot_points(pts,color=(1.,1.,1.))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L896_C4", "label": "plot_points()", "type": "expression", "loc": [896, 896], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L885_C0", "vector": [8, 1, 0.7805, 0.0009, 1, 0.41, 0.7143, 111, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "plot_points", "arg_names": [], "import_names": [], "rhs_call_name": "plot_points", "annotation": ""}, "snippet": " d3m.plot_points(pt,color=(0,1,0.),mode='sphere')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L898_C4", "label": "for i, obj_pts", "type": "for", "loc": [898, 904], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L885_C0", "vector": [6, 1, 0.7848, 0.0061, 1, 0.41, 0.8571, 852, 3, 0, 0, 0, 0, 0, 6], "semantic": {"name": "i, obj_pts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i,obj_pts in enumerate(obj_pts_list):\n size=gr.resolution.A1.tolist()\n size[2] = size[2]*2\n d3m.plot_points(obj_pts,color=color_list[i%len(color_list)])\n# display_list.append(pu.CubeCloud(obj_pts,color=color_list[i%len(color_list)],size=size))\n #display_list.insert(0,pu.PointCloud(obj_pts,color=color_list[i%len(color_list)]))\n print('mean:', obj_pts.mean(1).T)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L899_C8", "label": "size = tolist()", "type": "assigned_variable", "loc": [899, 899], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L898_C4", "vector": [14, 2, 0.7831, 0.0009, 2, 0.16, 0.0, 714, 3, 0, 0, 0, 185, 10, 1], "semantic": {"name": "size", "arg_names": [], "import_names": [], "rhs_call_name": "tolist", "annotation": ""}, "snippet": " size=gr.resolution.A1.tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L900_C8", "label": "assign", "type": "assigned_variable", "loc": [900, 900], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L898_C4", "vector": [14, 2, 0.784, 0.0009, 2, 0.16, 0.3333, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " size[2] = size[2]*2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L901_C8", "label": "plot_points()", "type": "expression", "loc": [901, 901], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L898_C4", "vector": [8, 2, 0.7848, 0.0009, 2, 0.16, 0.6667, 111, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "plot_points", "arg_names": [], "import_names": [], "rhs_call_name": "plot_points", "annotation": ""}, "snippet": " d3m.plot_points(obj_pts,color=color_list[i%len(color_list)])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L904_C8", "label": "print()", "type": "expression", "loc": [904, 904], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L898_C4", "vector": [8, 2, 0.7875, 0.0009, 2, 0.16, 1.0, 535, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('mean:', obj_pts.mean(1).T)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L906_C4", "label": "show()", "type": "expression", "loc": [906, 906], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L885_C0", "vector": [8, 1, 0.7892, 0.0009, 1, 0.41, 1.0, 497, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "show", "arg_names": [], "import_names": [], "rhs_call_name": "show", "annotation": ""}, "snippet": " d3m.show()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L909_C0", "label": "test_grasp_location_on_object", "type": "function", "loc": [909, 917], "level": 0, "parent": null, "vector": [2, 0, 0.7953, 0.0078, 0, 0.66, 0.8409, 272, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "test_grasp_location_on_object", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def test_grasp_location_on_object():\n display_list = []\n# display_list = None\n gr = create_segmentation_grid(pt,pos_list,scan_list,l1,l2,display_list=display_list)\n obj_pts_list = segment_objects_points(gr)\n closest_obj = find_closest_object(obj_pts_list,pt)\n grasp_location_on_object(closest_obj,display_list)\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L910_C4", "label": "display_list =", "type": "assigned_variable", "loc": [910, 910], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L909_C0", "vector": [14, 1, 0.7927, 0.0009, 1, 0.71, 0.0, 230, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "display_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " display_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L912_C4", "label": "gr = create_segmentation_grid()", "type": "assigned_variable", "loc": [912, 912], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L909_C0", "vector": [14, 1, 0.7944, 0.0009, 1, 0.71, 0.2, 8, 3, 6, 0, 0, 225, 10, 1], "semantic": {"name": "gr", "arg_names": [], "import_names": [], "rhs_call_name": "create_segmentation_grid", "annotation": ""}, "snippet": " gr = create_segmentation_grid(pt,pos_list,scan_list,l1,l2,display_list=display_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L913_C4", "label": "obj_pts_list = segment_objects_points()", "type": "assigned_variable", "loc": [913, 913], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L909_C0", "vector": [14, 1, 0.7953, 0.0009, 1, 0.71, 0.4, 157, 3, 1, 0, 0, 879, 10, 1], "semantic": {"name": "obj_pts_list", "arg_names": [], "import_names": [], "rhs_call_name": "segment_objects_points", "annotation": ""}, "snippet": " obj_pts_list = segment_objects_points(gr)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L914_C4", "label": "closest_obj = find_closest_object()", "type": "assigned_variable", "loc": [914, 914], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L909_C0", "vector": [14, 1, 0.7962, 0.0009, 1, 0.71, 0.6, 232, 3, 2, 0, 0, 121, 10, 1], "semantic": {"name": "closest_obj", "arg_names": [], "import_names": [], "rhs_call_name": "find_closest_object", "annotation": ""}, "snippet": " closest_obj = find_closest_object(obj_pts_list,pt)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L915_C4", "label": "grasp_location_on_object()", "type": "expression", "loc": [915, 915], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L909_C0", "vector": [8, 1, 0.797, 0.0009, 1, 0.71, 0.8, 920, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "grasp_location_on_object", "arg_names": [], "import_names": [], "rhs_call_name": "grasp_location_on_object", "annotation": ""}, "snippet": " grasp_location_on_object(closest_obj,display_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L917_C4", "label": "run()", "type": "expression", "loc": [917, 917], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L909_C0", "vector": [8, 1, 0.7988, 0.0009, 1, 0.71, 1.0, 679, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "run", "arg_names": [], "import_names": [], "rhs_call_name": "run", "annotation": ""}, "snippet": " po3d.run(display_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L919_C0", "label": "test_plane_finding", "type": "function", "loc": [919, 965], "level": 0, "parent": null, "vector": [2, 0, 0.8206, 0.0409, 0, 0.66, 0.8636, 9, 0, 0, 0, 0, 0, 0, 28], "semantic": {"name": "test_plane_finding", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def test_plane_finding():\n ''' visualize plane finding.\n '''\n# brf = pt + np.matrix([-0.4,-0.2,-0.3]).T\n# brf[0,0] = max(brf[0,0],0.05)\n# print 'brf:', brf.T\n#\n# tlb = pt + np.matrix([0.3, 0.2,0.3]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L920_C4", "label": "expression", "type": "expression", "loc": [920, 921], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L919_C0", "vector": [8, 1, 0.8018, 0.0017, 1, 0.68, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' visualize plane finding.\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L929_C4", "label": "brf =", "type": "assigned_variable", "loc": [929, 929], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L919_C0", "vector": [14, 1, 0.8092, 0.0009, 1, 0.68, 0.0385, 17, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "brf", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " brf = pt+np.matrix([-0.15,-0.25,-0.2]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L930_C4", "label": " = max()", "type": "assigned_variable", "loc": [930, 930], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L919_C0", "vector": [14, 1, 0.8101, 0.0009, 1, 0.68, 0.0769, 0, 3, 2, 0, 0, 442, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "max", "annotation": ""}, "snippet": " brf[0,0] = max(0.07,brf[0,0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L931_C4", "label": "tlb =", "type": "assigned_variable", "loc": [931, 931], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L919_C0", "vector": [14, 1, 0.811, 0.0009, 1, 0.68, 0.1154, 90, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "tlb", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tlb = pt+np.matrix([0.25, 0.25,0.2]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L933_C4", "label": "resolution =", "type": "assigned_variable", "loc": [933, 933], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L919_C0", "vector": [14, 1, 0.8127, 0.0009, 1, 0.68, 0.1538, 615, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "resolution", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " resolution = np.matrix([0.01,0.01,0.0025]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L935_C4", "label": "max_dist =", "type": "assigned_variable", "loc": [935, 935], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L919_C0", "vector": [14, 1, 0.8145, 0.0009, 1, 0.68, 0.1923, 822, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "max_dist", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " max_dist = np.linalg.norm(tlb) + 0.2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L936_C4", "label": "min_dist =", "type": "assigned_variable", "loc": [936, 936], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L919_C0", "vector": [14, 1, 0.8153, 0.0009, 1, 0.68, 0.2308, 109, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "min_dist", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " min_dist = brf[0,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L938_C4", "label": "all_pts = generate_pointcloud()", "type": "assigned_variable", "loc": [938, 939], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L919_C0", "vector": [14, 1, 0.8175, 0.0017, 1, 0.68, 0.2692, 45, 3, 9, 0, 0, 989, 10, 1], "semantic": {"name": "all_pts", "arg_names": [], "import_names": [], "rhs_call_name": "generate_pointcloud", "annotation": ""}, "snippet": " all_pts = generate_pointcloud(pos_list, scan_list, min_angle, max_angle, l1, l2,save_scan=False,\n max_dist=max_dist,min_dist=min_dist)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L942_C4", "label": "gr = occupancy_grid_3d()", "type": "assigned_variable", "loc": [942, 942], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L919_C0", "vector": [14, 1, 0.8206, 0.0009, 1, 0.68, 0.3077, 8, 3, 3, 0, 0, 222, 10, 1], "semantic": {"name": "gr", "arg_names": [], "import_names": [], "rhs_call_name": "occupancy_grid_3d", "annotation": ""}, "snippet": " gr = og3d.occupancy_grid_3d(brf,tlb,resolution)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L943_C4", "label": "fill_grid()", "type": "expression", "loc": [943, 943], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L919_C0", "vector": [8, 1, 0.8214, 0.0009, 1, 0.68, 0.3462, 619, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "fill_grid", "arg_names": [], "import_names": [], "rhs_call_name": "fill_grid", "annotation": ""}, "snippet": " gr.fill_grid(all_pts)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L944_C4", "label": "to_binary()", "type": "expression", "loc": [944, 944], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L919_C0", "vector": [8, 1, 0.8223, 0.0009, 1, 0.68, 0.3846, 206, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "to_binary", "arg_names": [], "import_names": [], "rhs_call_name": "to_binary", "annotation": ""}, "snippet": " gr.to_binary(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L945_C4", "label": "l = find_plane_indices()", "type": "assigned_variable", "loc": [945, 945], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L919_C0", "vector": [14, 1, 0.8232, 0.0009, 1, 0.68, 0.4231, 810, 3, 1, 0, 0, 383, 10, 1], "semantic": {"name": "l", "arg_names": [], "import_names": [], "rhs_call_name": "find_plane_indices", "annotation": ""}, "snippet": " l = gr.find_plane_indices(assume_plane=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L946_C4", "label": "z_min =", "type": "assigned_variable", "loc": [946, 946], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L919_C0", "vector": [14, 1, 0.824, 0.0009, 1, 0.68, 0.4615, 566, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "z_min", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " z_min = min(l)*gr.resolution[2,0]+gr.brf[2,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L947_C4", "label": "z_max =", "type": "assigned_variable", "loc": [947, 947], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L919_C0", "vector": [14, 1, 0.8249, 0.0009, 1, 0.68, 0.5, 465, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "z_max", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " z_max = max(l)*gr.resolution[2,0]+gr.brf[2,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L948_C4", "label": "print()", "type": "expression", "loc": [948, 948], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L919_C0", "vector": [8, 1, 0.8258, 0.0009, 1, 0.68, 0.5385, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('height of plane:', (z_max+z_min)/2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L949_C4", "label": "pts = grid_to_points()", "type": "assigned_variable", "loc": [949, 949], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L919_C0", "vector": [14, 1, 0.8267, 0.0009, 1, 0.68, 0.5769, 195, 3, 0, 0, 0, 558, 10, 1], "semantic": {"name": "pts", "arg_names": [], "import_names": [], "rhs_call_name": "grid_to_points", "annotation": ""}, "snippet": " pts = gr.grid_to_points()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L951_C4", "label": "plane_pts_bool = multiply()", "type": "assigned_variable", "loc": [951, 951], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L919_C0", "vector": [14, 1, 0.8284, 0.0009, 1, 0.68, 0.6154, 992, 3, 2, 0, 0, 960, 10, 1], "semantic": {"name": "plane_pts_bool", "arg_names": [], "import_names": [], "rhs_call_name": "multiply", "annotation": ""}, "snippet": " plane_pts_bool = np.multiply(pts[2,:]>=z_min,pts[2,:]<=z_max)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L952_C4", "label": "plane_pts =", "type": "assigned_variable", "loc": [952, 952], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L919_C0", "vector": [14, 1, 0.8293, 0.0009, 1, 0.68, 0.6538, 214, 6, 0, 0, 0, 0, 0, 2], "semantic": {"name": "plane_pts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " plane_pts = pts[:,np.where(plane_pts_bool)[1].A1.tolist()]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L953_C4", "label": "above_pts =", "type": "assigned_variable", "loc": [953, 953], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L919_C0", "vector": [14, 1, 0.8301, 0.0009, 1, 0.68, 0.6923, 36, 6, 0, 0, 0, 0, 0, 2], "semantic": {"name": "above_pts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " above_pts =pts[:,np.where(pts[2,:]>z_max)[1].A1.tolist()]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L954_C4", "label": "below_pts =", "type": "assigned_variable", "loc": [954, 954], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L919_C0", "vector": [14, 1, 0.831, 0.0009, 1, 0.68, 0.7308, 493, 6, 0, 0, 0, 0, 0, 2], "semantic": {"name": "below_pts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " below_pts =pts[:,np.where(pts[2,:]<z_min)[1].A1.tolist()]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L957_C4", "label": "plot_points()", "type": "expression", "loc": [957, 957], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L919_C0", "vector": [8, 1, 0.8336, 0.0009, 1, 0.68, 0.7692, 111, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "plot_points", "arg_names": [], "import_names": [], "rhs_call_name": "plot_points", "annotation": ""}, "snippet": " d3m.plot_points(pt,color=(0,1,0.),mode='sphere')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L958_C4", "label": "plot_points()", "type": "expression", "loc": [958, 958], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L919_C0", "vector": [8, 1, 0.8345, 0.0009, 1, 0.68, 0.8077, 111, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "plot_points", "arg_names": [], "import_names": [], "rhs_call_name": "plot_points", "annotation": ""}, "snippet": " d3m.plot_points(plane_pts,color=(0,0,1.))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L959_C4", "label": "plot_points()", "type": "expression", "loc": [959, 959], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L919_C0", "vector": [8, 1, 0.8354, 0.0009, 1, 0.68, 0.8462, 111, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "plot_points", "arg_names": [], "import_names": [], "rhs_call_name": "plot_points", "annotation": ""}, "snippet": " d3m.plot_points(above_pts,color=(1.0,1.0,1.0))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L960_C4", "label": "plot_points()", "type": "expression", "loc": [960, 960], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L919_C0", "vector": [8, 1, 0.8362, 0.0009, 1, 0.68, 0.8846, 111, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "plot_points", "arg_names": [], "import_names": [], "rhs_call_name": "plot_points", "annotation": ""}, "snippet": " d3m.plot_points(below_pts,color=(1.,0.,0.))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L962_C4", "label": "cube_tups = grid_lines()", "type": "assigned_variable", "loc": [962, 962], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L919_C0", "vector": [14, 1, 0.838, 0.0009, 1, 0.68, 0.9231, 94, 3, 0, 0, 0, 457, 10, 1], "semantic": {"name": "cube_tups", "arg_names": [], "import_names": [], "rhs_call_name": "grid_lines", "annotation": ""}, "snippet": " cube_tups = gr.grid_lines()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L963_C4", "label": "plot_cuboid()", "type": "expression", "loc": [963, 963], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L919_C0", "vector": [8, 1, 0.8389, 0.0009, 1, 0.68, 0.9615, 494, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "plot_cuboid", "arg_names": [], "import_names": [], "rhs_call_name": "plot_cuboid", "annotation": ""}, "snippet": " d3m.plot_cuboid(cube_tups)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L965_C4", "label": "show()", "type": "expression", "loc": [965, 965], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L919_C0", "vector": [8, 1, 0.8406, 0.0009, 1, 0.68, 1.0, 497, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "show", "arg_names": [], "import_names": [], "rhs_call_name": "show", "annotation": ""}, "snippet": " d3m.show()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L968_C0", "label": "test_approach", "type": "function", "loc": [968, 989], "level": 0, "parent": null, "vector": [2, 0, 0.8524, 0.0192, 0, 0.66, 0.8864, 438, 0, 0, 0, 0, 0, 0, 17], "semantic": {"name": "test_approach", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def test_approach():\n display_list=[]\n\n# gr = create_approach_grid(pt,pos_list,scan_list,l1,l2,display_list=display_list,show_pts=False)\n gr = create_approach_grid(pt,pos_list,scan_list,l1,l2,display_list=display_list,show_pts=True)\n t0 = time.time()\n p_erratic,p_edge,h = find_goto_point_surface_1(gr,pt,display_list)\n t1 = time.time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L969_C4", "label": "display_list =", "type": "assigned_variable", "loc": [969, 969], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L968_C0", "vector": [14, 1, 0.8441, 0.0009, 1, 0.64, 0.0, 230, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "display_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " display_list=[]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L972_C4", "label": "gr = create_approach_grid()", "type": "assigned_variable", "loc": [972, 972], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L968_C0", "vector": [14, 1, 0.8467, 0.0009, 1, 0.64, 0.0714, 8, 3, 7, 0, 0, 775, 10, 1], "semantic": {"name": "gr", "arg_names": [], "import_names": [], "rhs_call_name": "create_approach_grid", "annotation": ""}, "snippet": " gr = create_approach_grid(pt,pos_list,scan_list,l1,l2,display_list=display_list,show_pts=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L973_C4", "label": "t0 = time()", "type": "assigned_variable", "loc": [973, 973], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L968_C0", "vector": [14, 1, 0.8476, 0.0009, 1, 0.64, 0.1429, 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_99556:Assign_L974_C4", "label": "p_erratic, p_edge, h = find_goto_point_surface_1()", "type": "assigned_variable", "loc": [974, 974], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L968_C0", "vector": [14, 1, 0.8484, 0.0009, 1, 0.64, 0.2143, 915, 3, 3, 0, 0, 438, 10, 1], "semantic": {"name": "p_erratic, p_edge, h", "arg_names": [], "import_names": [], "rhs_call_name": "find_goto_point_surface_1", "annotation": ""}, "snippet": " p_erratic,p_edge,h = find_goto_point_surface_1(gr,pt,display_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L975_C4", "label": "t1 = time()", "type": "assigned_variable", "loc": [975, 975], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L968_C0", "vector": [14, 1, 0.8493, 0.0009, 1, 0.64, 0.2857, 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_99556:Expr_L976_C4", "label": "print()", "type": "expression", "loc": [976, 976], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L968_C0", "vector": [8, 1, 0.8502, 0.0009, 1, 0.64, 0.3571, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('aaaaaaaaaaaaaah:', t1-t0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L978_C4", "label": "l = find_plane_indices()", "type": "assigned_variable", "loc": [978, 978], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L968_C0", "vector": [14, 1, 0.8519, 0.0009, 1, 0.64, 0.4286, 810, 3, 1, 0, 0, 383, 10, 1], "semantic": {"name": "l", "arg_names": [], "import_names": [], "rhs_call_name": "find_plane_indices", "annotation": ""}, "snippet": " l = gr.find_plane_indices(assume_plane=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L979_C4", "label": "z_min =", "type": "assigned_variable", "loc": [979, 979], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L968_C0", "vector": [14, 1, 0.8528, 0.0009, 1, 0.64, 0.5, 566, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "z_min", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " z_min = min(l)*gr.resolution[2,0]+gr.brf[2,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L980_C4", "label": "z_max =", "type": "assigned_variable", "loc": [980, 980], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L968_C0", "vector": [14, 1, 0.8537, 0.0009, 1, 0.64, 0.5714, 465, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "z_max", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " z_max = max(l)*gr.resolution[2,0]+gr.brf[2,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L981_C4", "label": "print()", "type": "expression", "loc": [981, 981], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L968_C0", "vector": [8, 1, 0.8545, 0.0009, 1, 0.64, 0.6429, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('height of plane:', (z_max+z_min)/2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L983_C4", "label": "print()", "type": "expression", "loc": [983, 983], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L968_C0", "vector": [8, 1, 0.8563, 0.0009, 1, 0.64, 0.7143, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('height of surface in thok0 coord frame:', h)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L984_C4", "label": "print()", "type": "expression", "loc": [984, 984], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L968_C0", "vector": [8, 1, 0.8571, 0.0009, 1, 0.64, 0.7857, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('p_erratic in thok0:', p_erratic.T)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L985_C4", "label": "append()", "type": "expression", "loc": [985, 985], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L968_C0", "vector": [8, 1, 0.858, 0.0009, 1, 0.64, 0.8571, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " display_list.append(pu.CubeCloud(pt,color=(0,255,0),size=(0.018,0.018,0.018)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L987_C4", "label": "insert()", "type": "expression", "loc": [987, 987], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L968_C0", "vector": [8, 1, 0.8598, 0.0009, 1, 0.64, 0.9286, 368, 3, 2, 0, 0, 0, 0, 3], "semantic": {"name": "insert", "arg_names": [], "import_names": [], "rhs_call_name": "insert", "annotation": ""}, "snippet": " display_list.insert(0,pu.PointCloud(gr.grid_to_points(),color=(100,100,100)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L989_C4", "label": "run()", "type": "expression", "loc": [989, 989], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L968_C0", "vector": [8, 1, 0.8615, 0.0009, 1, 0.64, 1.0, 679, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "run", "arg_names": [], "import_names": [], "rhs_call_name": "run", "annotation": ""}, "snippet": " po3d.run(display_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L991_C0", "label": "test_max_forward", "type": "function", "loc": [991, 1005], "level": 0, "parent": null, "vector": [2, 0, 0.8693, 0.0131, 0, 0.66, 0.9091, 624, 0, 0, 0, 0, 0, 0, 8], "semantic": {"name": "test_max_forward", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def test_max_forward():\n max_dist = math.sqrt(pt[0,0]**2+pt[1,0]**2+2.0**1) + 0.3\n# max_dist = np.linalg.norm(pt[0:2]+0.3)\n min_angle,max_angle=math.radians(-40),math.radians(40)\n\n all_pts = generate_pointcloud(pos_list, scan_list, min_angle, max_angle, l1, l2, max_dist=max_dist,\n min_tilt=math.radians(-90))\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L992_C4", "label": "max_dist =", "type": "assigned_variable", "loc": [992, 992], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L991_C0", "vector": [14, 1, 0.8641, 0.0009, 1, 0.39, 0.0, 822, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "max_dist", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " max_dist = math.sqrt(pt[0,0]**2+pt[1,0]**2+2.0**1) + 0.3"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L994_C4", "label": "min_angle, max_angle =", "type": "assigned_variable", "loc": [994, 994], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L991_C0", "vector": [14, 1, 0.8659, 0.0009, 1, 0.39, 0.1429, 579, 0, 0, 0, 0, 0, 8, 2], "semantic": {"name": "min_angle, max_angle", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " min_angle,max_angle=math.radians(-40),math.radians(40)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L996_C4", "label": "all_pts = generate_pointcloud()", "type": "assigned_variable", "loc": [996, 997], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L991_C0", "vector": [14, 1, 0.868, 0.0017, 1, 0.39, 0.2857, 45, 3, 8, 0, 0, 989, 10, 2], "semantic": {"name": "all_pts", "arg_names": [], "import_names": [], "rhs_call_name": "generate_pointcloud", "annotation": ""}, "snippet": " all_pts = generate_pointcloud(pos_list, scan_list, min_angle, max_angle, l1, l2, max_dist=max_dist,\n min_tilt=math.radians(-90))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L999_C4", "label": "display_list =", "type": "assigned_variable", "loc": [999, 999], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L991_C0", "vector": [14, 1, 0.8702, 0.0009, 1, 0.39, 0.4286, 230, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "display_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " display_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L1000_C4", "label": "max_x = max_fwd_without_collision()", "type": "assigned_variable", "loc": [1000, 1000], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L991_C0", "vector": [14, 1, 0.8711, 0.0009, 1, 0.39, 0.5714, 64, 3, 4, 0, 0, 118, 10, 1], "semantic": {"name": "max_x", "arg_names": [], "import_names": [], "rhs_call_name": "max_fwd_without_collision", "annotation": ""}, "snippet": " max_x = max_fwd_without_collision(all_pts,0.20,max_dist,display_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L1001_C4", "label": "run()", "type": "expression", "loc": [1001, 1001], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L991_C0", "vector": [8, 1, 0.872, 0.0009, 1, 0.39, 0.7143, 679, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "run", "arg_names": [], "import_names": [], "rhs_call_name": "run", "annotation": ""}, "snippet": " po3d.run(display_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L1003_C4", "label": "print()", "type": "expression", "loc": [1003, 1003], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L991_C0", "vector": [8, 1, 0.8737, 0.0009, 1, 0.39, 0.8571, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('max_x:', max_x)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L1005_C4", "label": "dict =", "type": "assigned_variable", "loc": [1005, 1005], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L991_C0", "vector": [14, 1, 0.8754, 0.0009, 1, 0.39, 1.0, 827, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "dict", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " dict = {'pos_list':pos_list, 'scan_list':scan_list,'l1':l1, 'l2':l2, 'pt':pt}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L1008_C0", "label": "test_choose_grasp_strategy", "type": "function", "loc": [1008, 1019], "level": 0, "parent": null, "vector": [2, 0, 0.8828, 0.0105, 0, 0.66, 0.9318, 457, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "test_choose_grasp_strategy", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def test_choose_grasp_strategy():\n display_list = []\n far_dist = 0.15\n pt[1,0] += 0.0\n gr = create_overhead_grasp_choice_grid(pt,pos_list,scan_list,l1,l2,far_dist,display_list)\n print('overhead collide?',overhead_grasp_collision(pt,gr))\n display_list.append(pu.CubeCloud(pt,color=(0,200,0),size=(0.005,0.005,0.005)))\n# pts = generate_pointcloud(pos_list, scan_list, min_angle, max_angle, l1, l2,save_scan=False,"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L1009_C4", "label": "display_list =", "type": "assigned_variable", "loc": [1009, 1009], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L1008_C0", "vector": [14, 1, 0.8789, 0.0009, 1, 0.36, 0.0, 230, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "display_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " display_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L1010_C4", "label": "far_dist =", "type": "assigned_variable", "loc": [1010, 1010], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L1008_C0", "vector": [14, 1, 0.8798, 0.0009, 1, 0.36, 0.2, 748, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "far_dist", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " far_dist = 0.15"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L1012_C4", "label": "gr = create_overhead_grasp_choice_grid()", "type": "assigned_variable", "loc": [1012, 1012], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L1008_C0", "vector": [14, 1, 0.8815, 0.0009, 1, 0.36, 0.4, 8, 3, 7, 0, 0, 497, 10, 1], "semantic": {"name": "gr", "arg_names": [], "import_names": [], "rhs_call_name": "create_overhead_grasp_choice_grid", "annotation": ""}, "snippet": " gr = create_overhead_grasp_choice_grid(pt,pos_list,scan_list,l1,l2,far_dist,display_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L1013_C4", "label": "print()", "type": "expression", "loc": [1013, 1013], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L1008_C0", "vector": [8, 1, 0.8824, 0.0009, 1, 0.36, 0.6, 535, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('overhead collide?',overhead_grasp_collision(pt,gr))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L1014_C4", "label": "append()", "type": "expression", "loc": [1014, 1014], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L1008_C0", "vector": [8, 1, 0.8833, 0.0009, 1, 0.36, 0.8, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " display_list.append(pu.CubeCloud(pt,color=(0,200,0),size=(0.005,0.005,0.005)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L1019_C4", "label": "run()", "type": "expression", "loc": [1019, 1019], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L1008_C0", "vector": [8, 1, 0.8876, 0.0009, 1, 0.36, 1.0, 679, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "run", "arg_names": [], "import_names": [], "rhs_call_name": "run", "annotation": ""}, "snippet": " po3d.run(display_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L1021_C0", "label": "test_different_surfaces", "type": "function", "loc": [1021, 1065], "level": 0, "parent": null, "vector": [2, 0, 0.9085, 0.0392, 0, 0.66, 0.9545, 804, 0, 0, 0, 0, 0, 0, 20], "semantic": {"name": "test_different_surfaces", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def test_different_surfaces():\n display_list = []\n# all_pts = generate_pointcloud(pos_list, scan_list, math.radians(-40), math.radians(40), l1, l2,save_scan=False,\n# max_dist=np.Inf, min_dist=-np.Inf,min_tilt=-np.Inf,max_tilt=np.Inf)\n## pts = all_pts[:,np.where(np.multiply(all_pts[0,:]>0.1,all_pts[0,:]<0.4))[1].A1]\n## pts = pts[:,np.where(np.multiply(pts[1,:]<0.3,pts[1,:]>-0.3))[1].A1]\n## pts = pts[:,np.where(pts[2,:]>-0.2)[1].A1]\n## display_list.append(pu.PointCloud(pts,color=(0,200,0)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L1022_C4", "label": "display_list =", "type": "assigned_variable", "loc": [1022, 1022], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L1021_C0", "vector": [14, 1, 0.8902, 0.0009, 1, 0.95, 0.0, 230, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "display_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " display_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L1039_C4", "label": "gr = create_approach_grid()", "type": "assigned_variable", "loc": [1039, 1039], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L1021_C0", "vector": [14, 1, 0.9051, 0.0009, 1, 0.95, 0.05, 8, 3, 6, 0, 0, 775, 10, 1], "semantic": {"name": "gr", "arg_names": [], "import_names": [], "rhs_call_name": "create_approach_grid", "annotation": ""}, "snippet": " gr = create_approach_grid(pt,pos_list,scan_list,l1,l2,display_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L1041_C4", "label": "l = find_plane_indices()", "type": "assigned_variable", "loc": [1041, 1041], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L1021_C0", "vector": [14, 1, 0.9068, 0.0009, 1, 0.95, 0.1, 810, 3, 1, 0, 0, 383, 10, 1], "semantic": {"name": "l", "arg_names": [], "import_names": [], "rhs_call_name": "find_plane_indices", "annotation": ""}, "snippet": " l = gr.find_plane_indices(assume_plane=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L1042_C4", "label": "max_index = min()", "type": "assigned_variable", "loc": [1042, 1042], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L1021_C0", "vector": [14, 1, 0.9077, 0.0009, 1, 0.95, 0.15, 277, 3, 2, 0, 0, 867, 10, 2], "semantic": {"name": "max_index", "arg_names": [], "import_names": [], "rhs_call_name": "min", "annotation": ""}, "snippet": " max_index = min(max(l)+5,gr.grid_shape[2,0]-1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L1043_C4", "label": "min_index = max()", "type": "assigned_variable", "loc": [1043, 1043], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L1021_C0", "vector": [14, 1, 0.9085, 0.0009, 1, 0.95, 0.2, 727, 3, 2, 0, 0, 442, 10, 2], "semantic": {"name": "min_index", "arg_names": [], "import_names": [], "rhs_call_name": "max", "annotation": ""}, "snippet": " min_index = max(min(l)-5,0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L1044_C4", "label": "l = range()", "type": "assigned_variable", "loc": [1044, 1044], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L1021_C0", "vector": [14, 1, 0.9094, 0.0009, 1, 0.95, 0.25, 810, 3, 2, 0, 0, 816, 10, 1], "semantic": {"name": "l", "arg_names": [], "import_names": [], "rhs_call_name": "range", "annotation": ""}, "snippet": " l = range(min_index,max_index+1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L1046_C4", "label": "n_points_list =", "type": "assigned_variable", "loc": [1046, 1046], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L1021_C0", "vector": [14, 1, 0.9111, 0.0009, 1, 0.95, 0.3, 916, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "n_points_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " n_points_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L1047_C4", "label": "height_list =", "type": "assigned_variable", "loc": [1047, 1047], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L1021_C0", "vector": [14, 1, 0.912, 0.0009, 1, 0.95, 0.35, 613, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "height_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " height_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L1048_C4", "label": "for idx", "type": "for", "loc": [1048, 1050], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L1021_C0", "vector": [6, 1, 0.9138, 0.0026, 1, 0.95, 0.4, 187, 2, 0, 0, 0, 0, 0, 3], "semantic": {"name": "idx", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for idx in l:\n n_points_list.append(gr.grid[:,:,idx].sum())\n height_list.append(idx*gr.resolution[2,0]+gr.brf[2,0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L1049_C8", "label": "append()", "type": "expression", "loc": [1049, 1049], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L1048_C4", "vector": [8, 2, 0.9138, 0.0009, 2, 0.07, 0.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " n_points_list.append(gr.grid[:,:,idx].sum())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L1050_C8", "label": "append()", "type": "expression", "loc": [1050, 1050], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L1048_C4", "vector": [8, 2, 0.9146, 0.0009, 2, 0.07, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " height_list.append(idx*gr.resolution[2,0]+gr.brf[2,0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L1052_C4", "label": "bar()", "type": "expression", "loc": [1052, 1052], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L1021_C0", "vector": [8, 1, 0.9164, 0.0009, 1, 0.95, 0.45, 300, 3, 6, 0, 0, 0, 0, 1], "semantic": {"name": "bar", "arg_names": [], "import_names": [], "rhs_call_name": "bar", "annotation": ""}, "snippet": " pl.bar(height_list,n_points_list,width=gr.resolution[2,0],linewidth=0,align='center',color='y')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L1053_C4", "label": "max_occ = max()", "type": "assigned_variable", "loc": [1053, 1053], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L1021_C0", "vector": [14, 1, 0.9172, 0.0009, 1, 0.95, 0.5, 175, 3, 1, 0, 0, 442, 10, 1], "semantic": {"name": "max_occ", "arg_names": [], "import_names": [], "rhs_call_name": "max", "annotation": ""}, "snippet": " max_occ = max(n_points_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L1054_C4", "label": "thresh =", "type": "assigned_variable", "loc": [1054, 1054], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L1021_C0", "vector": [14, 1, 0.9181, 0.0009, 1, 0.95, 0.55, 844, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "thresh", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " thresh = max_occ/5"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L1055_C4", "label": "xmin, xmax = xlim()", "type": "assigned_variable", "loc": [1055, 1055], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L1021_C0", "vector": [14, 1, 0.919, 0.0009, 1, 0.95, 0.6, 440, 3, 0, 0, 0, 907, 10, 1], "semantic": {"name": "xmin, xmax", "arg_names": [], "import_names": [], "rhs_call_name": "xlim", "annotation": ""}, "snippet": " xmin,xmax = pl.xlim()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L1056_C4", "label": "t = axis()", "type": "assigned_variable", "loc": [1056, 1056], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L1021_C0", "vector": [14, 1, 0.9199, 0.0009, 1, 0.95, 0.65, 15, 3, 0, 0, 0, 860, 10, 1], "semantic": {"name": "t", "arg_names": [], "import_names": [], "rhs_call_name": "axis", "annotation": ""}, "snippet": " t = pl.axis()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L1057_C4", "label": "t =", "type": "assigned_variable", "loc": [1057, 1057], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L1021_C0", "vector": [14, 1, 0.9207, 0.0009, 1, 0.95, 0.7, 15, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "t", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " t = (xmin+0.0017,xmax-0.001,t[2],t[3]+50)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L1060_C4", "label": "plot()", "type": "expression", "loc": [1060, 1060], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L1021_C0", "vector": [8, 1, 0.9233, 0.0009, 1, 0.95, 0.75, 929, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "plot", "arg_names": [], "import_names": [], "rhs_call_name": "plot", "annotation": ""}, "snippet": " pl.plot([xmin,xmax],[thresh,thresh],c='b')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L1061_C4", "label": "title()", "type": "expression", "loc": [1061, 1061], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L1021_C0", "vector": [8, 1, 0.9242, 0.0009, 1, 0.95, 0.8, 48, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "title", "arg_names": [], "import_names": [], "rhs_call_name": "title", "annotation": ""}, "snippet": " pl.title('Histogram of number of points vs z-coordinate of points')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L1062_C4", "label": "xlabel()", "type": "expression", "loc": [1062, 1062], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L1021_C0", "vector": [8, 1, 0.9251, 0.0009, 1, 0.95, 0.85, 676, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "xlabel", "arg_names": [], "import_names": [], "rhs_call_name": "xlabel", "annotation": ""}, "snippet": " pl.xlabel('z-coordinate (relative to the laser range finder) (meters)')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L1063_C4", "label": "ylabel()", "type": "expression", "loc": [1063, 1063], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L1021_C0", "vector": [8, 1, 0.926, 0.0009, 1, 0.95, 0.9, 584, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "ylabel", "arg_names": [], "import_names": [], "rhs_call_name": "ylabel", "annotation": ""}, "snippet": " pl.ylabel('Number of points')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L1064_C4", "label": "axis()", "type": "expression", "loc": [1064, 1064], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L1021_C0", "vector": [8, 1, 0.9268, 0.0009, 1, 0.95, 0.95, 860, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "axis", "arg_names": [], "import_names": [], "rhs_call_name": "axis", "annotation": ""}, "snippet": " pl.axis(t)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L1065_C4", "label": "savefig()", "type": "expression", "loc": [1065, 1065], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L1021_C0", "vector": [8, 1, 0.9277, 0.0009, 1, 0.95, 1.0, 677, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "savefig", "arg_names": [], "import_names": [], "rhs_call_name": "savefig", "annotation": ""}, "snippet": " pl.savefig(pkl_file_name+'.png')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L1084_C0", "label": "test_occ_grid", "type": "function", "loc": [1084, 1092], "level": 0, "parent": null, "vector": [2, 0, 0.9477, 0.0078, 0, 0.66, 0.9773, 895, 0, 0, 0, 0, 0, 0, 7], "semantic": {"name": "test_occ_grid", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def test_occ_grid():\n\n gr = create_approach_grid(pt,pos_list,scan_list,l1,l2,display_list=None,show_pts=True)\n\n pts = gr.grid_to_points()\n display_list=[]\n display_list.append(pu.CubeCloud(pt,color=(0,255,0),size=(0.007,0.007,0.007)))\n display_list.append(pu.PointCloud(pts,color=(200,0,0)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L1086_C4", "label": "gr = create_approach_grid()", "type": "assigned_variable", "loc": [1086, 1086], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L1084_C0", "vector": [14, 1, 0.946, 0.0009, 1, 0.2, 0.0, 8, 3, 7, 0, 0, 775, 10, 1], "semantic": {"name": "gr", "arg_names": [], "import_names": [], "rhs_call_name": "create_approach_grid", "annotation": ""}, "snippet": " gr = create_approach_grid(pt,pos_list,scan_list,l1,l2,display_list=None,show_pts=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L1088_C4", "label": "pts = grid_to_points()", "type": "assigned_variable", "loc": [1088, 1088], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L1084_C0", "vector": [14, 1, 0.9477, 0.0009, 1, 0.2, 0.2, 195, 3, 0, 0, 0, 558, 10, 1], "semantic": {"name": "pts", "arg_names": [], "import_names": [], "rhs_call_name": "grid_to_points", "annotation": ""}, "snippet": " pts = gr.grid_to_points()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L1089_C4", "label": "display_list =", "type": "assigned_variable", "loc": [1089, 1089], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L1084_C0", "vector": [14, 1, 0.9486, 0.0009, 1, 0.2, 0.4, 230, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "display_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " display_list=[]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L1090_C4", "label": "append()", "type": "expression", "loc": [1090, 1090], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L1084_C0", "vector": [8, 1, 0.9495, 0.0009, 1, 0.2, 0.6, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " display_list.append(pu.CubeCloud(pt,color=(0,255,0),size=(0.007,0.007,0.007)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L1091_C4", "label": "append()", "type": "expression", "loc": [1091, 1091], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L1084_C0", "vector": [8, 1, 0.9503, 0.0009, 1, 0.2, 0.8, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " display_list.append(pu.PointCloud(pts,color=(200,0,0)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L1092_C4", "label": "run()", "type": "expression", "loc": [1092, 1092], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L1084_C0", "vector": [8, 1, 0.9512, 0.0009, 1, 0.2, 1.0, 679, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "run", "arg_names": [], "import_names": [], "rhs_call_name": "run", "annotation": ""}, "snippet": " po3d.run(display_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L1095_C0", "label": "if", "type": "if", "loc": [1095, 1138], "level": 0, "parent": null, "vector": [4, 0, 0.9726, 0.0383, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 15], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n\n p = optparse.OptionParser()\n p.add_option('-f', action='store', type='string', dest='pkl_file_name',\n help='file.pkl File with the scan,pos dict.')\n p.add_option('--all_pts', action='store_true', dest='show_all_pts',\n help='show all the points in light grey')\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L1097_C4", "label": "p = OptionParser()", "type": "assigned_variable", "loc": [1097, 1097], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L1095_C0", "vector": [14, 1, 0.9556, 0.0009, 1, 0.65, 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_99556:Expr_L1098_C4", "label": "add_option()", "type": "expression", "loc": [1098, 1099], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L1095_C0", "vector": [8, 1, 0.9569, 0.0017, 1, 0.65, 0.0556, 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', action='store', type='string', dest='pkl_file_name',\n help='file.pkl File with the scan,pos dict.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L1100_C4", "label": "add_option()", "type": "expression", "loc": [1100, 1101], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L1095_C0", "vector": [8, 1, 0.9586, 0.0017, 1, 0.65, 0.1111, 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('--all_pts', action='store_true', dest='show_all_pts',\n help='show all the points in light grey')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L1103_C4", "label": "opt, args = parse_args()", "type": "assigned_variable", "loc": [1103, 1103], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L1095_C0", "vector": [14, 1, 0.9608, 0.0009, 1, 0.65, 0.1667, 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_99556:Assign_L1104_C4", "label": "pkl_file_name =", "type": "assigned_variable", "loc": [1104, 1104], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L1095_C0", "vector": [14, 1, 0.9617, 0.0009, 1, 0.65, 0.2222, 696, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pkl_file_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pkl_file_name = opt.pkl_file_name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L1105_C4", "label": "show_full_cloud =", "type": "assigned_variable", "loc": [1105, 1105], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L1095_C0", "vector": [14, 1, 0.9625, 0.0009, 1, 0.65, 0.2778, 735, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "show_full_cloud", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " show_full_cloud = opt.show_all_pts"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L1107_C4", "label": "str_parts = split()", "type": "assigned_variable", "loc": [1107, 1107], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L1095_C0", "vector": [14, 1, 0.9643, 0.0009, 1, 0.65, 0.3333, 705, 3, 1, 0, 0, 908, 10, 1], "semantic": {"name": "str_parts", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": " str_parts = pkl_file_name.split('.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L1108_C4", "label": "raw_name =", "type": "assigned_variable", "loc": [1108, 1108], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L1095_C0", "vector": [14, 1, 0.9652, 0.0009, 1, 0.65, 0.3889, 845, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "raw_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " raw_name = str_parts[-2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L1109_C4", "label": "str_parts = split()", "type": "assigned_variable", "loc": [1109, 1109], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L1095_C0", "vector": [14, 1, 0.966, 0.0009, 1, 0.65, 0.4444, 705, 3, 1, 0, 0, 908, 10, 1], "semantic": {"name": "str_parts", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": " str_parts = raw_name.split('/')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L1110_C4", "label": "raw_name =", "type": "assigned_variable", "loc": [1110, 1110], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L1095_C0", "vector": [14, 1, 0.9669, 0.0009, 1, 0.65, 0.5, 845, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "raw_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " raw_name = str_parts[-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L1112_C4", "label": "dict = load_pickle()", "type": "assigned_variable", "loc": [1112, 1112], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L1095_C0", "vector": [14, 1, 0.9686, 0.0009, 1, 0.65, 0.5556, 827, 3, 1, 0, 0, 65, 10, 1], "semantic": {"name": "dict", "arg_names": [], "import_names": [], "rhs_call_name": "load_pickle", "annotation": ""}, "snippet": " dict = ut.load_pickle(pkl_file_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L1113_C4", "label": "pos_list =", "type": "assigned_variable", "loc": [1113, 1113], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L1095_C0", "vector": [14, 1, 0.9695, 0.0009, 1, 0.65, 0.6111, 279, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pos_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pos_list = dict['pos_list']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L1114_C4", "label": "scan_list =", "type": "assigned_variable", "loc": [1114, 1114], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L1095_C0", "vector": [14, 1, 0.9704, 0.0009, 1, 0.65, 0.6667, 378, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "scan_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " scan_list = dict['scan_list']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L1115_C4", "label": "min_angle = radians()", "type": "assigned_variable", "loc": [1115, 1115], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L1095_C0", "vector": [14, 1, 0.9713, 0.0009, 1, 0.65, 0.7222, 278, 3, 1, 0, 0, 383, 10, 1], "semantic": {"name": "min_angle", "arg_names": [], "import_names": [], "rhs_call_name": "radians", "annotation": ""}, "snippet": " min_angle = math.radians(-40)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L1116_C4", "label": "max_angle = radians()", "type": "assigned_variable", "loc": [1116, 1116], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L1095_C0", "vector": [14, 1, 0.9721, 0.0009, 1, 0.65, 0.7778, 451, 3, 1, 0, 0, 383, 10, 1], "semantic": {"name": "max_angle", "arg_names": [], "import_names": [], "rhs_call_name": "radians", "annotation": ""}, "snippet": " max_angle = math.radians(40)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L1118_C4", "label": "l1 =", "type": "assigned_variable", "loc": [1118, 1118], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L1095_C0", "vector": [14, 1, 0.9739, 0.0009, 1, 0.65, 0.8333, 888, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "l1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " l1 = dict['l1']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L1119_C4", "label": "l2 =", "type": "assigned_variable", "loc": [1119, 1119], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L1095_C0", "vector": [14, 1, 0.9747, 0.0009, 1, 0.65, 0.8889, 40, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "l2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " l2 = dict['l2']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L1123_C4", "label": "if", "type": "if", "loc": [1123, 1130], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L1095_C0", "vector": [4, 1, 0.9813, 0.007, 1, 0.65, 0.9444, 0, 3, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if dict.has_key('pt'):\n pt = dict['pt']\n print('dict has key pt')\n else:\n print('dict does NOT have key pt')\n pt = np.matrix([0.35,0.0,-0.3]).T\n dict['pt'] = pt\n ut.save_pickle(dict,pkl_file_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L1124_C8", "label": "pt =", "type": "assigned_variable", "loc": [1124, 1124], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L1123_C4", "vector": [14, 2, 0.9791, 0.0009, 2, 0.38, 0.0, 989, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pt = dict['pt']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L1125_C8", "label": "print()", "type": "expression", "loc": [1125, 1125], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L1123_C4", "vector": [8, 2, 0.98, 0.0009, 2, 0.38, 0.2, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('dict has key pt')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L1127_C8", "label": "print()", "type": "expression", "loc": [1127, 1127], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L1123_C4", "vector": [8, 2, 0.9817, 0.0009, 2, 0.38, 0.4, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('dict does NOT have key pt')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L1128_C8", "label": "pt =", "type": "assigned_variable", "loc": [1128, 1128], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L1123_C4", "vector": [14, 2, 0.9826, 0.0009, 2, 0.38, 0.6, 989, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "pt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pt = np.matrix([0.35,0.0,-0.3]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L1129_C8", "label": "assign", "type": "assigned_variable", "loc": [1129, 1129], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L1123_C4", "vector": [14, 2, 0.9834, 0.0009, 2, 0.38, 0.8, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " dict['pt'] = pt"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L1130_C8", "label": "save_pickle()", "type": "expression", "loc": [1130, 1130], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L1123_C4", "vector": [8, 2, 0.9843, 0.0009, 2, 0.38, 1.0, 390, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "save_pickle", "arg_names": [], "import_names": [], "rhs_call_name": "save_pickle", "annotation": ""}, "snippet": " ut.save_pickle(dict,pkl_file_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L1138_C4", "label": "test_segmentation()", "type": "expression", "loc": [1138, 1138], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L1095_C0", "vector": [8, 1, 0.9913, 0.0009, 1, 0.65, 1.0, 791, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "test_segmentation", "arg_names": [], "import_names": [], "rhs_call_name": "test_segmentation", "annotation": ""}, "snippet": " test_segmentation()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L57_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L58_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L59_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L61_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Return_L63_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L68_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L80_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L81_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L82_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L84_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L85_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L86_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L87_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L88_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L90_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L92_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L92_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L93_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L92_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L96_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L92_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L97_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L97_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L98_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L92_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L99_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L92_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L101_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L92_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L102_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L92_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L103_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L103_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L104_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L92_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L106_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L106_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L107_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L109_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L109_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L110_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L109_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L112_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L112_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L113_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L112_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L114_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L112_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L116_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L109_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L118_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L109_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L119_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L109_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L120_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L123_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L126_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L126_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L127_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L126_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L128_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L130_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L133_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L133_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L134_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L133_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Return_L135_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L133_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Return_L137_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L141_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L142_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L141_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L149_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L141_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L150_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L141_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L151_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L141_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L153_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L141_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L154_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L141_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L156_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L141_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L157_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L141_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L159_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L141_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L160_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L141_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L161_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L141_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L163_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L163_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L164_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L163_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L167_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L163_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L170_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L141_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L172_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L172_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L173_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L172_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L174_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L172_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L175_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L172_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L176_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L141_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Return_L179_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L181_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L182_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L181_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L188_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L181_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L191_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L181_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L192_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L192_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Return_L193_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L181_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L198_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L181_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L199_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L181_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L201_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L181_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L202_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L181_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L206_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L206_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L207_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L206_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L208_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L181_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L210_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L181_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L211_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L181_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Return_L213_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L217_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L218_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L217_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L221_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L217_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L222_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L217_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Return_L223_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L225_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L226_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L225_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L229_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L225_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L230_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L225_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L231_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L225_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L232_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L232_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L233_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L232_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L235_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L225_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L237_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L225_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L238_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L225_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L239_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L225_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L241_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L241_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L242_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L241_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L244_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L225_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L246_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L225_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L247_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L225_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L249_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L249_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Return_L250_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L225_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L252_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L225_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L256_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L225_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L257_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L225_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Return_L258_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L260_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L261_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L260_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L265_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L260_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L266_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L260_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L267_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L267_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L268_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L267_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Return_L269_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L260_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L271_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L260_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L272_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L260_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L273_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L260_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L275_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L260_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L276_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L260_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L277_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L260_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L278_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L260_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L279_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L260_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L280_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L260_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L281_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L260_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L282_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L260_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L283_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L260_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Return_L285_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L296_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L297_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L299_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L300_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L302_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L303_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L304_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L305_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L306_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L308_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L309_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L310_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L311_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L315_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L316_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L317_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L319_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L320_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L321_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L322_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L322_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L323_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L324_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L325_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L334_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L335_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L336_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L337_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L338_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L339_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L340_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L341_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L343_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L344_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L345_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L347_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L348_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L350_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L351_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L353_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L354_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L355_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L356_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L358_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L359_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L362_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L363_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L364_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L364_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L365_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L364_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L366_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L364_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L367_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L364_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L368_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L364_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L369_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L364_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L371_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L364_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L372_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L364_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L373_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L375_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L375_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L376_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L375_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Return_L377_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L379_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L381_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L382_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L382_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L383_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L382_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L385_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L382_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L386_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L382_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L387_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L389_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L390_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L390_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L391_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L390_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L393_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L390_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L394_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L390_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L395_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L397_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L397_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L398_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L397_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L399_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L397_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L400_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L402_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L402_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L403_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L402_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L404_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L402_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L405_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L405_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L407_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L402_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L410_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L402_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L411_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L411_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L412_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L411_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L413_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L402_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L415_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L402_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L416_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L416_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L417_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L416_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L419_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L416_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L420_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L416_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L421_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L402_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L423_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L402_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L424_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L424_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L425_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L424_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L427_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L424_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L428_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L424_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L429_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L431_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L432_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L432_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L433_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L432_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L434_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L432_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L436_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L432_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L437_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L439_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L440_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L442_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L442_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L443_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L442_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L444_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L442_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L445_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L442_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L447_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L442_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L448_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L295_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Return_L451_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L454_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L455_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L454_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L457_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L454_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L458_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L454_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L459_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L462_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L464_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L462_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L465_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L462_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L467_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L462_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L468_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L462_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L469_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L462_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L470_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L462_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L472_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L462_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L474_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L474_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Return_L475_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L462_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L477_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L462_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L478_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L462_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L480_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L462_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L482_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L482_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L483_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L482_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L485_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L462_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L487_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L487_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L488_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L487_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L489_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L487_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L490_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L487_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L491_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L491_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L493_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L462_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L495_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L462_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L496_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L462_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L497_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L462_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L500_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L462_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L502_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L462_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L503_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L503_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L504_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L503_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L506_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L503_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L508_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L503_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L509_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L503_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L510_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L503_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L513_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L503_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L514_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L503_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L515_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L503_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L516_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L503_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L517_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L503_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L518_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L503_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L519_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L503_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L524_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L462_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L525_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L462_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L527_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L462_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Return_L528_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L532_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L533_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L532_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L540_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L532_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L541_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L541_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L542_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L532_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L544_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L544_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Return_L545_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L532_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L546_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L532_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L547_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L532_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L548_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L532_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L550_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L550_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Return_L551_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L532_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Return_L552_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L554_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L556_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L554_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L563_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L554_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L564_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L564_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Return_L566_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L554_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L568_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L554_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L569_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L554_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L571_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L571_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L572_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L571_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L574_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L571_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L575_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L571_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L577_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L571_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L578_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L571_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L579_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L571_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L580_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L571_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L581_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L571_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L582_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L571_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L583_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L571_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L584_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L571_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L585_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L571_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L588_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L571_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L590_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L571_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L591_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L554_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L593_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L593_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Return_L594_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L554_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Return_L596_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L598_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L601_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L598_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L603_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L598_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L604_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L598_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L605_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L598_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L607_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L598_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L609_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L598_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L610_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L598_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L612_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L598_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L614_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L598_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L615_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L598_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L617_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L617_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L618_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L618_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L619_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L617_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L620_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L617_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L621_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L598_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Return_L623_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L625_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L626_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L625_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L627_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L625_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L628_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L625_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L629_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L625_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L630_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L625_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Return_L631_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L633_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L634_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L633_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L635_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L633_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L636_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L633_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L637_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L633_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Return_L638_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L640_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L641_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L640_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L642_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L640_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L643_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L640_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L650_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L640_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Return_L653_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L655_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L656_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L655_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L657_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L655_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L659_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L655_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L661_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L655_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Return_L663_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L665_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L675_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L665_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L676_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L665_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L678_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L665_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L679_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L665_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L680_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L665_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L682_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L665_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L683_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L665_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L684_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L665_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L686_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L665_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L688_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L688_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L689_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L688_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L690_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L690_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L691_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L690_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L692_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L665_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Return_L693_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L696_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L697_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L696_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L698_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L698_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Return_L699_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L698_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Return_L701_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L704_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L705_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L704_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L708_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L704_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L709_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L704_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L710_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L704_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L711_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L704_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L714_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L704_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L715_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L704_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L717_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L704_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L718_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L704_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L719_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L704_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L720_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L704_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L722_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L704_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L724_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L704_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L725_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L704_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L726_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L704_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L727_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L704_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L729_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L704_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L730_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L704_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L731_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L704_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L732_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L704_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L733_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L704_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L735_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L704_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L736_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L704_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L737_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L704_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L739_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L704_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L740_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L704_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L741_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L704_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L743_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L704_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L744_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L704_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L745_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L704_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L748_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L748_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L750_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L748_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L752_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L748_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L753_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L748_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L755_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L755_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L756_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L755_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L757_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L755_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L758_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L755_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L759_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L755_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L761_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L755_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L762_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L755_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L763_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L755_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L764_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L748_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L768_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L768_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L769_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L748_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L771_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L748_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L773_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L748_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L788_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L748_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L790_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L748_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L791_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L748_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L792_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L748_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L794_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L748_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L795_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L748_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L797_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L797_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L798_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L797_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L800_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L748_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L802_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L748_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L803_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L748_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L804_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L748_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L806_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L806_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L807_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L806_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L808_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L704_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L813_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L813_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L814_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L813_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L815_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L813_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L819_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L813_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L820_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L813_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L822_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L813_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L823_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L813_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L824_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L813_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L826_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L813_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L827_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L813_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L828_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L813_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L830_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L704_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Return_L832_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L838_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L839_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L838_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L840_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L838_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L841_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L838_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L844_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L838_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L845_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L838_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L846_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L838_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L847_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L849_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L850_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L849_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L851_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L849_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L853_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L849_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L854_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L849_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L856_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L849_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L857_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L849_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L858_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L849_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L860_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L849_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L861_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L849_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L864_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L849_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L867_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L849_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L868_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L849_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L869_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L849_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L872_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L872_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L873_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L872_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L874_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L872_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L876_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L872_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L877_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L872_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L879_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L849_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L881_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L849_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L882_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L885_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L886_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L885_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L888_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L885_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L889_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L889_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L890_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L889_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L891_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L885_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L894_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L885_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L895_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L885_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L896_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L885_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L898_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L898_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L899_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L898_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L900_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L898_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L901_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L898_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L904_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L885_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L906_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L909_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L910_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L909_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L912_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L909_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L913_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L909_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L914_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L909_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L915_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L909_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L917_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L919_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L920_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L919_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L929_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L919_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L930_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L919_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L931_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L919_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L933_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L919_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L935_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L919_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L936_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L919_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L938_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L919_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L942_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L919_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L943_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L919_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L944_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L919_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L945_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L919_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L946_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L919_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L947_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L919_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L948_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L919_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L949_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L919_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L951_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L919_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L952_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L919_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L953_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L919_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L954_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L919_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L957_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L919_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L958_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L919_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L959_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L919_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L960_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L919_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L962_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L919_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L963_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L919_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L965_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L968_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L969_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L968_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L972_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L968_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L973_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L968_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L974_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L968_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L975_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L968_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L976_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L968_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L978_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L968_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L979_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L968_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L980_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L968_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L981_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L968_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L983_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L968_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L984_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L968_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L985_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L968_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L987_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L968_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L989_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L991_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L992_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L991_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L994_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L991_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L996_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L991_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L999_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L991_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L1000_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L991_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L1001_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L991_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L1003_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L991_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L1005_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L1008_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L1009_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L1008_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L1010_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L1008_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L1012_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L1008_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L1013_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L1008_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L1014_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L1008_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L1019_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L1021_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L1022_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L1021_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L1039_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L1021_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L1041_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L1021_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L1042_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L1021_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L1043_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L1021_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L1044_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L1021_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L1046_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L1021_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L1047_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L1021_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L1048_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L1048_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L1049_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:For_L1048_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L1050_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L1021_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L1052_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L1021_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L1053_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L1021_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L1054_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L1021_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L1055_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L1021_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L1056_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L1021_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L1057_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L1021_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L1060_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L1021_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L1061_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L1021_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L1062_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L1021_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L1063_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L1021_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L1064_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L1021_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L1065_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L1084_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L1086_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L1084_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L1088_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L1084_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L1089_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L1084_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L1090_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L1084_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L1091_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:FunctionDef_L1084_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L1092_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L1095_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L1097_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L1095_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L1098_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L1095_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L1100_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L1095_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L1103_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L1095_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L1104_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L1095_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L1105_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L1095_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L1107_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L1095_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L1108_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L1095_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L1109_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L1095_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L1110_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L1095_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L1112_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L1095_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L1113_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L1095_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L1114_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L1095_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L1115_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L1095_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L1116_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L1095_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L1118_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L1095_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L1119_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L1095_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L1123_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L1123_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L1124_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L1123_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L1125_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L1123_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L1127_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L1123_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L1128_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L1123_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Assign_L1129_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L1123_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L1130_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99556:If_L1095_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99556:Expr_L1138_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 (Healthcare Robotics Lab, Georgia Tech.) import sys, optparse, os import time import math, numpy as np import scipy.ndimage as ni import copy import hrl_lib.util as ut, hrl_lib.transforms as tr ## subtract occupancy grids. og1 = og1-og2 # # @param og1 - occupancy_grid_3d object. # @param og2 - occupancy_grid_3d object. # #will position og2 at an appropriate location within og1 (hopefully) #will copy points in og2 but not in og1 into og1 # # points corresponding to the gird cells whose occupancy drops to # zero will still be in grid_points_list #UNTESTED: # * subtracting grids of different sizes. # * how the rotation_z of the occupancy grid will affect things. def subtract(og1,og2): if np.all(og1.resolution==og2.resolution) == False: print 'occupancy_grid_3d.subtract: The resolution of the two grids is not the same.' print 'res1, res2:', og1.resolution.A1.tolist(), og2.resolution.A1.tolist() print 'Exiting...' sys.exit() sub_tlb = og2.tlb sub_brf = og2.brf sub_tlb_idx = np.round((sub_tlb-og1.brf)/og1.resolution) sub_brf_idx = np.round((sub_brf-og1.brf)/og1.resolution) x_s,y_s,z_s = int(sub_brf_idx[0,0]),int(sub_brf_idx[1,0]),int(sub_brf_idx[2,0]) x_e,y_e,z_e = int(sub_tlb_idx[0,0]),int(sub_tlb_idx[1,0]),int(sub_tlb_idx[2,0]) x_e = min(x_e+1,og1.grid_shape[0,0]) y_e = min(y_e+1,og1.grid_shape[1,0]) z_e = min(z_e+1,og1.grid_shape[2,0]) sub_grid = og1.grid[x_s:x_e,y_s:y_e,z_s:z_e] if np.any(og1.grid_shape!=og2.grid_shape): print '#############################################################################' print 'WARNING: occupancy_grid_3d.subtract has not been tested for grids of different sizes.' print '#############################################################################' sub_grid = sub_grid-og2.grid sub_grid = np.abs(sub_grid) # for now. og1.grid[x_s:x_e,y_s:y_e,z_s:z_e] = sub_grid idxs = np.where(sub_grid>=1) shp = og2.grid_shape list_idxs = (idxs[0]+idxs[1]*shp[0,0]+idxs[2]*shp[0,0]*shp[1,0]).tolist() og1_list_idxs = (idxs[0]+x_s+(idxs[1]+y_s)*shp[0,0]+(idxs[2]+z_s)*shp[0,0]*shp[1,0]).tolist() og1_list_len = len(og1.grid_points_list) for og1_pts_idxs,pts_idxs in zip(og1_list_idxs,list_idxs): if og1_pts_idxs<og1_list_len: og1.grid_points_list[og1_pts_idxs] += og2.grid_points_list[pts_idxs] ## class which implements the occupancy grid class occupancy_grid_3d(): ## # @param brf - 3x1 matrix. Bottom Right Front. # @param tlb - 3x1 matrix (coord of center of the top left back cell) # @param resolution - 3x1 matrix. size of each cell (in meters) along # the different directions. def __init__(self, brf, tlb, resolution, rotation_z=math.radians(0.)): #print np.round((tlb-brf)/resolution).astype('int')+1 self.grid = np.zeros(np.round((tlb-brf)/resolution).astype('int')+1,dtype='int') self.tlb = tlb self.brf = brf self.grid_shape = np.matrix(self.grid.shape).T self.resolution = resolution n_cells = self.grid.shape[0]*self.grid.shape[1]*self.grid.shape[2] self.grid_points_list = [[] for i in range(n_cells)] self.rotation_z = rotation_z ## returns list of 8 tuples of 3x1 points which form the edges of the grid. # Useful for displaying the extents of the volume of interest (VOI). # @return list of 8 tuples of 3x1 points which form the edges of the grid. def grid_lines(self, rotation_angle=0.): grid_size = np.multiply(self.grid_shape,self.resolution) rot_mat = tr.rotZ(rotation_angle) p5 = self.tlb p6 = p5+np.matrix([0.,-grid_size[1,0],0.]).T p8 = p5+np.matrix([0.,0.,-grid_size[2,0]]).T p7 = p8+np.matrix([0.,-grid_size[1,0],0.]).T p3 = self.brf p4 = p3+np.matrix([0.,grid_size[1,0],0.]).T p2 = p3+np.matrix([0.,0.,grid_size[2,0]]).T p1 = p2+np.matrix([0.,grid_size[1,0],0.]).T p1 = rot_mat*p1 p2 = rot_mat*p2 p3 = rot_mat*p3 p4 = rot_mat*p4 p5 = rot_mat*p5 p6 = rot_mat*p6 p7 = rot_mat*p7 p8 = rot_mat*p8 l = [(p1,p2),(p1,p4),(p2,p3),(p3,p4),(p5,p6),(p6,p7),(p7,p8),(p8,p5),(p1,p5),(p2,p6),(p4,p8),(p3,p7)] #l = [(p5,p6),(p5,p3),(p1,p2)] return l ## fill the occupancy grid. # @param pts - 3xN matrix of points. # @param ignore_z - not use the z coord of the points. grid will be like a 2D grid. # #each cell of the grid gets filled the number of points that fall in the cell. def fill_grid(self,pts,ignore_z=False): if ignore_z: idx = np.where(np.min(np.multiply(pts[0:2,:]>self.brf[0:2,:], pts[0:2,:]<self.tlb[0:2,:]),0))[1] else: idx = np.where(np.min(np.multiply(pts[0:3,:]>self.brf,pts[0:3,:]<self.tlb),0))[1] if idx.shape[1] == 0: print 'aha!' return pts = pts[:,idx.A1.tolist()] # Find coordinates p_all = np.round((pts[0:3,:]-self.brf)/self.resolution) # Rotate points pts[0:3,:] = tr.Rz(self.rotation_z).T*pts[0:3,:] for i,p in enumerate(p_all.astype('int').T): if ignore_z: p[0,2] = 0 if np.any(p<0) or np.any(p>=self.grid_shape.T): continue tup = tuple(p.A1) self.grid_points_list[ tup[0] + self.grid_shape[0,0] * tup[1] + self.grid_shape[0,0] * self.grid_shape[1,0] * tup[2]].append(pts[:,i]) self.grid[tuple(p.A1)] += 1 def to_binary(self,thresh=1): ''' all cells with occupancy>=thresh set to 1, others set to 0. ''' filled = (self.grid>=thresh) self.grid[np.where(filled==True)] = 1 self.grid[np.where(filled==False)] = 0 def argmax_z(self,index_min=-np.Inf,index_max=np.Inf,search_up=False,search_down=False): ''' searches in the z direction for maximum number of cells with occupancy==1 call this function after calling to_binary() returns index. ''' index_min = int(max(index_min,0)) index_max = int(min(index_max,self.grid_shape[2,0]-1)) z_count_mat = [] #for i in xrange(self.grid_shape[2,0]): for i in xrange(index_min,index_max+1): z_count_mat.append(np.where(self.grid[:,:,i]==1)[0].shape[0]) if z_count_mat == []: return None z_count_mat = np.matrix(z_count_mat).T max_z = np.argmax(z_count_mat) max_count = z_count_mat[max_z,0] max_z += index_min print '#### max_count:', max_count if search_up: max_z_temp = max_z for i in range(1,5): #if (z_count_mat[max_z+i,0]*3.0)>max_count: #A #if (z_count_mat[max_z+i,0]*8.0)>max_count: #B if (max_z+i)>index_max: break if (z_count_mat[max_z+i-index_min,0]*5.0)>max_count: #B' max_z_temp = max_z+i max_z = max_z_temp if search_down: max_z_temp = max_z for i in range(1,5): if (max_z-i)<index_min: break if (max_z-i)>index_max: continue if (z_count_mat[max_z-i-index_min,0]*5.0)>max_count: max_z_temp = max_z-i max_z = max_z_temp return max_z,max_count def find_plane_indices(self,hmin=-np.Inf,hmax=np.Inf,assume_plane=False): ''' assume_plane - always return something. returns list of indices (z) corrresponding to horizontal plane points. returns [] if there is no plane ''' index_min = int(max(round((hmin-self.brf[2,0])/self.resolution[2,0]),0)) index_max = int(min(round((hmax-self.brf[2,0])/self.resolution[2,0]),self.grid_shape[2,0]-1)) z_plane,max_count = self.argmax_z(index_min,index_max,search_up=True) if z_plane == None: print 'oink oink.' return [] #---------- A # extra_remove_meters = 0.01 # n_more_to_remove = int(round(extra_remove_meters/self.resolution[2,0])) # l = range(max(z_plane-n_more_to_remove-1,0), # min(z_plane+n_more_to_remove+1,self.grid_shape[2,0]-1)) #---------- B extra_remove_meters = 0.005 n_more_to_remove = int(round(extra_remove_meters/self.resolution[2,0])) l = range(max(z_plane-10,0), min(z_plane+n_more_to_remove+1,self.grid_shape[2,0]-1)) # figure out whether this is indeed a plane. if assume_plane == False: n_more = int(round(0.1/self.resolution[2,0])) l_confirm = l+ range(max(l),min(z_plane+n_more+1,self.grid_shape[2,0]-1)) grid_2d = np.max(self.grid[:,:,l],2) n_plane_cells = grid_2d.sum() grid_2d = ni.binary_fill_holes(grid_2d) # I want 4-connectivity while filling holes. n_plane_cells = grid_2d.sum() min_plane_pts_threshold = (self.grid_shape[0,0]*self.grid_shape[1,0])/4 print '###n_plane_cells:', n_plane_cells print 'min_plane_pts_threshold:', min_plane_pts_threshold print 'find_plane_indices grid shape:',self.grid_shape.T if n_plane_cells < min_plane_pts_threshold: print 'occupancy_grid_3d.find_plane_indices: There is no plane.' print 'n_plane_cells:', n_plane_cells print 'min_plane_pts_threshold:', min_plane_pts_threshold l = [] return l ## get centroids of all the occupied cells as a 3xN np matrix # @param occupancy_threshold - number of points in a cell for it to be "occupied" # @return 3xN matrix of 3d coord of the cells which have occupancy >= occupancy_threshold def grid_to_centroids(self,occupancy_threshold=1): p = np.matrix(np.row_stack(np.where(self.grid>=occupancy_threshold))).astype('float') p[0,:] = p[0,:]*self.resolution[0,0] p[1,:] = p[1,:]*self.resolution[1,0] p[2,:] = p[2,:]*self.resolution[2,0] p += self.brf return p def grid_to_points(self,array=None,occupancy_threshold=1): ''' array - if not None then this will be used instead of self.grid returns 3xN matrix of 3d coord of the cells which have occupancy >= occupancy_threshold ''' if array == None: array = self.grid idxs = np.where(array>=occupancy_threshold) list_idxs = (idxs[0]+idxs[1]*self.grid_shape[0,0]+idxs[2]*self.grid_shape[0,0]*self.grid_shape[1,0]).tolist() l = [] for pts_idxs in list_idxs: l += self.grid_points_list[pts_idxs] if l == []: p = np.matrix([]) else: p = np.column_stack(l) return p def labeled_array_to_points(self,array,label): ''' returns coordinates of centers of grid cells corresponding to label as a 3xN matrix. ''' idxs = np.where(array==label) list_idxs = (idxs[0]+idxs[1]*self.grid_shape[0,0]+idxs[2]*self.grid_shape[0,0]*self.grid_shape[1,0]).tolist() l = [] for pts_idxs in list_idxs: l += self.grid_points_list[pts_idxs] if l == []: p = np.matrix([]) else: p = np.column_stack(l) return p def remove_vertical_plane(self): ''' removes plane parallel to the YZ plane. changes grid. returns plane_indices, slice corresponding to the vertical plane. points behind the plane are lost for ever! ''' self.grid = self.grid.swapaxes(2,0) self.grid_shape = np.matrix(self.grid.shape).T # z_max_first,max_count = self.argmax_z(search_up=False) # z_max_second,max_count_second = self.argmax_z(index_min=z_max_first+int(round(0.03/self.resolution[0,0])) ,search_up=False) z_max_first,max_count = self.argmax_z(search_down=False) z_max_second,max_count_second = self.argmax_z(index_min=z_max_first+int(round(0.035/self.resolution[0,0])) ,search_down=False) z_max_first,max_count = self.argmax_z(search_down=False) #z_max = self.argmax_z(search_up=True) if (max_count_second*1./max_count) > 0.3: z_max = z_max_second else: z_max = z_max_first print 'z_max_first', z_max_first print 'z_max_second', z_max_second print 'z_max', z_max more = int(round(0.03/self.resolution[0,0])) plane_indices = range(max(0,z_max-more),min(z_max+more,self.grid_shape[2,0])) self.grid = self.grid.swapaxes(2,0) self.grid_shape = np.matrix(self.grid.shape).T ver_plane_slice = self.grid[plane_indices,:,:] self.grid[plane_indices,:,:] = 0 max_x = max(plane_indices) behind_indices = range(max_x,self.grid_shape[0,0]) self.grid[behind_indices,:,:] = 0 return plane_indices,ver_plane_slice def remove_horizontal_plane(self, remove_below=True,hmin=-np.Inf,hmax=np.Inf, extra_layers=0): ''' call after to_binary() removes points corresponding to the horizontal plane from the grid. remove_below - remove points below the plane also. hmin,hmax - min and max possible height of the plane. (meters) This function changes grid. extra_layers - number of layers above the plane to remove. Sometimes I want to be over zealous while removing plane points. e.g. max_fwd_without_collision it returns the slice which has been set to zero, in case you want to leave the grid unchanged. ''' l = self.find_plane_indices(hmin,hmax) if l == []: print 'occupancy_grid_3d.remove_horizontal_plane: No plane found.' return None,l add_num = min(10,self.grid_shape[2,0]-max(l)-1) max_l = max(l)+add_num l_edge = l+range(max(l),max_l+1) grid_2d = np.max(self.grid[:,:,l_edge],2) # grid_2d = ni.binary_dilation(grid_2d,iterations=1) # I want 4-connectivity while filling holes. grid_2d = ni.binary_fill_holes(grid_2d) # I want 4-connectivity while filling holes. connect_structure = np.empty((3,3),dtype='int') connect_structure[:,:] = 1 eroded_2d = ni.binary_erosion(grid_2d,connect_structure,iterations=2) grid_2d = grid_2d-eroded_2d idxs = np.where(grid_2d!=0) if max_l>max(l): for i in range(min(5,add_num)): self.grid[idxs[0],idxs[1],max(l)+i+1] = 0 if remove_below: l = range(0,min(l)+1)+l max_z = max(l) for i in range(extra_layers): l.append(max_z+i+1) l_edge = l+range(max(l),max_l+1) plane_and_below_pts = self.grid[:,:,l_edge] self.grid[:,:,l] = 0 # set occupancy to zero. return plane_and_below_pts,l_edge def segment_objects(self, twod=False): ''' segments out objects after removing the plane. call after calling to_binary. returns labelled_array,n_labels labelled_array - same dimen as occupancy grid, each object has a different label. ''' plane_and_below_pts,l = self.remove_horizontal_plane(extra_layers=0) if l == []: print 'occupancy_grid_3d.segment_objects: There is no plane.' return None,None if twod == False: labelled_arr,n_labels = self.find_objects() else: labelled_arr,n_labels = self.find_objects_2d() self.grid[:,:,l] = plane_and_below_pts return labelled_arr,n_labels def find_objects_2d(self): ''' projects all points into the xy plane and then performs segmentation by region growing. ''' connect_structure = np.empty((3,3),dtype='int') connect_structure[:,:] = 1 grid_2d = np.max(self.grid[:,:,:],2) # grid_2d = ni.binary_erosion(grid_2d) # grid_2d = ni.binary_erosion(grid_2d,connect_structure) labeled_arr,n_labels = ni.label(grid_2d,connect_structure) print 'found %d objects'%(n_labels) labeled_arr_3d = self.grid.swapaxes(2,0) labeled_arr_3d = labeled_arr_3d.swapaxes(1,2) print 'labeled_arr.shape:',labeled_arr.shape print 'labeled_arr_3d.shape:',labeled_arr_3d.shape labeled_arr_3d = labeled_arr_3d*labeled_arr labeled_arr_3d = labeled_arr_3d.swapaxes(2,0) labeled_arr_3d = labeled_arr_3d.swapaxes(1,0) labeled_arr = labeled_arr_3d # I still want to count cells in 3d (thin but tall objects.) if n_labels > 0: labels_list = range(1,n_labels+1) #count_objects = ni.sum(grid_2d,labeled_arr,labels_list) count_objects = ni.sum(self.grid,labeled_arr,labels_list) if n_labels == 1: count_objects = [count_objects] t0 = time.time() new_labels_list = [] for c,l in zip(count_objects,labels_list): if c > 3: new_labels_list.append(l) else: labeled_arr[np.where(labeled_arr == l)] = 0 # relabel stuff for nl,l in enumerate(new_labels_list): labeled_arr[np.where(labeled_arr == l)] = nl+1 n_labels = len(new_labels_list) t1 = time.time() print 'time:', t1-t0 print 'found %d objects'%(n_labels) # return labeled_arr,n_labels return labeled_arr_3d,n_labels def find_objects(self): ''' region growing kind of thing for segmentation. Useful if plane has been removed. ''' connect_structure = np.empty((3,3,3),dtype='int') grid = copy.copy(self.grid) connect_structure[:,:,:] = 0 connect_structure[1,1,:] = 1 iterations = int(round(0.005/self.resolution[2,0])) # iterations=5 #grid = ni.binary_closing(grid,connect_structure,iterations=iterations) connect_structure[:,:,:] = 1 labeled_arr,n_labels = ni.label(grid,connect_structure) print 'ho!' print 'found %d objects'%(n_labels) if n_labels == 0: return labeled_arr,n_labels labels_list = range(1,n_labels+1) count_objects = ni.sum(grid,labeled_arr,labels_list) if n_labels == 1: count_objects = [count_objects] # t0 = time.time() # remove_labels = np.where(np.matrix(count_objects) <= 5)[1].A1.tolist() # for r in remove_labels: # labeled_arr[np.where(labeled_arr == r)] = 0 # t1 = time.time() # labeled_arr,n_labels = ni.label(labeled_arr,connect_structure) # print 'time:', t1-t0 t0 = time.time() new_labels_list = [] for c,l in zip(count_objects,labels_list): if c > 3: new_labels_list.append(l) else: labeled_arr[np.where(labeled_arr == l)] = 0 # relabel stuff for nl,l in enumerate(new_labels_list): labeled_arr[np.where(labeled_arr == l)] = nl+1 n_labels = len(new_labels_list) t1 = time.time() print 'time:', t1-t0 print 'found %d objects'%(n_labels) return labeled_arr,n_labels if __name__ == '__main__': import pygame_opengl_3d_display as po3d import hokuyo.pygame_utils as pu import processing_3d as p3d p = optparse.OptionParser() p.add_option('-f', action='store', type='string', dest='pkl_file_name', help='file.pkl File with the scan,pos dict.',default=None) p.add_option('-c', action='store', type='string', dest='pts_pkl', help='pkl file with 3D points',default=None) opt, args = p.parse_args() pts_pkl = opt.pts_pkl pkl_file_name = opt.pkl_file_name #-------------- simple test --------------- # gr = occupancy_grid_3d(np.matrix([0.,0.,0]).T, np.matrix([1.,1.,1]).T, # np.matrix([1,1,1]).T) # pts = np.matrix([[1.1,0,-0.2],[0,0,0],[0.7,0.7,0.3],[0.6,0.8,-0.2]]).T # gr.fill_grid(pts) ## print gr.grid resolution = np.matrix([0.01,0.01,0.01]).T gr = occupancy_grid_3d(np.matrix([0.45,-0.5,-1.0]).T, np.matrix([0.65,0.05,-0.2]).T, resolution) if pts_pkl != None: pts = ut.load_pickle(pts_pkl) elif pkl_file_name != None: dict = ut.load_pickle(pkl_file_name) pos_list = dict['pos_list'] scan_list = dict['scan_list'] min_angle = math.radians(-40) max_angle = math.radians(40) l1 = dict['l1'] l2 = dict['l2'] pts = p3d.generate_pointcloud(pos_list, scan_list, min_angle, max_angle, l1, l2) else: print 'specify a pkl file -c or -f' print 'Exiting...' sys.exit() print 'started filling the grid' t0 = time.time() gr.fill_grid(pts) t1 = time.time() print 'time to fill the grid:', t1-t0 #grid_pts = gr.grid_to_points() grid_pts = gr.grid_to_centroids() ## print grid_pts cloud = pu.CubeCloud(grid_pts,(0,0,0),(resolution/2).A1.tolist()) pc = pu.PointCloud(pts,(100,100,100)) lc = pu.LineCloud(gr.grid_lines(),(100,100,0)) po3d.run([cloud,pc,lc])
ajibawa-2023/Python-Code-Large/train/row_99557
334
613
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Import_L30_C0", "label": "sys import sys, optparse, os", "type": "import", "loc": [30, 30], "level": 0, "parent": null, "vector": [1, 0, 0.0489, 0.0016, 0, 0.66, 0.0, 509, 0, 3, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys", "optparse", "os"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys, optparse, os"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Import_L31_C0", "label": "time import time", "type": "import", "loc": [31, 31], "level": 0, "parent": null, "vector": [1, 0, 0.0506, 0.0016, 0, 0.66, 0.125, 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_99557:Import_L33_C0", "label": "math import math, np", "type": "import", "loc": [33, 33], "level": 0, "parent": null, "vector": [1, 0, 0.0538, 0.0016, 0, 0.66, 0.25, 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_99557:Import_L34_C0", "label": "scipy.ndimage import ni", "type": "import", "loc": [34, 34], "level": 0, "parent": null, "vector": [1, 0, 0.0555, 0.0016, 0, 0.66, 0.375, 348, 0, 1, 0, 0, 348, 0, 0], "semantic": {"name": "scipy.ndimage", "arg_names": [], "import_names": ["ni"], "rhs_call_name": "", "annotation": ""}, "snippet": "import scipy.ndimage as ni"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Import_L35_C0", "label": "copy import copy", "type": "import", "loc": [35, 35], "level": 0, "parent": null, "vector": [1, 0, 0.0571, 0.0016, 0, 0.66, 0.5, 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_99557:Import_L37_C0", "label": "hrl_lib.util import ut, tr", "type": "import", "loc": [37, 37], "level": 0, "parent": null, "vector": [1, 0, 0.0604, 0.0016, 0, 0.66, 0.625, 775, 0, 2, 0, 0, 775, 0, 0], "semantic": {"name": "hrl_lib.util", "arg_names": [], "import_names": ["ut", "tr"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.util as ut, hrl_lib.transforms as tr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L53_C0", "label": "subtract", "type": "function", "loc": [53, 90], "level": 0, "parent": null, "vector": [2, 0, 0.1166, 0.062, 0, 0.66, 0.75, 495, 0, 2, 0, 0, 0, 0, 28], "semantic": {"name": "subtract", "arg_names": ["og1", "og2"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def subtract(og1,og2):\n\n if np.all(og1.resolution==og2.resolution) == False:\n print('occupancy_grid_3d.subtract: The resolution of the two grids is not the same.')\n print('res1, res2:', og1.resolution.A1.tolist(), og2.resolution.A1.tolist())\n print('Exiting...')\n sys.exit()\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L55_C4", "label": "if", "type": "if", "loc": [55, 59], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L53_C0", "vector": [4, 1, 0.093, 0.0082, 1, 0.13, 0.0, 0, 0, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if np.all(og1.resolution==og2.resolution) == False:\n print('occupancy_grid_3d.subtract: The resolution of the two grids is not the same.')\n print('res1, res2:', og1.resolution.A1.tolist(), og2.resolution.A1.tolist())\n print('Exiting...')\n sys.exit()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Expr_L56_C8", "label": "print()", "type": "expression", "loc": [56, 56], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L55_C4", "vector": [8, 2, 0.0914, 0.0016, 2, 0.4, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('occupancy_grid_3d.subtract: The resolution of the two grids is not the same.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Expr_L57_C8", "label": "print()", "type": "expression", "loc": [57, 57], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L55_C4", "vector": [8, 2, 0.093, 0.0016, 2, 0.4, 0.3333, 535, 3, 3, 0, 0, 0, 0, 3], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('res1, res2:', og1.resolution.A1.tolist(), og2.resolution.A1.tolist())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Expr_L58_C8", "label": "print()", "type": "expression", "loc": [58, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L55_C4", "vector": [8, 2, 0.0946, 0.0016, 2, 0.4, 0.6667, 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_99557:Expr_L59_C8", "label": "exit()", "type": "expression", "loc": [59, 59], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L55_C4", "vector": [8, 2, 0.0962, 0.0016, 2, 0.4, 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_99557:Assign_L61_C4", "label": "sub_tlb =", "type": "assigned_variable", "loc": [61, 61], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L53_C0", "vector": [14, 1, 0.0995, 0.0016, 1, 0.13, 0.05, 443, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "sub_tlb", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " sub_tlb = og2.tlb"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L62_C4", "label": "sub_brf =", "type": "assigned_variable", "loc": [62, 62], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L53_C0", "vector": [14, 1, 0.1011, 0.0016, 1, 0.13, 0.1, 514, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "sub_brf", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " sub_brf = og2.brf"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L64_C4", "label": "sub_tlb_idx = round()", "type": "assigned_variable", "loc": [64, 64], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L53_C0", "vector": [14, 1, 0.1044, 0.0016, 1, 0.13, 0.15, 12, 3, 1, 0, 0, 19, 10, 1], "semantic": {"name": "sub_tlb_idx", "arg_names": [], "import_names": [], "rhs_call_name": "round", "annotation": ""}, "snippet": " sub_tlb_idx = np.round((sub_tlb-og1.brf)/og1.resolution)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L65_C4", "label": "sub_brf_idx = round()", "type": "assigned_variable", "loc": [65, 65], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L53_C0", "vector": [14, 1, 0.106, 0.0016, 1, 0.13, 0.2, 285, 3, 1, 0, 0, 19, 10, 1], "semantic": {"name": "sub_brf_idx", "arg_names": [], "import_names": [], "rhs_call_name": "round", "annotation": ""}, "snippet": " sub_brf_idx = np.round((sub_brf-og1.brf)/og1.resolution)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L67_C4", "label": "x_s, y_s, z_s =", "type": "assigned_variable", "loc": [67, 67], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L53_C0", "vector": [14, 1, 0.1093, 0.0016, 1, 0.13, 0.25, 672, 0, 0, 0, 0, 0, 8, 3], "semantic": {"name": "x_s, y_s, z_s", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " x_s,y_s,z_s = int(sub_brf_idx[0,0]),int(sub_brf_idx[1,0]),int(sub_brf_idx[2,0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L68_C4", "label": "x_e, y_e, z_e =", "type": "assigned_variable", "loc": [68, 68], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L53_C0", "vector": [14, 1, 0.1109, 0.0016, 1, 0.13, 0.3, 769, 0, 0, 0, 0, 0, 8, 3], "semantic": {"name": "x_e, y_e, z_e", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " x_e,y_e,z_e = int(sub_tlb_idx[0,0]),int(sub_tlb_idx[1,0]),int(sub_tlb_idx[2,0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L70_C4", "label": "x_e = min()", "type": "assigned_variable", "loc": [70, 70], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L53_C0", "vector": [14, 1, 0.1142, 0.0016, 1, 0.13, 0.35, 526, 3, 2, 0, 0, 867, 10, 1], "semantic": {"name": "x_e", "arg_names": [], "import_names": [], "rhs_call_name": "min", "annotation": ""}, "snippet": " x_e = min(x_e+1,og1.grid_shape[0,0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L71_C4", "label": "y_e = min()", "type": "assigned_variable", "loc": [71, 71], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L53_C0", "vector": [14, 1, 0.1158, 0.0016, 1, 0.13, 0.4, 768, 3, 2, 0, 0, 867, 10, 1], "semantic": {"name": "y_e", "arg_names": [], "import_names": [], "rhs_call_name": "min", "annotation": ""}, "snippet": " y_e = min(y_e+1,og1.grid_shape[1,0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L72_C4", "label": "z_e = min()", "type": "assigned_variable", "loc": [72, 72], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L53_C0", "vector": [14, 1, 0.1175, 0.0016, 1, 0.13, 0.45, 413, 3, 2, 0, 0, 867, 10, 1], "semantic": {"name": "z_e", "arg_names": [], "import_names": [], "rhs_call_name": "min", "annotation": ""}, "snippet": " z_e = min(z_e+1,og1.grid_shape[2,0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L73_C4", "label": "sub_grid =", "type": "assigned_variable", "loc": [73, 73], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L53_C0", "vector": [14, 1, 0.1191, 0.0016, 1, 0.13, 0.5, 668, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "sub_grid", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " sub_grid = og1.grid[x_s:x_e,y_s:y_e,z_s:z_e]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L75_C4", "label": "if", "type": "if", "loc": [75, 78], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L53_C0", "vector": [4, 1, 0.1248, 0.0065, 1, 0.13, 0.55, 0, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if np.any(og1.grid_shape!=og2.grid_shape):\n print('#############################################################################')\n print('WARNING: occupancy_grid_3d.subtract has not been tested for grids of different sizes.')\n print('#############################################################################')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Expr_L76_C8", "label": "print()", "type": "expression", "loc": [76, 76], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L75_C4", "vector": [8, 2, 0.124, 0.0016, 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('#############################################################################')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Expr_L77_C8", "label": "print()", "type": "expression", "loc": [77, 77], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L75_C4", "vector": [8, 2, 0.1256, 0.0016, 2, 0.31, 0.5, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('WARNING: occupancy_grid_3d.subtract has not been tested for grids of different sizes.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Expr_L78_C8", "label": "print()", "type": "expression", "loc": [78, 78], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L75_C4", "vector": [8, 2, 0.1272, 0.0016, 2, 0.31, 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_99557:Assign_L79_C4", "label": "sub_grid =", "type": "assigned_variable", "loc": [79, 79], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L53_C0", "vector": [14, 1, 0.1289, 0.0016, 1, 0.13, 0.6, 668, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "sub_grid", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " sub_grid = sub_grid-og2.grid"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L80_C4", "label": "sub_grid = abs()", "type": "assigned_variable", "loc": [80, 80], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L53_C0", "vector": [14, 1, 0.1305, 0.0016, 1, 0.13, 0.65, 668, 3, 1, 0, 0, 799, 10, 1], "semantic": {"name": "sub_grid", "arg_names": [], "import_names": [], "rhs_call_name": "abs", "annotation": ""}, "snippet": " sub_grid = np.abs(sub_grid) # for now."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L81_C4", "label": "assign", "type": "assigned_variable", "loc": [81, 81], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L53_C0", "vector": [14, 1, 0.1321, 0.0016, 1, 0.13, 0.7, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " og1.grid[x_s:x_e,y_s:y_e,z_s:z_e] = sub_grid"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L82_C4", "label": "idxs = where()", "type": "assigned_variable", "loc": [82, 82], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L53_C0", "vector": [14, 1, 0.1338, 0.0016, 1, 0.13, 0.75, 677, 3, 1, 0, 0, 169, 10, 1], "semantic": {"name": "idxs", "arg_names": [], "import_names": [], "rhs_call_name": "where", "annotation": ""}, "snippet": " idxs = np.where(sub_grid>=1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L83_C4", "label": "shp =", "type": "assigned_variable", "loc": [83, 83], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L53_C0", "vector": [14, 1, 0.1354, 0.0016, 1, 0.13, 0.8, 185, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "shp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " shp = og2.grid_shape"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L84_C4", "label": "list_idxs = tolist()", "type": "assigned_variable", "loc": [84, 84], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L53_C0", "vector": [14, 1, 0.137, 0.0016, 1, 0.13, 0.85, 227, 3, 0, 0, 0, 185, 10, 1], "semantic": {"name": "list_idxs", "arg_names": [], "import_names": [], "rhs_call_name": "tolist", "annotation": ""}, "snippet": " list_idxs = (idxs[0]+idxs[1]*shp[0,0]+idxs[2]*shp[0,0]*shp[1,0]).tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L86_C4", "label": "og1_list_idxs = tolist()", "type": "assigned_variable", "loc": [86, 86], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L53_C0", "vector": [14, 1, 0.1403, 0.0016, 1, 0.13, 0.9, 686, 3, 0, 0, 0, 185, 10, 1], "semantic": {"name": "og1_list_idxs", "arg_names": [], "import_names": [], "rhs_call_name": "tolist", "annotation": ""}, "snippet": " og1_list_idxs = (idxs[0]+x_s+(idxs[1]+y_s)*shp[0,0]+(idxs[2]+z_s)*shp[0,0]*shp[1,0]).tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L87_C4", "label": "og1_list_len = len()", "type": "assigned_variable", "loc": [87, 87], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L53_C0", "vector": [14, 1, 0.1419, 0.0016, 1, 0.13, 0.95, 97, 3, 1, 0, 0, 890, 10, 1], "semantic": {"name": "og1_list_len", "arg_names": [], "import_names": [], "rhs_call_name": "len", "annotation": ""}, "snippet": " og1_list_len = len(og1.grid_points_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:For_L88_C4", "label": "for og1_pts_idxs, pts_idxs", "type": "for", "loc": [88, 90], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L53_C0", "vector": [6, 1, 0.1452, 0.0049, 1, 0.13, 1.0, 18, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "og1_pts_idxs, pts_idxs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for og1_pts_idxs,pts_idxs in zip(og1_list_idxs,list_idxs):\n if og1_pts_idxs<og1_list_len:\n og1.grid_points_list[og1_pts_idxs] += og2.grid_points_list[pts_idxs]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L89_C8", "label": "if", "type": "if", "loc": [89, 90], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:For_L88_C4", "vector": [4, 2, 0.146, 0.0033, 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 og1_pts_idxs<og1_list_len:\n og1.grid_points_list[og1_pts_idxs] += og2.grid_points_list[pts_idxs]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:ClassDef_L93_C0", "label": "occupancy_grid_3d", "type": "class", "loc": [93, 545], "level": 0, "parent": null, "vector": [3, 0, 0.5204, 0.739, 0, 0.66, 0.875, 222, 0, 14, 0, 0, 0, 0, 99], "semantic": {"name": "occupancy_grid_3d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class occupancy_grid_3d():\n\n ##\n # @param brf - 3x1 matrix. Bottom Right Front.\n # @param tlb - 3x1 matrix (coord of center of the top left back cell)\n # @param resolution - 3x1 matrix. size of each cell (in meters) along\n # the different directions.\n def __init__(self, brf, tlb, resolution, rotation_z=math.radians(0.)):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L100_C4", "label": "__init__", "type": "function", "loc": [100, 111], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:ClassDef_L93_C0", "vector": [2, 1, 0.1721, 0.0196, 1, 0.5, 0.0, 555, 0, 5, 0, 0, 0, 0, 6], "semantic": {"name": "__init__", "arg_names": ["self", "brf", "tlb", "resolution", "rotation_z"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, brf, tlb, resolution, rotation_z=math.radians(0.)):\n #print np.round((tlb-brf)/resolution).astype('int')+1\n self.grid = np.zeros(np.round((tlb-brf)/resolution).astype('int')+1,dtype='int')\n\n self.tlb = tlb\n self.brf = brf\n self.grid_shape = np.matrix(self.grid.shape).T\n self.resolution = resolution"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L102_C8", "label": "self.grid = zeros()", "type": "assigned_variable", "loc": [102, 102], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L100_C4", "vector": [14, 2, 0.1664, 0.0016, 2, 0.16, 0.0, 16, 3, 2, 0, 0, 213, 10, 3], "semantic": {"name": "self.grid", "arg_names": [], "import_names": [], "rhs_call_name": "zeros", "annotation": ""}, "snippet": " self.grid = np.zeros(np.round((tlb-brf)/resolution).astype('int')+1,dtype='int')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L104_C8", "label": "self.tlb =", "type": "assigned_variable", "loc": [104, 104], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L100_C4", "vector": [14, 2, 0.1697, 0.0016, 2, 0.16, 0.1429, 478, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.tlb", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.tlb = tlb"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L105_C8", "label": "self.brf =", "type": "assigned_variable", "loc": [105, 105], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L100_C4", "vector": [14, 2, 0.1713, 0.0016, 2, 0.16, 0.2857, 962, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.brf", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.brf = brf"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L106_C8", "label": "self.grid_shape =", "type": "assigned_variable", "loc": [106, 106], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L100_C4", "vector": [14, 2, 0.1729, 0.0016, 2, 0.16, 0.4286, 573, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.grid_shape", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.grid_shape = np.matrix(self.grid.shape).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L107_C8", "label": "self.resolution =", "type": "assigned_variable", "loc": [107, 107], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L100_C4", "vector": [14, 2, 0.1746, 0.0016, 2, 0.16, 0.5714, 440, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.resolution", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.resolution = resolution"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L109_C8", "label": "n_cells =", "type": "assigned_variable", "loc": [109, 109], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L100_C4", "vector": [14, 2, 0.1778, 0.0016, 2, 0.16, 0.7143, 203, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "n_cells", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " n_cells = self.grid.shape[0]*self.grid.shape[1]*self.grid.shape[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L110_C8", "label": "self.grid_points_list =", "type": "assigned_variable", "loc": [110, 110], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L100_C4", "vector": [14, 2, 0.1794, 0.0016, 2, 0.16, 0.8571, 102, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.grid_points_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.grid_points_list = [[] for i in range(n_cells)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L111_C8", "label": "self.rotation_z =", "type": "assigned_variable", "loc": [111, 111], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L100_C4", "vector": [14, 2, 0.1811, 0.0016, 2, 0.16, 1.0, 878, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.rotation_z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.rotation_z = rotation_z"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L116_C4", "label": "grid_lines", "type": "function", "loc": [116, 140], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:ClassDef_L93_C0", "vector": [2, 1, 0.2088, 0.0408, 1, 0.5, 0.0769, 457, 0, 2, 1, 0, 0, 0, 8], "semantic": {"name": "grid_lines", "arg_names": ["self", "rotation_angle"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def grid_lines(self, rotation_angle=0.):\n grid_size = np.multiply(self.grid_shape,self.resolution)\n rot_mat = tr.rotZ(rotation_angle)\n p5 = self.tlb\n p6 = p5+np.matrix([0.,-grid_size[1,0],0.]).T\n p8 = p5+np.matrix([0.,0.,-grid_size[2,0]]).T\n p7 = p8+np.matrix([0.,-grid_size[1,0],0.]).T\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L117_C8", "label": "grid_size = multiply()", "type": "assigned_variable", "loc": [117, 117], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L116_C4", "vector": [14, 2, 0.1909, 0.0016, 2, 0.4, 0.0, 140, 3, 2, 0, 0, 960, 10, 1], "semantic": {"name": "grid_size", "arg_names": [], "import_names": [], "rhs_call_name": "multiply", "annotation": ""}, "snippet": " grid_size = np.multiply(self.grid_shape,self.resolution)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L118_C8", "label": "rot_mat = rotZ()", "type": "assigned_variable", "loc": [118, 118], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L116_C4", "vector": [14, 2, 0.1925, 0.0016, 2, 0.4, 0.0526, 968, 3, 1, 0, 0, 728, 10, 1], "semantic": {"name": "rot_mat", "arg_names": [], "import_names": [], "rhs_call_name": "rotZ", "annotation": ""}, "snippet": " rot_mat = tr.rotZ(rotation_angle)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L119_C8", "label": "p5 =", "type": "assigned_variable", "loc": [119, 119], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L116_C4", "vector": [14, 2, 0.1941, 0.0016, 2, 0.4, 0.1053, 735, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "p5", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p5 = self.tlb"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L120_C8", "label": "p6 =", "type": "assigned_variable", "loc": [120, 120], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L116_C4", "vector": [14, 2, 0.1958, 0.0016, 2, 0.4, 0.1579, 214, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "p6", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p6 = p5+np.matrix([0.,-grid_size[1,0],0.]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L121_C8", "label": "p8 =", "type": "assigned_variable", "loc": [121, 121], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L116_C4", "vector": [14, 2, 0.1974, 0.0016, 2, 0.4, 0.2105, 582, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "p8", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p8 = p5+np.matrix([0.,0.,-grid_size[2,0]]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L122_C8", "label": "p7 =", "type": "assigned_variable", "loc": [122, 122], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L116_C4", "vector": [14, 2, 0.199, 0.0016, 2, 0.4, 0.2632, 15, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "p7", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p7 = p8+np.matrix([0.,-grid_size[1,0],0.]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L124_C8", "label": "p3 =", "type": "assigned_variable", "loc": [124, 124], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L116_C4", "vector": [14, 2, 0.2023, 0.0016, 2, 0.4, 0.3158, 80, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "p3", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p3 = self.brf"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L125_C8", "label": "p4 =", "type": "assigned_variable", "loc": [125, 125], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L116_C4", "vector": [14, 2, 0.2039, 0.0016, 2, 0.4, 0.3684, 80, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "p4", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p4 = p3+np.matrix([0.,grid_size[1,0],0.]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L126_C8", "label": "p2 =", "type": "assigned_variable", "loc": [126, 126], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L116_C4", "vector": [14, 2, 0.2055, 0.0016, 2, 0.4, 0.4211, 843, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "p2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p2 = p3+np.matrix([0.,0.,grid_size[2,0]]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L127_C8", "label": "p1 =", "type": "assigned_variable", "loc": [127, 127], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L116_C4", "vector": [14, 2, 0.2072, 0.0016, 2, 0.4, 0.4737, 87, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "p1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p1 = p2+np.matrix([0.,grid_size[1,0],0.]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L129_C8", "label": "p1 =", "type": "assigned_variable", "loc": [129, 129], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L116_C4", "vector": [14, 2, 0.2104, 0.0016, 2, 0.4, 0.5263, 87, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "p1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p1 = rot_mat*p1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L130_C8", "label": "p2 =", "type": "assigned_variable", "loc": [130, 130], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L116_C4", "vector": [14, 2, 0.2121, 0.0016, 2, 0.4, 0.5789, 843, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "p2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p2 = rot_mat*p2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L131_C8", "label": "p3 =", "type": "assigned_variable", "loc": [131, 131], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L116_C4", "vector": [14, 2, 0.2137, 0.0016, 2, 0.4, 0.6316, 80, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "p3", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p3 = rot_mat*p3"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L132_C8", "label": "p4 =", "type": "assigned_variable", "loc": [132, 132], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L116_C4", "vector": [14, 2, 0.2153, 0.0016, 2, 0.4, 0.6842, 80, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "p4", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p4 = rot_mat*p4"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L133_C8", "label": "p5 =", "type": "assigned_variable", "loc": [133, 133], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L116_C4", "vector": [14, 2, 0.217, 0.0016, 2, 0.4, 0.7368, 735, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "p5", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p5 = rot_mat*p5"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L134_C8", "label": "p6 =", "type": "assigned_variable", "loc": [134, 134], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L116_C4", "vector": [14, 2, 0.2186, 0.0016, 2, 0.4, 0.7895, 214, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "p6", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p6 = rot_mat*p6"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L135_C8", "label": "p7 =", "type": "assigned_variable", "loc": [135, 135], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L116_C4", "vector": [14, 2, 0.2202, 0.0016, 2, 0.4, 0.8421, 15, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "p7", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p7 = rot_mat*p7"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L136_C8", "label": "p8 =", "type": "assigned_variable", "loc": [136, 136], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L116_C4", "vector": [14, 2, 0.2219, 0.0016, 2, 0.4, 0.8947, 582, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "p8", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p8 = rot_mat*p8"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L138_C8", "label": "l =", "type": "assigned_variable", "loc": [138, 138], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L116_C4", "vector": [14, 2, 0.2251, 0.0016, 2, 0.4, 0.9474, 810, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " l = [(p1,p2),(p1,p4),(p2,p3),(p3,p4),(p5,p6),(p6,p7),(p7,p8),(p8,p5),(p1,p5),(p2,p6),(p4,p8),(p3,p7)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Return_L140_C8", "label": "return", "type": "return", "loc": [140, 140], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L116_C4", "vector": [13, 2, 0.2284, 0.0016, 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 l"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L147_C4", "label": "fill_grid", "type": "function", "loc": [147, 177], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:ClassDef_L93_C0", "vector": [2, 1, 0.2643, 0.0506, 1, 0.5, 0.1538, 619, 0, 3, 0, 0, 0, 0, 17], "semantic": {"name": "fill_grid", "arg_names": ["self", "pts", "ignore_z"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def fill_grid(self,pts,ignore_z=False):\n if ignore_z:\n idx = np.where(np.min(np.multiply(pts[0:2,:]>self.brf[0:2,:],\n pts[0:2,:]<self.tlb[0:2,:]),0))[1]\n else:\n idx = np.where(np.min(np.multiply(pts[0:3,:]>self.brf,pts[0:3,:]<self.tlb),0))[1]\n\n if idx.shape[1] == 0:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L148_C8", "label": "if", "type": "if", "loc": [148, 152], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L147_C4", "vector": [4, 2, 0.2447, 0.0082, 2, 0.74, 0.0, 0, 2, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if ignore_z:\n idx = np.where(np.min(np.multiply(pts[0:2,:]>self.brf[0:2,:],\n pts[0:2,:]<self.tlb[0:2,:]),0))[1]\n else:\n idx = np.where(np.min(np.multiply(pts[0:3,:]>self.brf,pts[0:3,:]<self.tlb),0))[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L149_C12", "label": "idx =", "type": "assigned_variable", "loc": [149, 150], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L148_C8", "vector": [14, 3, 0.2439, 0.0033, 3, 0.64, 0.0, 187, 6, 0, 0, 0, 0, 0, 3], "semantic": {"name": "idx", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " idx = np.where(np.min(np.multiply(pts[0:2,:]>self.brf[0:2,:],\n pts[0:2,:]<self.tlb[0:2,:]),0))[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L152_C12", "label": "idx =", "type": "assigned_variable", "loc": [152, 152], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L148_C8", "vector": [14, 3, 0.248, 0.0016, 3, 0.64, 1.0, 187, 6, 0, 0, 0, 0, 0, 3], "semantic": {"name": "idx", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " idx = np.where(np.min(np.multiply(pts[0:3,:]>self.brf,pts[0:3,:]<self.tlb),0))[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L154_C8", "label": "if", "type": "if", "loc": [154, 156], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L147_C4", "vector": [4, 2, 0.2529, 0.0049, 2, 0.74, 0.2, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if idx.shape[1] == 0:\n print('aha!')\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Expr_L155_C12", "label": "print()", "type": "expression", "loc": [155, 155], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L154_C8", "vector": [8, 3, 0.2529, 0.0016, 3, 0.48, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('aha!')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Return_L156_C12", "label": "return", "type": "return", "loc": [156, 156], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L154_C8", "vector": [13, 3, 0.2545, 0.0016, 3, 0.48, 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_99557:Assign_L157_C8", "label": "pts =", "type": "assigned_variable", "loc": [157, 157], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L147_C4", "vector": [14, 2, 0.2561, 0.0016, 2, 0.74, 0.4, 195, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "pts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pts = pts[:,idx.A1.tolist()]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L160_C8", "label": "p_all = round()", "type": "assigned_variable", "loc": [160, 160], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L147_C4", "vector": [14, 2, 0.261, 0.0016, 2, 0.74, 0.6, 45, 3, 1, 0, 0, 19, 10, 1], "semantic": {"name": "p_all", "arg_names": [], "import_names": [], "rhs_call_name": "round", "annotation": ""}, "snippet": " p_all = np.round((pts[0:3,:]-self.brf)/self.resolution)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L162_C8", "label": "assign", "type": "assigned_variable", "loc": [162, 162], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L147_C4", "vector": [14, 2, 0.2643, 0.0016, 2, 0.74, 0.8, 0, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pts[0:3,:] = tr.Rz(self.rotation_z).T*pts[0:3,:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:For_L164_C8", "label": "for i, p", "type": "for", "loc": [164, 177], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L147_C4", "vector": [6, 2, 0.2781, 0.0228, 2, 0.74, 1.0, 816, 3, 0, 0, 0, 0, 0, 7], "semantic": {"name": "i, p", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i,p in enumerate(p_all.astype('int').T):\n if ignore_z:\n p[0,2] = 0\n\n if np.any(p<0) or np.any(p>=self.grid_shape.T):\n continue\n\n tup = tuple(p.A1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L165_C12", "label": "if", "type": "if", "loc": [165, 166], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:For_L164_C8", "vector": [4, 3, 0.27, 0.0033, 3, 0.86, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if ignore_z:\n p[0,2] = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L166_C16", "label": "assign", "type": "assigned_variable", "loc": [166, 166], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L165_C12", "vector": [14, 4, 0.2708, 0.0016, 4, 0.76, 0.0, 0, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p[0,2] = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L168_C12", "label": "if", "type": "if", "loc": [168, 169], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:For_L164_C8", "vector": [4, 3, 0.2749, 0.0033, 3, 0.86, 0.3333, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if np.any(p<0) or np.any(p>=self.grid_shape.T):\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L171_C12", "label": "tup = tuple()", "type": "assigned_variable", "loc": [171, 171], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:For_L164_C8", "vector": [14, 3, 0.279, 0.0016, 3, 0.86, 0.6667, 218, 3, 1, 0, 0, 259, 10, 1], "semantic": {"name": "tup", "arg_names": [], "import_names": [], "rhs_call_name": "tuple", "annotation": ""}, "snippet": " tup = tuple(p.A1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Expr_L172_C12", "label": "append()", "type": "expression", "loc": [172, 176], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:For_L164_C8", "vector": [8, 3, 0.2838, 0.0082, 3, 0.86, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.grid_points_list[\n tup[0] + self.grid_shape[0,0] * \n tup[1] + self.grid_shape[0,0] * \n self.grid_shape[1,0] * \n tup[2]].append(pts[:,i])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L180_C4", "label": "to_binary", "type": "function", "loc": [180, 185], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:ClassDef_L93_C0", "vector": [2, 1, 0.2977, 0.0098, 1, 0.5, 0.2308, 206, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "to_binary", "arg_names": ["self", "thresh"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def to_binary(self,thresh=1):\n ''' all cells with occupancy>=thresh set to 1, others set to 0.\n '''\n filled = (self.grid>=thresh)\n self.grid[np.where(filled==True)] = 1\n self.grid[np.where(filled==False)] = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Expr_L181_C8", "label": "expression", "type": "expression", "loc": [181, 182], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L180_C4", "vector": [8, 2, 0.2961, 0.0033, 2, 0.49, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' all cells with occupancy>=thresh set to 1, others set to 0.\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L183_C8", "label": "filled =", "type": "assigned_variable", "loc": [183, 183], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L180_C4", "vector": [14, 2, 0.2985, 0.0016, 2, 0.49, 0.3333, 984, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "filled", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " filled = (self.grid>=thresh)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L184_C8", "label": "assign", "type": "assigned_variable", "loc": [184, 184], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L180_C4", "vector": [14, 2, 0.3002, 0.0016, 2, 0.49, 0.6667, 0, 1, 0, 0, 0, 0, 1, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.grid[np.where(filled==True)] = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L185_C8", "label": "assign", "type": "assigned_variable", "loc": [185, 185], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L180_C4", "vector": [14, 2, 0.3018, 0.0016, 2, 0.49, 1.0, 0, 1, 0, 0, 0, 0, 1, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.grid[np.where(filled==False)] = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L187_C4", "label": "argmax_z", "type": "function", "loc": [187, 230], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:ClassDef_L93_C0", "vector": [2, 1, 0.3401, 0.0718, 1, 0.5, 0.3077, 859, 0, 5, 1, 0, 0, 0, 12], "semantic": {"name": "argmax_z", "arg_names": ["self", "index_min", "index_max", "search_up", "search_down"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def argmax_z(self,index_min=-np.Inf,index_max=np.Inf,search_up=False,search_down=False):\n ''' searches in the z direction for maximum number of cells with occupancy==1\n call this function after calling to_binary()\n returns index.\n '''\n index_min = int(max(index_min,0))\n index_max = int(min(index_max,self.grid_shape[2,0]-1))\n z_count_mat = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Expr_L188_C8", "label": "expression", "type": "expression", "loc": [188, 191], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L187_C4", "vector": [8, 2, 0.3091, 0.0065, 2, 0.89, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' searches in the z direction for maximum number of cells with occupancy==1\n call this function after calling to_binary()\n returns index.\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L192_C8", "label": "index_min = int()", "type": "assigned_variable", "loc": [192, 192], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L187_C4", "vector": [14, 2, 0.3132, 0.0016, 2, 0.89, 0.0833, 28, 3, 1, 0, 0, 901, 10, 2], "semantic": {"name": "index_min", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": " index_min = int(max(index_min,0))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L193_C8", "label": "index_max = int()", "type": "assigned_variable", "loc": [193, 193], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L187_C4", "vector": [14, 2, 0.3148, 0.0016, 2, 0.89, 0.1667, 818, 3, 1, 0, 0, 901, 10, 2], "semantic": {"name": "index_max", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": " index_max = int(min(index_max,self.grid_shape[2,0]-1))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L194_C8", "label": "z_count_mat =", "type": "assigned_variable", "loc": [194, 194], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L187_C4", "vector": [14, 2, 0.3165, 0.0016, 2, 0.89, 0.25, 469, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "z_count_mat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " z_count_mat = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:For_L196_C8", "label": "for i", "type": "for", "loc": [196, 197], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L187_C4", "vector": [6, 2, 0.3206, 0.0033, 2, 0.89, 0.3333, 826, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in xrange(index_min,index_max+1):\n z_count_mat.append(np.where(self.grid[:,:,i]==1)[0].shape[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Expr_L197_C12", "label": "append()", "type": "expression", "loc": [197, 197], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:For_L196_C8", "vector": [8, 3, 0.3214, 0.0016, 3, 0.13, 0.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " z_count_mat.append(np.where(self.grid[:,:,i]==1)[0].shape[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L199_C8", "label": "if", "type": "if", "loc": [199, 200], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L187_C4", "vector": [4, 2, 0.3254, 0.0033, 2, 0.89, 0.4167, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if z_count_mat == []:\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Return_L200_C12", "label": "return", "type": "return", "loc": [200, 200], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L199_C8", "vector": [13, 3, 0.3263, 0.0016, 3, 0.95, 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_99557:Assign_L201_C8", "label": "z_count_mat =", "type": "assigned_variable", "loc": [201, 201], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L187_C4", "vector": [14, 2, 0.3279, 0.0016, 2, 0.89, 0.5, 469, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "z_count_mat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " z_count_mat = np.matrix(z_count_mat).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L202_C8", "label": "max_z = argmax()", "type": "assigned_variable", "loc": [202, 202], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L187_C4", "vector": [14, 2, 0.3295, 0.0016, 2, 0.89, 0.5833, 119, 3, 1, 0, 0, 593, 10, 1], "semantic": {"name": "max_z", "arg_names": [], "import_names": [], "rhs_call_name": "argmax", "annotation": ""}, "snippet": " max_z = np.argmax(z_count_mat)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L203_C8", "label": "max_count =", "type": "assigned_variable", "loc": [203, 203], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L187_C4", "vector": [14, 2, 0.3312, 0.0016, 2, 0.89, 0.6667, 632, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "max_count", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " max_count = z_count_mat[max_z,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Expr_L205_C8", "label": "print()", "type": "expression", "loc": [205, 205], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L187_C4", "vector": [8, 2, 0.3344, 0.0016, 2, 0.89, 0.75, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('#### max_count:', max_count)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L207_C8", "label": "if", "type": "if", "loc": [207, 216], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L187_C4", "vector": [4, 2, 0.345, 0.0163, 2, 0.89, 0.8333, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if search_up:\n max_z_temp = max_z\n for i in range(1,5):\n #if (z_count_mat[max_z+i,0]*3.0)>max_count: #A\n #if (z_count_mat[max_z+i,0]*8.0)>max_count: #B\n if (max_z+i)>index_max:\n break\n if (z_count_mat[max_z+i-index_min,0]*5.0)>max_count: #B'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L208_C12", "label": "max_z_temp =", "type": "assigned_variable", "loc": [208, 208], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L207_C8", "vector": [14, 3, 0.3393, 0.0016, 3, 0.0, 0.0, 155, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "max_z_temp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " max_z_temp = max_z"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:For_L209_C12", "label": "for i", "type": "for", "loc": [209, 215], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L207_C8", "vector": [6, 3, 0.3458, 0.0114, 3, 0.0, 0.5, 826, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(1,5):\n #if (z_count_mat[max_z+i,0]*3.0)>max_count: #A\n #if (z_count_mat[max_z+i,0]*8.0)>max_count: #B\n if (max_z+i)>index_max:\n break\n if (z_count_mat[max_z+i-index_min,0]*5.0)>max_count: #B'\n max_z_temp = max_z+i"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L212_C16", "label": "if", "type": "if", "loc": [212, 213], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:For_L209_C12", "vector": [4, 4, 0.3467, 0.0033, 4, 0.7, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (max_z+i)>index_max:\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L214_C16", "label": "if", "type": "if", "loc": [214, 215], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:For_L209_C12", "vector": [4, 4, 0.3499, 0.0033, 4, 0.7, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (z_count_mat[max_z+i-index_min,0]*5.0)>max_count: #B'\n max_z_temp = max_z+i"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L215_C20", "label": "max_z_temp =", "type": "assigned_variable", "loc": [215, 215], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L214_C16", "vector": [14, 5, 0.3507, 0.0016, 5, 0.6, 0.0, 155, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "max_z_temp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " max_z_temp = max_z+i"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L216_C12", "label": "max_z =", "type": "assigned_variable", "loc": [216, 216], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L207_C8", "vector": [14, 3, 0.3524, 0.0016, 3, 0.0, 1.0, 119, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "max_z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " max_z = max_z_temp"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L218_C8", "label": "if", "type": "if", "loc": [218, 228], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L187_C4", "vector": [4, 2, 0.3638, 0.0179, 2, 0.89, 0.9167, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if search_down:\n max_z_temp = max_z\n for i in range(1,5):\n if (max_z-i)<index_min:\n break\n if (max_z-i)>index_max:\n continue\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L219_C12", "label": "max_z_temp =", "type": "assigned_variable", "loc": [219, 219], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L218_C8", "vector": [14, 3, 0.3573, 0.0016, 3, 0.4, 0.0, 155, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "max_z_temp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " max_z_temp = max_z"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:For_L220_C12", "label": "for i", "type": "for", "loc": [220, 227], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L218_C8", "vector": [6, 3, 0.3646, 0.0131, 3, 0.4, 0.5, 826, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(1,5):\n if (max_z-i)<index_min:\n break\n if (max_z-i)>index_max:\n continue\n\n if (z_count_mat[max_z-i-index_min,0]*5.0)>max_count:\n max_z_temp = max_z-i"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L221_C16", "label": "if", "type": "if", "loc": [221, 222], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:For_L220_C12", "vector": [4, 4, 0.3613, 0.0033, 4, 0.34, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (max_z-i)<index_min:\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L223_C16", "label": "if", "type": "if", "loc": [223, 224], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:For_L220_C12", "vector": [4, 4, 0.3646, 0.0033, 4, 0.34, 0.5, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (max_z-i)>index_max:\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L226_C16", "label": "if", "type": "if", "loc": [226, 227], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:For_L220_C12", "vector": [4, 4, 0.3695, 0.0033, 4, 0.34, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (z_count_mat[max_z-i-index_min,0]*5.0)>max_count:\n max_z_temp = max_z-i"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L227_C20", "label": "max_z_temp =", "type": "assigned_variable", "loc": [227, 227], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L226_C16", "vector": [14, 5, 0.3703, 0.0016, 5, 0.99, 0.0, 155, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "max_z_temp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " max_z_temp = max_z-i"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L228_C12", "label": "max_z =", "type": "assigned_variable", "loc": [228, 228], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L218_C8", "vector": [14, 3, 0.3719, 0.0016, 3, 0.4, 1.0, 119, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "max_z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " max_z = max_z_temp"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Return_L230_C8", "label": "return", "type": "return", "loc": [230, 230], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L187_C4", "vector": [13, 2, 0.3752, 0.0016, 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 max_z,max_count"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L232_C4", "label": "find_plane_indices", "type": "function", "loc": [232, 277], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:ClassDef_L93_C0", "vector": [2, 1, 0.4152, 0.075, 1, 0.5, 0.3846, 383, 0, 4, 1, 0, 0, 0, 28], "semantic": {"name": "find_plane_indices", "arg_names": ["self", "hmin", "hmax", "assume_plane"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def find_plane_indices(self,hmin=-np.Inf,hmax=np.Inf,assume_plane=False):\n ''' assume_plane - always return something.\n returns list of indices (z) corrresponding to horizontal plane points.\n returns [] if there is no plane\n '''\n index_min = int(max(round((hmin-self.brf[2,0])/self.resolution[2,0]),0))\n index_max = int(min(round((hmax-self.brf[2,0])/self.resolution[2,0]),self.grid_shape[2,0]-1))\n z_plane,max_count = self.argmax_z(index_min,index_max,search_up=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Expr_L233_C8", "label": "expression", "type": "expression", "loc": [233, 236], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L232_C4", "vector": [8, 2, 0.3825, 0.0065, 2, 0.43, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' assume_plane - always return something.\n returns list of indices (z) corrresponding to horizontal plane points.\n returns [] if there is no plane\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L237_C8", "label": "index_min = int()", "type": "assigned_variable", "loc": [237, 237], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L232_C4", "vector": [14, 2, 0.3866, 0.0016, 2, 0.43, 0.1111, 28, 3, 1, 0, 0, 901, 10, 3], "semantic": {"name": "index_min", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": " index_min = int(max(round((hmin-self.brf[2,0])/self.resolution[2,0]),0))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L238_C8", "label": "index_max = int()", "type": "assigned_variable", "loc": [238, 238], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L232_C4", "vector": [14, 2, 0.3883, 0.0016, 2, 0.43, 0.2222, 818, 3, 1, 0, 0, 901, 10, 3], "semantic": {"name": "index_max", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": " index_max = int(min(round((hmax-self.brf[2,0])/self.resolution[2,0]),self.grid_shape[2,0]-1))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L239_C8", "label": "z_plane, max_count = argmax_z()", "type": "assigned_variable", "loc": [239, 239], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L232_C4", "vector": [14, 2, 0.3899, 0.0016, 2, 0.43, 0.3333, 246, 3, 3, 0, 0, 859, 10, 1], "semantic": {"name": "z_plane, max_count", "arg_names": [], "import_names": [], "rhs_call_name": "argmax_z", "annotation": ""}, "snippet": " z_plane,max_count = self.argmax_z(index_min,index_max,search_up=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L240_C8", "label": "if", "type": "if", "loc": [240, 242], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L232_C4", "vector": [4, 2, 0.3931, 0.0049, 2, 0.43, 0.4444, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if z_plane == None:\n print('oink oink.')\n return []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Expr_L241_C12", "label": "print()", "type": "expression", "loc": [241, 241], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L240_C8", "vector": [8, 3, 0.3931, 0.0016, 3, 0.61, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('oink oink.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Return_L242_C12", "label": "return", "type": "return", "loc": [242, 242], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L240_C8", "vector": [13, 3, 0.3948, 0.0016, 3, 0.61, 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_99557:Assign_L251_C8", "label": "extra_remove_meters =", "type": "assigned_variable", "loc": [251, 251], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L232_C4", "vector": [14, 2, 0.4095, 0.0016, 2, 0.43, 0.5556, 582, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "extra_remove_meters", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " extra_remove_meters = 0.005"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L252_C8", "label": "n_more_to_remove = int()", "type": "assigned_variable", "loc": [252, 252], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L232_C4", "vector": [14, 2, 0.4111, 0.0016, 2, 0.43, 0.6667, 797, 3, 1, 0, 0, 901, 10, 2], "semantic": {"name": "n_more_to_remove", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": " n_more_to_remove = int(round(extra_remove_meters/self.resolution[2,0]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L253_C8", "label": "l = range()", "type": "assigned_variable", "loc": [253, 254], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L232_C4", "vector": [14, 2, 0.4135, 0.0033, 2, 0.43, 0.7778, 810, 3, 2, 0, 0, 816, 10, 3], "semantic": {"name": "l", "arg_names": [], "import_names": [], "rhs_call_name": "range", "annotation": ""}, "snippet": " l = range(max(z_plane-10,0),\n min(z_plane+n_more_to_remove+1,self.grid_shape[2,0]-1))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L257_C8", "label": "if", "type": "if", "loc": [257, 275], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L232_C4", "vector": [4, 2, 0.4339, 0.031, 2, 0.43, 0.8889, 0, 0, 0, 0, 0, 0, 0, 15], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if assume_plane == False:\n n_more = int(round(0.1/self.resolution[2,0]))\n l_confirm = l+ range(max(l),min(z_plane+n_more+1,self.grid_shape[2,0]-1))\n\n grid_2d = np.max(self.grid[:,:,l],2)\n n_plane_cells = grid_2d.sum()\n grid_2d = ni.binary_fill_holes(grid_2d) # I want 4-connectivity while filling holes.\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L258_C12", "label": "n_more = int()", "type": "assigned_variable", "loc": [258, 258], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L257_C8", "vector": [14, 3, 0.4209, 0.0016, 3, 0.67, 0.0, 365, 3, 1, 0, 0, 901, 10, 2], "semantic": {"name": "n_more", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": " n_more = int(round(0.1/self.resolution[2,0]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L259_C12", "label": "l_confirm =", "type": "assigned_variable", "loc": [259, 259], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L257_C8", "vector": [14, 3, 0.4225, 0.0016, 3, 0.67, 0.1, 114, 4, 0, 0, 0, 0, 0, 3], "semantic": {"name": "l_confirm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " l_confirm = l+ range(max(l),min(z_plane+n_more+1,self.grid_shape[2,0]-1))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L261_C12", "label": "grid_2d = max()", "type": "assigned_variable", "loc": [261, 261], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L257_C8", "vector": [14, 3, 0.4258, 0.0016, 3, 0.67, 0.2, 804, 3, 2, 0, 0, 442, 10, 1], "semantic": {"name": "grid_2d", "arg_names": [], "import_names": [], "rhs_call_name": "max", "annotation": ""}, "snippet": " grid_2d = np.max(self.grid[:,:,l],2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L262_C12", "label": "n_plane_cells = sum()", "type": "assigned_variable", "loc": [262, 262], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L257_C8", "vector": [14, 3, 0.4274, 0.0016, 3, 0.67, 0.3, 394, 3, 0, 0, 0, 824, 10, 1], "semantic": {"name": "n_plane_cells", "arg_names": [], "import_names": [], "rhs_call_name": "sum", "annotation": ""}, "snippet": " n_plane_cells = grid_2d.sum()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L263_C12", "label": "grid_2d = binary_fill_holes()", "type": "assigned_variable", "loc": [263, 263], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L257_C8", "vector": [14, 3, 0.429, 0.0016, 3, 0.67, 0.4, 804, 3, 1, 0, 0, 385, 10, 1], "semantic": {"name": "grid_2d", "arg_names": [], "import_names": [], "rhs_call_name": "binary_fill_holes", "annotation": ""}, "snippet": " grid_2d = ni.binary_fill_holes(grid_2d) # I want 4-connectivity while filling holes."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L265_C12", "label": "n_plane_cells = sum()", "type": "assigned_variable", "loc": [265, 265], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L257_C8", "vector": [14, 3, 0.4323, 0.0016, 3, 0.67, 0.5, 394, 3, 0, 0, 0, 824, 10, 1], "semantic": {"name": "n_plane_cells", "arg_names": [], "import_names": [], "rhs_call_name": "sum", "annotation": ""}, "snippet": " n_plane_cells = grid_2d.sum()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L266_C12", "label": "min_plane_pts_threshold =", "type": "assigned_variable", "loc": [266, 266], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L257_C8", "vector": [14, 3, 0.4339, 0.0016, 3, 0.67, 0.6, 811, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "min_plane_pts_threshold", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " min_plane_pts_threshold = (self.grid_shape[0,0]*self.grid_shape[1,0])/4"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Expr_L267_C12", "label": "print()", "type": "expression", "loc": [267, 267], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L257_C8", "vector": [8, 3, 0.4356, 0.0016, 3, 0.67, 0.7, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('###n_plane_cells:', n_plane_cells)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Expr_L268_C12", "label": "print()", "type": "expression", "loc": [268, 268], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L257_C8", "vector": [8, 3, 0.4372, 0.0016, 3, 0.67, 0.8, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('min_plane_pts_threshold:', min_plane_pts_threshold)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Expr_L269_C12", "label": "print()", "type": "expression", "loc": [269, 269], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L257_C8", "vector": [8, 3, 0.4388, 0.0016, 3, 0.67, 0.9, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('find_plane_indices grid shape:',self.grid_shape.T)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L271_C12", "label": "if", "type": "if", "loc": [271, 275], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L257_C8", "vector": [4, 3, 0.4454, 0.0082, 3, 0.67, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if n_plane_cells < min_plane_pts_threshold:\n print('occupancy_grid_3d.find_plane_indices: There is no plane.')\n print('n_plane_cells:', n_plane_cells)\n print('min_plane_pts_threshold:', min_plane_pts_threshold)\n l = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Expr_L272_C16", "label": "print()", "type": "expression", "loc": [272, 272], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L271_C12", "vector": [8, 4, 0.4437, 0.0016, 4, 0.99, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('occupancy_grid_3d.find_plane_indices: There is no plane.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Expr_L273_C16", "label": "print()", "type": "expression", "loc": [273, 273], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L271_C12", "vector": [8, 4, 0.4454, 0.0016, 4, 0.99, 0.3333, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('n_plane_cells:', n_plane_cells)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Expr_L274_C16", "label": "print()", "type": "expression", "loc": [274, 274], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L271_C12", "vector": [8, 4, 0.447, 0.0016, 4, 0.99, 0.6667, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('min_plane_pts_threshold:', min_plane_pts_threshold)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L275_C16", "label": "l =", "type": "assigned_variable", "loc": [275, 275], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L271_C12", "vector": [14, 4, 0.4486, 0.0016, 4, 0.99, 1.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_99557:Return_L277_C8", "label": "return", "type": "return", "loc": [277, 277], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L232_C4", "vector": [13, 2, 0.4519, 0.0016, 2, 0.43, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return l"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L283_C4", "label": "grid_to_centroids", "type": "function", "loc": [283, 289], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:ClassDef_L93_C0", "vector": [2, 1, 0.4666, 0.0114, 1, 0.5, 0.4615, 694, 0, 2, 1, 0, 0, 0, 4], "semantic": {"name": "grid_to_centroids", "arg_names": ["self", "occupancy_threshold"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def grid_to_centroids(self,occupancy_threshold=1):\n p = np.matrix(np.row_stack(np.where(self.grid>=occupancy_threshold))).astype('float')\n p[0,:] = p[0,:]*self.resolution[0,0]\n p[1,:] = p[1,:]*self.resolution[1,0]\n p[2,:] = p[2,:]*self.resolution[2,0]\n p += self.brf\n return p"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L284_C8", "label": "p = astype()", "type": "assigned_variable", "loc": [284, 284], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L283_C4", "vector": [14, 2, 0.4633, 0.0016, 2, 0.81, 0.0, 491, 3, 1, 0, 0, 32, 10, 4], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "astype", "annotation": ""}, "snippet": " p = np.matrix(np.row_stack(np.where(self.grid>=occupancy_threshold))).astype('float')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L285_C8", "label": "assign", "type": "assigned_variable", "loc": [285, 285], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L283_C4", "vector": [14, 2, 0.4649, 0.0016, 2, 0.81, 0.25, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p[0,:] = p[0,:]*self.resolution[0,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L286_C8", "label": "assign", "type": "assigned_variable", "loc": [286, 286], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L283_C4", "vector": [14, 2, 0.4666, 0.0016, 2, 0.81, 0.5, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p[1,:] = p[1,:]*self.resolution[1,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L287_C8", "label": "assign", "type": "assigned_variable", "loc": [287, 287], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L283_C4", "vector": [14, 2, 0.4682, 0.0016, 2, 0.81, 0.75, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p[2,:] = p[2,:]*self.resolution[2,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Return_L289_C8", "label": "return", "type": "return", "loc": [289, 289], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L283_C4", "vector": [13, 2, 0.4715, 0.0016, 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 p"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L292_C4", "label": "grid_to_points", "type": "function", "loc": [292, 312], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:ClassDef_L93_C0", "vector": [2, 1, 0.4927, 0.0343, 1, 0.5, 0.5385, 558, 0, 3, 1, 0, 0, 0, 4], "semantic": {"name": "grid_to_points", "arg_names": ["self", "array", "occupancy_threshold"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def grid_to_points(self,array=None,occupancy_threshold=1):\n ''' array - if not None then this will be used instead of self.grid\n returns 3xN matrix of 3d coord of the cells which have occupancy >= occupancy_threshold\n '''\n\n if array == None:\n array = self.grid\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Expr_L293_C8", "label": "expression", "type": "expression", "loc": [293, 295], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L292_C4", "vector": [8, 2, 0.4796, 0.0049, 2, 0.41, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' array - if not None then this will be used instead of self.grid\n returns 3xN matrix of 3d coord of the cells which have occupancy >= occupancy_threshold\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L297_C8", "label": "if", "type": "if", "loc": [297, 298], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L292_C4", "vector": [4, 2, 0.4853, 0.0033, 2, 0.41, 0.1429, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if array == None:\n array = self.grid"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L298_C12", "label": "array =", "type": "assigned_variable", "loc": [298, 298], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L297_C8", "vector": [14, 3, 0.4861, 0.0016, 3, 0.14, 0.0, 80, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "array", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " array = self.grid"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L300_C8", "label": "idxs = where()", "type": "assigned_variable", "loc": [300, 300], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L292_C4", "vector": [14, 2, 0.4894, 0.0016, 2, 0.41, 0.2857, 677, 3, 1, 0, 0, 169, 10, 1], "semantic": {"name": "idxs", "arg_names": [], "import_names": [], "rhs_call_name": "where", "annotation": ""}, "snippet": " idxs = np.where(array>=occupancy_threshold)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L301_C8", "label": "list_idxs = tolist()", "type": "assigned_variable", "loc": [301, 301], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L292_C4", "vector": [14, 2, 0.491, 0.0016, 2, 0.41, 0.4286, 227, 3, 0, 0, 0, 185, 10, 1], "semantic": {"name": "list_idxs", "arg_names": [], "import_names": [], "rhs_call_name": "tolist", "annotation": ""}, "snippet": " list_idxs = (idxs[0]+idxs[1]*self.grid_shape[0,0]+idxs[2]*self.grid_shape[0,0]*self.grid_shape[1,0]).tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L303_C8", "label": "l =", "type": "assigned_variable", "loc": [303, 303], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L292_C4", "vector": [14, 2, 0.4943, 0.0016, 2, 0.41, 0.5714, 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_99557:For_L304_C8", "label": "for pts_idxs", "type": "for", "loc": [304, 305], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L292_C4", "vector": [6, 2, 0.4967, 0.0033, 2, 0.41, 0.7143, 171, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pts_idxs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for pts_idxs in list_idxs:\n l += self.grid_points_list[pts_idxs]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L307_C8", "label": "if", "type": "if", "loc": [307, 310], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L292_C4", "vector": [4, 2, 0.5033, 0.0065, 2, 0.41, 0.8571, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if l == []:\n p = np.matrix([])\n else:\n p = np.column_stack(l)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L308_C12", "label": "p = matrix()", "type": "assigned_variable", "loc": [308, 308], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L307_C8", "vector": [14, 3, 0.5024, 0.0016, 3, 0.49, 0.0, 491, 3, 1, 0, 0, 162, 10, 1], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "matrix", "annotation": ""}, "snippet": " p = np.matrix([])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L310_C12", "label": "p = column_stack()", "type": "assigned_variable", "loc": [310, 310], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L307_C8", "vector": [14, 3, 0.5057, 0.0016, 3, 0.49, 1.0, 491, 3, 1, 0, 0, 724, 10, 1], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "column_stack", "annotation": ""}, "snippet": " p = np.column_stack(l)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Return_L312_C8", "label": "return", "type": "return", "loc": [312, 312], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L292_C4", "vector": [13, 2, 0.509, 0.0016, 2, 0.41, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return p"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L314_C4", "label": "labeled_array_to_points", "type": "function", "loc": [314, 330], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:ClassDef_L93_C0", "vector": [2, 1, 0.5253, 0.0277, 1, 0.5, 0.6154, 366, 0, 3, 1, 0, 0, 0, 4], "semantic": {"name": "labeled_array_to_points", "arg_names": ["self", "array", "label"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def labeled_array_to_points(self,array,label):\n ''' returns coordinates of centers of grid cells corresponding to\n label as a 3xN matrix.\n '''\n idxs = np.where(array==label)\n list_idxs = (idxs[0]+idxs[1]*self.grid_shape[0,0]+idxs[2]*self.grid_shape[0,0]*self.grid_shape[1,0]).tolist()\n\n l = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Expr_L315_C8", "label": "expression", "type": "expression", "loc": [315, 317], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L314_C4", "vector": [8, 2, 0.5155, 0.0049, 2, 0.34, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' returns coordinates of centers of grid cells corresponding to\n label as a 3xN matrix.\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L318_C8", "label": "idxs = where()", "type": "assigned_variable", "loc": [318, 318], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L314_C4", "vector": [14, 2, 0.5188, 0.0016, 2, 0.34, 0.1667, 677, 3, 1, 0, 0, 169, 10, 1], "semantic": {"name": "idxs", "arg_names": [], "import_names": [], "rhs_call_name": "where", "annotation": ""}, "snippet": " idxs = np.where(array==label)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L319_C8", "label": "list_idxs = tolist()", "type": "assigned_variable", "loc": [319, 319], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L314_C4", "vector": [14, 2, 0.5204, 0.0016, 2, 0.34, 0.3333, 227, 3, 0, 0, 0, 185, 10, 1], "semantic": {"name": "list_idxs", "arg_names": [], "import_names": [], "rhs_call_name": "tolist", "annotation": ""}, "snippet": " list_idxs = (idxs[0]+idxs[1]*self.grid_shape[0,0]+idxs[2]*self.grid_shape[0,0]*self.grid_shape[1,0]).tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L321_C8", "label": "l =", "type": "assigned_variable", "loc": [321, 321], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L314_C4", "vector": [14, 2, 0.5237, 0.0016, 2, 0.34, 0.5, 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_99557:For_L322_C8", "label": "for pts_idxs", "type": "for", "loc": [322, 323], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L314_C4", "vector": [6, 2, 0.5261, 0.0033, 2, 0.34, 0.6667, 171, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pts_idxs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for pts_idxs in list_idxs:\n l += self.grid_points_list[pts_idxs]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L325_C8", "label": "if", "type": "if", "loc": [325, 328], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L314_C4", "vector": [4, 2, 0.5326, 0.0065, 2, 0.34, 0.8333, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if l == []:\n p = np.matrix([])\n else:\n p = np.column_stack(l)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L326_C12", "label": "p = matrix()", "type": "assigned_variable", "loc": [326, 326], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L325_C8", "vector": [14, 3, 0.5318, 0.0016, 3, 0.24, 0.0, 491, 3, 1, 0, 0, 162, 10, 1], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "matrix", "annotation": ""}, "snippet": " p = np.matrix([])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L328_C12", "label": "p = column_stack()", "type": "assigned_variable", "loc": [328, 328], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L325_C8", "vector": [14, 3, 0.5351, 0.0016, 3, 0.24, 1.0, 491, 3, 1, 0, 0, 724, 10, 1], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "column_stack", "annotation": ""}, "snippet": " p = np.column_stack(l)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Return_L330_C8", "label": "return", "type": "return", "loc": [330, 330], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L314_C4", "vector": [13, 2, 0.5383, 0.0016, 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 p"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L332_C4", "label": "remove_vertical_plane", "type": "function", "loc": [332, 368], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:ClassDef_L93_C0", "vector": [2, 1, 0.571, 0.0604, 1, 0.5, 0.6923, 627, 0, 1, 1, 0, 0, 0, 19], "semantic": {"name": "remove_vertical_plane", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def remove_vertical_plane(self):\n ''' removes plane parallel to the YZ plane.\n changes grid.\n returns plane_indices, slice corresponding to the vertical plane.\n points behind the plane are lost for ever!\n '''\n self.grid = self.grid.swapaxes(2,0)\n self.grid_shape = np.matrix(self.grid.shape).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Expr_L333_C8", "label": "expression", "type": "expression", "loc": [333, 337], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L332_C4", "vector": [8, 2, 0.5465, 0.0082, 2, 0.31, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' removes plane parallel to the YZ plane.\n changes grid.\n returns plane_indices, slice corresponding to the vertical plane.\n points behind the plane are lost for ever!\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L338_C8", "label": "self.grid = swapaxes()", "type": "assigned_variable", "loc": [338, 338], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L332_C4", "vector": [14, 2, 0.5514, 0.0016, 2, 0.31, 0.0526, 16, 3, 2, 0, 0, 289, 10, 1], "semantic": {"name": "self.grid", "arg_names": [], "import_names": [], "rhs_call_name": "swapaxes", "annotation": ""}, "snippet": " self.grid = self.grid.swapaxes(2,0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L339_C8", "label": "self.grid_shape =", "type": "assigned_variable", "loc": [339, 339], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L332_C4", "vector": [14, 2, 0.553, 0.0016, 2, 0.31, 0.1053, 573, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.grid_shape", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.grid_shape = np.matrix(self.grid.shape).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L344_C8", "label": "z_max_first, max_count = argmax_z()", "type": "assigned_variable", "loc": [344, 344], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L332_C4", "vector": [14, 2, 0.5612, 0.0016, 2, 0.31, 0.1579, 959, 3, 1, 0, 0, 859, 10, 1], "semantic": {"name": "z_max_first, max_count", "arg_names": [], "import_names": [], "rhs_call_name": "argmax_z", "annotation": ""}, "snippet": " z_max_first,max_count = self.argmax_z(search_down=False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L345_C8", "label": "z_max_second, max_count_second = argmax_z()", "type": "assigned_variable", "loc": [345, 345], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L332_C4", "vector": [14, 2, 0.5628, 0.0016, 2, 0.31, 0.2105, 113, 3, 2, 0, 0, 859, 10, 3], "semantic": {"name": "z_max_second, max_count_second", "arg_names": [], "import_names": [], "rhs_call_name": "argmax_z", "annotation": ""}, "snippet": " z_max_second,max_count_second = self.argmax_z(index_min=z_max_first+int(round(0.035/self.resolution[0,0])) ,search_down=False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L346_C8", "label": "z_max_first, max_count = argmax_z()", "type": "assigned_variable", "loc": [346, 346], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L332_C4", "vector": [14, 2, 0.5644, 0.0016, 2, 0.31, 0.2632, 959, 3, 1, 0, 0, 859, 10, 1], "semantic": {"name": "z_max_first, max_count", "arg_names": [], "import_names": [], "rhs_call_name": "argmax_z", "annotation": ""}, "snippet": " z_max_first,max_count = self.argmax_z(search_down=False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L349_C8", "label": "if", "type": "if", "loc": [349, 352], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L332_C4", "vector": [4, 2, 0.5718, 0.0065, 2, 0.31, 0.3158, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (max_count_second*1./max_count) > 0.3:\n z_max = z_max_second\n else:\n z_max = z_max_first"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L350_C12", "label": "z_max =", "type": "assigned_variable", "loc": [350, 350], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L349_C8", "vector": [14, 3, 0.571, 0.0016, 3, 0.07, 0.0, 465, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "z_max", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " z_max = z_max_second"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L352_C12", "label": "z_max =", "type": "assigned_variable", "loc": [352, 352], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L349_C8", "vector": [14, 3, 0.5742, 0.0016, 3, 0.07, 1.0, 465, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "z_max", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " z_max = z_max_first"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Expr_L353_C8", "label": "print()", "type": "expression", "loc": [353, 353], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L332_C4", "vector": [8, 2, 0.5759, 0.0016, 2, 0.31, 0.3684, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('z_max_first', z_max_first)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Expr_L354_C8", "label": "print()", "type": "expression", "loc": [354, 354], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L332_C4", "vector": [8, 2, 0.5775, 0.0016, 2, 0.31, 0.4211, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('z_max_second', z_max_second)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Expr_L355_C8", "label": "print()", "type": "expression", "loc": [355, 355], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L332_C4", "vector": [8, 2, 0.5791, 0.0016, 2, 0.31, 0.4737, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('z_max', z_max)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L357_C8", "label": "more = int()", "type": "assigned_variable", "loc": [357, 357], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L332_C4", "vector": [14, 2, 0.5824, 0.0016, 2, 0.31, 0.5263, 179, 3, 1, 0, 0, 901, 10, 2], "semantic": {"name": "more", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": " more = int(round(0.03/self.resolution[0,0]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L358_C8", "label": "plane_indices = range()", "type": "assigned_variable", "loc": [358, 358], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L332_C4", "vector": [14, 2, 0.584, 0.0016, 2, 0.31, 0.5789, 595, 3, 2, 0, 0, 816, 10, 3], "semantic": {"name": "plane_indices", "arg_names": [], "import_names": [], "rhs_call_name": "range", "annotation": ""}, "snippet": " plane_indices = range(max(0,z_max-more),min(z_max+more,self.grid_shape[2,0]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L360_C8", "label": "self.grid = swapaxes()", "type": "assigned_variable", "loc": [360, 360], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L332_C4", "vector": [14, 2, 0.5873, 0.0016, 2, 0.31, 0.6316, 16, 3, 2, 0, 0, 289, 10, 1], "semantic": {"name": "self.grid", "arg_names": [], "import_names": [], "rhs_call_name": "swapaxes", "annotation": ""}, "snippet": " self.grid = self.grid.swapaxes(2,0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L361_C8", "label": "self.grid_shape =", "type": "assigned_variable", "loc": [361, 361], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L332_C4", "vector": [14, 2, 0.5889, 0.0016, 2, 0.31, 0.6842, 573, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.grid_shape", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.grid_shape = np.matrix(self.grid.shape).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L363_C8", "label": "ver_plane_slice =", "type": "assigned_variable", "loc": [363, 363], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L332_C4", "vector": [14, 2, 0.5922, 0.0016, 2, 0.31, 0.7368, 177, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ver_plane_slice", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ver_plane_slice = self.grid[plane_indices,:,:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L364_C8", "label": "assign", "type": "assigned_variable", "loc": [364, 364], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L332_C4", "vector": [14, 2, 0.5938, 0.0016, 2, 0.31, 0.7895, 0, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.grid[plane_indices,:,:] = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L365_C8", "label": "max_x = max()", "type": "assigned_variable", "loc": [365, 365], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L332_C4", "vector": [14, 2, 0.5954, 0.0016, 2, 0.31, 0.8421, 64, 3, 1, 0, 0, 442, 10, 1], "semantic": {"name": "max_x", "arg_names": [], "import_names": [], "rhs_call_name": "max", "annotation": ""}, "snippet": " max_x = max(plane_indices)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L366_C8", "label": "behind_indices = range()", "type": "assigned_variable", "loc": [366, 366], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L332_C4", "vector": [14, 2, 0.5971, 0.0016, 2, 0.31, 0.8947, 386, 3, 2, 0, 0, 816, 10, 1], "semantic": {"name": "behind_indices", "arg_names": [], "import_names": [], "rhs_call_name": "range", "annotation": ""}, "snippet": " behind_indices = range(max_x,self.grid_shape[0,0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L367_C8", "label": "assign", "type": "assigned_variable", "loc": [367, 367], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L332_C4", "vector": [14, 2, 0.5987, 0.0016, 2, 0.31, 0.9474, 0, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.grid[behind_indices,:,:] = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Return_L368_C8", "label": "return", "type": "return", "loc": [368, 368], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L332_C4", "vector": [13, 2, 0.6003, 0.0016, 2, 0.31, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return plane_indices,ver_plane_slice"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L370_C4", "label": "remove_horizontal_plane", "type": "function", "loc": [370, 420], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:ClassDef_L93_C0", "vector": [2, 1, 0.6444, 0.0832, 1, 0.5, 0.7692, 651, 0, 5, 1, 0, 0, 0, 23], "semantic": {"name": "remove_horizontal_plane", "arg_names": ["self", "remove_below", "hmin", "hmax", "extra_layers"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def remove_horizontal_plane(self, remove_below=True,hmin=-np.Inf,hmax=np.Inf,\n extra_layers=0):\n ''' call after to_binary()\n removes points corresponding to the horizontal plane from the grid.\n remove_below - remove points below the plane also.\n hmin,hmax - min and max possible height of the plane. (meters)\n This function changes grid.\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Expr_L372_C8", "label": "expression", "type": "expression", "loc": [372, 384], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L370_C4", "vector": [8, 2, 0.6166, 0.0212, 2, 0.7, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' call after to_binary()\n removes points corresponding to the horizontal plane from the grid.\n remove_below - remove points below the plane also.\n hmin,hmax - min and max possible height of the plane. (meters)\n This function changes grid.\n\n extra_layers - number of layers above the plane to remove. Sometimes\n I want to be over zealous while removing plane points."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L385_C8", "label": "l = find_plane_indices()", "type": "assigned_variable", "loc": [385, 385], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L370_C4", "vector": [14, 2, 0.6281, 0.0016, 2, 0.7, 0.05, 810, 3, 2, 0, 0, 383, 10, 1], "semantic": {"name": "l", "arg_names": [], "import_names": [], "rhs_call_name": "find_plane_indices", "annotation": ""}, "snippet": " l = self.find_plane_indices(hmin,hmax)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L387_C8", "label": "if", "type": "if", "loc": [387, 389], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L370_C4", "vector": [4, 2, 0.633, 0.0049, 2, 0.7, 0.1, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if l == []:\n print('occupancy_grid_3d.remove_horizontal_plane: No plane found.')\n return None,l"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Expr_L388_C12", "label": "print()", "type": "expression", "loc": [388, 388], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L387_C8", "vector": [8, 3, 0.633, 0.0016, 3, 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('occupancy_grid_3d.remove_horizontal_plane: No plane found.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Return_L389_C12", "label": "return", "type": "return", "loc": [389, 389], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L387_C8", "vector": [13, 3, 0.6346, 0.0016, 3, 0.71, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return None,l"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L391_C8", "label": "add_num = min()", "type": "assigned_variable", "loc": [391, 391], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L370_C4", "vector": [14, 2, 0.6378, 0.0016, 2, 0.7, 0.15, 660, 3, 2, 0, 0, 867, 10, 2], "semantic": {"name": "add_num", "arg_names": [], "import_names": [], "rhs_call_name": "min", "annotation": ""}, "snippet": " add_num = min(10,self.grid_shape[2,0]-max(l)-1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L392_C8", "label": "max_l =", "type": "assigned_variable", "loc": [392, 392], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L370_C4", "vector": [14, 2, 0.6395, 0.0016, 2, 0.7, 0.2, 756, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "max_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " max_l = max(l)+add_num"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L393_C8", "label": "l_edge =", "type": "assigned_variable", "loc": [393, 393], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L370_C4", "vector": [14, 2, 0.6411, 0.0016, 2, 0.7, 0.25, 370, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "l_edge", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " l_edge = l+range(max(l),max_l+1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L395_C8", "label": "grid_2d = max()", "type": "assigned_variable", "loc": [395, 395], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L370_C4", "vector": [14, 2, 0.6444, 0.0016, 2, 0.7, 0.3, 804, 3, 2, 0, 0, 442, 10, 1], "semantic": {"name": "grid_2d", "arg_names": [], "import_names": [], "rhs_call_name": "max", "annotation": ""}, "snippet": " grid_2d = np.max(self.grid[:,:,l_edge],2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L397_C8", "label": "grid_2d = binary_fill_holes()", "type": "assigned_variable", "loc": [397, 397], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L370_C4", "vector": [14, 2, 0.6476, 0.0016, 2, 0.7, 0.35, 804, 3, 1, 0, 0, 385, 10, 1], "semantic": {"name": "grid_2d", "arg_names": [], "import_names": [], "rhs_call_name": "binary_fill_holes", "annotation": ""}, "snippet": " grid_2d = ni.binary_fill_holes(grid_2d) # I want 4-connectivity while filling holes."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L399_C8", "label": "connect_structure = empty()", "type": "assigned_variable", "loc": [399, 399], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L370_C4", "vector": [14, 2, 0.6509, 0.0016, 2, 0.7, 0.4, 297, 3, 2, 0, 0, 365, 10, 1], "semantic": {"name": "connect_structure", "arg_names": [], "import_names": [], "rhs_call_name": "empty", "annotation": ""}, "snippet": " connect_structure = np.empty((3,3),dtype='int')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L400_C8", "label": "assign", "type": "assigned_variable", "loc": [400, 400], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L370_C4", "vector": [14, 2, 0.6525, 0.0016, 2, 0.7, 0.45, 0, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " connect_structure[:,:] = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L401_C8", "label": "eroded_2d = binary_erosion()", "type": "assigned_variable", "loc": [401, 401], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L370_C4", "vector": [14, 2, 0.6542, 0.0016, 2, 0.7, 0.5, 36, 3, 3, 0, 0, 333, 10, 1], "semantic": {"name": "eroded_2d", "arg_names": [], "import_names": [], "rhs_call_name": "binary_erosion", "annotation": ""}, "snippet": " eroded_2d = ni.binary_erosion(grid_2d,connect_structure,iterations=2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L402_C8", "label": "grid_2d =", "type": "assigned_variable", "loc": [402, 402], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L370_C4", "vector": [14, 2, 0.6558, 0.0016, 2, 0.7, 0.55, 804, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "grid_2d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " grid_2d = grid_2d-eroded_2d"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L403_C8", "label": "idxs = where()", "type": "assigned_variable", "loc": [403, 403], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L370_C4", "vector": [14, 2, 0.6574, 0.0016, 2, 0.7, 0.6, 677, 3, 1, 0, 0, 169, 10, 1], "semantic": {"name": "idxs", "arg_names": [], "import_names": [], "rhs_call_name": "where", "annotation": ""}, "snippet": " idxs = np.where(grid_2d!=0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L405_C8", "label": "if", "type": "if", "loc": [405, 407], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L370_C4", "vector": [4, 2, 0.6623, 0.0049, 2, 0.7, 0.65, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if max_l>max(l):\n for i in range(min(5,add_num)):\n self.grid[idxs[0],idxs[1],max(l)+i+1] = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:For_L406_C12", "label": "for i", "type": "for", "loc": [406, 407], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L405_C8", "vector": [6, 3, 0.6631, 0.0033, 3, 0.1, 0.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(min(5,add_num)):\n self.grid[idxs[0],idxs[1],max(l)+i+1] = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L407_C16", "label": "assign", "type": "assigned_variable", "loc": [407, 407], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:For_L406_C12", "vector": [14, 4, 0.6639, 0.0016, 4, 0.27, 0.0, 0, 1, 0, 0, 0, 0, 1, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.grid[idxs[0],idxs[1],max(l)+i+1] = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L409_C8", "label": "if", "type": "if", "loc": [409, 410], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L370_C4", "vector": [4, 2, 0.668, 0.0033, 2, 0.7, 0.7, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if remove_below:\n l = range(0,min(l)+1)+l"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L410_C12", "label": "l =", "type": "assigned_variable", "loc": [410, 410], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L409_C8", "vector": [14, 3, 0.6688, 0.0016, 3, 0.12, 0.0, 810, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " l = range(0,min(l)+1)+l"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L412_C8", "label": "max_z = max()", "type": "assigned_variable", "loc": [412, 412], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L370_C4", "vector": [14, 2, 0.6721, 0.0016, 2, 0.7, 0.75, 119, 3, 1, 0, 0, 442, 10, 1], "semantic": {"name": "max_z", "arg_names": [], "import_names": [], "rhs_call_name": "max", "annotation": ""}, "snippet": " max_z = max(l)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:For_L413_C8", "label": "for i", "type": "for", "loc": [413, 414], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L370_C4", "vector": [6, 2, 0.6746, 0.0033, 2, 0.7, 0.8, 826, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(extra_layers):\n l.append(max_z+i+1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Expr_L414_C12", "label": "append()", "type": "expression", "loc": [414, 414], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:For_L413_C8", "vector": [8, 3, 0.6754, 0.0016, 3, 0.5, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " l.append(max_z+i+1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L416_C8", "label": "l_edge =", "type": "assigned_variable", "loc": [416, 416], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L370_C4", "vector": [14, 2, 0.6786, 0.0016, 2, 0.7, 0.85, 370, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "l_edge", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " l_edge = l+range(max(l),max_l+1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L418_C8", "label": "plane_and_below_pts =", "type": "assigned_variable", "loc": [418, 418], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L370_C4", "vector": [14, 2, 0.6819, 0.0016, 2, 0.7, 0.9, 756, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "plane_and_below_pts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " plane_and_below_pts = self.grid[:,:,l_edge]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L419_C8", "label": "assign", "type": "assigned_variable", "loc": [419, 419], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L370_C4", "vector": [14, 2, 0.6835, 0.0016, 2, 0.7, 0.95, 0, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.grid[:,:,l] = 0 # set occupancy to zero."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Return_L420_C8", "label": "return", "type": "return", "loc": [420, 420], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L370_C4", "vector": [13, 2, 0.6852, 0.0016, 2, 0.7, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return plane_and_below_pts,l_edge"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L422_C4", "label": "segment_objects", "type": "function", "loc": [422, 438], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:ClassDef_L93_C0", "vector": [2, 1, 0.7015, 0.0277, 1, 0.5, 0.8462, 295, 0, 2, 1, 0, 0, 0, 4], "semantic": {"name": "segment_objects", "arg_names": ["self", "twod"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def segment_objects(self, twod=False):\n ''' segments out objects after removing the plane.\n call after calling to_binary.\n returns labelled_array,n_labels\n labelled_array - same dimen as occupancy grid, each object has a different label.\n '''\n plane_and_below_pts,l = self.remove_horizontal_plane(extra_layers=0)\n if l == []:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Expr_L423_C8", "label": "expression", "type": "expression", "loc": [423, 427], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L422_C4", "vector": [8, 2, 0.6933, 0.0082, 2, 0.93, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' segments out objects after removing the plane.\n call after calling to_binary.\n returns labelled_array,n_labels\n labelled_array - same dimen as occupancy grid, each object has a different label.\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L428_C8", "label": "plane_and_below_pts, l = remove_horizontal_plane()", "type": "assigned_variable", "loc": [428, 428], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L422_C4", "vector": [14, 2, 0.6982, 0.0016, 2, 0.93, 0.2, 297, 3, 1, 0, 0, 651, 10, 1], "semantic": {"name": "plane_and_below_pts, l", "arg_names": [], "import_names": [], "rhs_call_name": "remove_horizontal_plane", "annotation": ""}, "snippet": " plane_and_below_pts,l = self.remove_horizontal_plane(extra_layers=0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L429_C8", "label": "if", "type": "if", "loc": [429, 431], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L422_C4", "vector": [4, 2, 0.7015, 0.0049, 2, 0.93, 0.4, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if l == []:\n print('occupancy_grid_3d.segment_objects: There is no plane.')\n return None,None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Expr_L430_C12", "label": "print()", "type": "expression", "loc": [430, 430], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L429_C8", "vector": [8, 3, 0.7015, 0.0016, 3, 0.44, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('occupancy_grid_3d.segment_objects: There is no plane.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Return_L431_C12", "label": "return", "type": "return", "loc": [431, 431], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L429_C8", "vector": [13, 3, 0.7031, 0.0016, 3, 0.44, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return None,None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L433_C8", "label": "if", "type": "if", "loc": [433, 436], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L422_C4", "vector": [4, 2, 0.7088, 0.0065, 2, 0.93, 0.6, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if twod == False:\n labelled_arr,n_labels = self.find_objects()\n else:\n labelled_arr,n_labels = self.find_objects_2d()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L434_C12", "label": "labelled_arr, n_labels = find_objects()", "type": "assigned_variable", "loc": [434, 434], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L433_C8", "vector": [14, 3, 0.708, 0.0016, 3, 0.27, 0.0, 775, 3, 0, 0, 0, 936, 10, 1], "semantic": {"name": "labelled_arr, n_labels", "arg_names": [], "import_names": [], "rhs_call_name": "find_objects", "annotation": ""}, "snippet": " labelled_arr,n_labels = self.find_objects()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L436_C12", "label": "labelled_arr, n_labels = find_objects_2d()", "type": "assigned_variable", "loc": [436, 436], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L433_C8", "vector": [14, 3, 0.7113, 0.0016, 3, 0.27, 1.0, 775, 3, 0, 0, 0, 417, 10, 1], "semantic": {"name": "labelled_arr, n_labels", "arg_names": [], "import_names": [], "rhs_call_name": "find_objects_2d", "annotation": ""}, "snippet": " labelled_arr,n_labels = self.find_objects_2d()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L437_C8", "label": "assign", "type": "assigned_variable", "loc": [437, 437], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L422_C4", "vector": [14, 2, 0.7129, 0.0016, 2, 0.93, 0.8, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.grid[:,:,l] = plane_and_below_pts"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Return_L438_C8", "label": "return", "type": "return", "loc": [438, 438], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L422_C4", "vector": [13, 2, 0.7145, 0.0016, 2, 0.93, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return labelled_arr,n_labels"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L440_C4", "label": "find_objects_2d", "type": "function", "loc": [440, 488], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:ClassDef_L93_C0", "vector": [2, 1, 0.7569, 0.0799, 1, 0.5, 0.9231, 417, 0, 1, 1, 0, 0, 0, 22], "semantic": {"name": "find_objects_2d", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def find_objects_2d(self):\n ''' projects all points into the xy plane and then performs\n segmentation by region growing.\n '''\n connect_structure = np.empty((3,3),dtype='int')\n connect_structure[:,:] = 1\n grid_2d = np.max(self.grid[:,:,:],2)\n# grid_2d = ni.binary_erosion(grid_2d)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Expr_L441_C8", "label": "expression", "type": "expression", "loc": [441, 443], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L440_C4", "vector": [8, 2, 0.721, 0.0049, 2, 0.05, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' projects all points into the xy plane and then performs\n segmentation by region growing.\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L444_C8", "label": "connect_structure = empty()", "type": "assigned_variable", "loc": [444, 444], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L440_C4", "vector": [14, 2, 0.7243, 0.0016, 2, 0.05, 0.0625, 297, 3, 2, 0, 0, 365, 10, 1], "semantic": {"name": "connect_structure", "arg_names": [], "import_names": [], "rhs_call_name": "empty", "annotation": ""}, "snippet": " connect_structure = np.empty((3,3),dtype='int')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L445_C8", "label": "assign", "type": "assigned_variable", "loc": [445, 445], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L440_C4", "vector": [14, 2, 0.7259, 0.0016, 2, 0.05, 0.125, 0, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " connect_structure[:,:] = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L446_C8", "label": "grid_2d = max()", "type": "assigned_variable", "loc": [446, 446], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L440_C4", "vector": [14, 2, 0.7276, 0.0016, 2, 0.05, 0.1875, 804, 3, 2, 0, 0, 442, 10, 1], "semantic": {"name": "grid_2d", "arg_names": [], "import_names": [], "rhs_call_name": "max", "annotation": ""}, "snippet": " grid_2d = np.max(self.grid[:,:,:],2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L449_C8", "label": "labeled_arr, n_labels = label()", "type": "assigned_variable", "loc": [449, 449], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L440_C4", "vector": [14, 2, 0.7325, 0.0016, 2, 0.05, 0.25, 952, 3, 2, 0, 0, 811, 10, 1], "semantic": {"name": "labeled_arr, n_labels", "arg_names": [], "import_names": [], "rhs_call_name": "label", "annotation": ""}, "snippet": " labeled_arr,n_labels = ni.label(grid_2d,connect_structure)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Expr_L450_C8", "label": "print()", "type": "expression", "loc": [450, 450], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L440_C4", "vector": [8, 2, 0.7341, 0.0016, 2, 0.05, 0.3125, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('found %d objects'%(n_labels))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L452_C8", "label": "labeled_arr_3d = swapaxes()", "type": "assigned_variable", "loc": [452, 452], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L440_C4", "vector": [14, 2, 0.7374, 0.0016, 2, 0.05, 0.375, 689, 3, 2, 0, 0, 289, 10, 1], "semantic": {"name": "labeled_arr_3d", "arg_names": [], "import_names": [], "rhs_call_name": "swapaxes", "annotation": ""}, "snippet": " labeled_arr_3d = self.grid.swapaxes(2,0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L453_C8", "label": "labeled_arr_3d = swapaxes()", "type": "assigned_variable", "loc": [453, 453], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L440_C4", "vector": [14, 2, 0.739, 0.0016, 2, 0.05, 0.4375, 689, 3, 2, 0, 0, 289, 10, 1], "semantic": {"name": "labeled_arr_3d", "arg_names": [], "import_names": [], "rhs_call_name": "swapaxes", "annotation": ""}, "snippet": " labeled_arr_3d = labeled_arr_3d.swapaxes(1,2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Expr_L454_C8", "label": "print()", "type": "expression", "loc": [454, 454], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L440_C4", "vector": [8, 2, 0.7406, 0.0016, 2, 0.05, 0.5, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('labeled_arr.shape:',labeled_arr.shape)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Expr_L455_C8", "label": "print()", "type": "expression", "loc": [455, 455], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L440_C4", "vector": [8, 2, 0.7423, 0.0016, 2, 0.05, 0.5625, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('labeled_arr_3d.shape:',labeled_arr_3d.shape)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L456_C8", "label": "labeled_arr_3d =", "type": "assigned_variable", "loc": [456, 456], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L440_C4", "vector": [14, 2, 0.7439, 0.0016, 2, 0.05, 0.625, 689, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "labeled_arr_3d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " labeled_arr_3d = labeled_arr_3d*labeled_arr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L457_C8", "label": "labeled_arr_3d = swapaxes()", "type": "assigned_variable", "loc": [457, 457], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L440_C4", "vector": [14, 2, 0.7455, 0.0016, 2, 0.05, 0.6875, 689, 3, 2, 0, 0, 289, 10, 1], "semantic": {"name": "labeled_arr_3d", "arg_names": [], "import_names": [], "rhs_call_name": "swapaxes", "annotation": ""}, "snippet": " labeled_arr_3d = labeled_arr_3d.swapaxes(2,0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L458_C8", "label": "labeled_arr_3d = swapaxes()", "type": "assigned_variable", "loc": [458, 458], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L440_C4", "vector": [14, 2, 0.7471, 0.0016, 2, 0.05, 0.75, 689, 3, 2, 0, 0, 289, 10, 1], "semantic": {"name": "labeled_arr_3d", "arg_names": [], "import_names": [], "rhs_call_name": "swapaxes", "annotation": ""}, "snippet": " labeled_arr_3d = labeled_arr_3d.swapaxes(1,0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L459_C8", "label": "labeled_arr =", "type": "assigned_variable", "loc": [459, 459], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L440_C4", "vector": [14, 2, 0.7488, 0.0016, 2, 0.05, 0.8125, 434, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "labeled_arr", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " labeled_arr = labeled_arr_3d"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L462_C8", "label": "if", "type": "if", "loc": [462, 484], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L440_C4", "vector": [4, 2, 0.7716, 0.0375, 2, 0.05, 0.875, 0, 0, 0, 0, 0, 0, 0, 11], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if n_labels > 0:\n labels_list = range(1,n_labels+1)\n #count_objects = ni.sum(grid_2d,labeled_arr,labels_list)\n count_objects = ni.sum(self.grid,labeled_arr,labels_list)\n if n_labels == 1:\n count_objects = [count_objects]\n\n t0 = time.time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L463_C12", "label": "labels_list = range()", "type": "assigned_variable", "loc": [463, 463], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L462_C8", "vector": [14, 3, 0.7553, 0.0016, 3, 0.9, 0.0, 325, 3, 2, 0, 0, 816, 10, 1], "semantic": {"name": "labels_list", "arg_names": [], "import_names": [], "rhs_call_name": "range", "annotation": ""}, "snippet": " labels_list = range(1,n_labels+1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L465_C12", "label": "count_objects = sum()", "type": "assigned_variable", "loc": [465, 465], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L462_C8", "vector": [14, 3, 0.7586, 0.0016, 3, 0.9, 0.1111, 769, 3, 3, 0, 0, 824, 10, 1], "semantic": {"name": "count_objects", "arg_names": [], "import_names": [], "rhs_call_name": "sum", "annotation": ""}, "snippet": " count_objects = ni.sum(self.grid,labeled_arr,labels_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L466_C12", "label": "if", "type": "if", "loc": [466, 467], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L462_C8", "vector": [4, 3, 0.761, 0.0033, 3, 0.9, 0.2222, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if n_labels == 1:\n count_objects = [count_objects]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L467_C16", "label": "count_objects =", "type": "assigned_variable", "loc": [467, 467], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L466_C12", "vector": [14, 4, 0.7618, 0.0016, 4, 0.95, 0.0, 769, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "count_objects", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " count_objects = [count_objects]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L469_C12", "label": "t0 = time()", "type": "assigned_variable", "loc": [469, 469], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L462_C8", "vector": [14, 3, 0.7651, 0.0016, 3, 0.9, 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_99557:Assign_L470_C12", "label": "new_labels_list =", "type": "assigned_variable", "loc": [470, 470], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L462_C8", "vector": [14, 3, 0.7667, 0.0016, 3, 0.9, 0.4444, 12, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "new_labels_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " new_labels_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:For_L472_C12", "label": "for c, l", "type": "for", "loc": [472, 476], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L462_C8", "vector": [6, 3, 0.7732, 0.0082, 3, 0.9, 0.5556, 723, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "c, l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for c,l in zip(count_objects,labels_list):\n if c > 3:\n new_labels_list.append(l)\n else:\n labeled_arr[np.where(labeled_arr == l)] = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L473_C16", "label": "if", "type": "if", "loc": [473, 476], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:For_L472_C12", "vector": [4, 4, 0.7741, 0.0065, 4, 0.34, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if c > 3:\n new_labels_list.append(l)\n else:\n labeled_arr[np.where(labeled_arr == l)] = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Expr_L474_C20", "label": "append()", "type": "expression", "loc": [474, 474], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L473_C16", "vector": [8, 5, 0.7732, 0.0016, 5, 0.53, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " new_labels_list.append(l)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L476_C20", "label": "assign", "type": "assigned_variable", "loc": [476, 476], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L473_C16", "vector": [14, 5, 0.7765, 0.0016, 5, 0.53, 1.0, 0, 1, 0, 0, 0, 0, 1, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " labeled_arr[np.where(labeled_arr == l)] = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:For_L479_C12", "label": "for nl, l", "type": "for", "loc": [479, 480], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L462_C8", "vector": [6, 3, 0.7822, 0.0033, 3, 0.9, 0.6667, 313, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "nl, l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for nl,l in enumerate(new_labels_list):\n labeled_arr[np.where(labeled_arr == l)] = nl+1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L480_C16", "label": "assign", "type": "assigned_variable", "loc": [480, 480], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:For_L479_C12", "vector": [14, 4, 0.783, 0.0016, 4, 0.41, 0.0, 0, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " labeled_arr[np.where(labeled_arr == l)] = nl+1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L482_C12", "label": "n_labels = len()", "type": "assigned_variable", "loc": [482, 482], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L462_C8", "vector": [14, 3, 0.7863, 0.0016, 3, 0.9, 0.7778, 797, 3, 1, 0, 0, 890, 10, 1], "semantic": {"name": "n_labels", "arg_names": [], "import_names": [], "rhs_call_name": "len", "annotation": ""}, "snippet": " n_labels = len(new_labels_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L483_C12", "label": "t1 = time()", "type": "assigned_variable", "loc": [483, 483], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L462_C8", "vector": [14, 3, 0.7879, 0.0016, 3, 0.9, 0.8889, 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_99557:Expr_L484_C12", "label": "print()", "type": "expression", "loc": [484, 484], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L462_C8", "vector": [8, 3, 0.7896, 0.0016, 3, 0.9, 1.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-t0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Expr_L486_C8", "label": "print()", "type": "expression", "loc": [486, 486], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L440_C4", "vector": [8, 2, 0.7928, 0.0016, 2, 0.05, 0.9375, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('found %d objects'%(n_labels))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Return_L488_C8", "label": "return", "type": "return", "loc": [488, 488], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L440_C4", "vector": [13, 2, 0.7961, 0.0016, 2, 0.05, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return labeled_arr_3d,n_labels"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L490_C4", "label": "find_objects", "type": "function", "loc": [490, 545], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:ClassDef_L93_C0", "vector": [2, 1, 0.8442, 0.0914, 1, 0.5, 1.0, 936, 0, 1, 1, 0, 0, 0, 19], "semantic": {"name": "find_objects", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def find_objects(self):\n ''' region growing kind of thing for segmentation. Useful if plane has been removed.\n '''\n connect_structure = np.empty((3,3,3),dtype='int')\n grid = copy.copy(self.grid)\n\n connect_structure[:,:,:] = 0\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Expr_L491_C8", "label": "expression", "type": "expression", "loc": [491, 492], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L490_C4", "vector": [8, 2, 0.8018, 0.0033, 2, 0.41, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' region growing kind of thing for segmentation. Useful if plane has been removed.\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L493_C8", "label": "connect_structure = empty()", "type": "assigned_variable", "loc": [493, 493], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L490_C4", "vector": [14, 2, 0.8042, 0.0016, 2, 0.41, 0.0455, 297, 3, 2, 0, 0, 365, 10, 1], "semantic": {"name": "connect_structure", "arg_names": [], "import_names": [], "rhs_call_name": "empty", "annotation": ""}, "snippet": " connect_structure = np.empty((3,3,3),dtype='int')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L494_C8", "label": "grid = copy()", "type": "assigned_variable", "loc": [494, 494], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L490_C4", "vector": [14, 2, 0.8059, 0.0016, 2, 0.41, 0.0909, 690, 3, 1, 0, 0, 739, 10, 1], "semantic": {"name": "grid", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " grid = copy.copy(self.grid)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L496_C8", "label": "assign", "type": "assigned_variable", "loc": [496, 496], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L490_C4", "vector": [14, 2, 0.8091, 0.0016, 2, 0.41, 0.1364, 0, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " connect_structure[:,:,:] = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L498_C8", "label": "assign", "type": "assigned_variable", "loc": [498, 498], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L490_C4", "vector": [14, 2, 0.8124, 0.0016, 2, 0.41, 0.1818, 0, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " connect_structure[1,1,:] = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L499_C8", "label": "iterations = int()", "type": "assigned_variable", "loc": [499, 499], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L490_C4", "vector": [14, 2, 0.814, 0.0016, 2, 0.41, 0.2273, 143, 3, 1, 0, 0, 901, 10, 2], "semantic": {"name": "iterations", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": " iterations = int(round(0.005/self.resolution[2,0]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L505_C8", "label": "assign", "type": "assigned_variable", "loc": [505, 505], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L490_C4", "vector": [14, 2, 0.8238, 0.0016, 2, 0.41, 0.2727, 0, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " connect_structure[:,:,:] = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L506_C8", "label": "labeled_arr, n_labels = label()", "type": "assigned_variable", "loc": [506, 506], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L490_C4", "vector": [14, 2, 0.8254, 0.0016, 2, 0.41, 0.3182, 952, 3, 2, 0, 0, 811, 10, 1], "semantic": {"name": "labeled_arr, n_labels", "arg_names": [], "import_names": [], "rhs_call_name": "label", "annotation": ""}, "snippet": " labeled_arr,n_labels = ni.label(grid,connect_structure)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Expr_L507_C8", "label": "print()", "type": "expression", "loc": [507, 507], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L490_C4", "vector": [8, 2, 0.8271, 0.0016, 2, 0.41, 0.3636, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('ho!')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Expr_L508_C8", "label": "print()", "type": "expression", "loc": [508, 508], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L490_C4", "vector": [8, 2, 0.8287, 0.0016, 2, 0.41, 0.4091, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('found %d objects'%(n_labels))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L510_C8", "label": "if", "type": "if", "loc": [510, 511], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L490_C4", "vector": [4, 2, 0.8328, 0.0033, 2, 0.41, 0.4545, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if n_labels == 0:\n return labeled_arr,n_labels"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Return_L511_C12", "label": "return", "type": "return", "loc": [511, 511], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L510_C8", "vector": [13, 3, 0.8336, 0.0016, 3, 0.13, 0.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return labeled_arr,n_labels"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L513_C8", "label": "labels_list = range()", "type": "assigned_variable", "loc": [513, 513], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L490_C4", "vector": [14, 2, 0.8369, 0.0016, 2, 0.41, 0.5, 325, 3, 2, 0, 0, 816, 10, 1], "semantic": {"name": "labels_list", "arg_names": [], "import_names": [], "rhs_call_name": "range", "annotation": ""}, "snippet": " labels_list = range(1,n_labels+1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L514_C8", "label": "count_objects = sum()", "type": "assigned_variable", "loc": [514, 514], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L490_C4", "vector": [14, 2, 0.8385, 0.0016, 2, 0.41, 0.5455, 769, 3, 3, 0, 0, 824, 10, 1], "semantic": {"name": "count_objects", "arg_names": [], "import_names": [], "rhs_call_name": "sum", "annotation": ""}, "snippet": " count_objects = ni.sum(grid,labeled_arr,labels_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L515_C8", "label": "if", "type": "if", "loc": [515, 516], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L490_C4", "vector": [4, 2, 0.8409, 0.0033, 2, 0.41, 0.5909, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if n_labels == 1:\n count_objects = [count_objects]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L516_C12", "label": "count_objects =", "type": "assigned_variable", "loc": [516, 516], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L515_C8", "vector": [14, 3, 0.8418, 0.0016, 3, 0.99, 0.0, 769, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "count_objects", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " count_objects = [count_objects]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L526_C8", "label": "t0 = time()", "type": "assigned_variable", "loc": [526, 526], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L490_C4", "vector": [14, 2, 0.8581, 0.0016, 2, 0.41, 0.6364, 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_99557:Assign_L527_C8", "label": "new_labels_list =", "type": "assigned_variable", "loc": [527, 527], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L490_C4", "vector": [14, 2, 0.8597, 0.0016, 2, 0.41, 0.6818, 12, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "new_labels_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " new_labels_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:For_L529_C8", "label": "for c, l", "type": "for", "loc": [529, 533], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L490_C4", "vector": [6, 2, 0.8662, 0.0082, 2, 0.41, 0.7273, 723, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "c, l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for c,l in zip(count_objects,labels_list):\n if c > 3:\n new_labels_list.append(l)\n else:\n labeled_arr[np.where(labeled_arr == l)] = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L530_C12", "label": "if", "type": "if", "loc": [530, 533], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:For_L529_C8", "vector": [4, 3, 0.867, 0.0065, 3, 0.58, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if c > 3:\n new_labels_list.append(l)\n else:\n labeled_arr[np.where(labeled_arr == l)] = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Expr_L531_C16", "label": "append()", "type": "expression", "loc": [531, 531], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L530_C12", "vector": [8, 4, 0.8662, 0.0016, 4, 0.02, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " new_labels_list.append(l)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L533_C16", "label": "assign", "type": "assigned_variable", "loc": [533, 533], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L530_C12", "vector": [14, 4, 0.8695, 0.0016, 4, 0.02, 1.0, 0, 1, 0, 0, 0, 0, 1, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " labeled_arr[np.where(labeled_arr == l)] = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:For_L536_C8", "label": "for nl, l", "type": "for", "loc": [536, 537], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L490_C4", "vector": [6, 2, 0.8752, 0.0033, 2, 0.41, 0.7727, 313, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "nl, l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for nl,l in enumerate(new_labels_list):\n labeled_arr[np.where(labeled_arr == l)] = nl+1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L537_C12", "label": "assign", "type": "assigned_variable", "loc": [537, 537], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:For_L536_C8", "vector": [14, 3, 0.876, 0.0016, 3, 0.41, 0.0, 0, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " labeled_arr[np.where(labeled_arr == l)] = nl+1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L539_C8", "label": "n_labels = len()", "type": "assigned_variable", "loc": [539, 539], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L490_C4", "vector": [14, 2, 0.8793, 0.0016, 2, 0.41, 0.8182, 797, 3, 1, 0, 0, 890, 10, 1], "semantic": {"name": "n_labels", "arg_names": [], "import_names": [], "rhs_call_name": "len", "annotation": ""}, "snippet": " n_labels = len(new_labels_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L540_C8", "label": "t1 = time()", "type": "assigned_variable", "loc": [540, 540], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L490_C4", "vector": [14, 2, 0.8809, 0.0016, 2, 0.41, 0.8636, 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_99557:Expr_L541_C8", "label": "print()", "type": "expression", "loc": [541, 541], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L490_C4", "vector": [8, 2, 0.8825, 0.0016, 2, 0.41, 0.9091, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('time:', t1-t0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Expr_L544_C8", "label": "print()", "type": "expression", "loc": [544, 544], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L490_C4", "vector": [8, 2, 0.8874, 0.0016, 2, 0.41, 0.9545, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('found %d objects'%(n_labels))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Return_L545_C8", "label": "return", "type": "return", "loc": [545, 545], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L490_C4", "vector": [13, 2, 0.8891, 0.0016, 2, 0.41, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return labeled_arr,n_labels"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L549_C0", "label": "if", "type": "if", "loc": [549, 609], "level": 0, "parent": null, "vector": [4, 0, 0.9445, 0.0995, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 28], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n import pygame_opengl_3d_display as po3d\n import hokuyo.pygame_utils as pu\n import processing_3d as p3d\n\n p = optparse.OptionParser()\n\n p.add_option('-f', action='store', type='string', dest='pkl_file_name',"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Import_L550_C4", "label": "pygame_opengl_3d_display import po3d", "type": "import", "loc": [550, 550], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L549_C0", "vector": [1, 1, 0.8972, 0.0016, 1, 0.22, 0.0, 8, 0, 1, 0, 0, 8, 0, 0], "semantic": {"name": "pygame_opengl_3d_display", "arg_names": [], "import_names": ["po3d"], "rhs_call_name": "", "annotation": ""}, "snippet": " import pygame_opengl_3d_display as po3d"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Import_L551_C4", "label": "hokuyo.pygame_utils import pu", "type": "import", "loc": [551, 551], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L549_C0", "vector": [1, 1, 0.8989, 0.0016, 1, 0.22, 0.0476, 87, 0, 1, 0, 0, 87, 0, 0], "semantic": {"name": "hokuyo.pygame_utils", "arg_names": [], "import_names": ["pu"], "rhs_call_name": "", "annotation": ""}, "snippet": " import hokuyo.pygame_utils as pu"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Import_L552_C4", "label": "processing_3d import p3d", "type": "import", "loc": [552, 552], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L549_C0", "vector": [1, 1, 0.9005, 0.0016, 1, 0.22, 0.0952, 842, 0, 1, 0, 0, 842, 0, 0], "semantic": {"name": "processing_3d", "arg_names": [], "import_names": ["p3d"], "rhs_call_name": "", "annotation": ""}, "snippet": " import processing_3d as p3d"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L554_C4", "label": "p = OptionParser()", "type": "assigned_variable", "loc": [554, 554], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L549_C0", "vector": [14, 1, 0.9038, 0.0016, 1, 0.22, 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_99557:Expr_L556_C4", "label": "add_option()", "type": "expression", "loc": [556, 557], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L549_C0", "vector": [8, 1, 0.9078, 0.0033, 1, 0.22, 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('-f', action='store', type='string', dest='pkl_file_name',\n help='file.pkl File with the scan,pos dict.',default=None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Expr_L558_C4", "label": "add_option()", "type": "expression", "loc": [558, 559], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L549_C0", "vector": [8, 1, 0.9111, 0.0033, 1, 0.22, 0.2381, 176, 3, 6, 0, 0, 0, 0, 1], "semantic": {"name": "add_option", "arg_names": [], "import_names": [], "rhs_call_name": "add_option", "annotation": ""}, "snippet": " p.add_option('-c', action='store', type='string', dest='pts_pkl',\n help='pkl file with 3D points',default=None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L561_C4", "label": "opt, args = parse_args()", "type": "assigned_variable", "loc": [561, 561], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L549_C0", "vector": [14, 1, 0.9152, 0.0016, 1, 0.22, 0.2857, 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_99557:Assign_L562_C4", "label": "pts_pkl =", "type": "assigned_variable", "loc": [562, 562], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L549_C0", "vector": [14, 1, 0.9168, 0.0016, 1, 0.22, 0.3333, 967, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pts_pkl", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pts_pkl = opt.pts_pkl"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L563_C4", "label": "pkl_file_name =", "type": "assigned_variable", "loc": [563, 563], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L549_C0", "vector": [14, 1, 0.9184, 0.0016, 1, 0.22, 0.381, 696, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pkl_file_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pkl_file_name = opt.pkl_file_name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L573_C4", "label": "resolution =", "type": "assigned_variable", "loc": [573, 573], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L549_C0", "vector": [14, 1, 0.9347, 0.0016, 1, 0.22, 0.4286, 615, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "resolution", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " resolution = np.matrix([0.01,0.01,0.01]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L574_C4", "label": "gr = occupancy_grid_3d()", "type": "assigned_variable", "loc": [574, 575], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L549_C0", "vector": [14, 1, 0.9372, 0.0033, 1, 0.22, 0.4762, 8, 3, 3, 0, 0, 222, 10, 3], "semantic": {"name": "gr", "arg_names": [], "import_names": [], "rhs_call_name": "occupancy_grid_3d", "annotation": ""}, "snippet": " gr = occupancy_grid_3d(np.matrix([0.45,-0.5,-1.0]).T, np.matrix([0.65,0.05,-0.2]).T,\n resolution)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L577_C4", "label": "if", "type": "if", "loc": [577, 594], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L549_C0", "vector": [4, 1, 0.9551, 0.0294, 1, 0.22, 0.5238, 0, 0, 0, 0, 0, 0, 0, 8], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if pts_pkl != None:\n pts = ut.load_pickle(pts_pkl)\n\n elif pkl_file_name != None:\n dict = ut.load_pickle(pkl_file_name)\n pos_list = dict['pos_list']\n scan_list = dict['scan_list']\n min_angle = math.radians(-40)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L578_C8", "label": "pts = load_pickle()", "type": "assigned_variable", "loc": [578, 578], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L577_C4", "vector": [14, 2, 0.9429, 0.0016, 2, 0.66, 0.0, 195, 3, 1, 0, 0, 65, 10, 1], "semantic": {"name": "pts", "arg_names": [], "import_names": [], "rhs_call_name": "load_pickle", "annotation": ""}, "snippet": " pts = ut.load_pickle(pts_pkl)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L580_C4", "label": "if", "type": "if", "loc": [580, 594], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L577_C4", "vector": [4, 2, 0.9576, 0.0245, 2, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif pkl_file_name != None:\n dict = ut.load_pickle(pkl_file_name)\n pos_list = dict['pos_list']\n scan_list = dict['scan_list']\n min_angle = math.radians(-40)\n max_angle = math.radians(40)\n\n l1 = dict['l1']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L581_C8", "label": "dict = load_pickle()", "type": "assigned_variable", "loc": [581, 581], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L580_C4", "vector": [14, 3, 0.9478, 0.0016, 3, 0.84, 0.0, 827, 3, 1, 0, 0, 65, 10, 1], "semantic": {"name": "dict", "arg_names": [], "import_names": [], "rhs_call_name": "load_pickle", "annotation": ""}, "snippet": " dict = ut.load_pickle(pkl_file_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L582_C8", "label": "pos_list =", "type": "assigned_variable", "loc": [582, 582], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L580_C4", "vector": [14, 3, 0.9494, 0.0016, 3, 0.84, 0.1, 279, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pos_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pos_list = dict['pos_list']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L583_C8", "label": "scan_list =", "type": "assigned_variable", "loc": [583, 583], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L580_C4", "vector": [14, 3, 0.9511, 0.0016, 3, 0.84, 0.2, 378, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "scan_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " scan_list = dict['scan_list']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L584_C8", "label": "min_angle = radians()", "type": "assigned_variable", "loc": [584, 584], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L580_C4", "vector": [14, 3, 0.9527, 0.0016, 3, 0.84, 0.3, 278, 3, 1, 0, 0, 383, 10, 1], "semantic": {"name": "min_angle", "arg_names": [], "import_names": [], "rhs_call_name": "radians", "annotation": ""}, "snippet": " min_angle = math.radians(-40)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L585_C8", "label": "max_angle = radians()", "type": "assigned_variable", "loc": [585, 585], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L580_C4", "vector": [14, 3, 0.9543, 0.0016, 3, 0.84, 0.4, 451, 3, 1, 0, 0, 383, 10, 1], "semantic": {"name": "max_angle", "arg_names": [], "import_names": [], "rhs_call_name": "radians", "annotation": ""}, "snippet": " max_angle = math.radians(40)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L587_C8", "label": "l1 =", "type": "assigned_variable", "loc": [587, 587], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L580_C4", "vector": [14, 3, 0.9576, 0.0016, 3, 0.84, 0.5, 888, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "l1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " l1 = dict['l1']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L588_C8", "label": "l2 =", "type": "assigned_variable", "loc": [588, 588], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L580_C4", "vector": [14, 3, 0.9592, 0.0016, 3, 0.84, 0.6, 40, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "l2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " l2 = dict['l2']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L589_C8", "label": "pts = generate_pointcloud()", "type": "assigned_variable", "loc": [589, 589], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L580_C4", "vector": [14, 3, 0.9608, 0.0016, 3, 0.84, 0.7, 195, 3, 6, 0, 0, 989, 10, 1], "semantic": {"name": "pts", "arg_names": [], "import_names": [], "rhs_call_name": "generate_pointcloud", "annotation": ""}, "snippet": " pts = p3d.generate_pointcloud(pos_list, scan_list, min_angle, max_angle, l1, l2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Expr_L592_C8", "label": "print()", "type": "expression", "loc": [592, 592], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L580_C4", "vector": [8, 3, 0.9657, 0.0016, 3, 0.84, 0.8, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('specify a pkl file -c or -f')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Expr_L593_C8", "label": "print()", "type": "expression", "loc": [593, 593], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L580_C4", "vector": [8, 3, 0.9674, 0.0016, 3, 0.84, 0.9, 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_99557:Expr_L594_C8", "label": "exit()", "type": "expression", "loc": [594, 594], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L580_C4", "vector": [8, 3, 0.969, 0.0016, 3, 0.84, 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_99557:Expr_L597_C4", "label": "print()", "type": "expression", "loc": [597, 597], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L549_C0", "vector": [8, 1, 0.9739, 0.0016, 1, 0.22, 0.5714, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('started filling the grid')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L598_C4", "label": "t0 = time()", "type": "assigned_variable", "loc": [598, 598], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L549_C0", "vector": [14, 1, 0.9755, 0.0016, 1, 0.22, 0.619, 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_99557:Expr_L599_C4", "label": "fill_grid()", "type": "expression", "loc": [599, 599], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L549_C0", "vector": [8, 1, 0.9772, 0.0016, 1, 0.22, 0.6667, 619, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "fill_grid", "arg_names": [], "import_names": [], "rhs_call_name": "fill_grid", "annotation": ""}, "snippet": " gr.fill_grid(pts)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L600_C4", "label": "t1 = time()", "type": "assigned_variable", "loc": [600, 600], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L549_C0", "vector": [14, 1, 0.9788, 0.0016, 1, 0.22, 0.7143, 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_99557:Expr_L601_C4", "label": "print()", "type": "expression", "loc": [601, 601], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L549_C0", "vector": [8, 1, 0.9804, 0.0016, 1, 0.22, 0.7619, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('time to fill the grid:', t1-t0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L604_C4", "label": "grid_pts = grid_to_centroids()", "type": "assigned_variable", "loc": [604, 604], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L549_C0", "vector": [14, 1, 0.9853, 0.0016, 1, 0.22, 0.8095, 251, 3, 0, 0, 0, 694, 10, 1], "semantic": {"name": "grid_pts", "arg_names": [], "import_names": [], "rhs_call_name": "grid_to_centroids", "annotation": ""}, "snippet": " grid_pts = gr.grid_to_centroids()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L606_C4", "label": "cloud = CubeCloud()", "type": "assigned_variable", "loc": [606, 606], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L549_C0", "vector": [14, 1, 0.9886, 0.0016, 1, 0.22, 0.8571, 824, 3, 3, 0, 0, 751, 10, 2], "semantic": {"name": "cloud", "arg_names": [], "import_names": [], "rhs_call_name": "CubeCloud", "annotation": ""}, "snippet": " cloud = pu.CubeCloud(grid_pts,(0,0,0),(resolution/2).A1.tolist())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L607_C4", "label": "pc = PointCloud()", "type": "assigned_variable", "loc": [607, 607], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L549_C0", "vector": [14, 1, 0.9902, 0.0016, 1, 0.22, 0.9048, 876, 3, 2, 0, 0, 428, 10, 1], "semantic": {"name": "pc", "arg_names": [], "import_names": [], "rhs_call_name": "PointCloud", "annotation": ""}, "snippet": " pc = pu.PointCloud(pts,(100,100,100))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L608_C4", "label": "lc = LineCloud()", "type": "assigned_variable", "loc": [608, 608], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L549_C0", "vector": [14, 1, 0.9918, 0.0016, 1, 0.22, 0.9524, 255, 3, 2, 0, 0, 344, 10, 2], "semantic": {"name": "lc", "arg_names": [], "import_names": [], "rhs_call_name": "LineCloud", "annotation": ""}, "snippet": " lc = pu.LineCloud(gr.grid_lines(),(100,100,0))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99557:Expr_L609_C4", "label": "run()", "type": "expression", "loc": [609, 609], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L549_C0", "vector": [8, 1, 0.9935, 0.0016, 1, 0.22, 1.0, 679, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "run", "arg_names": [], "import_names": [], "rhs_call_name": "run", "annotation": ""}, "snippet": " po3d.run([cloud,pc,lc])"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L55_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Expr_L56_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Expr_L57_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Expr_L58_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Expr_L59_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L61_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L62_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L64_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L65_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L67_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L68_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L70_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L71_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L72_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L73_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L75_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L75_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Expr_L76_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L75_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Expr_L77_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L75_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Expr_L78_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L79_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L80_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L81_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L82_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L83_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L84_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L86_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L87_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:For_L88_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:For_L88_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L89_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:ClassDef_L93_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L100_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L100_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L102_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L100_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L104_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L100_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L105_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L100_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L106_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L100_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L107_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L100_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L109_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L100_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L110_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L100_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L111_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:ClassDef_L93_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L116_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L116_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L117_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L116_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L118_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L116_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L119_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L116_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L120_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L116_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L121_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L116_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L122_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L116_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L124_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L116_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L125_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L116_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L126_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L116_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L127_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L116_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L129_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L116_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L130_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L116_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L131_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L116_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L132_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L116_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L133_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L116_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L134_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L116_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L135_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L116_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L136_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L116_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L138_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L116_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Return_L140_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:ClassDef_L93_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L147_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L148_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L148_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L149_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L148_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L152_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L154_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L154_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Expr_L155_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L154_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Return_L156_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L157_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L160_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L162_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:For_L164_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:For_L164_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L165_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L165_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L166_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:For_L164_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L168_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:For_L164_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L171_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:For_L164_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Expr_L172_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:ClassDef_L93_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L180_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L180_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Expr_L181_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L180_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L183_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L180_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L184_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L180_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L185_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:ClassDef_L93_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L187_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L187_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Expr_L188_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L187_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L192_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L187_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L193_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L187_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L194_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L187_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:For_L196_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:For_L196_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Expr_L197_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L187_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L199_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L199_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Return_L200_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L187_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L201_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L187_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L202_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L187_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L203_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L187_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Expr_L205_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L187_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L207_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L207_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L208_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L207_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:For_L209_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:For_L209_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L212_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:For_L209_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L214_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L214_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L215_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L207_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L216_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L187_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L218_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L218_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L219_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L218_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:For_L220_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:For_L220_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L221_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:For_L220_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L223_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:For_L220_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L226_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L226_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L227_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L218_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L228_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L187_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Return_L230_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:ClassDef_L93_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L232_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L232_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Expr_L233_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L232_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L237_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L232_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L238_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L232_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L239_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L232_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L240_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L240_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Expr_L241_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L240_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Return_L242_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L232_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L251_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L232_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L252_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L232_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L253_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L232_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L257_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L257_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L258_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L257_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L259_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L257_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L261_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L257_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L262_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L257_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L263_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L257_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L265_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L257_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L266_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L257_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Expr_L267_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L257_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Expr_L268_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L257_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Expr_L269_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L257_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L271_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L271_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Expr_L272_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L271_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Expr_L273_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L271_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Expr_L274_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L271_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L275_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L232_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Return_L277_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:ClassDef_L93_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L283_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L283_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L284_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L283_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L285_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L283_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L286_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L283_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L287_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L283_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Return_L289_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:ClassDef_L93_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L292_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L292_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Expr_L293_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L292_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L297_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L297_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L298_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L292_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L300_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L292_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L301_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L292_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L303_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L292_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:For_L304_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L292_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L307_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L307_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L308_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L307_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L310_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L292_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Return_L312_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:ClassDef_L93_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L314_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L314_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Expr_L315_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L314_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L318_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L314_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L319_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L314_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L321_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L314_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:For_L322_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L314_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L325_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L325_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L326_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L325_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L328_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L314_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Return_L330_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:ClassDef_L93_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L332_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L332_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Expr_L333_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L332_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L338_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L332_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L339_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L332_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L344_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L332_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L345_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L332_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L346_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L332_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L349_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L349_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L350_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L349_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L352_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L332_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Expr_L353_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L332_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Expr_L354_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L332_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Expr_L355_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L332_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L357_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L332_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L358_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L332_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L360_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L332_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L361_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L332_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L363_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L332_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L364_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L332_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L365_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L332_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L366_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L332_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L367_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L332_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Return_L368_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:ClassDef_L93_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L370_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L370_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Expr_L372_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L370_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L385_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L370_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L387_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L387_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Expr_L388_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L387_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Return_L389_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L370_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L391_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L370_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L392_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L370_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L393_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L370_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L395_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L370_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L397_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L370_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L399_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L370_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L400_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L370_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L401_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L370_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L402_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L370_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L403_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L370_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L405_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L405_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:For_L406_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:For_L406_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L407_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L370_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L409_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L409_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L410_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L370_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L412_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L370_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:For_L413_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:For_L413_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Expr_L414_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L370_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L416_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L370_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L418_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L370_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L419_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L370_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Return_L420_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:ClassDef_L93_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L422_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L422_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Expr_L423_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L422_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L428_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L422_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L429_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L429_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Expr_L430_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L429_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Return_L431_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L422_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L433_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L433_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L434_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L433_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L436_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L422_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L437_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L422_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Return_L438_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:ClassDef_L93_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L440_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L440_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Expr_L441_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L440_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L444_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L440_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L445_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L440_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L446_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L440_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L449_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L440_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Expr_L450_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L440_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L452_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L440_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L453_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L440_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Expr_L454_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L440_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Expr_L455_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L440_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L456_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L440_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L457_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L440_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L458_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L440_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L459_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L440_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L462_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L462_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L463_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L462_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L465_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L462_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L466_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L466_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L467_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L462_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L469_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L462_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L470_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L462_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:For_L472_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:For_L472_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L473_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L473_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Expr_L474_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L473_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L476_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L462_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:For_L479_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:For_L479_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L480_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L462_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L482_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L462_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L483_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L462_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Expr_L484_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L440_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Expr_L486_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L440_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Return_L488_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:ClassDef_L93_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L490_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L490_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Expr_L491_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L490_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L493_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L490_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L494_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L490_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L496_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L490_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L498_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L490_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L499_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L490_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L505_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L490_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L506_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L490_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Expr_L507_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L490_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Expr_L508_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L490_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L510_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L510_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Return_L511_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L490_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L513_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L490_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L514_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L490_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L515_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L515_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L516_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L490_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L526_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L490_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L527_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L490_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:For_L529_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:For_L529_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L530_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L530_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Expr_L531_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L530_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L533_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L490_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:For_L536_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:For_L536_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L537_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L490_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L539_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L490_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L540_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L490_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Expr_L541_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L490_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Expr_L544_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:FunctionDef_L490_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Return_L545_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L549_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Import_L550_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L549_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Import_L551_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L549_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Import_L552_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L549_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L554_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L549_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Expr_L556_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L549_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Expr_L558_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L549_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L561_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L549_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L562_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L549_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L563_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L549_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L573_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L549_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L574_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L549_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L577_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L577_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L578_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L577_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L580_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L580_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L581_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L580_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L582_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L580_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L583_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L580_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L584_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L580_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L585_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L580_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L587_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L580_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L588_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L580_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L589_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L580_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Expr_L592_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L580_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Expr_L593_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L580_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Expr_L594_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L549_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Expr_L597_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L549_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L598_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L549_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Expr_L599_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L549_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L600_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L549_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Expr_L601_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L549_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L604_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L549_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L606_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L549_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L607_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L549_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Assign_L608_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99557:If_L549_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99557:Expr_L609_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 (Healthcare Robotics Lab, Georgia Tech.) import roslib; roslib.load_manifest('zenither') import rospy from hrl_msgs.msg import FloatArray from threading import RLock class ZenitherClient(): def __init__(self, init_ros_node = False, zenither_pose_topic = 'zenither_pose'): if init_ros_node: rospy.init_node('ZenitherClient') self.h = None self.lock = RLock() rospy.Subscriber(zenither_pose_topic, FloatArray, self.pose_cb) def pose_cb(self, fa): self.lock.acquire() self.h = fa.data[0] self.lock.release() def height(self): self.lock.acquire() h = self.h self.lock.release() return h if __name__ == '__main__': zc = ZenitherClient(init_ros_node = True) while not rospy.is_shutdown(): print 'h:', zc.height() rospy.sleep(0.1)
ajibawa-2023/Python-Code-Large/train/row_99558
26
59
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99558:Import_L28_C0", "label": "roslib import roslib", "type": "import", "loc": [28, 28], "level": 0, "parent": null, "vector": [1, 0, 0.4746, 0.0169, 0, 0.66, 0.0, 796, 0, 1, 0, 0, 796, 0, 0], "semantic": {"name": "roslib", "arg_names": [], "import_names": ["roslib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('zenither')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99558:Expr_L28_C15", "label": "load_manifest()", "type": "expression", "loc": [28, 28], "level": 0, "parent": null, "vector": [8, 0, 0.4746, 0.0169, 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('zenither')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99558:Import_L29_C0", "label": "rospy import rospy", "type": "import", "loc": [29, 29], "level": 0, "parent": null, "vector": [1, 0, 0.4915, 0.0169, 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_99558:ImportFrom_L30_C0", "label": "from hrl_msgs.msg import FloatArray", "type": "import", "loc": [30, 30], "level": 0, "parent": null, "vector": [1, 0, 0.5085, 0.0169, 0, 0.66, 0.5, 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_99558:ImportFrom_L31_C0", "label": "from threading import RLock", "type": "import", "loc": [31, 31], "level": 0, "parent": null, "vector": [1, 0, 0.5254, 0.0169, 0, 0.66, 0.6667, 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_99558:ClassDef_L33_C0", "label": "ZenitherClient", "type": "class", "loc": [33, 51], "level": 0, "parent": null, "vector": [3, 0, 0.7119, 0.322, 0, 0.66, 0.8333, 79, 0, 3, 0, 0, 0, 0, 7], "semantic": {"name": "ZenitherClient", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ZenitherClient():\n def __init__(self, init_ros_node = False,\n zenither_pose_topic = 'zenither_pose'):\n if init_ros_node:\n rospy.init_node('ZenitherClient')\n self.h = None\n self.lock = RLock()\n rospy.Subscriber(zenither_pose_topic, FloatArray, self.pose_cb)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99558:FunctionDef_L34_C4", "label": "__init__", "type": "function", "loc": [34, 40], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99558:ClassDef_L33_C0", "vector": [2, 1, 0.6271, 0.1186, 1, 0.91, 0.0, 555, 0, 3, 0, 0, 0, 0, 3], "semantic": {"name": "__init__", "arg_names": ["self", "init_ros_node", "zenither_pose_topic"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, init_ros_node = False,\n zenither_pose_topic = 'zenither_pose'):\n if init_ros_node:\n rospy.init_node('ZenitherClient')\n self.h = None\n self.lock = RLock()\n rospy.Subscriber(zenither_pose_topic, FloatArray, self.pose_cb)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99558:If_L36_C8", "label": "if", "type": "if", "loc": [36, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99558:FunctionDef_L34_C4", "vector": [4, 2, 0.6186, 0.0339, 2, 0.05, 0.0, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if init_ros_node:\n rospy.init_node('ZenitherClient')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99558:Expr_L37_C12", "label": "init_node()", "type": "expression", "loc": [37, 37], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99558:If_L36_C8", "vector": [8, 3, 0.6271, 0.0169, 3, 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('ZenitherClient')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99558:Assign_L38_C8", "label": "self.h =", "type": "assigned_variable", "loc": [38, 38], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99558:FunctionDef_L34_C4", "vector": [14, 2, 0.6441, 0.0169, 2, 0.05, 0.3333, 164, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.h", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.h = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99558:Assign_L39_C8", "label": "self.lock = RLock()", "type": "assigned_variable", "loc": [39, 39], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99558:FunctionDef_L34_C4", "vector": [14, 2, 0.661, 0.0169, 2, 0.05, 0.6667, 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_99558:Expr_L40_C8", "label": "Subscriber()", "type": "expression", "loc": [40, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99558:FunctionDef_L34_C4", "vector": [8, 2, 0.678, 0.0169, 2, 0.05, 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(zenither_pose_topic, FloatArray, self.pose_cb)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99558:FunctionDef_L42_C4", "label": "pose_cb", "type": "function", "loc": [42, 45], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99558:ClassDef_L33_C0", "vector": [2, 1, 0.7373, 0.0678, 1, 0.91, 0.5, 686, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "pose_cb", "arg_names": ["self", "fa"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def pose_cb(self, fa):\n self.lock.acquire()\n self.h = fa.data[0]\n self.lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99558:Expr_L43_C8", "label": "acquire()", "type": "expression", "loc": [43, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99558:FunctionDef_L42_C4", "vector": [8, 2, 0.7288, 0.0169, 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.lock.acquire()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99558:Assign_L44_C8", "label": "self.h =", "type": "assigned_variable", "loc": [44, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99558:FunctionDef_L42_C4", "vector": [14, 2, 0.7458, 0.0169, 2, 0.26, 0.5, 164, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.h", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.h = fa.data[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99558:Expr_L45_C8", "label": "release()", "type": "expression", "loc": [45, 45], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99558:FunctionDef_L42_C4", "vector": [8, 2, 0.7627, 0.0169, 2, 0.26, 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_99558:FunctionDef_L47_C4", "label": "height", "type": "function", "loc": [47, 51], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99558:ClassDef_L33_C0", "vector": [2, 1, 0.8305, 0.0847, 1, 0.91, 1.0, 751, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "height", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def height(self):\n self.lock.acquire()\n h = self.h\n self.lock.release()\n return h"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99558:Expr_L48_C8", "label": "acquire()", "type": "expression", "loc": [48, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99558:FunctionDef_L47_C4", "vector": [8, 2, 0.8136, 0.0169, 2, 0.9, 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_99558:Assign_L49_C8", "label": "h =", "type": "assigned_variable", "loc": [49, 49], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99558:FunctionDef_L47_C4", "vector": [14, 2, 0.8305, 0.0169, 2, 0.9, 0.3333, 686, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "h", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " h = self.h"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99558:Expr_L50_C8", "label": "release()", "type": "expression", "loc": [50, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99558:FunctionDef_L47_C4", "vector": [8, 2, 0.8475, 0.0169, 2, 0.9, 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_99558:Return_L51_C8", "label": "return", "type": "return", "loc": [51, 51], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99558:FunctionDef_L47_C4", "vector": [13, 2, 0.8644, 0.0169, 2, 0.9, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return h"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99558:If_L53_C0", "label": "if", "type": "if", "loc": [53, 57], "level": 0, "parent": null, "vector": [4, 0, 0.9322, 0.0847, 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 zc = ZenitherClient(init_ros_node = True)\n while not rospy.is_shutdown():\n print('h:', zc.height())\n rospy.sleep(0.1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99558:Assign_L54_C4", "label": "zc = ZenitherClient()", "type": "assigned_variable", "loc": [54, 54], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99558:If_L53_C0", "vector": [14, 1, 0.9153, 0.0169, 1, 0.09, 0.0, 477, 3, 1, 0, 0, 79, 10, 1], "semantic": {"name": "zc", "arg_names": [], "import_names": [], "rhs_call_name": "ZenitherClient", "annotation": ""}, "snippet": " zc = ZenitherClient(init_ros_node = True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99558:While_L55_C4", "label": "while", "type": "while", "loc": [55, 57], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99558:If_L53_C0", "vector": [5, 1, 0.9492, 0.0508, 1, 0.09, 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 print('h:', zc.height())\n rospy.sleep(0.1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99558:Expr_L56_C8", "label": "print()", "type": "expression", "loc": [56, 56], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99558:While_L55_C4", "vector": [8, 2, 0.9492, 0.0169, 2, 0.53, 0.0, 535, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('h:', zc.height())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99558:Expr_L57_C8", "label": "sleep()", "type": "expression", "loc": [57, 57], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99558:While_L55_C4", "vector": [8, 2, 0.9661, 0.0169, 2, 0.53, 1.0, 476, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " rospy.sleep(0.1)"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99558:ClassDef_L33_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99558:FunctionDef_L34_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99558:FunctionDef_L34_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99558:If_L36_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99558:If_L36_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99558:Expr_L37_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99558:FunctionDef_L34_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99558:Assign_L38_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99558:FunctionDef_L34_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99558:Assign_L39_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99558:FunctionDef_L34_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99558:Expr_L40_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99558:ClassDef_L33_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99558:FunctionDef_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99558:FunctionDef_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99558:Expr_L43_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99558:FunctionDef_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99558:Assign_L44_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99558:FunctionDef_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99558:Expr_L45_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99558:ClassDef_L33_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99558:FunctionDef_L47_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99558:FunctionDef_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99558:Expr_L48_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99558:FunctionDef_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99558:Assign_L49_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99558:FunctionDef_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99558:Expr_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99558:FunctionDef_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99558:Return_L51_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99558:If_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99558:Assign_L54_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99558:If_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99558:While_L55_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99558:While_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99558:Expr_L56_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99558:While_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99558:Expr_L57_C8"}]
#!/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. # # ROS wrapper for zenither. ## author Advait Jain (Healthcare Robotics Lab, Georgia Tech.) ## author Travis Deyle (Healthcare Robotics Lab, Georgia Tech.) from threading import RLock import roslib roslib.load_manifest('zenither') import zenither_config as zc import rospy from hrl_srvs.srv import Float_Int from hrl_msgs.msg import FloatArray class ZenitherClient(): def __init__(self, robot): try: rospy.init_node('ZenitherClient') rospy.logout('ZenitherServer: Initialized Node') except rospy.ROSException: pass if robot not in zc.calib: raise RuntimeError('unknown robot') self.calib = zc.calib[robot] srv = '/zenither/move_position' rospy.wait_for_service(srv) self.move_position = rospy.ServiceProxy(srv, Float_Int) srv = '/zenither/stop' rospy.wait_for_service(srv) self.stop = rospy.ServiceProxy(srv, Float_Int) srv = '/zenither/apply_torque' rospy.wait_for_service(srv) self.apply_torque = rospy.ServiceProxy(srv, Float_Int) srv = '/zenither/torque_move_position' rospy.wait_for_service(srv) self.torque_move_position = rospy.ServiceProxy(srv, Float_Int) zenither_pose_topic = 'zenither_pose' self.h = None self.lock = RLock() rospy.Subscriber(zenither_pose_topic, FloatArray, self.pose_cb) #---------- functions to send zenither commands. ------------- def estop(self): self.stop(0) def zenith(self, torque=None): if torque == None: torque=self.calib['zenith_torque'] self.apply_torque(torque) def nadir(self, torque=None): if torque == None: torque=self.calib['nadir_torque'] self.apply_torque(torque) #--------- zenither height functions -------------- def pose_cb(self, fa): self.lock.acquire() self.h = fa.data[0] self.lock.release() ## return the current height of the zenither. def height(self): self.lock.acquire() h = self.h self.lock.release() return h if __name__ == '__main__': import time cl = ZenitherClient('HRL2') cl.zenith() time.sleep(0.5) cl.estop()
ajibawa-2023/Python-Code-Large/train/row_99559
55
116
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99559:ImportFrom_L33_C0", "label": "from threading import RLock", "type": "import", "loc": [33, 33], "level": 0, "parent": null, "vector": [1, 0, 0.2845, 0.0086, 0, 0.66, 0.0, 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_99559:Import_L35_C0", "label": "roslib import roslib", "type": "import", "loc": [35, 35], "level": 0, "parent": null, "vector": [1, 0, 0.3017, 0.0086, 0, 0.66, 0.125, 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_99559:Expr_L36_C0", "label": "load_manifest()", "type": "expression", "loc": [36, 36], "level": 0, "parent": null, "vector": [8, 0, 0.3103, 0.0086, 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('zenither')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99559:Import_L37_C0", "label": "zenither_config import zc", "type": "import", "loc": [37, 37], "level": 0, "parent": null, "vector": [1, 0, 0.319, 0.0086, 0, 0.66, 0.375, 945, 0, 1, 0, 0, 945, 0, 0], "semantic": {"name": "zenither_config", "arg_names": [], "import_names": ["zc"], "rhs_call_name": "", "annotation": ""}, "snippet": "import zenither_config as zc"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99559:Import_L38_C0", "label": "rospy import rospy", "type": "import", "loc": [38, 38], "level": 0, "parent": null, "vector": [1, 0, 0.3276, 0.0086, 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_99559:ImportFrom_L39_C0", "label": "from hrl_srvs.srv import Float_Int", "type": "import", "loc": [39, 39], "level": 0, "parent": null, "vector": [1, 0, 0.3362, 0.0086, 0, 0.66, 0.625, 416, 0, 1, 0, 0, 416, 0, 0], "semantic": {"name": "hrl_srvs.srv", "arg_names": [], "import_names": ["Float_Int"], "rhs_call_name": "", "annotation": ""}, "snippet": "from hrl_srvs.srv import Float_Int"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99559:ImportFrom_L40_C0", "label": "from hrl_msgs.msg import FloatArray", "type": "import", "loc": [40, 40], "level": 0, "parent": null, "vector": [1, 0, 0.3448, 0.0086, 0, 0.66, 0.75, 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_99559:ClassDef_L44_C0", "label": "ZenitherClient", "type": "class", "loc": [44, 103], "level": 0, "parent": null, "vector": [3, 0, 0.6336, 0.5172, 0, 0.66, 0.875, 79, 0, 6, 0, 0, 0, 0, 20], "semantic": {"name": "ZenitherClient", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ZenitherClient():\n def __init__(self, robot):\n try:\n rospy.init_node('ZenitherClient')\n rospy.logout('ZenitherServer: Initialized Node')\n except rospy.ROSException:\n pass\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99559:FunctionDef_L45_C4", "label": "__init__", "type": "function", "loc": [45, 75], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99559:ClassDef_L44_C0", "vector": [2, 1, 0.5172, 0.2672, 1, 0.25, 0.0, 555, 0, 2, 0, 0, 0, 0, 13], "semantic": {"name": "__init__", "arg_names": ["self", "robot"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, robot):\n try:\n rospy.init_node('ZenitherClient')\n rospy.logout('ZenitherServer: Initialized Node')\n except rospy.ROSException:\n pass\n\n if robot not in zc.calib:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99559:Try_L46_C8", "label": "try", "type": "try", "loc": [46, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99559:FunctionDef_L45_C4", "vector": [7, 2, 0.4138, 0.0431, 2, 0.9, 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('ZenitherClient')\n rospy.logout('ZenitherServer: Initialized Node')\n except rospy.ROSException:\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99559:Expr_L47_C12", "label": "init_node()", "type": "expression", "loc": [47, 47], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99559:Try_L46_C8", "vector": [8, 3, 0.4052, 0.0086, 3, 0.02, 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('ZenitherClient')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99559:Expr_L48_C12", "label": "logout()", "type": "expression", "loc": [48, 48], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99559:Try_L46_C8", "vector": [8, 3, 0.4138, 0.0086, 3, 0.02, 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('ZenitherServer: Initialized Node')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99559:If_L52_C8", "label": "if", "type": "if", "loc": [52, 53], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99559:FunctionDef_L45_C4", "vector": [4, 2, 0.4526, 0.0172, 2, 0.9, 0.0556, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if robot not in zc.calib:\n raise RuntimeError('unknown robot')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99559:Assign_L54_C8", "label": "self.calib =", "type": "assigned_variable", "loc": [54, 54], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99559:FunctionDef_L45_C4", "vector": [14, 2, 0.4655, 0.0086, 2, 0.9, 0.1111, 885, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.calib", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.calib = zc.calib[robot]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99559:Assign_L56_C8", "label": "srv =", "type": "assigned_variable", "loc": [56, 56], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99559:FunctionDef_L45_C4", "vector": [14, 2, 0.4828, 0.0086, 2, 0.9, 0.1667, 445, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "srv", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " srv = '/zenither/move_position'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99559:Expr_L57_C8", "label": "wait_for_service()", "type": "expression", "loc": [57, 57], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99559:FunctionDef_L45_C4", "vector": [8, 2, 0.4914, 0.0086, 2, 0.9, 0.2222, 617, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "wait_for_service", "arg_names": [], "import_names": [], "rhs_call_name": "wait_for_service", "annotation": ""}, "snippet": " rospy.wait_for_service(srv)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99559:Assign_L58_C8", "label": "self.move_position = ServiceProxy()", "type": "assigned_variable", "loc": [58, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99559:FunctionDef_L45_C4", "vector": [14, 2, 0.5, 0.0086, 2, 0.9, 0.2778, 163, 3, 2, 0, 0, 915, 10, 1], "semantic": {"name": "self.move_position", "arg_names": [], "import_names": [], "rhs_call_name": "ServiceProxy", "annotation": ""}, "snippet": " self.move_position = rospy.ServiceProxy(srv, Float_Int)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99559:Assign_L60_C8", "label": "srv =", "type": "assigned_variable", "loc": [60, 60], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99559:FunctionDef_L45_C4", "vector": [14, 2, 0.5172, 0.0086, 2, 0.9, 0.3333, 445, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "srv", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " srv = '/zenither/stop'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99559:Expr_L61_C8", "label": "wait_for_service()", "type": "expression", "loc": [61, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99559:FunctionDef_L45_C4", "vector": [8, 2, 0.5259, 0.0086, 2, 0.9, 0.3889, 617, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "wait_for_service", "arg_names": [], "import_names": [], "rhs_call_name": "wait_for_service", "annotation": ""}, "snippet": " rospy.wait_for_service(srv)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99559:Assign_L62_C8", "label": "self.stop = ServiceProxy()", "type": "assigned_variable", "loc": [62, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99559:FunctionDef_L45_C4", "vector": [14, 2, 0.5345, 0.0086, 2, 0.9, 0.4444, 746, 3, 2, 0, 0, 915, 10, 1], "semantic": {"name": "self.stop", "arg_names": [], "import_names": [], "rhs_call_name": "ServiceProxy", "annotation": ""}, "snippet": " self.stop = rospy.ServiceProxy(srv, Float_Int)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99559:Assign_L64_C8", "label": "srv =", "type": "assigned_variable", "loc": [64, 64], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99559:FunctionDef_L45_C4", "vector": [14, 2, 0.5517, 0.0086, 2, 0.9, 0.5, 445, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "srv", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " srv = '/zenither/apply_torque'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99559:Expr_L65_C8", "label": "wait_for_service()", "type": "expression", "loc": [65, 65], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99559:FunctionDef_L45_C4", "vector": [8, 2, 0.5603, 0.0086, 2, 0.9, 0.5556, 617, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "wait_for_service", "arg_names": [], "import_names": [], "rhs_call_name": "wait_for_service", "annotation": ""}, "snippet": " rospy.wait_for_service(srv)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99559:Assign_L66_C8", "label": "self.apply_torque = ServiceProxy()", "type": "assigned_variable", "loc": [66, 66], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99559:FunctionDef_L45_C4", "vector": [14, 2, 0.569, 0.0086, 2, 0.9, 0.6111, 563, 3, 2, 0, 0, 915, 10, 1], "semantic": {"name": "self.apply_torque", "arg_names": [], "import_names": [], "rhs_call_name": "ServiceProxy", "annotation": ""}, "snippet": " self.apply_torque = rospy.ServiceProxy(srv, Float_Int)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99559:Assign_L68_C8", "label": "srv =", "type": "assigned_variable", "loc": [68, 68], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99559:FunctionDef_L45_C4", "vector": [14, 2, 0.5862, 0.0086, 2, 0.9, 0.6667, 445, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "srv", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " srv = '/zenither/torque_move_position'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99559:Expr_L69_C8", "label": "wait_for_service()", "type": "expression", "loc": [69, 69], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99559:FunctionDef_L45_C4", "vector": [8, 2, 0.5948, 0.0086, 2, 0.9, 0.7222, 617, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "wait_for_service", "arg_names": [], "import_names": [], "rhs_call_name": "wait_for_service", "annotation": ""}, "snippet": " rospy.wait_for_service(srv)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99559:Assign_L70_C8", "label": "self.torque_move_position = ServiceProxy()", "type": "assigned_variable", "loc": [70, 70], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99559:FunctionDef_L45_C4", "vector": [14, 2, 0.6034, 0.0086, 2, 0.9, 0.7778, 86, 3, 2, 0, 0, 915, 10, 1], "semantic": {"name": "self.torque_move_position", "arg_names": [], "import_names": [], "rhs_call_name": "ServiceProxy", "annotation": ""}, "snippet": " self.torque_move_position = rospy.ServiceProxy(srv, Float_Int)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99559:Assign_L72_C8", "label": "zenither_pose_topic =", "type": "assigned_variable", "loc": [72, 72], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99559:FunctionDef_L45_C4", "vector": [14, 2, 0.6207, 0.0086, 2, 0.9, 0.8333, 392, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "zenither_pose_topic", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " zenither_pose_topic = 'zenither_pose'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99559:Assign_L73_C8", "label": "self.h =", "type": "assigned_variable", "loc": [73, 73], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99559:FunctionDef_L45_C4", "vector": [14, 2, 0.6293, 0.0086, 2, 0.9, 0.8889, 164, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.h", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.h = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99559:Assign_L74_C8", "label": "self.lock = RLock()", "type": "assigned_variable", "loc": [74, 74], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99559:FunctionDef_L45_C4", "vector": [14, 2, 0.6379, 0.0086, 2, 0.9, 0.9444, 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_99559:Expr_L75_C8", "label": "Subscriber()", "type": "expression", "loc": [75, 75], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99559:FunctionDef_L45_C4", "vector": [8, 2, 0.6466, 0.0086, 2, 0.9, 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(zenither_pose_topic, FloatArray, self.pose_cb)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99559:FunctionDef_L78_C4", "label": "estop", "type": "function", "loc": [78, 79], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99559:ClassDef_L44_C0", "vector": [2, 1, 0.6767, 0.0172, 1, 0.25, 0.2, 12, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "estop", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def estop(self):\n self.stop(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99559:Expr_L79_C8", "label": "stop()", "type": "expression", "loc": [79, 79], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99559:FunctionDef_L78_C4", "vector": [8, 2, 0.681, 0.0086, 2, 0.45, 0.0, 343, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "stop", "annotation": ""}, "snippet": " self.stop(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99559:FunctionDef_L81_C4", "label": "zenith", "type": "function", "loc": [81, 84], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99559:ClassDef_L44_C0", "vector": [2, 1, 0.7112, 0.0345, 1, 0.25, 0.4, 130, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "zenith", "arg_names": ["self", "torque"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def zenith(self, torque=None):\n if torque == None:\n torque=self.calib['zenith_torque']\n self.apply_torque(torque)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99559:If_L82_C8", "label": "if", "type": "if", "loc": [82, 83], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99559:FunctionDef_L81_C4", "vector": [4, 2, 0.7112, 0.0172, 2, 0.59, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if torque == None:\n torque=self.calib['zenith_torque']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99559:Assign_L83_C12", "label": "torque =", "type": "assigned_variable", "loc": [83, 83], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99559:If_L82_C8", "vector": [14, 3, 0.7155, 0.0086, 3, 0.31, 0.0, 684, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "torque", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " torque=self.calib['zenith_torque']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99559:Expr_L84_C8", "label": "apply_torque()", "type": "expression", "loc": [84, 84], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99559:FunctionDef_L81_C4", "vector": [8, 2, 0.7241, 0.0086, 2, 0.59, 1.0, 994, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "apply_torque", "arg_names": [], "import_names": [], "rhs_call_name": "apply_torque", "annotation": ""}, "snippet": " self.apply_torque(torque)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99559:FunctionDef_L86_C4", "label": "nadir", "type": "function", "loc": [86, 89], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99559:ClassDef_L44_C0", "vector": [2, 1, 0.7543, 0.0345, 1, 0.25, 0.6, 441, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "nadir", "arg_names": ["self", "torque"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def nadir(self, torque=None):\n if torque == None:\n torque=self.calib['nadir_torque']\n self.apply_torque(torque)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99559:If_L87_C8", "label": "if", "type": "if", "loc": [87, 88], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99559:FunctionDef_L86_C4", "vector": [4, 2, 0.7543, 0.0172, 2, 0.4, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if torque == None:\n torque=self.calib['nadir_torque']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99559:Assign_L88_C12", "label": "torque =", "type": "assigned_variable", "loc": [88, 88], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99559:If_L87_C8", "vector": [14, 3, 0.7586, 0.0086, 3, 0.3, 0.0, 684, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "torque", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " torque=self.calib['nadir_torque']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99559:Expr_L89_C8", "label": "apply_torque()", "type": "expression", "loc": [89, 89], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99559:FunctionDef_L86_C4", "vector": [8, 2, 0.7672, 0.0086, 2, 0.4, 1.0, 994, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "apply_torque", "arg_names": [], "import_names": [], "rhs_call_name": "apply_torque", "annotation": ""}, "snippet": " self.apply_torque(torque)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99559:FunctionDef_L93_C4", "label": "pose_cb", "type": "function", "loc": [93, 96], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99559:ClassDef_L44_C0", "vector": [2, 1, 0.8147, 0.0345, 1, 0.25, 0.8, 686, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "pose_cb", "arg_names": ["self", "fa"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def pose_cb(self, fa):\n self.lock.acquire()\n self.h = fa.data[0]\n self.lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99559:Expr_L94_C8", "label": "acquire()", "type": "expression", "loc": [94, 94], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99559:FunctionDef_L93_C4", "vector": [8, 2, 0.8103, 0.0086, 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.lock.acquire()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99559:Assign_L95_C8", "label": "self.h =", "type": "assigned_variable", "loc": [95, 95], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99559:FunctionDef_L93_C4", "vector": [14, 2, 0.819, 0.0086, 2, 0.7, 0.5, 164, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.h", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.h = fa.data[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99559:Expr_L96_C8", "label": "release()", "type": "expression", "loc": [96, 96], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99559:FunctionDef_L93_C4", "vector": [8, 2, 0.8276, 0.0086, 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.lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99559:FunctionDef_L99_C4", "label": "height", "type": "function", "loc": [99, 103], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99559:ClassDef_L44_C0", "vector": [2, 1, 0.8707, 0.0431, 1, 0.25, 1.0, 751, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "height", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def height(self):\n self.lock.acquire()\n h = self.h\n self.lock.release()\n return h"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99559:Expr_L100_C8", "label": "acquire()", "type": "expression", "loc": [100, 100], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99559:FunctionDef_L99_C4", "vector": [8, 2, 0.8621, 0.0086, 2, 0.9, 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_99559:Assign_L101_C8", "label": "h =", "type": "assigned_variable", "loc": [101, 101], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99559:FunctionDef_L99_C4", "vector": [14, 2, 0.8707, 0.0086, 2, 0.9, 0.3333, 686, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "h", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " h = self.h"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99559:Expr_L102_C8", "label": "release()", "type": "expression", "loc": [102, 102], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99559:FunctionDef_L99_C4", "vector": [8, 2, 0.8793, 0.0086, 2, 0.9, 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_99559:Return_L103_C8", "label": "return", "type": "return", "loc": [103, 103], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99559:FunctionDef_L99_C4", "vector": [13, 2, 0.8879, 0.0086, 2, 0.9, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return h"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99559:If_L107_C0", "label": "if", "type": "if", "loc": [107, 114], "level": 0, "parent": null, "vector": [4, 0, 0.9526, 0.069, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n import time\n\n cl = ZenitherClient('HRL2')\n\n cl.zenith()\n time.sleep(0.5)\n cl.estop()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99559:Import_L108_C4", "label": "time import time", "type": "import", "loc": [108, 108], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99559:If_L107_C0", "vector": [1, 1, 0.931, 0.0086, 1, 0.01, 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_99559:Assign_L110_C4", "label": "cl = ZenitherClient()", "type": "assigned_variable", "loc": [110, 110], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99559:If_L107_C0", "vector": [14, 1, 0.9483, 0.0086, 1, 0.01, 0.25, 649, 3, 1, 0, 0, 79, 10, 1], "semantic": {"name": "cl", "arg_names": [], "import_names": [], "rhs_call_name": "ZenitherClient", "annotation": ""}, "snippet": " cl = ZenitherClient('HRL2')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99559:Expr_L112_C4", "label": "zenith()", "type": "expression", "loc": [112, 112], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99559:If_L107_C0", "vector": [8, 1, 0.9655, 0.0086, 1, 0.01, 0.5, 130, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "zenith", "arg_names": [], "import_names": [], "rhs_call_name": "zenith", "annotation": ""}, "snippet": " cl.zenith()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99559:Expr_L113_C4", "label": "sleep()", "type": "expression", "loc": [113, 113], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99559:If_L107_C0", "vector": [8, 1, 0.9741, 0.0086, 1, 0.01, 0.75, 476, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " time.sleep(0.5)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99559:Expr_L114_C4", "label": "estop()", "type": "expression", "loc": [114, 114], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99559:If_L107_C0", "vector": [8, 1, 0.9828, 0.0086, 1, 0.01, 1.0, 12, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "estop", "arg_names": [], "import_names": [], "rhs_call_name": "estop", "annotation": ""}, "snippet": " cl.estop()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99559:ClassDef_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99559:FunctionDef_L45_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99559:FunctionDef_L45_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99559:Try_L46_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99559:Try_L46_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99559:Expr_L47_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99559:Try_L46_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99559:Expr_L48_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99559:FunctionDef_L45_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99559:If_L52_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99559:FunctionDef_L45_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99559:Assign_L54_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99559:FunctionDef_L45_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99559:Assign_L56_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99559:FunctionDef_L45_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99559:Expr_L57_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99559:FunctionDef_L45_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99559:Assign_L58_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99559:FunctionDef_L45_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99559:Assign_L60_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99559:FunctionDef_L45_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99559:Expr_L61_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99559:FunctionDef_L45_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99559:Assign_L62_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99559:FunctionDef_L45_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99559:Assign_L64_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99559:FunctionDef_L45_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99559:Expr_L65_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99559:FunctionDef_L45_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99559:Assign_L66_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99559:FunctionDef_L45_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99559:Assign_L68_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99559:FunctionDef_L45_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99559:Expr_L69_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99559:FunctionDef_L45_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99559:Assign_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99559:FunctionDef_L45_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99559:Assign_L72_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99559:FunctionDef_L45_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99559:Assign_L73_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99559:FunctionDef_L45_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99559:Assign_L74_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99559:FunctionDef_L45_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99559:Expr_L75_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99559:ClassDef_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99559:FunctionDef_L78_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99559:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99559:Expr_L79_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99559:ClassDef_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99559:FunctionDef_L81_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99559:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99559:If_L82_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99559:If_L82_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99559:Assign_L83_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99559:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99559:Expr_L84_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99559:ClassDef_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99559:FunctionDef_L86_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99559:FunctionDef_L86_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99559:If_L87_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99559:If_L87_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99559:Assign_L88_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99559:FunctionDef_L86_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99559:Expr_L89_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99559:ClassDef_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99559:FunctionDef_L93_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99559:FunctionDef_L93_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99559:Expr_L94_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99559:FunctionDef_L93_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99559:Assign_L95_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99559:FunctionDef_L93_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99559:Expr_L96_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99559:ClassDef_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99559:FunctionDef_L99_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99559:FunctionDef_L99_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99559:Expr_L100_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99559:FunctionDef_L99_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99559:Assign_L101_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99559:FunctionDef_L99_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99559:Expr_L102_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99559:FunctionDef_L99_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99559:Return_L103_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99559:If_L107_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99559:Import_L108_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99559:If_L107_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99559:Assign_L110_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99559:If_L107_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99559:Expr_L112_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99559:If_L107_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99559:Expr_L113_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99559:If_L107_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99559:Expr_L114_C4"}]
calib = { 'El-E': { 'robot': 'El-E', 'pos_factor': 0.9144 / (183897 - 1250), 'vel_factor': 0.9144 / (183897 - 1250) / 20, 'acc_factor': 0.9144 / (183897 - 1250), 'POS_MAX': 0.9, 'VEL_DEFAULT': 1.5, 'VEL_MAX': 4.0, 'ACC_DEFAULT':0.0002, 'ACC_MAX':0.001, 'ZERO_BIAS':-0.004, 'HAS_BRAKE':True, 'nadir_torque': 0, 'zenith_torque': 200, 'down_fast_torque': 0, 'down_slow_torque': 50, 'down_snail_torque': 60, 'up_fast_torque': 300, 'up_slow_torque': 250, 'up_snail_torque': 200, 'max_height': 0.89, 'min_height': 0.005 }, 'HRL2': { #-------- Cressel's explanation ------------------------- # max speed for size 40 1m actuator is 1400rpm / 0.45m/s # conversion for velocity 536.87633 cnts/s / rpm # 536.87633*1400/0.45 # cnts/s / m/s (0.5,-540179)(0.0,0) # close but not there yet #-------- Advait's explanation # 1 rev of zenither = 20mm (from festo manual, page 10) # 1 rev of animatics servo = 2000 encoder counts (pg 6, section 1.0 of the animatics manual) # a gear reduction of 10 (I think I remember Cressel mentioning this). # => 20000 counts = 20mm or 1 count = 1/1000,000 meters # 'robot': 'HRL2', 'pos_factor': 1.0/ (-1000000), # Advait - Apr 27, 2009 'POS_MAX': 0.96, # Advait - Feb 17, 2009 'ZERO_BIAS':0.28, 'HAS_BRAKE':True, 'nadir_torque': 3, 'zenith_torque': 400, 'down_fast_torque': 0, 'down_slow_torque': 3, 'down_snail_torque': 5, 'up_fast_torque': 450, 'up_slow_torque': 400, 'up_snail_torque': 300, 'zero_vel_torque': 90, 'max_height': 1.32, 'min_height': 0.29 }, 'test_rig': { #-------- Advait's explanation # 1 rev of zenither = 10mm (from festo manual, page 10) # 1 rev of animatics servo = 2000 encoder counts (pg 6, section 1.0 of the animatics manual) # => 2000 counts = 10mm or 1 count = 1/200,000 meters # # for vel_factor and acc_factor, see Page 8 of Animatics manual # 'robot': 'test_rig', 'pos_factor': 1.0 /200000, 'vel_factor': 1.0/(32212.578*100), 'acc_factor': 1.0/(7.9166433*100), 'POS_MAX': 0.9, 'VEL_DEFAULT': 0.2, 'VEL_MAX': 0.4, 'ACC_DEFAULT':0.5, 'ACC_MAX':10.0, 'ZERO_BIAS':0.0, 'HAS_BRAKE':False, 'nadir_torque': -150, 'zenith_torque': 150, 'max_height': 0.9, 'min_height': 0.005 }, }
ajibawa-2023/Python-Code-Large/train/row_99560
1
84
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99560:Assign_L2_C0", "label": "calib =", "type": "assigned_variable", "loc": [2, 82], "level": 0, "parent": null, "vector": [14, 0, 0.5, 0.9643, 0, 0.66, 0.0, 147, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "calib", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "calib = {\n 'El-E': {\n 'robot': 'El-E',\n 'pos_factor': 0.9144 / (183897 - 1250),\n 'vel_factor': 0.9144 / (183897 - 1250) / 20,\n 'acc_factor': 0.9144 / (183897 - 1250),\n 'POS_MAX': 0.9,\n 'VEL_DEFAULT': 1.5,"}]
[]
__all__ = [ 'zenither', 'lib_zenither', 'ros_zenither_server', 'ros_zenither_client' ]
ajibawa-2023/Python-Code-Large/train/row_99561
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_99561:Assign_L1_C0", "label": "__all__ =", "type": "assigned_variable", "loc": [1, 6], "level": 0, "parent": null, "vector": [14, 0, 0.5833, 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'zenither',\n'lib_zenither',\n'ros_zenither_server',\n'ros_zenither_client'\n]"}]
[]
#!/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 (Healthcare Robotics Lab, Georgia Tech.) ## author Travis Deyle (Healthcare Robotics Lab, Georgia Tech.) ## author Hai Nguyen (Healthcare Robotics Lab, Georgia Tech.) import roslib roslib.load_manifest('zenither') import rospy from hrl_srvs.srv import Float_Int import time import sys class ZenitherServer(): def __init__(self, zenither): try: rospy.init_node('ZenitherServer') rospy.logout('ZenitherServer: Initialized Node') except rospy.ROSException: pass self.zenither = zenither self.smp = rospy.Service('/zenither/move_position', Float_Int, self.move_position) self.ss = rospy.Service('/zenither/stop', Float_Int, self.estop) self.sat = rospy.Service('/zenither/apply_torque', Float_Int, self.apply_torque) self.stmp = rospy.Service('/zenither/torque_move_position', Float_Int, self.torque_move_position) def move_position(self, msg): print 'move_position is UNTESTED' #self.zenither.move_position( msg.value ) return True def apply_torque(self, req): self.zenither.nadir(req.value) return True def estop(self, req): self.zenither.estop() return True def torque_move_position(self, req): self.zenither.torque_move_position(req.value) return True if __name__ == '__main__': import zenither.zenither as zenither z = zenither.Zenither('HRL2', pose_read_thread = True) zs = ZenitherServer(z) rospy.spin() # rosservice call /zenither/move_position 0.3
ajibawa-2023/Python-Code-Large/train/row_99563
33
85
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99563:Import_L33_C0", "label": "roslib import roslib", "type": "import", "loc": [33, 33], "level": 0, "parent": null, "vector": [1, 0, 0.3882, 0.0118, 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_99563:Expr_L34_C0", "label": "load_manifest()", "type": "expression", "loc": [34, 34], "level": 0, "parent": null, "vector": [8, 0, 0.4, 0.0118, 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('zenither')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99563:Import_L35_C0", "label": "rospy import rospy", "type": "import", "loc": [35, 35], "level": 0, "parent": null, "vector": [1, 0, 0.4118, 0.0118, 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_99563:ImportFrom_L36_C0", "label": "from hrl_srvs.srv import Float_Int", "type": "import", "loc": [36, 36], "level": 0, "parent": null, "vector": [1, 0, 0.4235, 0.0118, 0, 0.66, 0.4286, 416, 0, 1, 0, 0, 416, 0, 0], "semantic": {"name": "hrl_srvs.srv", "arg_names": [], "import_names": ["Float_Int"], "rhs_call_name": "", "annotation": ""}, "snippet": "from hrl_srvs.srv import Float_Int"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99563:Import_L38_C0", "label": "time import time", "type": "import", "loc": [38, 38], "level": 0, "parent": null, "vector": [1, 0, 0.4471, 0.0118, 0, 0.66, 0.5714, 654, 0, 1, 0, 0, 654, 0, 0], "semantic": {"name": "time", "arg_names": [], "import_names": ["time"], "rhs_call_name": "", "annotation": ""}, "snippet": "import time"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99563:Import_L39_C0", "label": "sys import sys", "type": "import", "loc": [39, 39], "level": 0, "parent": null, "vector": [1, 0, 0.4588, 0.0118, 0, 0.66, 0.7143, 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_99563:ClassDef_L42_C0", "label": "ZenitherServer", "type": "class", "loc": [42, 75], "level": 0, "parent": null, "vector": [3, 0, 0.6882, 0.4, 0, 0.66, 0.8571, 706, 0, 5, 0, 0, 0, 0, 10], "semantic": {"name": "ZenitherServer", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ZenitherServer():\n def __init__(self, zenither):\n try:\n rospy.init_node('ZenitherServer')\n rospy.logout('ZenitherServer: Initialized Node')\n except rospy.ROSException:\n pass\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99563:FunctionDef_L43_C4", "label": "__init__", "type": "function", "loc": [43, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99563:ClassDef_L42_C0", "vector": [2, 1, 0.5941, 0.1882, 1, 0.51, 0.0, 555, 0, 2, 0, 0, 0, 0, 6], "semantic": {"name": "__init__", "arg_names": ["self", "zenither"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, zenither):\n try:\n rospy.init_node('ZenitherServer')\n rospy.logout('ZenitherServer: Initialized Node')\n except rospy.ROSException:\n pass\n\n self.zenither = zenither"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99563:Try_L44_C8", "label": "try", "type": "try", "loc": [44, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99563:FunctionDef_L43_C4", "vector": [7, 2, 0.5412, 0.0588, 2, 0.58, 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('ZenitherServer')\n rospy.logout('ZenitherServer: Initialized Node')\n except rospy.ROSException:\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99563:Expr_L45_C12", "label": "init_node()", "type": "expression", "loc": [45, 45], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99563:Try_L44_C8", "vector": [8, 3, 0.5294, 0.0118, 3, 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('ZenitherServer')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99563:Expr_L46_C12", "label": "logout()", "type": "expression", "loc": [46, 46], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99563:Try_L44_C8", "vector": [8, 3, 0.5412, 0.0118, 3, 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('ZenitherServer: Initialized Node')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99563:Assign_L50_C8", "label": "self.zenither =", "type": "assigned_variable", "loc": [50, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99563:FunctionDef_L43_C4", "vector": [14, 2, 0.5882, 0.0118, 2, 0.58, 0.2, 880, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.zenither", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.zenither = zenither"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99563:Assign_L51_C8", "label": "self.smp = Service()", "type": "assigned_variable", "loc": [51, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99563:FunctionDef_L43_C4", "vector": [14, 2, 0.6059, 0.0235, 2, 0.58, 0.4, 148, 3, 3, 0, 0, 451, 10, 1], "semantic": {"name": "self.smp", "arg_names": [], "import_names": [], "rhs_call_name": "Service", "annotation": ""}, "snippet": " self.smp = rospy.Service('/zenither/move_position', Float_Int,\n self.move_position)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99563:Assign_L53_C8", "label": "self.ss = Service()", "type": "assigned_variable", "loc": [53, 54], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99563:FunctionDef_L43_C4", "vector": [14, 2, 0.6294, 0.0235, 2, 0.58, 0.6, 244, 3, 3, 0, 0, 451, 10, 1], "semantic": {"name": "self.ss", "arg_names": [], "import_names": [], "rhs_call_name": "Service", "annotation": ""}, "snippet": " self.ss = rospy.Service('/zenither/stop', Float_Int,\n self.estop)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99563:Assign_L55_C8", "label": "self.sat = Service()", "type": "assigned_variable", "loc": [55, 56], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99563:FunctionDef_L43_C4", "vector": [14, 2, 0.6529, 0.0235, 2, 0.58, 0.8, 893, 3, 3, 0, 0, 451, 10, 1], "semantic": {"name": "self.sat", "arg_names": [], "import_names": [], "rhs_call_name": "Service", "annotation": ""}, "snippet": " self.sat = rospy.Service('/zenither/apply_torque', Float_Int,\n self.apply_torque)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99563:Assign_L57_C8", "label": "self.stmp = Service()", "type": "assigned_variable", "loc": [57, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99563:FunctionDef_L43_C4", "vector": [14, 2, 0.6765, 0.0235, 2, 0.58, 1.0, 339, 3, 3, 0, 0, 451, 10, 1], "semantic": {"name": "self.stmp", "arg_names": [], "import_names": [], "rhs_call_name": "Service", "annotation": ""}, "snippet": " self.stmp = rospy.Service('/zenither/torque_move_position',\n Float_Int, self.torque_move_position)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99563:FunctionDef_L60_C4", "label": "move_position", "type": "function", "loc": [60, 63], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99563:ClassDef_L42_C0", "vector": [2, 1, 0.7235, 0.0471, 1, 0.51, 0.25, 667, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "move_position", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def move_position(self, msg):\n print('move_position is UNTESTED')\n #self.zenither.move_position( msg.value )\n return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99563:Expr_L61_C8", "label": "print()", "type": "expression", "loc": [61, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99563:FunctionDef_L60_C4", "vector": [8, 2, 0.7176, 0.0118, 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('move_position is UNTESTED')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99563:Return_L63_C8", "label": "return", "type": "return", "loc": [63, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99563:FunctionDef_L60_C4", "vector": [13, 2, 0.7412, 0.0118, 2, 0.89, 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_99563:FunctionDef_L65_C4", "label": "apply_torque", "type": "function", "loc": [65, 67], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99563:ClassDef_L42_C0", "vector": [2, 1, 0.7765, 0.0353, 1, 0.51, 0.5, 994, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "apply_torque", "arg_names": ["self", "req"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def apply_torque(self, req):\n self.zenither.nadir(req.value)\n return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99563:Expr_L66_C8", "label": "nadir()", "type": "expression", "loc": [66, 66], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99563:FunctionDef_L65_C4", "vector": [8, 2, 0.7765, 0.0118, 2, 0.87, 0.0, 441, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "nadir", "arg_names": [], "import_names": [], "rhs_call_name": "nadir", "annotation": ""}, "snippet": " self.zenither.nadir(req.value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99563:Return_L67_C8", "label": "return", "type": "return", "loc": [67, 67], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99563:FunctionDef_L65_C4", "vector": [13, 2, 0.7882, 0.0118, 2, 0.87, 1.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99563:FunctionDef_L69_C4", "label": "estop", "type": "function", "loc": [69, 71], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99563:ClassDef_L42_C0", "vector": [2, 1, 0.8235, 0.0353, 1, 0.51, 0.75, 12, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "estop", "arg_names": ["self", "req"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def estop(self, req):\n self.zenither.estop()\n return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99563:Expr_L70_C8", "label": "estop()", "type": "expression", "loc": [70, 70], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99563:FunctionDef_L69_C4", "vector": [8, 2, 0.8235, 0.0118, 2, 0.38, 0.0, 12, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "estop", "arg_names": [], "import_names": [], "rhs_call_name": "estop", "annotation": ""}, "snippet": " self.zenither.estop()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99563:Return_L71_C8", "label": "return", "type": "return", "loc": [71, 71], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99563:FunctionDef_L69_C4", "vector": [13, 2, 0.8353, 0.0118, 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 True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99563:FunctionDef_L73_C4", "label": "torque_move_position", "type": "function", "loc": [73, 75], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99563:ClassDef_L42_C0", "vector": [2, 1, 0.8706, 0.0353, 1, 0.51, 1.0, 351, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "torque_move_position", "arg_names": ["self", "req"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def torque_move_position(self, req):\n self.zenither.torque_move_position(req.value)\n return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99563:Expr_L74_C8", "label": "torque_move_position()", "type": "expression", "loc": [74, 74], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99563:FunctionDef_L73_C4", "vector": [8, 2, 0.8706, 0.0118, 2, 0.93, 0.0, 351, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "torque_move_position", "arg_names": [], "import_names": [], "rhs_call_name": "torque_move_position", "annotation": ""}, "snippet": " self.zenither.torque_move_position(req.value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99563:Return_L75_C8", "label": "return", "type": "return", "loc": [75, 75], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99563:FunctionDef_L73_C4", "vector": [13, 2, 0.8824, 0.0118, 2, 0.93, 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_99563:If_L79_C0", "label": "if", "type": "if", "loc": [79, 83], "level": 0, "parent": null, "vector": [4, 0, 0.9529, 0.0588, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n import zenither.zenither as zenither\n z = zenither.Zenither('HRL2', pose_read_thread = True)\n zs = ZenitherServer(z)\n rospy.spin()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99563:Import_L80_C4", "label": "zenither.zenither import zenither", "type": "import", "loc": [80, 80], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99563:If_L79_C0", "vector": [1, 1, 0.9412, 0.0118, 1, 0.22, 0.0, 751, 0, 1, 0, 0, 751, 0, 0], "semantic": {"name": "zenither.zenither", "arg_names": [], "import_names": ["zenither"], "rhs_call_name": "", "annotation": ""}, "snippet": " import zenither.zenither as zenither"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99563:Assign_L81_C4", "label": "z = Zenither()", "type": "assigned_variable", "loc": [81, 81], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99563:If_L79_C0", "vector": [14, 1, 0.9529, 0.0118, 1, 0.22, 0.3333, 859, 3, 2, 0, 0, 477, 10, 1], "semantic": {"name": "z", "arg_names": [], "import_names": [], "rhs_call_name": "Zenither", "annotation": ""}, "snippet": " z = zenither.Zenither('HRL2', pose_read_thread = True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99563:Assign_L82_C4", "label": "zs = ZenitherServer()", "type": "assigned_variable", "loc": [82, 82], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99563:If_L79_C0", "vector": [14, 1, 0.9647, 0.0118, 1, 0.22, 0.6667, 406, 3, 1, 0, 0, 706, 10, 1], "semantic": {"name": "zs", "arg_names": [], "import_names": [], "rhs_call_name": "ZenitherServer", "annotation": ""}, "snippet": " zs = ZenitherServer(z)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99563:Expr_L83_C4", "label": "spin()", "type": "expression", "loc": [83, 83], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99563:If_L79_C0", "vector": [8, 1, 0.9765, 0.0118, 1, 0.22, 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_99563:ClassDef_L42_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99563:FunctionDef_L43_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99563:FunctionDef_L43_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99563:Try_L44_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99563:Try_L44_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99563:Expr_L45_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99563:Try_L44_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99563:Expr_L46_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99563:FunctionDef_L43_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99563:Assign_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99563:FunctionDef_L43_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99563:Assign_L51_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99563:FunctionDef_L43_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99563:Assign_L53_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99563:FunctionDef_L43_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99563:Assign_L55_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99563:FunctionDef_L43_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99563:Assign_L57_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99563:ClassDef_L42_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99563:FunctionDef_L60_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99563:FunctionDef_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99563:Expr_L61_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99563:FunctionDef_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99563:Return_L63_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99563:ClassDef_L42_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99563:FunctionDef_L65_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99563:FunctionDef_L65_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99563:Expr_L66_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99563:FunctionDef_L65_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99563:Return_L67_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99563:ClassDef_L42_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99563:FunctionDef_L69_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99563:FunctionDef_L69_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99563:Expr_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99563:FunctionDef_L69_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99563:Return_L71_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99563:ClassDef_L42_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99563:FunctionDef_L73_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99563:FunctionDef_L73_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99563:Expr_L74_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99563:FunctionDef_L73_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99563:Return_L75_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99563:If_L79_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99563:Import_L80_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99563:If_L79_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99563:Assign_L81_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99563:If_L79_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99563:Assign_L82_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99563:If_L79_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99563:Expr_L83_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 Cressel Anderson (Healthcare Robotics Lab, Georgia Tech.) # \author Marc Killpack (Healthcare Robotics Lab, Georgia Tech.) import pygame import pygame.joystick import sys, optparse import segway_command as sc import time as time import roslib roslib.load_manifest('segway_omni') import rospy import hrl_lib.util as ut import numpy as np from pygame.locals import * if __name__=='__main__': p = optparse.OptionParser() p.add_option('-z', action='store_true', dest='zenither', help='control the zenither also') opt, args = p.parse_args() zenither_flag = opt.zenither if zenither_flag: import zenither.zenither as zenither z = zenither.Zenither(robot='HRL2') cmd_node = sc.SegwayCommand() max_xvel = 0.18 max_yvel = 0.15 max_speed = 0.18 # don't exceed 0.18 under any condition. max_avel = 0.18 xvel = 0.0 yvel = 0.0 avel = 0.0 #init pygame pygame.init() #joystick_status joystick_count = pygame.joystick.get_count() print "Joysticks found: %d\n" % joystick_count try: js = pygame.joystick.Joystick(0) js.init() except pygame.error: print "joystick error" js = None js_status = js.get_init() print js_status screen = pygame.display.set_mode((320,80)) pygame.display.set_caption('Snozzjoy') background = pygame.Surface(screen.get_size()) background = background.convert() background.fill((250,250,250)) x=0. y=0. a=0. len = 5 xvel_history = np.matrix(np.zeros([len,1])) connected = False while not rospy.is_shutdown(): move_zenither_flag=False for event in pygame.event.get(): if (event.type == JOYAXISMOTION): if event.axis == 0: #left pedal x = -0.5 * event.value - 0.5 elif event.axis == 1 and x == 0: #right pedal x = 0.5 * event.value + 0.5 if event.axis == 2: a = event.value print 'event.axis: ',event.axis,'event.value: ',event.value # elif (event.type == JOYBUTTONDOWN): # if zenither_flag: # if(event.button == 0): # z.zenith(z.calib['up_slow_torque']) # move_zenither_flag=True # if(event.button == 1): # z.nadir(z.calib['down_snail_torque']) # move_zenither_flag=True if x == 0 and y == 0 and a ==0: connected = True # detect a joystick disconnect try: js.quit() js.init() except pygame.error: print "joystick error" rospy.signal_shutdown() # if zenither_flag and (move_zenither_flag == False): # z.estop() #send segway commands if connected: xvel = x*max_xvel # xvel_history[0:(len-1)] = xvel_history[1:len] # xvel_history[(len-1)] = xvel # xvel = np.mean(xvel_history) yvel = y*max_yvel avel = a*max_avel vel_vec = np.matrix([xvel,yvel]).T vel_mag = np.linalg.norm(vel_vec) speed = ut.bound(vel_mag,max_speed,0.) if speed >= 0.05: vel_vec = vel_vec*speed/vel_mag xvel,yvel = vel_vec[0,0],vel_vec[1,0] cmd_node.set_velocity(xvel,yvel,avel) print '*******xvel=',xvel,'; avel=',avel # stop the segway cmd_node.set_velocity(0.,0.,0.)
ajibawa-2023/Python-Code-Large/train/row_99564
78
164
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99564:Import_L32_C0", "label": "pygame import pygame", "type": "import", "loc": [32, 32], "level": 0, "parent": null, "vector": [1, 0, 0.1951, 0.0061, 0, 0.66, 0.0, 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_99564:Import_L33_C0", "label": "pygame.joystick import pygame.joystick", "type": "import", "loc": [33, 33], "level": 0, "parent": null, "vector": [1, 0, 0.2012, 0.0061, 0, 0.66, 0.0909, 115, 0, 1, 0, 0, 115, 0, 0], "semantic": {"name": "pygame.joystick", "arg_names": [], "import_names": ["pygame.joystick"], "rhs_call_name": "", "annotation": ""}, "snippet": "import pygame.joystick"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99564:Import_L34_C0", "label": "sys import sys, optparse", "type": "import", "loc": [34, 34], "level": 0, "parent": null, "vector": [1, 0, 0.2073, 0.0061, 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_99564:Import_L35_C0", "label": "segway_command import sc", "type": "import", "loc": [35, 35], "level": 0, "parent": null, "vector": [1, 0, 0.2134, 0.0061, 0, 0.66, 0.2727, 716, 0, 1, 0, 0, 716, 0, 0], "semantic": {"name": "segway_command", "arg_names": [], "import_names": ["sc"], "rhs_call_name": "", "annotation": ""}, "snippet": "import segway_command as sc"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99564:Import_L36_C0", "label": "time import time", "type": "import", "loc": [36, 36], "level": 0, "parent": null, "vector": [1, 0, 0.2195, 0.0061, 0, 0.66, 0.3636, 654, 0, 1, 0, 0, 654, 0, 0], "semantic": {"name": "time", "arg_names": [], "import_names": ["time"], "rhs_call_name": "", "annotation": ""}, "snippet": "import time as time"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99564:Import_L37_C0", "label": "roslib import roslib", "type": "import", "loc": [37, 37], "level": 0, "parent": null, "vector": [1, 0, 0.2256, 0.0061, 0, 0.66, 0.4545, 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_99564:Expr_L38_C0", "label": "load_manifest()", "type": "expression", "loc": [38, 38], "level": 0, "parent": null, "vector": [8, 0, 0.2317, 0.0061, 0, 0.66, 0.5455, 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('segway_omni')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99564:Import_L39_C0", "label": "rospy import rospy", "type": "import", "loc": [39, 39], "level": 0, "parent": null, "vector": [1, 0, 0.2378, 0.0061, 0, 0.66, 0.6364, 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_99564:Import_L41_C0", "label": "hrl_lib.util import ut", "type": "import", "loc": [41, 41], "level": 0, "parent": null, "vector": [1, 0, 0.25, 0.0061, 0, 0.66, 0.7273, 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_99564:Import_L42_C0", "label": "numpy import np", "type": "import", "loc": [42, 42], "level": 0, "parent": null, "vector": [1, 0, 0.2561, 0.0061, 0, 0.66, 0.8182, 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_99564:ImportFrom_L44_C0", "label": "from pygame.locals import *", "type": "import", "loc": [44, 44], "level": 0, "parent": null, "vector": [1, 0, 0.2683, 0.0061, 0, 0.66, 0.9091, 515, 0, 1, 0, 0, 515, 0, 0], "semantic": {"name": "pygame.locals", "arg_names": [], "import_names": ["*"], "rhs_call_name": "", "annotation": ""}, "snippet": "from pygame.locals import *"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L47_C0", "label": "if", "type": "if", "loc": [47, 161], "level": 0, "parent": null, "vector": [4, 0, 0.6341, 0.7012, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 33], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__=='__main__':\n p = optparse.OptionParser()\n\n p.add_option('-z', action='store_true', dest='zenither',\n help='control the zenither also')\n\n opt, args = p.parse_args()\n zenither_flag = opt.zenither"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99564:Assign_L48_C4", "label": "p = OptionParser()", "type": "assigned_variable", "loc": [48, 48], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L47_C0", "vector": [14, 1, 0.2927, 0.0061, 1, 0.44, 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_99564:Expr_L50_C4", "label": "add_option()", "type": "expression", "loc": [50, 51], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L47_C0", "vector": [8, 1, 0.3079, 0.0122, 1, 0.44, 0.0323, 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('-z', action='store_true', dest='zenither',\n help='control the zenither also')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99564:Assign_L53_C4", "label": "opt, args = parse_args()", "type": "assigned_variable", "loc": [53, 53], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L47_C0", "vector": [14, 1, 0.3232, 0.0061, 1, 0.44, 0.0645, 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_99564:Assign_L54_C4", "label": "zenither_flag =", "type": "assigned_variable", "loc": [54, 54], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L47_C0", "vector": [14, 1, 0.3293, 0.0061, 1, 0.44, 0.0968, 821, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "zenither_flag", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " zenither_flag = opt.zenither"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L56_C4", "label": "if", "type": "if", "loc": [56, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L47_C0", "vector": [4, 1, 0.3476, 0.0183, 1, 0.44, 0.129, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if zenither_flag:\n import zenither.zenither as zenither\n z = zenither.Zenither(robot='HRL2')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99564:Import_L57_C8", "label": "zenither.zenither import zenither", "type": "import", "loc": [57, 57], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L56_C4", "vector": [1, 2, 0.3476, 0.0061, 2, 0.82, 0.0, 751, 0, 1, 0, 0, 751, 0, 0], "semantic": {"name": "zenither.zenither", "arg_names": [], "import_names": ["zenither"], "rhs_call_name": "", "annotation": ""}, "snippet": " import zenither.zenither as zenither"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99564:Assign_L58_C8", "label": "z = Zenither()", "type": "assigned_variable", "loc": [58, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L56_C4", "vector": [14, 2, 0.3537, 0.0061, 2, 0.82, 1.0, 859, 3, 1, 0, 0, 477, 10, 1], "semantic": {"name": "z", "arg_names": [], "import_names": [], "rhs_call_name": "Zenither", "annotation": ""}, "snippet": " z = zenither.Zenither(robot='HRL2')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99564:Assign_L60_C4", "label": "cmd_node = SegwayCommand()", "type": "assigned_variable", "loc": [60, 60], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L47_C0", "vector": [14, 1, 0.3659, 0.0061, 1, 0.44, 0.1613, 175, 3, 0, 0, 0, 821, 10, 1], "semantic": {"name": "cmd_node", "arg_names": [], "import_names": [], "rhs_call_name": "SegwayCommand", "annotation": ""}, "snippet": " cmd_node = sc.SegwayCommand()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99564:Assign_L62_C4", "label": "max_xvel =", "type": "assigned_variable", "loc": [62, 62], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L47_C0", "vector": [14, 1, 0.378, 0.0061, 1, 0.44, 0.1935, 8, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "max_xvel", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " max_xvel = 0.18 "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99564:Assign_L63_C4", "label": "max_yvel =", "type": "assigned_variable", "loc": [63, 63], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L47_C0", "vector": [14, 1, 0.3841, 0.0061, 1, 0.44, 0.2258, 570, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "max_yvel", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " max_yvel = 0.15"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99564:Assign_L64_C4", "label": "max_speed =", "type": "assigned_variable", "loc": [64, 64], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L47_C0", "vector": [14, 1, 0.3902, 0.0061, 1, 0.44, 0.2581, 113, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "max_speed", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " max_speed = 0.18 # don't exceed 0.18 under any condition."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99564:Assign_L65_C4", "label": "max_avel =", "type": "assigned_variable", "loc": [65, 65], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L47_C0", "vector": [14, 1, 0.3963, 0.0061, 1, 0.44, 0.2903, 633, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "max_avel", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " max_avel = 0.18"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99564:Assign_L67_C4", "label": "xvel =", "type": "assigned_variable", "loc": [67, 67], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L47_C0", "vector": [14, 1, 0.4085, 0.0061, 1, 0.44, 0.3226, 984, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "xvel", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " xvel = 0.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99564:Assign_L68_C4", "label": "yvel =", "type": "assigned_variable", "loc": [68, 68], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L47_C0", "vector": [14, 1, 0.4146, 0.0061, 1, 0.44, 0.3548, 335, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "yvel", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " yvel = 0.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99564:Assign_L69_C4", "label": "avel =", "type": "assigned_variable", "loc": [69, 69], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L47_C0", "vector": [14, 1, 0.4207, 0.0061, 1, 0.44, 0.3871, 290, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "avel", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " avel = 0.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99564:Expr_L72_C4", "label": "init()", "type": "expression", "loc": [72, 72], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L47_C0", "vector": [8, 1, 0.439, 0.0061, 1, 0.44, 0.4194, 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_99564:Assign_L75_C4", "label": "joystick_count = get_count()", "type": "assigned_variable", "loc": [75, 75], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L47_C0", "vector": [14, 1, 0.4573, 0.0061, 1, 0.44, 0.4516, 732, 3, 0, 0, 0, 338, 10, 1], "semantic": {"name": "joystick_count", "arg_names": [], "import_names": [], "rhs_call_name": "get_count", "annotation": ""}, "snippet": " joystick_count = pygame.joystick.get_count()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99564:Expr_L77_C4", "label": "print()", "type": "expression", "loc": [77, 77], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L47_C0", "vector": [8, 1, 0.4695, 0.0061, 1, 0.44, 0.4839, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"Joysticks found: %d\\n\" % joystick_count)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99564:Try_L79_C4", "label": "try", "type": "try", "loc": [79, 84], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L47_C0", "vector": [7, 1, 0.497, 0.0366, 1, 0.44, 0.5161, 0, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n js = pygame.joystick.Joystick(0)\n js.init()\n except pygame.error:\n print(\"joystick error\")\n js = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99564:Assign_L80_C8", "label": "js = Joystick()", "type": "assigned_variable", "loc": [80, 80], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99564:Try_L79_C4", "vector": [14, 2, 0.4878, 0.0061, 2, 0.69, 0.0, 62, 3, 1, 0, 0, 752, 10, 1], "semantic": {"name": "js", "arg_names": [], "import_names": [], "rhs_call_name": "Joystick", "annotation": ""}, "snippet": " js = pygame.joystick.Joystick(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99564:Expr_L81_C8", "label": "init()", "type": "expression", "loc": [81, 81], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99564:Try_L79_C4", "vector": [8, 2, 0.4939, 0.0061, 2, 0.69, 1.0, 319, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "init", "arg_names": [], "import_names": [], "rhs_call_name": "init", "annotation": ""}, "snippet": " js.init()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99564:Expr_L83_C8", "label": "print()", "type": "expression", "loc": [83, 83], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99564:Try_L79_C4", "vector": [8, 2, 0.5061, 0.0061, 2, 0.69, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"joystick error\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99564:Assign_L84_C8", "label": "js =", "type": "assigned_variable", "loc": [84, 84], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99564:Try_L79_C4", "vector": [14, 2, 0.5122, 0.0061, 2, 0.69, 1.0, 62, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "js", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " js = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99564:Assign_L86_C4", "label": "js_status = get_init()", "type": "assigned_variable", "loc": [86, 86], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L47_C0", "vector": [14, 1, 0.5244, 0.0061, 1, 0.44, 0.5484, 717, 3, 0, 0, 0, 261, 10, 1], "semantic": {"name": "js_status", "arg_names": [], "import_names": [], "rhs_call_name": "get_init", "annotation": ""}, "snippet": " js_status = js.get_init()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99564:Expr_L87_C4", "label": "print()", "type": "expression", "loc": [87, 87], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L47_C0", "vector": [8, 1, 0.5305, 0.0061, 1, 0.44, 0.5806, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(js_status)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99564:Assign_L89_C4", "label": "screen = set_mode()", "type": "assigned_variable", "loc": [89, 89], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L47_C0", "vector": [14, 1, 0.5427, 0.0061, 1, 0.44, 0.6129, 522, 3, 1, 0, 0, 255, 10, 1], "semantic": {"name": "screen", "arg_names": [], "import_names": [], "rhs_call_name": "set_mode", "annotation": ""}, "snippet": " screen = pygame.display.set_mode((320,80))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99564:Expr_L90_C4", "label": "set_caption()", "type": "expression", "loc": [90, 90], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L47_C0", "vector": [8, 1, 0.5488, 0.0061, 1, 0.44, 0.6452, 763, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_caption", "arg_names": [], "import_names": [], "rhs_call_name": "set_caption", "annotation": ""}, "snippet": " pygame.display.set_caption('Snozzjoy')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99564:Assign_L92_C4", "label": "background = Surface()", "type": "assigned_variable", "loc": [92, 92], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L47_C0", "vector": [14, 1, 0.561, 0.0061, 1, 0.44, 0.6774, 459, 3, 1, 0, 0, 719, 10, 2], "semantic": {"name": "background", "arg_names": [], "import_names": [], "rhs_call_name": "Surface", "annotation": ""}, "snippet": " background = pygame.Surface(screen.get_size())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99564:Assign_L93_C4", "label": "background = convert()", "type": "assigned_variable", "loc": [93, 93], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L47_C0", "vector": [14, 1, 0.5671, 0.0061, 1, 0.44, 0.7097, 459, 3, 0, 0, 0, 438, 10, 1], "semantic": {"name": "background", "arg_names": [], "import_names": [], "rhs_call_name": "convert", "annotation": ""}, "snippet": " background = background.convert()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99564:Expr_L94_C4", "label": "fill()", "type": "expression", "loc": [94, 94], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L47_C0", "vector": [8, 1, 0.5732, 0.0061, 1, 0.44, 0.7419, 346, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "fill", "arg_names": [], "import_names": [], "rhs_call_name": "fill", "annotation": ""}, "snippet": " background.fill((250,250,250))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99564:Assign_L96_C4", "label": "x =", "type": "assigned_variable", "loc": [96, 96], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L47_C0", "vector": [14, 1, 0.5854, 0.0061, 1, 0.44, 0.7742, 190, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " x=0."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99564:Assign_L97_C4", "label": "y =", "type": "assigned_variable", "loc": [97, 97], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L47_C0", "vector": [14, 1, 0.5915, 0.0061, 1, 0.44, 0.8065, 304, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " y=0."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99564:Assign_L98_C4", "label": "a =", "type": "assigned_variable", "loc": [98, 98], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L47_C0", "vector": [14, 1, 0.5976, 0.0061, 1, 0.44, 0.8387, 475, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "a", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " a=0."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99564:Assign_L100_C4", "label": "len =", "type": "assigned_variable", "loc": [100, 100], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L47_C0", "vector": [14, 1, 0.6098, 0.0061, 1, 0.44, 0.871, 890, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "len", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " len = 5"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99564:Assign_L101_C4", "label": "xvel_history = matrix()", "type": "assigned_variable", "loc": [101, 101], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L47_C0", "vector": [14, 1, 0.6159, 0.0061, 1, 0.44, 0.9032, 461, 3, 1, 0, 0, 162, 10, 2], "semantic": {"name": "xvel_history", "arg_names": [], "import_names": [], "rhs_call_name": "matrix", "annotation": ""}, "snippet": " xvel_history = np.matrix(np.zeros([len,1]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99564:Assign_L103_C4", "label": "connected =", "type": "assigned_variable", "loc": [103, 103], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L47_C0", "vector": [14, 1, 0.628, 0.0061, 1, 0.44, 0.9355, 720, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "connected", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " connected = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99564:While_L104_C4", "label": "while", "type": "while", "loc": [104, 159], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L47_C0", "vector": [5, 1, 0.8018, 0.3415, 1, 0.44, 0.9677, 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\n move_zenither_flag=False\n for event in pygame.event.get():\n \n if (event.type == JOYAXISMOTION):\n if event.axis == 0: #left pedal\n x = -0.5 * event.value - 0.5"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99564:Assign_L106_C8", "label": "move_zenither_flag =", "type": "assigned_variable", "loc": [106, 106], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99564:While_L104_C4", "vector": [14, 2, 0.6463, 0.0061, 2, 0.52, 0.0, 27, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "move_zenither_flag", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " move_zenither_flag=False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99564:For_L107_C8", "label": "for event", "type": "for", "loc": [107, 116], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99564:While_L104_C4", "vector": [6, 2, 0.6799, 0.061, 2, 0.52, 0.25, 371, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "event", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for event in pygame.event.get():\n \n if (event.type == JOYAXISMOTION):\n if event.axis == 0: #left pedal\n x = -0.5 * event.value - 0.5\n elif event.axis == 1 and x == 0: #right pedal\n x = 0.5 * event.value + 0.5\n if event.axis == 2:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L109_C12", "label": "if", "type": "if", "loc": [109, 116], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99564:For_L107_C8", "vector": [4, 3, 0.686, 0.0488, 3, 0.83, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (event.type == JOYAXISMOTION):\n if event.axis == 0: #left pedal\n x = -0.5 * event.value - 0.5\n elif event.axis == 1 and x == 0: #right pedal\n x = 0.5 * event.value + 0.5\n if event.axis == 2:\n a = event.value\n print('event.axis: ',event.axis,'event.value: ',event.value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L110_C16", "label": "if", "type": "if", "loc": [110, 113], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L109_C12", "vector": [4, 4, 0.6799, 0.0244, 4, 0.89, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if event.axis == 0: #left pedal\n x = -0.5 * event.value - 0.5\n elif event.axis == 1 and x == 0: #right pedal\n x = 0.5 * event.value + 0.5"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99564:Assign_L111_C20", "label": "x =", "type": "assigned_variable", "loc": [111, 111], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L110_C16", "vector": [14, 5, 0.6768, 0.0061, 5, 0.4, 0.0, 190, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " x = -0.5 * event.value - 0.5"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L112_C16", "label": "if", "type": "if", "loc": [112, 113], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L110_C16", "vector": [4, 5, 0.686, 0.0122, 5, 0.4, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif event.axis == 1 and x == 0: #right pedal\n x = 0.5 * event.value + 0.5"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99564:Assign_L113_C20", "label": "x =", "type": "assigned_variable", "loc": [113, 113], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L112_C16", "vector": [14, 6, 0.689, 0.0061, 6, 0.15, 0.0, 190, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " x = 0.5 * event.value + 0.5"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L114_C16", "label": "if", "type": "if", "loc": [114, 115], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L109_C12", "vector": [4, 4, 0.6982, 0.0122, 4, 0.89, 0.5, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if event.axis == 2:\n a = event.value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99564:Assign_L115_C20", "label": "a =", "type": "assigned_variable", "loc": [115, 115], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L114_C16", "vector": [14, 5, 0.7012, 0.0061, 5, 0.59, 0.0, 475, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "a", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " a = event.value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99564:Expr_L116_C16", "label": "print()", "type": "expression", "loc": [116, 116], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L109_C12", "vector": [8, 4, 0.7073, 0.0061, 4, 0.89, 1.0, 535, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('event.axis: ',event.axis,'event.value: ',event.value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L128_C8", "label": "if", "type": "if", "loc": [128, 129], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99564:While_L104_C4", "vector": [4, 2, 0.7835, 0.0122, 2, 0.52, 0.5, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if x == 0 and y == 0 and a ==0:\n connected = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99564:Assign_L129_C12", "label": "connected =", "type": "assigned_variable", "loc": [129, 129], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L128_C8", "vector": [14, 3, 0.7866, 0.0061, 3, 0.84, 0.0, 720, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "connected", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " connected = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99564:Try_L132_C8", "label": "try", "type": "try", "loc": [132, 137], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99564:While_L104_C4", "vector": [7, 2, 0.8201, 0.0366, 2, 0.52, 0.75, 0, 0, 1, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n js.quit()\n js.init()\n except pygame.error:\n print(\"joystick error\")\n rospy.signal_shutdown()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99564:Expr_L133_C12", "label": "quit()", "type": "expression", "loc": [133, 133], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99564:Try_L132_C8", "vector": [8, 3, 0.811, 0.0061, 3, 0.6, 0.0, 219, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "quit", "arg_names": [], "import_names": [], "rhs_call_name": "quit", "annotation": ""}, "snippet": " js.quit()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99564:Expr_L134_C12", "label": "init()", "type": "expression", "loc": [134, 134], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99564:Try_L132_C8", "vector": [8, 3, 0.8171, 0.0061, 3, 0.6, 1.0, 319, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "init", "arg_names": [], "import_names": [], "rhs_call_name": "init", "annotation": ""}, "snippet": " js.init()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99564:Expr_L136_C12", "label": "print()", "type": "expression", "loc": [136, 136], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99564:Try_L132_C8", "vector": [8, 3, 0.8293, 0.0061, 3, 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(\"joystick error\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99564:Expr_L137_C12", "label": "signal_shutdown()", "type": "expression", "loc": [137, 137], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99564:Try_L132_C8", "vector": [8, 3, 0.8354, 0.0061, 3, 0.6, 1.0, 504, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "signal_shutdown", "arg_names": [], "import_names": [], "rhs_call_name": "signal_shutdown", "annotation": ""}, "snippet": " rospy.signal_shutdown()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L143_C8", "label": "if", "type": "if", "loc": [143, 159], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99564:While_L104_C4", "vector": [4, 2, 0.9207, 0.1037, 2, 0.52, 1.0, 0, 2, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if connected:\n xvel = x*max_xvel\n# xvel_history[0:(len-1)] = xvel_history[1:len]\n# xvel_history[(len-1)] = xvel\n# xvel = np.mean(xvel_history)\n\n yvel = y*max_yvel\n avel = a*max_avel"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99564:Assign_L144_C12", "label": "xvel =", "type": "assigned_variable", "loc": [144, 144], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L143_C8", "vector": [14, 3, 0.878, 0.0061, 3, 0.87, 0.0, 984, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "xvel", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " xvel = x*max_xvel"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99564:Assign_L149_C12", "label": "yvel =", "type": "assigned_variable", "loc": [149, 149], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L143_C8", "vector": [14, 3, 0.9085, 0.0061, 3, 0.87, 0.125, 335, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "yvel", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " yvel = y*max_yvel"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99564:Assign_L150_C12", "label": "avel =", "type": "assigned_variable", "loc": [150, 150], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L143_C8", "vector": [14, 3, 0.9146, 0.0061, 3, 0.87, 0.25, 290, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "avel", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " avel = a*max_avel"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99564:Assign_L152_C12", "label": "vel_vec =", "type": "assigned_variable", "loc": [152, 152], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L143_C8", "vector": [14, 3, 0.9268, 0.0061, 3, 0.87, 0.375, 410, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "vel_vec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " vel_vec = np.matrix([xvel,yvel]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99564:Assign_L153_C12", "label": "vel_mag = norm()", "type": "assigned_variable", "loc": [153, 153], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L143_C8", "vector": [14, 3, 0.9329, 0.0061, 3, 0.87, 0.5, 586, 3, 1, 0, 0, 902, 10, 1], "semantic": {"name": "vel_mag", "arg_names": [], "import_names": [], "rhs_call_name": "norm", "annotation": ""}, "snippet": " vel_mag = np.linalg.norm(vel_vec)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99564:Assign_L154_C12", "label": "speed = bound()", "type": "assigned_variable", "loc": [154, 154], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L143_C8", "vector": [14, 3, 0.939, 0.0061, 3, 0.87, 0.625, 970, 3, 3, 0, 0, 996, 10, 1], "semantic": {"name": "speed", "arg_names": [], "import_names": [], "rhs_call_name": "bound", "annotation": ""}, "snippet": " speed = ut.bound(vel_mag,max_speed,0.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L155_C12", "label": "if", "type": "if", "loc": [155, 156], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L143_C8", "vector": [4, 3, 0.9482, 0.0122, 3, 0.87, 0.75, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if speed >= 0.05:\n vel_vec = vel_vec*speed/vel_mag"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99564:Assign_L156_C16", "label": "vel_vec =", "type": "assigned_variable", "loc": [156, 156], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L155_C12", "vector": [14, 4, 0.9512, 0.0061, 4, 0.37, 0.0, 410, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "vel_vec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " vel_vec = vel_vec*speed/vel_mag"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99564:Assign_L158_C12", "label": "xvel, yvel =", "type": "assigned_variable", "loc": [158, 158], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L143_C8", "vector": [14, 3, 0.9634, 0.0061, 3, 0.87, 0.875, 263, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "xvel, yvel", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " xvel,yvel = vel_vec[0,0],vel_vec[1,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99564:Expr_L159_C12", "label": "set_velocity()", "type": "expression", "loc": [159, 159], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L143_C8", "vector": [8, 3, 0.9695, 0.0061, 3, 0.87, 1.0, 855, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "set_velocity", "arg_names": [], "import_names": [], "rhs_call_name": "set_velocity", "annotation": ""}, "snippet": " cmd_node.set_velocity(xvel,yvel,avel) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99564:Expr_L161_C4", "label": "set_velocity()", "type": "expression", "loc": [161, 161], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L47_C0", "vector": [8, 1, 0.9817, 0.0061, 1, 0.44, 1.0, 855, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "set_velocity", "arg_names": [], "import_names": [], "rhs_call_name": "set_velocity", "annotation": ""}, "snippet": " cmd_node.set_velocity(0.,0.,0.)"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99564:Assign_L48_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99564:Expr_L50_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99564:Assign_L53_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99564:Assign_L54_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L56_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99564:Import_L57_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99564:Assign_L58_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99564:Assign_L60_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99564:Assign_L62_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99564:Assign_L63_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99564:Assign_L64_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99564:Assign_L65_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99564:Assign_L67_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99564:Assign_L68_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99564:Assign_L69_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99564:Expr_L72_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99564:Assign_L75_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99564:Expr_L77_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99564:Try_L79_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99564:Try_L79_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99564:Assign_L80_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99564:Try_L79_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99564:Expr_L81_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99564:Try_L79_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99564:Expr_L83_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99564:Try_L79_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99564:Assign_L84_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99564:Assign_L86_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99564:Expr_L87_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99564:Assign_L89_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99564:Expr_L90_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99564:Assign_L92_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99564:Assign_L93_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99564:Expr_L94_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99564:Assign_L96_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99564:Assign_L97_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99564:Assign_L98_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99564:Assign_L100_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99564:Assign_L101_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99564:Assign_L103_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99564:While_L104_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99564:While_L104_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99564:Assign_L106_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99564:While_L104_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99564:For_L107_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99564:For_L107_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L109_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L109_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L110_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L110_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99564:Assign_L111_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L110_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L112_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L112_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99564:Assign_L113_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L109_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L114_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L114_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99564:Assign_L115_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L109_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99564:Expr_L116_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99564:While_L104_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L128_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L128_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99564:Assign_L129_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99564:While_L104_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99564:Try_L132_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99564:Try_L132_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99564:Expr_L133_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99564:Try_L132_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99564:Expr_L134_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99564:Try_L132_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99564:Expr_L136_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99564:Try_L132_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99564:Expr_L137_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99564:While_L104_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L143_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L143_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99564:Assign_L144_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L143_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99564:Assign_L149_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L143_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99564:Assign_L150_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L143_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99564:Assign_L152_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L143_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99564:Assign_L153_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L143_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99564:Assign_L154_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L143_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L155_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L155_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99564:Assign_L156_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L143_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99564:Assign_L158_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L143_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99564:Expr_L159_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99564:If_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99564:Expr_L161_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 Cressel Anderson (Healthcare Robotics Lab, Georgia Tech.) import usb import pickle import time import numpy as np import math import struct class Mecanum_Properties(): def __init__( self ): self.r1 = .2032/2. # 8in wheels self.r2 = .2032/2. # 8in wheels self.R = 4*2.54/100 # wheel radius in meters self.la = .6223/2 # 1/2 width of the base self.lb = .33655/2 # 1/2 length of the base class Mecanum( Mecanum_Properties ): def __init__( self ): self.segway_front = Segway( side='front') self.segway_back = Segway( side='back' ) Mecanum_Properties.__init__(self) self.get_status() def set_velocity( self, xvel, yvel, avel ): """xvel and yvel should be in m/s and avel should be rad/s""" yvel = -yvel R = self.R la = self.la lb = self.lb # eq. 17 from Knematic modeling for feedback control of an # omnidirectional wheeled mobile robot by Muir and Neuman at # CMU J = 1/R * np.matrix([-1,1, (la + lb), 1,1,-(la + lb), -1,1,-(la + lb), 1,1, (la + lb) ]).reshape(4,3) # their coordinate frame is rotated dP = np.matrix( [ -yvel, -xvel, avel] ).T w = J*dP # they use a goofy ordering flw = w[1,0] frw = w[0,0] blw = w[2,0] brw = w[3,0] front_cmd = self.segway_front.send_wheel_velocities( flw, frw ) back_cmd = self.segway_back.send_wheel_velocities( blw, brw ) if front_cmd == False or back_cmd == False: print 'Velocities out of spec: ',flw,frw,blw,brw print 'Perhaps we should consider sending the max command so motion doesn\'t hang.' def stop(self): self.set_velocity(0.,0.,0.) def get_status( self ): pass class Segway_Properties(): def __init__( self ): self._integrated_wheel_displacement = 24372/(2*math.pi) # countsp / rad #vv = 39 # countsp/sec / count_velocity --- original #tv = 19 # countsp/sec / count_velocity --- original vv = 39 # countsp/sec / count_velocity tv = 22 # countsp/sec / count_velocity self._V_vel = vv /self._integrated_wheel_displacement # rad/sec / count_velocity self._T_vel = tv /self._integrated_wheel_displacement # rad/sec / count_velocity # w = | a b | * V # | c d | a = self._V_vel b = self._T_vel c = self._V_vel d = -self._T_vel self.A = np.matrix([a,b,c,d]).reshape(2,2) self.A_inv = 1/(a*b-c*d) * np.matrix([ d, -b, -c, a ]).reshape(2,2) # w = A*V # V = A_inv*w # in addition to what should command the platform velocities should be self._power_base_battery_voltage = 1/4. #(volt)/count self._ui_battery_voltage = .0125 #(volt)/count self._ui_battery_voltage_offset = 1.4 #volts class Segway( Segway_Properties ): def __init__( self, side='front' ): """side should be 'front' or 'back'""" Segway_Properties.__init__(self) self.side = side self.segway = None self.connect() self.pitch_ang = 0 self.pitch_rate = 0 self.yaw_ang = 0 self.yaw_rate = 0 self.LW_vel = 0 self.RW_vel = 0 self.yaw_rate = 0 self.servo_frames = 0 self.integrated_wheel_displacement_left = 0 self.integrated_wheel_displacement_right = 0 self.integrated_for_aft_displacement = 0 self.integrated_yaw_displacement = 0 self.left_motor_torque = 0 self.right_motor_torque = 0 self.operational_mode = 0 self.controller_gain_schedule = 0 self.ui_battery_voltage = 0 self.power_base_battery_voltage = 0 self.velocity_commanded = 0 self.turn_commanded = 0 def connect(self): buses = usb.busses() segway_handle_list = [] for bus in buses: for device in bus.devices: if device.idVendor == 1027 and device.idProduct == 59177: h = device.open() serial_num = int(h.getString(3,10)) if serial_num == 215: if self.side == 'front': print 'Connected to front segway' self.segway = h self.segway.claimInterface(0) elif serial_num == 201: if self.side == 'back': print 'Connected to rear segway' self.segway = h self.segway.claimInterface(0) else: raise RuntimeError( 'Unknown_segway connected.' + ' Serial Number is ',serial_num ) def calc_checksum(self, msg): checksum = 0 for byt in msg: checksum = (checksum+byt)%65536 checksum_hi = checksum >> 8 checksum &= 0xff checksum = (checksum+checksum_hi)%65536 checksum_hi = checksum >> 8 checksum &= 0xff checksum = (checksum+checksum_hi)%65536 checksum = (~checksum+1)&0xff return checksum def compose_velocity_cmd(self,linvel,angvel): byt_hi = 0x04 byt_lo = 0x13 if self.side == 'back': # because the front segway is linvel = -linvel # turned around linvel_counts = int(linvel) angvel_counts = int(angvel) if abs(linvel_counts)>1176: print 'connect.compose_velocity_cmd: Linear velocity is too high. counts: %d'%linvel return [] if abs(angvel_counts)>1024: print 'connect.compose_velocity_cmd: Angular velocity is too high. counts: %d'%angvel return [] usb_msg_fixed = [0xf0,0x55,0x00,0x00,0x00,0x00,byt_hi,byt_lo,0x00] can_vel_msg = [(linvel_counts>>8)&0xff,linvel_counts&0xff,(angvel_counts>>8)&0xff,angvel_counts&0xff,0x00,0x00,0x00,0x00] msg_send = usb_msg_fixed + can_vel_msg msg_send.append(self.calc_checksum(msg_send)) return msg_send def send_command(self, linvel0, angvel0 ): msg0 = self.compose_velocity_cmd(linvel0,angvel0) if msg0 == []: return False for i in range(1): self.segway.bulkWrite(0x02,msg0) def send_wheel_velocities( self, lvel, rvel ): w = np.matrix([lvel,rvel]).T V = self.A_inv*w #print 'V = ',V xv = V[0,0] tv = V[1,0] #print 'Left vel = ',lvel #print 'Right vel = ',rvel #print 'Forward command = ',xv #print 'Turn command = ',tv return self.send_command( xv, tv ) def parse_usb_cmd(self,msg): if len(msg) < 18: return if self.calc_checksum(msg[:-1]) != msg[-1]: #got garbage rejecting return id = ((msg[4]<<3)|((msg[5]>>5)&7))&0xfff data = msg[9:17] if id == 0x400: # unused pass elif id == 0x401: self.pitch_ang = self._2_bytes( data[0], data[1] ) self.pitch_rate = self._2_bytes( data[2], data[3] ) self.yaw_ang = self._2_bytes( data[4], data[5] ) self.yaw_rate = self._2_bytes( data[6], data[7] ) elif id == 0x402: self.LW_vel = self._2_bytes( data[0], data[1] )#/self._LW_vel self.RW_vel = self._2_bytes( data[2], data[3] )#/self._RW_vel self.yaw_rate = self._2_bytes( data[4], data[5] ) self.servo_frames = self._2_bytes_unsigned( data[6], data[7] ) elif id == 0x403: self.integrated_wheel_displacement_left = self._4_bytes(data[2],data[3],data[0],data[1]) self.integrated_wheel_displacement_right = self._4_bytes(data[6],data[7],data[4],data[5]) pass elif id == 0x404: self.integrated_for_aft_displacement = self._4_bytes(data[2],data[3],data[0],data[1]) self.integrated_yaw_displacement = self._4_bytes(data[6],data[7],data[4],data[5]) elif id == 0x405: self.left_motor_torque = self._2_bytes( data[0], data[1] ) self.right_motor_torque = self._2_bytes( data[2], data[3] ) elif id == 0x406: self.operational_mode = self._2_bytes( data[0], data[1] ) self.controller_gain_schedule = self._2_bytes( data[2], data[3] ) self.ui_battery_voltage = self._2_bytes( data[4], data[5] )*self._ui_battery_voltage + self._ui_battery_voltage_offset self.power_base_battery_voltage = self._2_bytes( data[6], data[7] )*self._power_base_battery_voltage elif id == 0x407: self.velocity_commanded = self._2_bytes( data[0], data[1] )#/self._LW_vel self.turn_commanded = self._2_bytes( data[2], data[3] ) elif msg[1] == 0x00: # print 'heartbeat id = ',hex(msg[6]),hex(msg[7]) pass elif id == 0x680: # CU Status Message pass else: #print 'no message parsed:', hex(id) pass def _2_bytes( self,high, low ): return struct.unpack('>h',chr(high)+chr(low))[0] def _2_bytes_unsigned( self,high, low ): return struct.unpack('>H',chr(high)+chr(low))[0] def _4_bytes( self,highhigh, lowhigh, highlow, lowlow ): return struct.unpack('>l',chr(highhigh)+chr(lowhigh)+chr(highlow)+chr(lowlow))[0] def clear_read(self): rd = self.segway.bulkRead(0x81,1000) def read(self): before = time.time() rd = self.segway.bulkRead(0x81,9*(18+2)) msg = [(a & 0xff) for a in rd] i=0 while 1: try: msg.pop(i*62) msg.pop(i*62) i += 1 except IndexError: break #find the start idx1 = msg.index(0xf0) if msg[idx1+18] != 0xf0: # if this is not the start of a message get rid of the bad start msg = msg[idx1+1:] else: # we found the start while len(msg) > 17: try: single_msg = msg[idx1:idx1+18] if (single_msg[1] == 0x55 and single_msg[2] == 0xaa) or single_msg[1] == 0x00: self.parse_usb_cmd(single_msg) msg = msg[18:] except IndexError: break def print_feedback( self ): print 'self.integrated_wheel_displacement_left = ',self.integrated_wheel_displacement_left print 'self.integrated_wheel_displacement_right = ',self.integrated_wheel_displacement_right print 'self.LW_vel = ',self.LW_vel print 'self.RW_vel = ',self.RW_vel print 'frame = ',self.servo_frames print 'self.velocity_commanded = ',self.velocity_commanded print 'self.turn_commanded = ',self.turn_commanded #print 'self.yaw_rate = ',self.yaw_rate if __name__ == '__main__': import segway seg= segway.Segway() seg.clear_read() # send_command_fixed(segway_rear) rrates = [] lrates = [] for vel in range(31): linvel = 2000.*(vel)/30 - 1000. angvel = 0. start = time.time() last = start lastwrite = start lastread = start while 1: # seg.send_command(200,0.0) # seg.send_wheel_velocities(100.0,100.0) if time.time() - lastwrite > 0.1: print 'loop 1',time.time() - start #seg.send_command( linvel, angvel ) lastwrite = time.time() #seg.send_platform_velocities( 0,0 ) seg.send_wheel_velocities(1.,1.) if time.time() - lastread > 0.01: seg.read() lastread = time.time() #seg.print_feedback() if time.time() - start > 2.0: break left_start = seg.integrated_wheel_displacement_left right_start = seg.integrated_wheel_displacement_right first_points = time.time() while 1: # seg.send_command(200,0.0) # seg.send_wheel_velocities(100.0,100.0) if time.time() - lastwrite > 0.1: print 'loop 1.5',time.time() - start #seg.send_command( linvel, angvel ) lastwrite = time.time() #seg.send_platform_velocities( 0,0 ) seg.send_wheel_velocities(1.,1.) if time.time() - lastread > 0.01: seg.read() lastread = time.time() #seg.print_feedback() if time.time() - start > 5.0: break left_stop = seg.integrated_wheel_displacement_left right_stop = seg.integrated_wheel_displacement_right last_points = time.time() diff = last_points - first_points print 'Time: ',diff print 'left rate: ',(left_stop - left_start)/diff print 'right rate: ',(right_stop - right_start)/diff rrates.append(((right_stop - right_start)/diff,linvel)) lrates.append(((left_stop - left_start)/diff,linvel)) while 1: if time.time() - lastread > 0.01: seg.read() lastread = time.time() #seg.print_feedback() if seg.LW_vel ==0 and seg.RW_vel == 0: break print 'rrates:',rrates print 'lrates:',lrates import pylab x = [] y = [] x1 = [] y1 = [] for a, b in rrates: x.append(b) y.append(a) for a, b in lrates: x1.append(b) y1.append(a) pylab.plot(x,y,x1,y1) pylab.show() #while 1: # print 'loop 2' # seg.read() #seg.print_feedback() # print 'time: ', time.time()-start # if seg.LW_vel == 0 and seg.RW_vel == 0: # break # print 'total time: ', time.time()-start # print 'time to stop: ', time.time()-stop # msg = [] # while True: # msg += list(handle_rmp0.bulkRead(0x81,100)) # idx1 = msg.index(0xf0) # idx2 = msg.index(0xf0,idx1+1) # if idx2-idx1 == 18: # single_msg = msg[idx1:idx2] # if single_msg[1] == 0x55 and single_msg[2] == 0xaa: # parse_usb_cmd(single_msg) # # msg = msg[idx2:]
ajibawa-2023/Python-Code-Large/train/row_99565
275
464
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Import_L29_C0", "label": "usb import usb", "type": "import", "loc": [29, 29], "level": 0, "parent": null, "vector": [1, 0, 0.0625, 0.0022, 0, 0.66, 0.0, 856, 0, 1, 0, 0, 856, 0, 0], "semantic": {"name": "usb", "arg_names": [], "import_names": ["usb"], "rhs_call_name": "", "annotation": ""}, "snippet": "import usb"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Import_L30_C0", "label": "pickle import pickle", "type": "import", "loc": [30, 30], "level": 0, "parent": null, "vector": [1, 0, 0.0647, 0.0022, 0, 0.66, 0.1, 848, 0, 1, 0, 0, 848, 0, 0], "semantic": {"name": "pickle", "arg_names": [], "import_names": ["pickle"], "rhs_call_name": "", "annotation": ""}, "snippet": "import pickle"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Import_L31_C0", "label": "time import time", "type": "import", "loc": [31, 31], "level": 0, "parent": null, "vector": [1, 0, 0.0668, 0.0022, 0, 0.66, 0.2, 654, 0, 1, 0, 0, 654, 0, 0], "semantic": {"name": "time", "arg_names": [], "import_names": ["time"], "rhs_call_name": "", "annotation": ""}, "snippet": "import time"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Import_L32_C0", "label": "numpy import np", "type": "import", "loc": [32, 32], "level": 0, "parent": null, "vector": [1, 0, 0.069, 0.0022, 0, 0.66, 0.3, 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_99565:Import_L34_C0", "label": "math import math", "type": "import", "loc": [34, 34], "level": 0, "parent": null, "vector": [1, 0, 0.0733, 0.0022, 0, 0.66, 0.4, 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_99565:Import_L35_C0", "label": "struct import struct", "type": "import", "loc": [35, 35], "level": 0, "parent": null, "vector": [1, 0, 0.0754, 0.0022, 0, 0.66, 0.5, 399, 0, 1, 0, 0, 399, 0, 0], "semantic": {"name": "struct", "arg_names": [], "import_names": ["struct"], "rhs_call_name": "", "annotation": ""}, "snippet": "import struct"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:ClassDef_L37_C0", "label": "Mecanum_Properties", "type": "class", "loc": [37, 45], "level": 0, "parent": null, "vector": [3, 0, 0.0884, 0.0194, 0, 0.66, 0.6, 111, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "Mecanum_Properties", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Mecanum_Properties():\n def __init__( self ):\n self.r1 = .2032/2. # 8in wheels\n self.r2 = .2032/2. # 8in wheels\n \n self.R = 4*2.54/100 # wheel radius in meters\n \n self.la = .6223/2 # 1/2 width of the base"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L38_C4", "label": "__init__", "type": "function", "loc": [38, 45], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:ClassDef_L37_C0", "vector": [2, 1, 0.0894, 0.0172, 1, 0.62, 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.r1 = .2032/2. # 8in wheels\n self.r2 = .2032/2. # 8in wheels\n \n self.R = 4*2.54/100 # wheel radius in meters\n \n self.la = .6223/2 # 1/2 width of the base\n self.lb = .33655/2 # 1/2 length of the base"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L39_C8", "label": "self.r1 =", "type": "assigned_variable", "loc": [39, 39], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L38_C4", "vector": [14, 2, 0.0841, 0.0022, 2, 0.66, 0.0, 229, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.r1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.r1 = .2032/2. # 8in wheels"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L40_C8", "label": "self.r2 =", "type": "assigned_variable", "loc": [40, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L38_C4", "vector": [14, 2, 0.0862, 0.0022, 2, 0.66, 0.25, 696, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.r2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.r2 = .2032/2. # 8in wheels"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L42_C8", "label": "self.R =", "type": "assigned_variable", "loc": [42, 42], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L38_C4", "vector": [14, 2, 0.0905, 0.0022, 2, 0.66, 0.5, 333, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.R", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.R = 4*2.54/100 # wheel radius in meters"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L44_C8", "label": "self.la =", "type": "assigned_variable", "loc": [44, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L38_C4", "vector": [14, 2, 0.0948, 0.0022, 2, 0.66, 0.75, 935, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.la", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.la = .6223/2 # 1/2 width of the base"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L45_C8", "label": "self.lb =", "type": "assigned_variable", "loc": [45, 45], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L38_C4", "vector": [14, 2, 0.097, 0.0022, 2, 0.66, 1.0, 885, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.lb", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.lb = .33655/2 # 1/2 length of the base"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:ClassDef_L47_C0", "label": "Mecanum", "type": "class", "loc": [47, 94], "level": 0, "parent": null, "vector": [3, 0, 0.1519, 0.1034, 0, 0.66, 0.7, 751, 0, 4, 0, 0, 111, 0, 12], "semantic": {"name": "Mecanum", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Mecanum( Mecanum_Properties ):\n def __init__( self ):\n self.segway_front = Segway( side='front')\n self.segway_back = Segway( side='back' )\n\n Mecanum_Properties.__init__(self)\n self.get_status()\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L48_C4", "label": "__init__", "type": "function", "loc": [48, 53], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:ClassDef_L47_C0", "vector": [2, 1, 0.1088, 0.0129, 1, 0.43, 0.0, 555, 0, 1, 0, 0, 0, 0, 4], "semantic": {"name": "__init__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__( self ):\n self.segway_front = Segway( side='front')\n self.segway_back = Segway( side='back' )\n\n Mecanum_Properties.__init__(self)\n self.get_status()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L49_C8", "label": "self.segway_front = Segway()", "type": "assigned_variable", "loc": [49, 49], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L48_C4", "vector": [14, 2, 0.1056, 0.0022, 2, 0.17, 0.0, 796, 3, 1, 0, 0, 322, 10, 1], "semantic": {"name": "self.segway_front", "arg_names": [], "import_names": [], "rhs_call_name": "Segway", "annotation": ""}, "snippet": " self.segway_front = Segway( side='front')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L50_C8", "label": "self.segway_back = Segway()", "type": "assigned_variable", "loc": [50, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L48_C4", "vector": [14, 2, 0.1078, 0.0022, 2, 0.17, 0.3333, 140, 3, 1, 0, 0, 322, 10, 1], "semantic": {"name": "self.segway_back", "arg_names": [], "import_names": [], "rhs_call_name": "Segway", "annotation": ""}, "snippet": " self.segway_back = Segway( side='back' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Expr_L52_C8", "label": "__init__()", "type": "expression", "loc": [52, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L48_C4", "vector": [8, 2, 0.1121, 0.0022, 2, 0.17, 0.6667, 555, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " Mecanum_Properties.__init__(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Expr_L53_C8", "label": "get_status()", "type": "expression", "loc": [53, 53], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L48_C4", "vector": [8, 2, 0.1142, 0.0022, 2, 0.17, 1.0, 163, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "get_status", "arg_names": [], "import_names": [], "rhs_call_name": "get_status", "annotation": ""}, "snippet": " self.get_status()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L55_C4", "label": "set_velocity", "type": "function", "loc": [55, 88], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:ClassDef_L47_C0", "vector": [2, 1, 0.1541, 0.0733, 1, 0.43, 0.3333, 855, 0, 4, 0, 0, 0, 0, 7], "semantic": {"name": "set_velocity", "arg_names": ["self", "xvel", "yvel", "avel"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def set_velocity( self, xvel, yvel, avel ):\n \"\"\"xvel and yvel should be in m/s and avel should be rad/s\"\"\"\n yvel = -yvel\n\n R = self.R\n la = self.la\n lb = self.lb\n "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Expr_L56_C8", "label": "expression", "type": "expression", "loc": [56, 56], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L55_C4", "vector": [8, 2, 0.1207, 0.0022, 2, 0.64, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"xvel and yvel should be in m/s and avel should be rad/s\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L57_C8", "label": "yvel =", "type": "assigned_variable", "loc": [57, 57], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L55_C4", "vector": [14, 2, 0.1228, 0.0022, 2, 0.64, 0.0714, 335, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "yvel", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " yvel = -yvel"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L59_C8", "label": "R =", "type": "assigned_variable", "loc": [59, 59], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L55_C4", "vector": [14, 2, 0.1272, 0.0022, 2, 0.64, 0.1429, 467, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "R", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " R = self.R"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L60_C8", "label": "la =", "type": "assigned_variable", "loc": [60, 60], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L55_C4", "vector": [14, 2, 0.1293, 0.0022, 2, 0.64, 0.2143, 187, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "la", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " la = self.la"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L61_C8", "label": "lb =", "type": "assigned_variable", "loc": [61, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L55_C4", "vector": [14, 2, 0.1315, 0.0022, 2, 0.64, 0.2857, 666, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "lb", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " lb = self.lb"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L66_C8", "label": "J =", "type": "assigned_variable", "loc": [66, 69], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L55_C4", "vector": [14, 2, 0.1455, 0.0086, 2, 0.64, 0.3571, 946, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "J", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " J = 1/R * np.matrix([-1,1, (la + lb),\n 1,1,-(la + lb),\n -1,1,-(la + lb),\n 1,1, (la + lb) ]).reshape(4,3)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L72_C8", "label": "dP =", "type": "assigned_variable", "loc": [72, 72], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L55_C4", "vector": [14, 2, 0.1552, 0.0022, 2, 0.64, 0.4286, 5, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "dP", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " dP = np.matrix( [ -yvel, -xvel, avel] ).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L74_C8", "label": "w =", "type": "assigned_variable", "loc": [74, 74], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L55_C4", "vector": [14, 2, 0.1595, 0.0022, 2, 0.64, 0.5, 549, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "w", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " w = J*dP"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L78_C8", "label": "flw =", "type": "assigned_variable", "loc": [78, 78], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L55_C4", "vector": [14, 2, 0.1681, 0.0022, 2, 0.64, 0.5714, 340, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "flw", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " flw = w[1,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L79_C8", "label": "frw =", "type": "assigned_variable", "loc": [79, 79], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L55_C4", "vector": [14, 2, 0.1703, 0.0022, 2, 0.64, 0.6429, 858, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "frw", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " frw = w[0,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L80_C8", "label": "blw =", "type": "assigned_variable", "loc": [80, 80], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L55_C4", "vector": [14, 2, 0.1724, 0.0022, 2, 0.64, 0.7143, 178, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "blw", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " blw = w[2,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L81_C8", "label": "brw =", "type": "assigned_variable", "loc": [81, 81], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L55_C4", "vector": [14, 2, 0.1746, 0.0022, 2, 0.64, 0.7857, 129, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "brw", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " brw = w[3,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L83_C8", "label": "front_cmd = send_wheel_velocities()", "type": "assigned_variable", "loc": [83, 83], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L55_C4", "vector": [14, 2, 0.1789, 0.0022, 2, 0.64, 0.8571, 98, 3, 2, 0, 0, 747, 10, 1], "semantic": {"name": "front_cmd", "arg_names": [], "import_names": [], "rhs_call_name": "send_wheel_velocities", "annotation": ""}, "snippet": " front_cmd = self.segway_front.send_wheel_velocities( flw, frw )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L84_C8", "label": "back_cmd = send_wheel_velocities()", "type": "assigned_variable", "loc": [84, 84], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L55_C4", "vector": [14, 2, 0.181, 0.0022, 2, 0.64, 0.9286, 839, 3, 2, 0, 0, 747, 10, 1], "semantic": {"name": "back_cmd", "arg_names": [], "import_names": [], "rhs_call_name": "send_wheel_velocities", "annotation": ""}, "snippet": " back_cmd = self.segway_back.send_wheel_velocities( blw, brw )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L86_C8", "label": "if", "type": "if", "loc": [86, 88], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L55_C4", "vector": [4, 2, 0.1875, 0.0065, 2, 0.64, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if front_cmd == False or back_cmd == False:\n print('Velocities out of spec: ',flw,frw,blw,brw)\n print('Perhaps we should consider sending the max command so motion doesn\\'t hang.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Expr_L87_C12", "label": "print()", "type": "expression", "loc": [87, 87], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L86_C8", "vector": [8, 3, 0.1875, 0.0022, 3, 0.5, 0.0, 535, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Velocities out of spec: ',flw,frw,blw,brw)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Expr_L88_C12", "label": "print()", "type": "expression", "loc": [88, 88], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L86_C8", "vector": [8, 3, 0.1897, 0.0022, 3, 0.5, 1.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Perhaps we should consider sending the max command so motion doesn\\'t hang.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L90_C4", "label": "stop", "type": "function", "loc": [90, 91], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:ClassDef_L47_C0", "vector": [2, 1, 0.195, 0.0043, 1, 0.43, 0.6667, 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.set_velocity(0.,0.,0.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Expr_L91_C8", "label": "set_velocity()", "type": "expression", "loc": [91, 91], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L90_C4", "vector": [8, 2, 0.1961, 0.0022, 2, 0.82, 0.0, 855, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "set_velocity", "arg_names": [], "import_names": [], "rhs_call_name": "set_velocity", "annotation": ""}, "snippet": " self.set_velocity(0.,0.,0.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L93_C4", "label": "get_status", "type": "function", "loc": [93, 94], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:ClassDef_L47_C0", "vector": [2, 1, 0.2015, 0.0043, 1, 0.43, 1.0, 163, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "get_status", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_status( self ):\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:ClassDef_L96_C0", "label": "Segway_Properties", "type": "class", "loc": [96, 123], "level": 0, "parent": null, "vector": [3, 0, 0.236, 0.0603, 0, 0.66, 0.8, 814, 0, 1, 0, 0, 0, 0, 4], "semantic": {"name": "Segway_Properties", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Segway_Properties():\n def __init__( self ):\n self._integrated_wheel_displacement = 24372/(2*math.pi) # countsp / rad\n #vv = 39 # countsp/sec / count_velocity --- original\n #tv = 19 # countsp/sec / count_velocity --- original\n vv = 39 # countsp/sec / count_velocity \n tv = 22 # countsp/sec / count_velocity \n self._V_vel = vv /self._integrated_wheel_displacement # rad/sec / count_velocity"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L97_C4", "label": "__init__", "type": "function", "loc": [97, 123], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:ClassDef_L96_C0", "vector": [2, 1, 0.2371, 0.0582, 1, 0.68, 0.0, 555, 0, 1, 0, 0, 0, 0, 4], "semantic": {"name": "__init__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__( self ):\n self._integrated_wheel_displacement = 24372/(2*math.pi) # countsp / rad\n #vv = 39 # countsp/sec / count_velocity --- original\n #tv = 19 # countsp/sec / count_velocity --- original\n vv = 39 # countsp/sec / count_velocity \n tv = 22 # countsp/sec / count_velocity \n self._V_vel = vv /self._integrated_wheel_displacement # rad/sec / count_velocity\n self._T_vel = tv /self._integrated_wheel_displacement # rad/sec / count_velocity"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L98_C8", "label": "self._integrated_wheel_displacement =", "type": "assigned_variable", "loc": [98, 98], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L97_C4", "vector": [14, 2, 0.2112, 0.0022, 2, 0.53, 0.0, 791, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._integrated_wheel_displacement", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._integrated_wheel_displacement = 24372/(2*math.pi) # countsp / rad"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L101_C8", "label": "vv =", "type": "assigned_variable", "loc": [101, 101], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L97_C4", "vector": [14, 2, 0.2177, 0.0022, 2, 0.53, 0.0769, 849, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "vv", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " vv = 39 # countsp/sec / count_velocity "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L102_C8", "label": "tv =", "type": "assigned_variable", "loc": [102, 102], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L97_C4", "vector": [14, 2, 0.2198, 0.0022, 2, 0.53, 0.1538, 495, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "tv", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tv = 22 # countsp/sec / count_velocity "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L103_C8", "label": "self._V_vel =", "type": "assigned_variable", "loc": [103, 103], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L97_C4", "vector": [14, 2, 0.222, 0.0022, 2, 0.53, 0.2308, 117, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._V_vel", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._V_vel = vv /self._integrated_wheel_displacement # rad/sec / count_velocity"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L104_C8", "label": "self._T_vel =", "type": "assigned_variable", "loc": [104, 104], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L97_C4", "vector": [14, 2, 0.2241, 0.0022, 2, 0.53, 0.3077, 339, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._T_vel", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._T_vel = tv /self._integrated_wheel_displacement # rad/sec / count_velocity"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L109_C8", "label": "a =", "type": "assigned_variable", "loc": [109, 109], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L97_C4", "vector": [14, 2, 0.2349, 0.0022, 2, 0.53, 0.3846, 475, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "a", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " a = self._V_vel"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L110_C8", "label": "b =", "type": "assigned_variable", "loc": [110, 110], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L97_C4", "vector": [14, 2, 0.2371, 0.0022, 2, 0.53, 0.4615, 756, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "b", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " b = self._T_vel"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L111_C8", "label": "c =", "type": "assigned_variable", "loc": [111, 111], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L97_C4", "vector": [14, 2, 0.2392, 0.0022, 2, 0.53, 0.5385, 411, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "c", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " c = self._V_vel"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L112_C8", "label": "d =", "type": "assigned_variable", "loc": [112, 112], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L97_C4", "vector": [14, 2, 0.2414, 0.0022, 2, 0.53, 0.6154, 355, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " d = -self._T_vel"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L113_C8", "label": "self.A = reshape()", "type": "assigned_variable", "loc": [113, 113], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L97_C4", "vector": [14, 2, 0.2435, 0.0022, 2, 0.53, 0.6923, 538, 3, 2, 0, 0, 276, 10, 2], "semantic": {"name": "self.A", "arg_names": [], "import_names": [], "rhs_call_name": "reshape", "annotation": ""}, "snippet": " self.A = np.matrix([a,b,c,d]).reshape(2,2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L114_C8", "label": "self.A_inv =", "type": "assigned_variable", "loc": [114, 114], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L97_C4", "vector": [14, 2, 0.2457, 0.0022, 2, 0.53, 0.7692, 87, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "self.A_inv", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.A_inv = 1/(a*b-c*d) * np.matrix([ d, -b, -c, a ]).reshape(2,2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L121_C8", "label": "self._power_base_battery_voltage =", "type": "assigned_variable", "loc": [121, 121], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L97_C4", "vector": [14, 2, 0.2608, 0.0022, 2, 0.53, 0.8462, 423, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._power_base_battery_voltage", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._power_base_battery_voltage = 1/4. #(volt)/count"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L122_C8", "label": "self._ui_battery_voltage =", "type": "assigned_variable", "loc": [122, 122], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L97_C4", "vector": [14, 2, 0.2629, 0.0022, 2, 0.53, 0.9231, 155, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "self._ui_battery_voltage", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._ui_battery_voltage = .0125 #(volt)/count"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L123_C8", "label": "self._ui_battery_voltage_offset =", "type": "assigned_variable", "loc": [123, 123], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L97_C4", "vector": [14, 2, 0.2651, 0.0022, 2, 0.53, 1.0, 983, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "self._ui_battery_voltage_offset", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._ui_battery_voltage_offset = 1.4 #volts"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:ClassDef_L125_C0", "label": "Segway", "type": "class", "loc": [125, 343], "level": 0, "parent": null, "vector": [3, 0, 0.5043, 0.472, 0, 0.66, 0.9, 322, 0, 13, 0, 0, 814, 0, 72], "semantic": {"name": "Segway", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Segway( Segway_Properties ):\n \n def __init__( self, side='front' ):\n \"\"\"side should be 'front' or 'back'\"\"\"\n Segway_Properties.__init__(self)\n\n self.side = side\n self.segway = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L127_C4", "label": "__init__", "type": "function", "loc": [127, 154], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:ClassDef_L125_C0", "vector": [2, 1, 0.3028, 0.0603, 1, 0.43, 0.0, 555, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": ["self", "side"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__( self, side='front' ):\n \"\"\"side should be 'front' or 'back'\"\"\"\n Segway_Properties.__init__(self)\n\n self.side = side\n self.segway = None\n self.connect()\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Expr_L128_C8", "label": "expression", "type": "expression", "loc": [128, 128], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L127_C4", "vector": [8, 2, 0.2759, 0.0022, 2, 0.18, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"side should be 'front' or 'back'\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Expr_L129_C8", "label": "__init__()", "type": "expression", "loc": [129, 129], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L127_C4", "vector": [8, 2, 0.278, 0.0022, 2, 0.18, 0.0417, 555, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " Segway_Properties.__init__(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L131_C8", "label": "self.side =", "type": "assigned_variable", "loc": [131, 131], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L127_C4", "vector": [14, 2, 0.2823, 0.0022, 2, 0.18, 0.0833, 35, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.side", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.side = side"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L132_C8", "label": "self.segway =", "type": "assigned_variable", "loc": [132, 132], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L127_C4", "vector": [14, 2, 0.2845, 0.0022, 2, 0.18, 0.125, 92, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.segway", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.segway = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Expr_L133_C8", "label": "connect()", "type": "expression", "loc": [133, 133], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L127_C4", "vector": [8, 2, 0.2866, 0.0022, 2, 0.18, 0.1667, 242, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "connect", "arg_names": [], "import_names": [], "rhs_call_name": "connect", "annotation": ""}, "snippet": " self.connect()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L135_C8", "label": "self.pitch_ang =", "type": "assigned_variable", "loc": [135, 135], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L127_C4", "vector": [14, 2, 0.2909, 0.0022, 2, 0.18, 0.2083, 33, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.pitch_ang", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.pitch_ang = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L136_C8", "label": "self.pitch_rate =", "type": "assigned_variable", "loc": [136, 136], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L127_C4", "vector": [14, 2, 0.2931, 0.0022, 2, 0.18, 0.25, 681, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.pitch_rate", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.pitch_rate = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L137_C8", "label": "self.yaw_ang =", "type": "assigned_variable", "loc": [137, 137], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L127_C4", "vector": [14, 2, 0.2953, 0.0022, 2, 0.18, 0.2917, 940, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.yaw_ang", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.yaw_ang = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L138_C8", "label": "self.yaw_rate =", "type": "assigned_variable", "loc": [138, 138], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L127_C4", "vector": [14, 2, 0.2974, 0.0022, 2, 0.18, 0.3333, 124, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.yaw_rate", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.yaw_rate = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L139_C8", "label": "self.LW_vel =", "type": "assigned_variable", "loc": [139, 139], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L127_C4", "vector": [14, 2, 0.2996, 0.0022, 2, 0.18, 0.375, 747, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.LW_vel", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.LW_vel = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L140_C8", "label": "self.RW_vel =", "type": "assigned_variable", "loc": [140, 140], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L127_C4", "vector": [14, 2, 0.3017, 0.0022, 2, 0.18, 0.4167, 750, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.RW_vel", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.RW_vel = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L141_C8", "label": "self.yaw_rate =", "type": "assigned_variable", "loc": [141, 141], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L127_C4", "vector": [14, 2, 0.3039, 0.0022, 2, 0.18, 0.4583, 124, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.yaw_rate", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.yaw_rate = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L142_C8", "label": "self.servo_frames =", "type": "assigned_variable", "loc": [142, 142], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L127_C4", "vector": [14, 2, 0.306, 0.0022, 2, 0.18, 0.5, 743, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.servo_frames", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.servo_frames = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L143_C8", "label": "self.integrated_wheel_displacement_left =", "type": "assigned_variable", "loc": [143, 143], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L127_C4", "vector": [14, 2, 0.3082, 0.0022, 2, 0.18, 0.5417, 257, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.integrated_wheel_displacement_left", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.integrated_wheel_displacement_left = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L144_C8", "label": "self.integrated_wheel_displacement_right =", "type": "assigned_variable", "loc": [144, 144], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L127_C4", "vector": [14, 2, 0.3103, 0.0022, 2, 0.18, 0.5833, 410, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.integrated_wheel_displacement_right", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.integrated_wheel_displacement_right = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L145_C8", "label": "self.integrated_for_aft_displacement =", "type": "assigned_variable", "loc": [145, 145], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L127_C4", "vector": [14, 2, 0.3125, 0.0022, 2, 0.18, 0.625, 661, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.integrated_for_aft_displacement", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.integrated_for_aft_displacement = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L146_C8", "label": "self.integrated_yaw_displacement =", "type": "assigned_variable", "loc": [146, 146], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L127_C4", "vector": [14, 2, 0.3147, 0.0022, 2, 0.18, 0.6667, 37, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.integrated_yaw_displacement", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.integrated_yaw_displacement = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L147_C8", "label": "self.left_motor_torque =", "type": "assigned_variable", "loc": [147, 147], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L127_C4", "vector": [14, 2, 0.3168, 0.0022, 2, 0.18, 0.7083, 534, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.left_motor_torque", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.left_motor_torque = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L148_C8", "label": "self.right_motor_torque =", "type": "assigned_variable", "loc": [148, 148], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L127_C4", "vector": [14, 2, 0.319, 0.0022, 2, 0.18, 0.75, 169, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.right_motor_torque", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.right_motor_torque = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L149_C8", "label": "self.operational_mode =", "type": "assigned_variable", "loc": [149, 149], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L127_C4", "vector": [14, 2, 0.3211, 0.0022, 2, 0.18, 0.7917, 95, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.operational_mode", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.operational_mode = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L150_C8", "label": "self.controller_gain_schedule =", "type": "assigned_variable", "loc": [150, 150], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L127_C4", "vector": [14, 2, 0.3233, 0.0022, 2, 0.18, 0.8333, 203, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.controller_gain_schedule", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.controller_gain_schedule = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L151_C8", "label": "self.ui_battery_voltage =", "type": "assigned_variable", "loc": [151, 151], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L127_C4", "vector": [14, 2, 0.3254, 0.0022, 2, 0.18, 0.875, 102, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.ui_battery_voltage", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.ui_battery_voltage = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L152_C8", "label": "self.power_base_battery_voltage =", "type": "assigned_variable", "loc": [152, 152], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L127_C4", "vector": [14, 2, 0.3276, 0.0022, 2, 0.18, 0.9167, 547, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.power_base_battery_voltage", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.power_base_battery_voltage = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L153_C8", "label": "self.velocity_commanded =", "type": "assigned_variable", "loc": [153, 153], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L127_C4", "vector": [14, 2, 0.3297, 0.0022, 2, 0.18, 0.9583, 643, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.velocity_commanded", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.velocity_commanded = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L154_C8", "label": "self.turn_commanded =", "type": "assigned_variable", "loc": [154, 154], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L127_C4", "vector": [14, 2, 0.3319, 0.0022, 2, 0.18, 1.0, 4, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.turn_commanded", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.turn_commanded = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L156_C4", "label": "connect", "type": "function", "loc": [156, 176], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:ClassDef_L125_C0", "vector": [2, 1, 0.3578, 0.0453, 1, 0.43, 0.0833, 242, 0, 1, 0, 0, 0, 0, 9], "semantic": {"name": "connect", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def connect(self):\n buses = usb.busses()\n segway_handle_list = []\n for bus in buses:\n for device in bus.devices:\n if device.idVendor == 1027 and device.idProduct == 59177:\n h = device.open()\n serial_num = int(h.getString(3,10))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L157_C8", "label": "buses = busses()", "type": "assigned_variable", "loc": [157, 157], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L156_C4", "vector": [14, 2, 0.3384, 0.0022, 2, 0.05, 0.0, 158, 3, 0, 0, 0, 592, 10, 1], "semantic": {"name": "buses", "arg_names": [], "import_names": [], "rhs_call_name": "busses", "annotation": ""}, "snippet": " buses = usb.busses()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L158_C8", "label": "segway_handle_list =", "type": "assigned_variable", "loc": [158, 158], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L156_C4", "vector": [14, 2, 0.3405, 0.0022, 2, 0.05, 0.5, 824, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "segway_handle_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " segway_handle_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:For_L159_C8", "label": "for bus", "type": "for", "loc": [159, 176], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L156_C4", "vector": [6, 2, 0.361, 0.0388, 2, 0.05, 1.0, 857, 2, 0, 0, 0, 0, 0, 8], "semantic": {"name": "bus", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for bus in buses:\n for device in bus.devices:\n if device.idVendor == 1027 and device.idProduct == 59177:\n h = device.open()\n serial_num = int(h.getString(3,10))\n if serial_num == 215:\n if self.side == 'front':\n print('Connected to front segway')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:For_L160_C12", "label": "for device", "type": "for", "loc": [160, 176], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:For_L159_C8", "vector": [6, 3, 0.3621, 0.0366, 3, 0.54, 0.0, 183, 7, 0, 0, 0, 0, 0, 8], "semantic": {"name": "device", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for device in bus.devices:\n if device.idVendor == 1027 and device.idProduct == 59177:\n h = device.open()\n serial_num = int(h.getString(3,10))\n if serial_num == 215:\n if self.side == 'front':\n print('Connected to front segway')\n self.segway = h"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L161_C16", "label": "if", "type": "if", "loc": [161, 176], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:For_L160_C12", "vector": [4, 4, 0.3631, 0.0345, 4, 0.66, 0.0, 0, 0, 0, 0, 0, 0, 0, 8], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if device.idVendor == 1027 and device.idProduct == 59177:\n h = device.open()\n serial_num = int(h.getString(3,10))\n if serial_num == 215:\n if self.side == 'front':\n print('Connected to front segway')\n self.segway = h\n self.segway.claimInterface(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L162_C20", "label": "h = open()", "type": "assigned_variable", "loc": [162, 162], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L161_C16", "vector": [14, 5, 0.3491, 0.0022, 5, 0.82, 0.0, 686, 3, 0, 0, 0, 693, 10, 1], "semantic": {"name": "h", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": " h = device.open()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L163_C20", "label": "serial_num = int()", "type": "assigned_variable", "loc": [163, 163], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L161_C16", "vector": [14, 5, 0.3513, 0.0022, 5, 0.82, 0.5, 985, 3, 1, 0, 0, 901, 10, 2], "semantic": {"name": "serial_num", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": " serial_num = int(h.getString(3,10))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L164_C20", "label": "if", "type": "if", "loc": [164, 176], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L161_C16", "vector": [4, 5, 0.3664, 0.028, 5, 0.82, 1.0, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if serial_num == 215:\n if self.side == 'front':\n print('Connected to front segway')\n self.segway = h\n self.segway.claimInterface(0)\n elif serial_num == 201:\n if self.side == 'back':\n print('Connected to rear segway')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L165_C24", "label": "if", "type": "if", "loc": [165, 168], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L164_C20", "vector": [4, 6, 0.3588, 0.0086, 6, 0.07, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.side == 'front':\n print('Connected to front segway')\n self.segway = h\n self.segway.claimInterface(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Expr_L166_C28", "label": "print()", "type": "expression", "loc": [166, 166], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L165_C24", "vector": [8, 7, 0.3578, 0.0022, 7, 0.29, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Connected to front segway')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L167_C28", "label": "self.segway =", "type": "assigned_variable", "loc": [167, 167], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L165_C24", "vector": [14, 7, 0.3599, 0.0022, 7, 0.29, 0.5, 92, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.segway", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.segway = h"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Expr_L168_C28", "label": "claimInterface()", "type": "expression", "loc": [168, 168], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L165_C24", "vector": [8, 7, 0.3621, 0.0022, 7, 0.29, 1.0, 263, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "claimInterface", "arg_names": [], "import_names": [], "rhs_call_name": "claimInterface", "annotation": ""}, "snippet": " self.segway.claimInterface(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L169_C20", "label": "if", "type": "if", "loc": [169, 176], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L164_C20", "vector": [4, 6, 0.3718, 0.0172, 6, 0.07, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif serial_num == 201:\n if self.side == 'back':\n print('Connected to rear segway')\n self.segway = h\n self.segway.claimInterface(0)\n else:\n raise RuntimeError( 'Unknown_segway connected.' +\n ' Serial Number is ',serial_num )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L170_C24", "label": "if", "type": "if", "loc": [170, 173], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L169_C20", "vector": [4, 7, 0.3696, 0.0086, 7, 0.03, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.side == 'back':\n print('Connected to rear segway')\n self.segway = h\n self.segway.claimInterface(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Expr_L171_C28", "label": "print()", "type": "expression", "loc": [171, 171], "level": 8, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L170_C24", "vector": [8, 8, 0.3685, 0.0022, 8, 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('Connected to rear segway')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L172_C28", "label": "self.segway =", "type": "assigned_variable", "loc": [172, 172], "level": 8, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L170_C24", "vector": [14, 8, 0.3707, 0.0022, 8, 0.13, 0.5, 92, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.segway", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.segway = h"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Expr_L173_C28", "label": "claimInterface()", "type": "expression", "loc": [173, 173], "level": 8, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L170_C24", "vector": [8, 8, 0.3728, 0.0022, 8, 0.13, 1.0, 263, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "claimInterface", "arg_names": [], "import_names": [], "rhs_call_name": "claimInterface", "annotation": ""}, "snippet": " self.segway.claimInterface(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L179_C4", "label": "calc_checksum", "type": "function", "loc": [179, 190], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:ClassDef_L125_C0", "vector": [2, 1, 0.3976, 0.0259, 1, 0.43, 0.1667, 220, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "calc_checksum", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def calc_checksum(self, msg):\n checksum = 0\n for byt in msg:\n checksum = (checksum+byt)%65536\n checksum_hi = checksum >> 8\n checksum &= 0xff\n checksum = (checksum+checksum_hi)%65536\n checksum_hi = checksum >> 8"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L180_C8", "label": "checksum =", "type": "assigned_variable", "loc": [180, 180], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L179_C4", "vector": [14, 2, 0.3879, 0.0022, 2, 0.47, 0.0, 20, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "checksum", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " checksum = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:For_L181_C8", "label": "for byt", "type": "for", "loc": [181, 182], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L179_C4", "vector": [6, 2, 0.3912, 0.0043, 2, 0.47, 0.1429, 529, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "byt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for byt in msg:\n checksum = (checksum+byt)%65536"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L182_C12", "label": "checksum =", "type": "assigned_variable", "loc": [182, 182], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:For_L181_C8", "vector": [14, 3, 0.3922, 0.0022, 3, 0.0, 0.0, 20, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "checksum", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " checksum = (checksum+byt)%65536"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L183_C8", "label": "checksum_hi =", "type": "assigned_variable", "loc": [183, 183], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L179_C4", "vector": [14, 2, 0.3944, 0.0022, 2, 0.47, 0.2857, 867, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "checksum_hi", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " checksum_hi = checksum >> 8"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L185_C8", "label": "checksum =", "type": "assigned_variable", "loc": [185, 185], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L179_C4", "vector": [14, 2, 0.3987, 0.0022, 2, 0.47, 0.4286, 20, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "checksum", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " checksum = (checksum+checksum_hi)%65536"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L186_C8", "label": "checksum_hi =", "type": "assigned_variable", "loc": [186, 186], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L179_C4", "vector": [14, 2, 0.4009, 0.0022, 2, 0.47, 0.5714, 867, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "checksum_hi", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " checksum_hi = checksum >> 8"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L188_C8", "label": "checksum =", "type": "assigned_variable", "loc": [188, 188], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L179_C4", "vector": [14, 2, 0.4052, 0.0022, 2, 0.47, 0.7143, 20, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "checksum", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " checksum = (checksum+checksum_hi)%65536"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L189_C8", "label": "checksum =", "type": "assigned_variable", "loc": [189, 189], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L179_C4", "vector": [14, 2, 0.4073, 0.0022, 2, 0.47, 0.8571, 20, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "checksum", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " checksum = (~checksum+1)&0xff"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Return_L190_C8", "label": "return", "type": "return", "loc": [190, 190], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L179_C4", "vector": [13, 2, 0.4095, 0.0022, 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 checksum"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L192_C4", "label": "compose_velocity_cmd", "type": "function", "loc": [192, 214], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:ClassDef_L125_C0", "vector": [2, 1, 0.4375, 0.0496, 1, 0.43, 0.25, 299, 0, 3, 1, 0, 0, 0, 8], "semantic": {"name": "compose_velocity_cmd", "arg_names": ["self", "linvel", "angvel"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def compose_velocity_cmd(self,linvel,angvel):\n byt_hi = 0x04\n byt_lo = 0x13\n\n if self.side == 'back': # because the front segway is\n linvel = -linvel # turned around\n linvel_counts = int(linvel)\n angvel_counts = int(angvel)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L193_C8", "label": "byt_hi =", "type": "assigned_variable", "loc": [193, 193], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L192_C4", "vector": [14, 2, 0.4159, 0.0022, 2, 0.27, 0.0, 527, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "byt_hi", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " byt_hi = 0x04"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L194_C8", "label": "byt_lo =", "type": "assigned_variable", "loc": [194, 194], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L192_C4", "vector": [14, 2, 0.4181, 0.0022, 2, 0.27, 0.0909, 707, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "byt_lo", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " byt_lo = 0x13"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L196_C8", "label": "if", "type": "if", "loc": [196, 197], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L192_C4", "vector": [4, 2, 0.4235, 0.0043, 2, 0.27, 0.1818, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.side == 'back': # because the front segway is\n linvel = -linvel # turned around"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L197_C12", "label": "linvel =", "type": "assigned_variable", "loc": [197, 197], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L196_C8", "vector": [14, 3, 0.4246, 0.0022, 3, 0.05, 0.0, 299, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "linvel", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " linvel = -linvel # turned around"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L198_C8", "label": "linvel_counts = int()", "type": "assigned_variable", "loc": [198, 198], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L192_C4", "vector": [14, 2, 0.4267, 0.0022, 2, 0.27, 0.2727, 130, 3, 1, 0, 0, 901, 10, 1], "semantic": {"name": "linvel_counts", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": " linvel_counts = int(linvel)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L199_C8", "label": "angvel_counts = int()", "type": "assigned_variable", "loc": [199, 199], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L192_C4", "vector": [14, 2, 0.4289, 0.0022, 2, 0.27, 0.3636, 718, 3, 1, 0, 0, 901, 10, 1], "semantic": {"name": "angvel_counts", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": " angvel_counts = int(angvel)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L201_C8", "label": "if", "type": "if", "loc": [201, 203], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L192_C4", "vector": [4, 2, 0.4353, 0.0065, 2, 0.27, 0.4545, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if abs(linvel_counts)>1176:\n print('connect.compose_velocity_cmd: Linear velocity is too high. counts: %d'%linvel)\n return []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Expr_L202_C12", "label": "print()", "type": "expression", "loc": [202, 202], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L201_C8", "vector": [8, 3, 0.4353, 0.0022, 3, 0.06, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('connect.compose_velocity_cmd: Linear velocity is too high. counts: %d'%linvel)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Return_L203_C12", "label": "return", "type": "return", "loc": [203, 203], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L201_C8", "vector": [13, 3, 0.4375, 0.0022, 3, 0.06, 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_99565:If_L205_C8", "label": "if", "type": "if", "loc": [205, 207], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L192_C4", "vector": [4, 2, 0.444, 0.0065, 2, 0.27, 0.5455, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if abs(angvel_counts)>1024:\n print('connect.compose_velocity_cmd: Angular velocity is too high. counts: %d'%angvel)\n return []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Expr_L206_C12", "label": "print()", "type": "expression", "loc": [206, 206], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L205_C8", "vector": [8, 3, 0.444, 0.0022, 3, 0.9, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('connect.compose_velocity_cmd: Angular velocity is too high. counts: %d'%angvel)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Return_L207_C12", "label": "return", "type": "return", "loc": [207, 207], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L205_C8", "vector": [13, 3, 0.4461, 0.0022, 3, 0.9, 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_99565:Assign_L209_C8", "label": "usb_msg_fixed =", "type": "assigned_variable", "loc": [209, 209], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L192_C4", "vector": [14, 2, 0.4504, 0.0022, 2, 0.27, 0.6364, 703, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "usb_msg_fixed", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " usb_msg_fixed = [0xf0,0x55,0x00,0x00,0x00,0x00,byt_hi,byt_lo,0x00]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L210_C8", "label": "can_vel_msg =", "type": "assigned_variable", "loc": [210, 210], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L192_C4", "vector": [14, 2, 0.4526, 0.0022, 2, 0.27, 0.7273, 99, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "can_vel_msg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " can_vel_msg = [(linvel_counts>>8)&0xff,linvel_counts&0xff,(angvel_counts>>8)&0xff,angvel_counts&0xff,0x00,0x00,0x00,0x00]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L211_C8", "label": "msg_send =", "type": "assigned_variable", "loc": [211, 211], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L192_C4", "vector": [14, 2, 0.4547, 0.0022, 2, 0.27, 0.8182, 262, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "msg_send", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " msg_send = usb_msg_fixed + can_vel_msg"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Expr_L212_C8", "label": "append()", "type": "expression", "loc": [212, 212], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L192_C4", "vector": [8, 2, 0.4569, 0.0022, 2, 0.27, 0.9091, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " msg_send.append(self.calc_checksum(msg_send))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Return_L214_C8", "label": "return", "type": "return", "loc": [214, 214], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L192_C4", "vector": [13, 2, 0.4612, 0.0022, 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 msg_send"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L217_C4", "label": "send_command", "type": "function", "loc": [217, 223], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:ClassDef_L125_C0", "vector": [2, 1, 0.4741, 0.0151, 1, 0.43, 0.3333, 754, 0, 3, 1, 0, 0, 0, 3], "semantic": {"name": "send_command", "arg_names": ["self", "linvel0", "angvel0"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def send_command(self, linvel0, angvel0 ):\n msg0 = self.compose_velocity_cmd(linvel0,angvel0)\n if msg0 == []:\n return False\n\n for i in range(1):\n self.segway.bulkWrite(0x02,msg0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L218_C8", "label": "msg0 = compose_velocity_cmd()", "type": "assigned_variable", "loc": [218, 218], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L217_C4", "vector": [14, 2, 0.4698, 0.0022, 2, 0.77, 0.0, 995, 3, 2, 0, 0, 299, 10, 1], "semantic": {"name": "msg0", "arg_names": [], "import_names": [], "rhs_call_name": "compose_velocity_cmd", "annotation": ""}, "snippet": " msg0 = self.compose_velocity_cmd(linvel0,angvel0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L219_C8", "label": "if", "type": "if", "loc": [219, 220], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L217_C4", "vector": [4, 2, 0.4731, 0.0043, 2, 0.77, 0.5, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if msg0 == []:\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Return_L220_C12", "label": "return", "type": "return", "loc": [220, 220], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L219_C8", "vector": [13, 3, 0.4741, 0.0022, 3, 0.55, 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_99565:For_L222_C8", "label": "for i", "type": "for", "loc": [222, 223], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L217_C4", "vector": [6, 2, 0.4795, 0.0043, 2, 0.77, 1.0, 826, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(1):\n self.segway.bulkWrite(0x02,msg0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Expr_L223_C12", "label": "bulkWrite()", "type": "expression", "loc": [223, 223], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:For_L222_C8", "vector": [8, 3, 0.4806, 0.0022, 3, 0.58, 0.0, 759, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "bulkWrite", "arg_names": [], "import_names": [], "rhs_call_name": "bulkWrite", "annotation": ""}, "snippet": " self.segway.bulkWrite(0x02,msg0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L225_C4", "label": "send_wheel_velocities", "type": "function", "loc": [225, 239], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:ClassDef_L125_C0", "vector": [2, 1, 0.5, 0.0323, 1, 0.43, 0.4167, 747, 0, 3, 1, 0, 0, 0, 2], "semantic": {"name": "send_wheel_velocities", "arg_names": ["self", "lvel", "rvel"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def send_wheel_velocities( self, lvel, rvel ):\n w = np.matrix([lvel,rvel]).T\n\n V = self.A_inv*w\n\n #print 'V = ',V\n xv = V[0,0]\n tv = V[1,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L226_C8", "label": "w =", "type": "assigned_variable", "loc": [226, 226], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L225_C4", "vector": [14, 2, 0.4871, 0.0022, 2, 0.97, 0.0, 549, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "w", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " w = np.matrix([lvel,rvel]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L228_C8", "label": "V =", "type": "assigned_variable", "loc": [228, 228], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L225_C4", "vector": [14, 2, 0.4914, 0.0022, 2, 0.97, 0.25, 442, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "V", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " V = self.A_inv*w"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L231_C8", "label": "xv =", "type": "assigned_variable", "loc": [231, 231], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L225_C4", "vector": [14, 2, 0.4978, 0.0022, 2, 0.97, 0.5, 9, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "xv", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " xv = V[0,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L232_C8", "label": "tv =", "type": "assigned_variable", "loc": [232, 232], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L225_C4", "vector": [14, 2, 0.5, 0.0022, 2, 0.97, 0.75, 495, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "tv", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tv = V[1,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Return_L239_C8", "label": "return", "type": "return", "loc": [239, 239], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L225_C4", "vector": [13, 2, 0.5151, 0.0022, 2, 0.97, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.send_command( xv, tv )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L241_C4", "label": "parse_usb_cmd", "type": "function", "loc": [241, 291], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:ClassDef_L125_C0", "vector": [2, 1, 0.5733, 0.1099, 1, 0.43, 0.5, 117, 0, 2, 0, 0, 0, 0, 22], "semantic": {"name": "parse_usb_cmd", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def parse_usb_cmd(self,msg):\n if len(msg) < 18:\n return\n\n if self.calc_checksum(msg[:-1]) != msg[-1]:\n #got garbage rejecting\n return\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L242_C8", "label": "if", "type": "if", "loc": [242, 243], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L241_C4", "vector": [4, 2, 0.5226, 0.0043, 2, 0.28, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(msg) < 18:\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Return_L243_C12", "label": "return", "type": "return", "loc": [243, 243], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L242_C8", "vector": [13, 3, 0.5237, 0.0022, 3, 0.94, 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_99565:If_L245_C8", "label": "if", "type": "if", "loc": [245, 247], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L241_C4", "vector": [4, 2, 0.5302, 0.0065, 2, 0.28, 0.25, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.calc_checksum(msg[:-1]) != msg[-1]:\n #got garbage rejecting\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Return_L247_C12", "label": "return", "type": "return", "loc": [247, 247], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L245_C8", "vector": [13, 3, 0.5323, 0.0022, 3, 0.14, 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_99565:Assign_L249_C8", "label": "id =", "type": "assigned_variable", "loc": [249, 249], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L241_C4", "vector": [14, 2, 0.5366, 0.0022, 2, 0.28, 0.5, 941, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " id = ((msg[4]<<3)|((msg[5]>>5)&7))&0xfff"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L251_C8", "label": "data =", "type": "assigned_variable", "loc": [251, 251], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L241_C4", "vector": [14, 2, 0.5409, 0.0022, 2, 0.28, 0.75, 929, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " data = msg[9:17]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L252_C8", "label": "if", "type": "if", "loc": [252, 291], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L241_C4", "vector": [4, 2, 0.5851, 0.0862, 2, 0.28, 1.0, 0, 0, 0, 0, 0, 0, 0, 20], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if id == 0x400:\n # unused\n pass\n elif id == 0x401:\n self.pitch_ang = self._2_bytes( data[0], data[1] )\n self.pitch_rate = self._2_bytes( data[2], data[3] )\n self.yaw_ang = self._2_bytes( data[4], data[5] )\n self.yaw_rate = self._2_bytes( data[6], data[7] )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L255_C8", "label": "if", "type": "if", "loc": [255, 291], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L252_C8", "vector": [4, 3, 0.5884, 0.0797, 3, 0.37, 0.0, 0, 0, 0, 0, 0, 0, 0, 20], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif id == 0x401:\n self.pitch_ang = self._2_bytes( data[0], data[1] )\n self.pitch_rate = self._2_bytes( data[2], data[3] )\n self.yaw_ang = self._2_bytes( data[4], data[5] )\n self.yaw_rate = self._2_bytes( data[6], data[7] )\n elif id == 0x402:\n self.LW_vel = self._2_bytes( data[0], data[1] )#/self._LW_vel\n self.RW_vel = self._2_bytes( data[2], data[3] )#/self._RW_vel"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L256_C12", "label": "self.pitch_ang = _2_bytes()", "type": "assigned_variable", "loc": [256, 256], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L255_C8", "vector": [14, 4, 0.5517, 0.0022, 4, 0.04, 0.0, 33, 3, 2, 0, 0, 454, 10, 1], "semantic": {"name": "self.pitch_ang", "arg_names": [], "import_names": [], "rhs_call_name": "_2_bytes", "annotation": ""}, "snippet": " self.pitch_ang = self._2_bytes( data[0], data[1] )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L257_C12", "label": "self.pitch_rate = _2_bytes()", "type": "assigned_variable", "loc": [257, 257], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L255_C8", "vector": [14, 4, 0.5539, 0.0022, 4, 0.04, 0.25, 681, 3, 2, 0, 0, 454, 10, 1], "semantic": {"name": "self.pitch_rate", "arg_names": [], "import_names": [], "rhs_call_name": "_2_bytes", "annotation": ""}, "snippet": " self.pitch_rate = self._2_bytes( data[2], data[3] )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L258_C12", "label": "self.yaw_ang = _2_bytes()", "type": "assigned_variable", "loc": [258, 258], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L255_C8", "vector": [14, 4, 0.556, 0.0022, 4, 0.04, 0.5, 940, 3, 2, 0, 0, 454, 10, 1], "semantic": {"name": "self.yaw_ang", "arg_names": [], "import_names": [], "rhs_call_name": "_2_bytes", "annotation": ""}, "snippet": " self.yaw_ang = self._2_bytes( data[4], data[5] )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L259_C12", "label": "self.yaw_rate = _2_bytes()", "type": "assigned_variable", "loc": [259, 259], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L255_C8", "vector": [14, 4, 0.5582, 0.0022, 4, 0.04, 0.75, 124, 3, 2, 0, 0, 454, 10, 1], "semantic": {"name": "self.yaw_rate", "arg_names": [], "import_names": [], "rhs_call_name": "_2_bytes", "annotation": ""}, "snippet": " self.yaw_rate = self._2_bytes( data[6], data[7] )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L260_C8", "label": "if", "type": "if", "loc": [260, 291], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L255_C8", "vector": [4, 4, 0.5938, 0.069, 4, 0.04, 1.0, 0, 0, 0, 0, 0, 0, 0, 16], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif id == 0x402:\n self.LW_vel = self._2_bytes( data[0], data[1] )#/self._LW_vel\n self.RW_vel = self._2_bytes( data[2], data[3] )#/self._RW_vel\n self.yaw_rate = self._2_bytes( data[4], data[5] )\n self.servo_frames = self._2_bytes_unsigned( data[6], data[7] )\n elif id == 0x403:\n self.integrated_wheel_displacement_left = self._4_bytes(data[2],data[3],data[0],data[1])\n self.integrated_wheel_displacement_right = self._4_bytes(data[6],data[7],data[4],data[5])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L261_C12", "label": "self.LW_vel = _2_bytes()", "type": "assigned_variable", "loc": [261, 261], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L260_C8", "vector": [14, 5, 0.5625, 0.0022, 5, 0.29, 0.0, 747, 3, 2, 0, 0, 454, 10, 1], "semantic": {"name": "self.LW_vel", "arg_names": [], "import_names": [], "rhs_call_name": "_2_bytes", "annotation": ""}, "snippet": " self.LW_vel = self._2_bytes( data[0], data[1] )#/self._LW_vel"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L262_C12", "label": "self.RW_vel = _2_bytes()", "type": "assigned_variable", "loc": [262, 262], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L260_C8", "vector": [14, 5, 0.5647, 0.0022, 5, 0.29, 0.25, 750, 3, 2, 0, 0, 454, 10, 1], "semantic": {"name": "self.RW_vel", "arg_names": [], "import_names": [], "rhs_call_name": "_2_bytes", "annotation": ""}, "snippet": " self.RW_vel = self._2_bytes( data[2], data[3] )#/self._RW_vel"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L263_C12", "label": "self.yaw_rate = _2_bytes()", "type": "assigned_variable", "loc": [263, 263], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L260_C8", "vector": [14, 5, 0.5668, 0.0022, 5, 0.29, 0.5, 124, 3, 2, 0, 0, 454, 10, 1], "semantic": {"name": "self.yaw_rate", "arg_names": [], "import_names": [], "rhs_call_name": "_2_bytes", "annotation": ""}, "snippet": " self.yaw_rate = self._2_bytes( data[4], data[5] )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L264_C12", "label": "self.servo_frames = _2_bytes_unsigned()", "type": "assigned_variable", "loc": [264, 264], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L260_C8", "vector": [14, 5, 0.569, 0.0022, 5, 0.29, 0.75, 743, 3, 2, 0, 0, 328, 10, 1], "semantic": {"name": "self.servo_frames", "arg_names": [], "import_names": [], "rhs_call_name": "_2_bytes_unsigned", "annotation": ""}, "snippet": " self.servo_frames = self._2_bytes_unsigned( data[6], data[7] )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L265_C8", "label": "if", "type": "if", "loc": [265, 291], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L260_C8", "vector": [4, 5, 0.5991, 0.0582, 5, 0.29, 1.0, 0, 0, 0, 0, 0, 0, 0, 12], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif id == 0x403:\n self.integrated_wheel_displacement_left = self._4_bytes(data[2],data[3],data[0],data[1])\n self.integrated_wheel_displacement_right = self._4_bytes(data[6],data[7],data[4],data[5])\n pass\n elif id == 0x404:\n self.integrated_for_aft_displacement = self._4_bytes(data[2],data[3],data[0],data[1])\n self.integrated_yaw_displacement = self._4_bytes(data[6],data[7],data[4],data[5])\n elif id == 0x405:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L266_C12", "label": "self.integrated_wheel_displacement_left = _4_bytes()", "type": "assigned_variable", "loc": [266, 266], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L265_C8", "vector": [14, 6, 0.5733, 0.0022, 6, 0.45, 0.0, 257, 3, 4, 0, 0, 67, 10, 1], "semantic": {"name": "self.integrated_wheel_displacement_left", "arg_names": [], "import_names": [], "rhs_call_name": "_4_bytes", "annotation": ""}, "snippet": " self.integrated_wheel_displacement_left = self._4_bytes(data[2],data[3],data[0],data[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L267_C12", "label": "self.integrated_wheel_displacement_right = _4_bytes()", "type": "assigned_variable", "loc": [267, 267], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L265_C8", "vector": [14, 6, 0.5754, 0.0022, 6, 0.45, 0.5, 410, 3, 4, 0, 0, 67, 10, 1], "semantic": {"name": "self.integrated_wheel_displacement_right", "arg_names": [], "import_names": [], "rhs_call_name": "_4_bytes", "annotation": ""}, "snippet": " self.integrated_wheel_displacement_right = self._4_bytes(data[6],data[7],data[4],data[5])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L269_C8", "label": "if", "type": "if", "loc": [269, 291], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L265_C8", "vector": [4, 6, 0.6034, 0.0496, 6, 0.45, 1.0, 0, 0, 0, 0, 0, 0, 0, 10], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif id == 0x404:\n self.integrated_for_aft_displacement = self._4_bytes(data[2],data[3],data[0],data[1])\n self.integrated_yaw_displacement = self._4_bytes(data[6],data[7],data[4],data[5])\n elif id == 0x405:\n self.left_motor_torque = self._2_bytes( data[0], data[1] )\n self.right_motor_torque = self._2_bytes( data[2], data[3] )\n elif id == 0x406:\n self.operational_mode = self._2_bytes( data[0], data[1] )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L270_C12", "label": "self.integrated_for_aft_displacement = _4_bytes()", "type": "assigned_variable", "loc": [270, 270], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L269_C8", "vector": [14, 7, 0.5819, 0.0022, 7, 0.62, 0.0, 661, 3, 4, 0, 0, 67, 10, 1], "semantic": {"name": "self.integrated_for_aft_displacement", "arg_names": [], "import_names": [], "rhs_call_name": "_4_bytes", "annotation": ""}, "snippet": " self.integrated_for_aft_displacement = self._4_bytes(data[2],data[3],data[0],data[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L271_C12", "label": "self.integrated_yaw_displacement = _4_bytes()", "type": "assigned_variable", "loc": [271, 271], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L269_C8", "vector": [14, 7, 0.5841, 0.0022, 7, 0.62, 0.5, 37, 3, 4, 0, 0, 67, 10, 1], "semantic": {"name": "self.integrated_yaw_displacement", "arg_names": [], "import_names": [], "rhs_call_name": "_4_bytes", "annotation": ""}, "snippet": " self.integrated_yaw_displacement = self._4_bytes(data[6],data[7],data[4],data[5])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L272_C8", "label": "if", "type": "if", "loc": [272, 291], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L269_C8", "vector": [4, 7, 0.6067, 0.0431, 7, 0.62, 1.0, 0, 0, 0, 0, 0, 0, 0, 8], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif id == 0x405:\n self.left_motor_torque = self._2_bytes( data[0], data[1] )\n self.right_motor_torque = self._2_bytes( data[2], data[3] )\n elif id == 0x406:\n self.operational_mode = self._2_bytes( data[0], data[1] )\n self.controller_gain_schedule = self._2_bytes( data[2], data[3] )\n self.ui_battery_voltage = self._2_bytes( data[4], data[5] )*self._ui_battery_voltage + self._ui_battery_voltage_offset\n self.power_base_battery_voltage = self._2_bytes( data[6], data[7] )*self._power_base_battery_voltage"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L273_C12", "label": "self.left_motor_torque = _2_bytes()", "type": "assigned_variable", "loc": [273, 273], "level": 8, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L272_C8", "vector": [14, 8, 0.5884, 0.0022, 8, 0.01, 0.0, 534, 3, 2, 0, 0, 454, 10, 1], "semantic": {"name": "self.left_motor_torque", "arg_names": [], "import_names": [], "rhs_call_name": "_2_bytes", "annotation": ""}, "snippet": " self.left_motor_torque = self._2_bytes( data[0], data[1] )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L274_C12", "label": "self.right_motor_torque = _2_bytes()", "type": "assigned_variable", "loc": [274, 274], "level": 8, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L272_C8", "vector": [14, 8, 0.5905, 0.0022, 8, 0.01, 0.5, 169, 3, 2, 0, 0, 454, 10, 1], "semantic": {"name": "self.right_motor_torque", "arg_names": [], "import_names": [], "rhs_call_name": "_2_bytes", "annotation": ""}, "snippet": " self.right_motor_torque = self._2_bytes( data[2], data[3] )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L275_C8", "label": "if", "type": "if", "loc": [275, 291], "level": 8, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L272_C8", "vector": [4, 8, 0.6099, 0.0366, 8, 0.01, 1.0, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif id == 0x406:\n self.operational_mode = self._2_bytes( data[0], data[1] )\n self.controller_gain_schedule = self._2_bytes( data[2], data[3] )\n self.ui_battery_voltage = self._2_bytes( data[4], data[5] )*self._ui_battery_voltage + self._ui_battery_voltage_offset\n self.power_base_battery_voltage = self._2_bytes( data[6], data[7] )*self._power_base_battery_voltage\n elif id == 0x407:\n self.velocity_commanded = self._2_bytes( data[0], data[1] )#/self._LW_vel\n self.turn_commanded = self._2_bytes( data[2], data[3] )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L276_C12", "label": "self.operational_mode = _2_bytes()", "type": "assigned_variable", "loc": [276, 276], "level": 9, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L275_C8", "vector": [14, 9, 0.5948, 0.0022, 9, 0.38, 0.0, 95, 3, 2, 0, 0, 454, 10, 1], "semantic": {"name": "self.operational_mode", "arg_names": [], "import_names": [], "rhs_call_name": "_2_bytes", "annotation": ""}, "snippet": " self.operational_mode = self._2_bytes( data[0], data[1] )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L277_C12", "label": "self.controller_gain_schedule = _2_bytes()", "type": "assigned_variable", "loc": [277, 277], "level": 9, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L275_C8", "vector": [14, 9, 0.597, 0.0022, 9, 0.38, 0.25, 203, 3, 2, 0, 0, 454, 10, 1], "semantic": {"name": "self.controller_gain_schedule", "arg_names": [], "import_names": [], "rhs_call_name": "_2_bytes", "annotation": ""}, "snippet": " self.controller_gain_schedule = self._2_bytes( data[2], data[3] )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L278_C12", "label": "self.ui_battery_voltage =", "type": "assigned_variable", "loc": [278, 278], "level": 9, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L275_C8", "vector": [14, 9, 0.5991, 0.0022, 9, 0.38, 0.5, 102, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.ui_battery_voltage", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.ui_battery_voltage = self._2_bytes( data[4], data[5] )*self._ui_battery_voltage + self._ui_battery_voltage_offset"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L279_C12", "label": "self.power_base_battery_voltage =", "type": "assigned_variable", "loc": [279, 279], "level": 9, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L275_C8", "vector": [14, 9, 0.6013, 0.0022, 9, 0.38, 0.75, 547, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.power_base_battery_voltage", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.power_base_battery_voltage = self._2_bytes( data[6], data[7] )*self._power_base_battery_voltage"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L280_C8", "label": "if", "type": "if", "loc": [280, 291], "level": 9, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L275_C8", "vector": [4, 9, 0.6153, 0.0259, 9, 0.38, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif id == 0x407:\n self.velocity_commanded = self._2_bytes( data[0], data[1] )#/self._LW_vel\n self.turn_commanded = self._2_bytes( data[2], data[3] )\n elif msg[1] == 0x00:\n # print 'heartbeat id = ',hex(msg[6]),hex(msg[7])\n pass\n elif id == 0x680:\n # CU Status Message"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L281_C12", "label": "self.velocity_commanded = _2_bytes()", "type": "assigned_variable", "loc": [281, 281], "level": 10, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L280_C8", "vector": [14, 10, 0.6056, 0.0022, 10, 0.67, 0.0, 643, 3, 2, 0, 0, 454, 10, 1], "semantic": {"name": "self.velocity_commanded", "arg_names": [], "import_names": [], "rhs_call_name": "_2_bytes", "annotation": ""}, "snippet": " self.velocity_commanded = self._2_bytes( data[0], data[1] )#/self._LW_vel"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L282_C12", "label": "self.turn_commanded = _2_bytes()", "type": "assigned_variable", "loc": [282, 282], "level": 10, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L280_C8", "vector": [14, 10, 0.6078, 0.0022, 10, 0.67, 0.5, 4, 3, 2, 0, 0, 454, 10, 1], "semantic": {"name": "self.turn_commanded", "arg_names": [], "import_names": [], "rhs_call_name": "_2_bytes", "annotation": ""}, "snippet": " self.turn_commanded = self._2_bytes( data[2], data[3] )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L283_C8", "label": "if", "type": "if", "loc": [283, 291], "level": 10, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L280_C8", "vector": [4, 10, 0.6185, 0.0194, 10, 0.67, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif msg[1] == 0x00:\n # print 'heartbeat id = ',hex(msg[6]),hex(msg[7])\n pass\n elif id == 0x680:\n # CU Status Message\n pass\n else:\n #print 'no message parsed:', hex(id)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L286_C8", "label": "if", "type": "if", "loc": [286, 291], "level": 11, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L283_C8", "vector": [4, 11, 0.6218, 0.0129, 11, 0.73, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif id == 0x680:\n # CU Status Message\n pass\n else:\n #print 'no message parsed:', hex(id)\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L293_C4", "label": "_2_bytes", "type": "function", "loc": [293, 294], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:ClassDef_L125_C0", "vector": [2, 1, 0.6325, 0.0043, 1, 0.43, 0.5833, 454, 0, 3, 1, 0, 0, 0, 3], "semantic": {"name": "_2_bytes", "arg_names": ["self", "high", "low"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _2_bytes( self,high, low ):\n return struct.unpack('>h',chr(high)+chr(low))[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Return_L294_C8", "label": "return", "type": "return", "loc": [294, 294], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L293_C4", "vector": [13, 2, 0.6336, 0.0022, 2, 0.7, 0.0, 0, 6, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return struct.unpack('>h',chr(high)+chr(low))[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L296_C4", "label": "_2_bytes_unsigned", "type": "function", "loc": [296, 297], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:ClassDef_L125_C0", "vector": [2, 1, 0.639, 0.0043, 1, 0.43, 0.6667, 328, 0, 3, 1, 0, 0, 0, 3], "semantic": {"name": "_2_bytes_unsigned", "arg_names": ["self", "high", "low"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _2_bytes_unsigned( self,high, low ):\n return struct.unpack('>H',chr(high)+chr(low))[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Return_L297_C8", "label": "return", "type": "return", "loc": [297, 297], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L296_C4", "vector": [13, 2, 0.6401, 0.0022, 2, 0.21, 0.0, 0, 6, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return struct.unpack('>H',chr(high)+chr(low))[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L299_C4", "label": "_4_bytes", "type": "function", "loc": [299, 300], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:ClassDef_L125_C0", "vector": [2, 1, 0.6455, 0.0043, 1, 0.43, 0.75, 67, 0, 5, 1, 0, 0, 0, 5], "semantic": {"name": "_4_bytes", "arg_names": ["self", "highhigh", "lowhigh", "highlow", "lowlow"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _4_bytes( self,highhigh, lowhigh, highlow, lowlow ):\n return struct.unpack('>l',chr(highhigh)+chr(lowhigh)+chr(highlow)+chr(lowlow))[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Return_L300_C8", "label": "return", "type": "return", "loc": [300, 300], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L299_C4", "vector": [13, 2, 0.6466, 0.0022, 2, 0.74, 0.0, 0, 6, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return struct.unpack('>l',chr(highhigh)+chr(lowhigh)+chr(highlow)+chr(lowlow))[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L302_C4", "label": "clear_read", "type": "function", "loc": [302, 303], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:ClassDef_L125_C0", "vector": [2, 1, 0.6519, 0.0043, 1, 0.43, 0.8333, 603, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "clear_read", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def clear_read(self):\n rd = self.segway.bulkRead(0x81,1000)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L303_C8", "label": "rd = bulkRead()", "type": "assigned_variable", "loc": [303, 303], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L302_C4", "vector": [14, 2, 0.653, 0.0022, 2, 0.65, 0.0, 661, 3, 2, 0, 0, 249, 10, 1], "semantic": {"name": "rd", "arg_names": [], "import_names": [], "rhs_call_name": "bulkRead", "annotation": ""}, "snippet": " rd = self.segway.bulkRead(0x81,1000)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L305_C4", "label": "read", "type": "function", "loc": [305, 334], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:ClassDef_L125_C0", "vector": [2, 1, 0.6886, 0.0647, 1, 0.43, 0.9167, 453, 0, 1, 0, 0, 0, 0, 7], "semantic": {"name": "read", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def read(self):\n before = time.time()\n rd = self.segway.bulkRead(0x81,9*(18+2))\n msg = [(a & 0xff) for a in rd]\n\n i=0\n while 1:\n try:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L306_C8", "label": "before = time()", "type": "assigned_variable", "loc": [306, 306], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L305_C4", "vector": [14, 2, 0.6595, 0.0022, 2, 0.35, 0.0, 255, 3, 0, 0, 0, 654, 10, 1], "semantic": {"name": "before", "arg_names": [], "import_names": [], "rhs_call_name": "time", "annotation": ""}, "snippet": " before = time.time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L307_C8", "label": "rd = bulkRead()", "type": "assigned_variable", "loc": [307, 307], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L305_C4", "vector": [14, 2, 0.6616, 0.0022, 2, 0.35, 0.1667, 661, 3, 2, 0, 0, 249, 10, 1], "semantic": {"name": "rd", "arg_names": [], "import_names": [], "rhs_call_name": "bulkRead", "annotation": ""}, "snippet": " rd = self.segway.bulkRead(0x81,9*(18+2))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L308_C8", "label": "msg =", "type": "assigned_variable", "loc": [308, 308], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L305_C4", "vector": [14, 2, 0.6638, 0.0022, 2, 0.35, 0.3333, 712, 5, 0, 0, 0, 0, 0, 0], "semantic": {"name": "msg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " msg = [(a & 0xff) for a in rd]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L310_C8", "label": "i =", "type": "assigned_variable", "loc": [310, 310], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L305_C4", "vector": [14, 2, 0.6681, 0.0022, 2, 0.35, 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_99565:While_L311_C8", "label": "while", "type": "while", "loc": [311, 317], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L305_C4", "vector": [5, 2, 0.6767, 0.0151, 2, 0.35, 0.6667, 0, 1, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while 1:\n try:\n msg.pop(i*62)\n msg.pop(i*62)\n i += 1\n except IndexError:\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Try_L312_C12", "label": "try", "type": "try", "loc": [312, 317], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:While_L311_C8", "vector": [7, 3, 0.6778, 0.0129, 3, 0.5, 0.0, 0, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n msg.pop(i*62)\n msg.pop(i*62)\n i += 1\n except IndexError:\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Expr_L313_C16", "label": "pop()", "type": "expression", "loc": [313, 313], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:Try_L312_C12", "vector": [8, 4, 0.6746, 0.0022, 4, 0.64, 0.0, 969, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "pop", "arg_names": [], "import_names": [], "rhs_call_name": "pop", "annotation": ""}, "snippet": " msg.pop(i*62)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Expr_L314_C16", "label": "pop()", "type": "expression", "loc": [314, 314], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:Try_L312_C12", "vector": [8, 4, 0.6767, 0.0022, 4, 0.64, 1.0, 969, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "pop", "arg_names": [], "import_names": [], "rhs_call_name": "pop", "annotation": ""}, "snippet": " msg.pop(i*62)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L320_C8", "label": "idx1 = index()", "type": "assigned_variable", "loc": [320, 320], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L305_C4", "vector": [14, 2, 0.6897, 0.0022, 2, 0.35, 0.8333, 409, 3, 1, 0, 0, 780, 10, 1], "semantic": {"name": "idx1", "arg_names": [], "import_names": [], "rhs_call_name": "index", "annotation": ""}, "snippet": " idx1 = msg.index(0xf0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L322_C8", "label": "if", "type": "if", "loc": [322, 334], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L305_C4", "vector": [4, 2, 0.7069, 0.028, 2, 0.35, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if msg[idx1+18] != 0xf0:\n # if this is not the start of a message get rid of the bad start\n msg = msg[idx1+1:]\n else:\n # we found the start\n while len(msg) > 17:\n try:\n single_msg = msg[idx1:idx1+18]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L324_C12", "label": "msg =", "type": "assigned_variable", "loc": [324, 324], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L322_C8", "vector": [14, 3, 0.6983, 0.0022, 3, 0.97, 0.0, 712, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "msg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " msg = msg[idx1+1:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:While_L327_C12", "label": "while", "type": "while", "loc": [327, 334], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L322_C8", "vector": [5, 3, 0.7123, 0.0172, 3, 0.97, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while len(msg) > 17:\n try:\n single_msg = msg[idx1:idx1+18]\n if (single_msg[1] == 0x55 and single_msg[2] == 0xaa) or single_msg[1] == 0x00:\n self.parse_usb_cmd(single_msg)\n msg = msg[18:]\n except IndexError:\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Try_L328_C16", "label": "try", "type": "try", "loc": [328, 334], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:While_L327_C12", "vector": [7, 4, 0.7134, 0.0151, 4, 0.56, 0.0, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n single_msg = msg[idx1:idx1+18]\n if (single_msg[1] == 0x55 and single_msg[2] == 0xaa) or single_msg[1] == 0x00:\n self.parse_usb_cmd(single_msg)\n msg = msg[18:]\n except IndexError:\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L329_C20", "label": "single_msg =", "type": "assigned_variable", "loc": [329, 329], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:Try_L328_C16", "vector": [14, 5, 0.7091, 0.0022, 5, 0.09, 0.0, 321, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "single_msg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " single_msg = msg[idx1:idx1+18]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L330_C20", "label": "if", "type": "if", "loc": [330, 331], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:Try_L328_C16", "vector": [4, 5, 0.7123, 0.0043, 5, 0.09, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (single_msg[1] == 0x55 and single_msg[2] == 0xaa) or single_msg[1] == 0x00:\n self.parse_usb_cmd(single_msg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Expr_L331_C24", "label": "parse_usb_cmd()", "type": "expression", "loc": [331, 331], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L330_C20", "vector": [8, 6, 0.7134, 0.0022, 6, 0.56, 0.0, 117, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "parse_usb_cmd", "arg_names": [], "import_names": [], "rhs_call_name": "parse_usb_cmd", "annotation": ""}, "snippet": " self.parse_usb_cmd(single_msg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L332_C20", "label": "msg =", "type": "assigned_variable", "loc": [332, 332], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:Try_L328_C16", "vector": [14, 5, 0.7155, 0.0022, 5, 0.09, 1.0, 712, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "msg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " msg = msg[18:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L336_C4", "label": "print_feedback", "type": "function", "loc": [336, 343], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:ClassDef_L125_C0", "vector": [2, 1, 0.7317, 0.0172, 1, 0.43, 1.0, 876, 0, 1, 0, 0, 0, 0, 7], "semantic": {"name": "print_feedback", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def print_feedback( self ):\n print('self.integrated_wheel_displacement_left = ',self.integrated_wheel_displacement_left)\n print('self.integrated_wheel_displacement_right = ',self.integrated_wheel_displacement_right)\n print('self.LW_vel = ',self.LW_vel)\n print('self.RW_vel = ',self.RW_vel)\n print('frame = ',self.servo_frames)\n print('self.velocity_commanded = ',self.velocity_commanded)\n print('self.turn_commanded = ',self.turn_commanded)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Expr_L337_C8", "label": "print()", "type": "expression", "loc": [337, 337], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L336_C4", "vector": [8, 2, 0.7263, 0.0022, 2, 0.46, 0.0, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('self.integrated_wheel_displacement_left = ',self.integrated_wheel_displacement_left)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Expr_L338_C8", "label": "print()", "type": "expression", "loc": [338, 338], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L336_C4", "vector": [8, 2, 0.7284, 0.0022, 2, 0.46, 0.1667, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('self.integrated_wheel_displacement_right = ',self.integrated_wheel_displacement_right)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Expr_L339_C8", "label": "print()", "type": "expression", "loc": [339, 339], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L336_C4", "vector": [8, 2, 0.7306, 0.0022, 2, 0.46, 0.3333, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('self.LW_vel = ',self.LW_vel)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Expr_L340_C8", "label": "print()", "type": "expression", "loc": [340, 340], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L336_C4", "vector": [8, 2, 0.7328, 0.0022, 2, 0.46, 0.5, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('self.RW_vel = ',self.RW_vel)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Expr_L341_C8", "label": "print()", "type": "expression", "loc": [341, 341], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L336_C4", "vector": [8, 2, 0.7349, 0.0022, 2, 0.46, 0.6667, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('frame = ',self.servo_frames)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Expr_L342_C8", "label": "print()", "type": "expression", "loc": [342, 342], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L336_C4", "vector": [8, 2, 0.7371, 0.0022, 2, 0.46, 0.8333, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('self.velocity_commanded = ',self.velocity_commanded)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Expr_L343_C8", "label": "print()", "type": "expression", "loc": [343, 343], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L336_C4", "vector": [8, 2, 0.7392, 0.0022, 2, 0.46, 1.0, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('self.turn_commanded = ',self.turn_commanded)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L347_C0", "label": "if", "type": "if", "loc": [347, 436], "level": 0, "parent": null, "vector": [4, 0, 0.8438, 0.194, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 40], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n\n import segway\n seg= segway.Segway()\n seg.clear_read()\n# send_command_fixed(segway_rear)\n rrates = []\n lrates = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Import_L349_C4", "label": "segway import segway", "type": "import", "loc": [349, 349], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L347_C0", "vector": [1, 1, 0.7522, 0.0022, 1, 0.22, 0.0, 380, 0, 1, 0, 0, 380, 0, 0], "semantic": {"name": "segway", "arg_names": [], "import_names": ["segway"], "rhs_call_name": "", "annotation": ""}, "snippet": " import segway"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L350_C4", "label": "seg = Segway()", "type": "assigned_variable", "loc": [350, 350], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L347_C0", "vector": [14, 1, 0.7543, 0.0022, 1, 0.22, 0.0625, 921, 3, 0, 0, 0, 322, 10, 1], "semantic": {"name": "seg", "arg_names": [], "import_names": [], "rhs_call_name": "Segway", "annotation": ""}, "snippet": " seg= segway.Segway()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Expr_L351_C4", "label": "clear_read()", "type": "expression", "loc": [351, 351], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L347_C0", "vector": [8, 1, 0.7565, 0.0022, 1, 0.22, 0.125, 603, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "clear_read", "arg_names": [], "import_names": [], "rhs_call_name": "clear_read", "annotation": ""}, "snippet": " seg.clear_read()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L353_C4", "label": "rrates =", "type": "assigned_variable", "loc": [353, 353], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L347_C0", "vector": [14, 1, 0.7608, 0.0022, 1, 0.22, 0.1875, 581, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "rrates", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rrates = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L354_C4", "label": "lrates =", "type": "assigned_variable", "loc": [354, 354], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L347_C0", "vector": [14, 1, 0.7629, 0.0022, 1, 0.22, 0.25, 903, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "lrates", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " lrates = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:For_L356_C4", "label": "for vel", "type": "for", "loc": [356, 418], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L347_C0", "vector": [6, 1, 0.8341, 0.1358, 1, 0.22, 0.3125, 527, 3, 0, 0, 0, 0, 0, 30], "semantic": {"name": "vel", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for vel in range(31):\n linvel = 2000.*(vel)/30 - 1000.\n angvel = 0.\n\n start = time.time()\n last = start\n lastwrite = start\n lastread = start"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L357_C8", "label": "linvel =", "type": "assigned_variable", "loc": [357, 357], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:For_L356_C4", "vector": [14, 2, 0.7694, 0.0022, 2, 0.31, 0.0, 299, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "linvel", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " linvel = 2000.*(vel)/30 - 1000."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L358_C8", "label": "angvel =", "type": "assigned_variable", "loc": [358, 358], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:For_L356_C4", "vector": [14, 2, 0.7716, 0.0022, 2, 0.31, 0.05, 569, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "angvel", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " angvel = 0."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L360_C8", "label": "start = time()", "type": "assigned_variable", "loc": [360, 360], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:For_L356_C4", "vector": [14, 2, 0.7759, 0.0022, 2, 0.31, 0.1, 511, 3, 0, 0, 0, 654, 10, 1], "semantic": {"name": "start", "arg_names": [], "import_names": [], "rhs_call_name": "time", "annotation": ""}, "snippet": " start = time.time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L361_C8", "label": "last =", "type": "assigned_variable", "loc": [361, 361], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:For_L356_C4", "vector": [14, 2, 0.778, 0.0022, 2, 0.31, 0.15, 95, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "last", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " last = start"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L362_C8", "label": "lastwrite =", "type": "assigned_variable", "loc": [362, 362], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:For_L356_C4", "vector": [14, 2, 0.7802, 0.0022, 2, 0.31, 0.2, 142, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "lastwrite", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " lastwrite = start"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L363_C8", "label": "lastread =", "type": "assigned_variable", "loc": [363, 363], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:For_L356_C4", "vector": [14, 2, 0.7823, 0.0022, 2, 0.31, 0.25, 337, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "lastread", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " lastread = start"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:While_L364_C8", "label": "while", "type": "while", "loc": [364, 378], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:For_L356_C4", "vector": [5, 2, 0.7996, 0.0323, 2, 0.31, 0.3, 0, 1, 0, 0, 0, 0, 0, 9], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while 1:\n # seg.send_command(200,0.0)\n # seg.send_wheel_velocities(100.0,100.0)\n if time.time() - lastwrite > 0.1:\n print('loop 1',time.time() - start)\n #seg.send_command( linvel, angvel )\n lastwrite = time.time()\n #seg.send_platform_velocities( 0,0 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L367_C12", "label": "if", "type": "if", "loc": [367, 372], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:While_L364_C8", "vector": [4, 3, 0.7963, 0.0129, 3, 0.49, 0.0, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if time.time() - lastwrite > 0.1:\n print('loop 1',time.time() - start)\n #seg.send_command( linvel, angvel )\n lastwrite = time.time()\n #seg.send_platform_velocities( 0,0 )\n seg.send_wheel_velocities(1.,1.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Expr_L368_C16", "label": "print()", "type": "expression", "loc": [368, 368], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L367_C12", "vector": [8, 4, 0.7931, 0.0022, 4, 0.98, 0.0, 535, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('loop 1',time.time() - start)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L370_C16", "label": "lastwrite = time()", "type": "assigned_variable", "loc": [370, 370], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L367_C12", "vector": [14, 4, 0.7974, 0.0022, 4, 0.98, 0.5, 142, 3, 0, 0, 0, 654, 10, 1], "semantic": {"name": "lastwrite", "arg_names": [], "import_names": [], "rhs_call_name": "time", "annotation": ""}, "snippet": " lastwrite = time.time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Expr_L372_C16", "label": "send_wheel_velocities()", "type": "expression", "loc": [372, 372], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L367_C12", "vector": [8, 4, 0.8017, 0.0022, 4, 0.98, 1.0, 747, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "send_wheel_velocities", "arg_names": [], "import_names": [], "rhs_call_name": "send_wheel_velocities", "annotation": ""}, "snippet": " seg.send_wheel_velocities(1.,1.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L373_C12", "label": "if", "type": "if", "loc": [373, 375], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:While_L364_C8", "vector": [4, 3, 0.806, 0.0065, 3, 0.49, 0.5, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if time.time() - lastread > 0.01:\n seg.read()\n lastread = time.time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Expr_L374_C16", "label": "read()", "type": "expression", "loc": [374, 374], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L373_C12", "vector": [8, 4, 0.806, 0.0022, 4, 0.95, 0.0, 453, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "read", "arg_names": [], "import_names": [], "rhs_call_name": "read", "annotation": ""}, "snippet": " seg.read()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L375_C16", "label": "lastread = time()", "type": "assigned_variable", "loc": [375, 375], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L373_C12", "vector": [14, 4, 0.8082, 0.0022, 4, 0.95, 1.0, 337, 3, 0, 0, 0, 654, 10, 1], "semantic": {"name": "lastread", "arg_names": [], "import_names": [], "rhs_call_name": "time", "annotation": ""}, "snippet": " lastread = time.time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L377_C12", "label": "if", "type": "if", "loc": [377, 378], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:While_L364_C8", "vector": [4, 3, 0.8136, 0.0043, 3, 0.49, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if time.time() - start > 2.0:\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L380_C8", "label": "left_start =", "type": "assigned_variable", "loc": [380, 380], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:For_L356_C4", "vector": [14, 2, 0.819, 0.0022, 2, 0.31, 0.35, 423, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "left_start", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " left_start = seg.integrated_wheel_displacement_left"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L381_C8", "label": "right_start =", "type": "assigned_variable", "loc": [381, 381], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:For_L356_C4", "vector": [14, 2, 0.8211, 0.0022, 2, 0.31, 0.4, 833, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "right_start", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " right_start = seg.integrated_wheel_displacement_right"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L382_C8", "label": "first_points = time()", "type": "assigned_variable", "loc": [382, 382], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:For_L356_C4", "vector": [14, 2, 0.8233, 0.0022, 2, 0.31, 0.45, 148, 3, 0, 0, 0, 654, 10, 1], "semantic": {"name": "first_points", "arg_names": [], "import_names": [], "rhs_call_name": "time", "annotation": ""}, "snippet": " first_points = time.time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:While_L384_C8", "label": "while", "type": "while", "loc": [384, 398], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:For_L356_C4", "vector": [5, 2, 0.8427, 0.0323, 2, 0.31, 0.5, 0, 1, 0, 0, 0, 0, 0, 9], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while 1:\n # seg.send_command(200,0.0)\n # seg.send_wheel_velocities(100.0,100.0)\n if time.time() - lastwrite > 0.1:\n print('loop 1.5',time.time() - start)\n #seg.send_command( linvel, angvel )\n lastwrite = time.time()\n #seg.send_platform_velocities( 0,0 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L387_C12", "label": "if", "type": "if", "loc": [387, 392], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:While_L384_C8", "vector": [4, 3, 0.8394, 0.0129, 3, 0.91, 0.0, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if time.time() - lastwrite > 0.1:\n print('loop 1.5',time.time() - start)\n #seg.send_command( linvel, angvel )\n lastwrite = time.time()\n #seg.send_platform_velocities( 0,0 )\n seg.send_wheel_velocities(1.,1.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Expr_L388_C16", "label": "print()", "type": "expression", "loc": [388, 388], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L387_C12", "vector": [8, 4, 0.8362, 0.0022, 4, 0.84, 0.0, 535, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('loop 1.5',time.time() - start)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L390_C16", "label": "lastwrite = time()", "type": "assigned_variable", "loc": [390, 390], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L387_C12", "vector": [14, 4, 0.8405, 0.0022, 4, 0.84, 0.5, 142, 3, 0, 0, 0, 654, 10, 1], "semantic": {"name": "lastwrite", "arg_names": [], "import_names": [], "rhs_call_name": "time", "annotation": ""}, "snippet": " lastwrite = time.time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Expr_L392_C16", "label": "send_wheel_velocities()", "type": "expression", "loc": [392, 392], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L387_C12", "vector": [8, 4, 0.8448, 0.0022, 4, 0.84, 1.0, 747, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "send_wheel_velocities", "arg_names": [], "import_names": [], "rhs_call_name": "send_wheel_velocities", "annotation": ""}, "snippet": " seg.send_wheel_velocities(1.,1.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L393_C12", "label": "if", "type": "if", "loc": [393, 395], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:While_L384_C8", "vector": [4, 3, 0.8491, 0.0065, 3, 0.91, 0.5, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if time.time() - lastread > 0.01:\n seg.read()\n lastread = time.time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Expr_L394_C16", "label": "read()", "type": "expression", "loc": [394, 394], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L393_C12", "vector": [8, 4, 0.8491, 0.0022, 4, 0.45, 0.0, 453, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "read", "arg_names": [], "import_names": [], "rhs_call_name": "read", "annotation": ""}, "snippet": " seg.read()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L395_C16", "label": "lastread = time()", "type": "assigned_variable", "loc": [395, 395], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L393_C12", "vector": [14, 4, 0.8513, 0.0022, 4, 0.45, 1.0, 337, 3, 0, 0, 0, 654, 10, 1], "semantic": {"name": "lastread", "arg_names": [], "import_names": [], "rhs_call_name": "time", "annotation": ""}, "snippet": " lastread = time.time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L397_C12", "label": "if", "type": "if", "loc": [397, 398], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:While_L384_C8", "vector": [4, 3, 0.8567, 0.0043, 3, 0.91, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if time.time() - start > 5.0:\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L400_C8", "label": "left_stop =", "type": "assigned_variable", "loc": [400, 400], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:For_L356_C4", "vector": [14, 2, 0.8621, 0.0022, 2, 0.31, 0.55, 886, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "left_stop", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " left_stop = seg.integrated_wheel_displacement_left"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L401_C8", "label": "right_stop =", "type": "assigned_variable", "loc": [401, 401], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:For_L356_C4", "vector": [14, 2, 0.8642, 0.0022, 2, 0.31, 0.6, 929, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "right_stop", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " right_stop = seg.integrated_wheel_displacement_right"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L402_C8", "label": "last_points = time()", "type": "assigned_variable", "loc": [402, 402], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:For_L356_C4", "vector": [14, 2, 0.8664, 0.0022, 2, 0.31, 0.65, 879, 3, 0, 0, 0, 654, 10, 1], "semantic": {"name": "last_points", "arg_names": [], "import_names": [], "rhs_call_name": "time", "annotation": ""}, "snippet": " last_points = time.time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L404_C8", "label": "diff =", "type": "assigned_variable", "loc": [404, 404], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:For_L356_C4", "vector": [14, 2, 0.8707, 0.0022, 2, 0.31, 0.7, 833, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "diff", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " diff = last_points - first_points"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Expr_L405_C8", "label": "print()", "type": "expression", "loc": [405, 405], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:For_L356_C4", "vector": [8, 2, 0.8728, 0.0022, 2, 0.31, 0.75, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Time: ',diff)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Expr_L406_C8", "label": "print()", "type": "expression", "loc": [406, 406], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:For_L356_C4", "vector": [8, 2, 0.875, 0.0022, 2, 0.31, 0.8, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('left rate: ',(left_stop - left_start)/diff)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Expr_L407_C8", "label": "print()", "type": "expression", "loc": [407, 407], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:For_L356_C4", "vector": [8, 2, 0.8772, 0.0022, 2, 0.31, 0.85, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('right rate: ',(right_stop - right_start)/diff)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Expr_L409_C8", "label": "append()", "type": "expression", "loc": [409, 409], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:For_L356_C4", "vector": [8, 2, 0.8815, 0.0022, 2, 0.31, 0.9, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " rrates.append(((right_stop - right_start)/diff,linvel))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Expr_L410_C8", "label": "append()", "type": "expression", "loc": [410, 410], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:For_L356_C4", "vector": [8, 2, 0.8836, 0.0022, 2, 0.31, 0.95, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " lrates.append(((left_stop - left_start)/diff,linvel))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:While_L412_C8", "label": "while", "type": "while", "loc": [412, 418], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:For_L356_C4", "vector": [5, 2, 0.8944, 0.0151, 2, 0.31, 1.0, 0, 1, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while 1:\n if time.time() - lastread > 0.01:\n seg.read()\n lastread = time.time()\n #seg.print_feedback()\n if seg.LW_vel ==0 and seg.RW_vel == 0:\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L413_C12", "label": "if", "type": "if", "loc": [413, 415], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:While_L412_C8", "vector": [4, 3, 0.8922, 0.0065, 3, 0.76, 0.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if time.time() - lastread > 0.01:\n seg.read()\n lastread = time.time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Expr_L414_C16", "label": "read()", "type": "expression", "loc": [414, 414], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L413_C12", "vector": [8, 4, 0.8922, 0.0022, 4, 0.46, 0.0, 453, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "read", "arg_names": [], "import_names": [], "rhs_call_name": "read", "annotation": ""}, "snippet": " seg.read()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L415_C16", "label": "lastread = time()", "type": "assigned_variable", "loc": [415, 415], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L413_C12", "vector": [14, 4, 0.8944, 0.0022, 4, 0.46, 1.0, 337, 3, 0, 0, 0, 654, 10, 1], "semantic": {"name": "lastread", "arg_names": [], "import_names": [], "rhs_call_name": "time", "annotation": ""}, "snippet": " lastread = time.time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L417_C12", "label": "if", "type": "if", "loc": [417, 418], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:While_L412_C8", "vector": [4, 3, 0.8998, 0.0043, 3, 0.76, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if seg.LW_vel ==0 and seg.RW_vel == 0:\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Expr_L420_C4", "label": "print()", "type": "expression", "loc": [420, 420], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L347_C0", "vector": [8, 1, 0.9052, 0.0022, 1, 0.22, 0.375, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('rrates:',rrates)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Expr_L421_C4", "label": "print()", "type": "expression", "loc": [421, 421], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L347_C0", "vector": [8, 1, 0.9073, 0.0022, 1, 0.22, 0.4375, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('lrates:',lrates)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Import_L424_C4", "label": "pylab import pylab", "type": "import", "loc": [424, 424], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L347_C0", "vector": [1, 1, 0.9138, 0.0022, 1, 0.22, 0.5, 735, 0, 1, 0, 0, 735, 0, 0], "semantic": {"name": "pylab", "arg_names": [], "import_names": ["pylab"], "rhs_call_name": "", "annotation": ""}, "snippet": " import pylab"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L425_C4", "label": "x =", "type": "assigned_variable", "loc": [425, 425], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L347_C0", "vector": [14, 1, 0.9159, 0.0022, 1, 0.22, 0.5625, 190, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " x = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L426_C4", "label": "y =", "type": "assigned_variable", "loc": [426, 426], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L347_C0", "vector": [14, 1, 0.9181, 0.0022, 1, 0.22, 0.625, 304, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " y = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L427_C4", "label": "x1 =", "type": "assigned_variable", "loc": [427, 427], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L347_C0", "vector": [14, 1, 0.9203, 0.0022, 1, 0.22, 0.6875, 634, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "x1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " x1 = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L428_C4", "label": "y1 =", "type": "assigned_variable", "loc": [428, 428], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L347_C0", "vector": [14, 1, 0.9224, 0.0022, 1, 0.22, 0.75, 361, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "y1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " y1 = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:For_L429_C4", "label": "for a, b", "type": "for", "loc": [429, 431], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L347_C0", "vector": [6, 1, 0.9267, 0.0065, 1, 0.22, 0.8125, 127, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "a, b", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for a, b in rrates:\n x.append(b)\n y.append(a)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Expr_L430_C8", "label": "append()", "type": "expression", "loc": [430, 430], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:For_L429_C4", "vector": [8, 2, 0.9267, 0.0022, 2, 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": " x.append(b)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Expr_L431_C8", "label": "append()", "type": "expression", "loc": [431, 431], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:For_L429_C4", "vector": [8, 2, 0.9289, 0.0022, 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": " y.append(a)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:For_L432_C4", "label": "for a, b", "type": "for", "loc": [432, 434], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L347_C0", "vector": [6, 1, 0.9332, 0.0065, 1, 0.22, 0.875, 127, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "a, b", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for a, b in lrates:\n x1.append(b)\n y1.append(a)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Expr_L433_C8", "label": "append()", "type": "expression", "loc": [433, 433], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:For_L432_C4", "vector": [8, 2, 0.9332, 0.0022, 2, 0.39, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " x1.append(b)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Expr_L434_C8", "label": "append()", "type": "expression", "loc": [434, 434], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:For_L432_C4", "vector": [8, 2, 0.9353, 0.0022, 2, 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": " y1.append(a)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Expr_L435_C4", "label": "plot()", "type": "expression", "loc": [435, 435], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L347_C0", "vector": [8, 1, 0.9375, 0.0022, 1, 0.22, 0.9375, 929, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "plot", "arg_names": [], "import_names": [], "rhs_call_name": "plot", "annotation": ""}, "snippet": " pylab.plot(x,y,x1,y1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99565:Expr_L436_C4", "label": "show()", "type": "expression", "loc": [436, 436], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L347_C0", "vector": [8, 1, 0.9397, 0.0022, 1, 0.22, 1.0, 497, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "show", "arg_names": [], "import_names": [], "rhs_call_name": "show", "annotation": ""}, "snippet": " pylab.show()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99565:ClassDef_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L38_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L39_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L40_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L42_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L44_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L45_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:ClassDef_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L48_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L49_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Expr_L52_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Expr_L53_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:ClassDef_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L55_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Expr_L56_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L57_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L59_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L60_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L61_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L66_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L72_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L74_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L78_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L79_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L80_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L81_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L83_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L84_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L86_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L86_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Expr_L87_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L86_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Expr_L88_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:ClassDef_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L90_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L90_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Expr_L91_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:ClassDef_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L93_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:ClassDef_L96_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L97_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L98_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L101_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L102_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L103_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L104_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L109_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L110_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L111_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L112_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L113_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L114_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L121_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L122_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L123_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:ClassDef_L125_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L127_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L127_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Expr_L128_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L127_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Expr_L129_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L127_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L131_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L127_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L132_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L127_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Expr_L133_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L127_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L135_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L127_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L136_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L127_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L137_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L127_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L138_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L127_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L139_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L127_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L140_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L127_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L141_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L127_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L142_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L127_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L143_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L127_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L144_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L127_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L145_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L127_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L146_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L127_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L147_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L127_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L148_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L127_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L149_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L127_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L150_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L127_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L151_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L127_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L152_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L127_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L153_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L127_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L154_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:ClassDef_L125_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L156_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L156_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L157_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L156_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L158_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L156_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:For_L159_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:For_L159_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:For_L160_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:For_L160_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L161_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L161_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L162_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L161_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L163_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L161_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L164_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L164_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L165_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L165_C24", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Expr_L166_C28"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L165_C24", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L167_C28"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L165_C24", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Expr_L168_C28"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L164_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L169_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L169_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L170_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L170_C24", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Expr_L171_C28"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L170_C24", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L172_C28"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L170_C24", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Expr_L173_C28"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:ClassDef_L125_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L179_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L179_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L180_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L179_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:For_L181_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:For_L181_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L182_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L179_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L183_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L179_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L185_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L179_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L186_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L179_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L188_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L179_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L189_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L179_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Return_L190_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:ClassDef_L125_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L192_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L192_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L193_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L192_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L194_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L192_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L196_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L196_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L197_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L192_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L198_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L192_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L199_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L192_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L201_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L201_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Expr_L202_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L201_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Return_L203_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L192_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L205_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L205_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Expr_L206_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L205_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Return_L207_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L192_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L209_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L192_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L210_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L192_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L211_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L192_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Expr_L212_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L192_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Return_L214_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:ClassDef_L125_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L217_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L217_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L218_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L217_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L219_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L219_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Return_L220_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L217_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:For_L222_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:For_L222_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Expr_L223_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:ClassDef_L125_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L225_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L225_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L226_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L225_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L228_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L225_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L231_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L225_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L232_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L225_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Return_L239_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:ClassDef_L125_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L241_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L241_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L242_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L242_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Return_L243_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L241_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L245_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L245_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Return_L247_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L241_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L249_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L241_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L251_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L241_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L252_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L252_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L255_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L255_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L256_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L255_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L257_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L255_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L258_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L255_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L259_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L255_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L260_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L260_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L261_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L260_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L262_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L260_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L263_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L260_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L264_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L260_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L265_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L265_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L266_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L265_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L267_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L265_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L269_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L269_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L270_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L269_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L271_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L269_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L272_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L272_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L273_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L272_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L274_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L272_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L275_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L275_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L276_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L275_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L277_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L275_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L278_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L275_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L279_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L275_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L280_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L280_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L281_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L280_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L282_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L280_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L283_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L283_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L286_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:ClassDef_L125_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L293_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L293_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Return_L294_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:ClassDef_L125_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L296_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L296_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Return_L297_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:ClassDef_L125_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L299_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L299_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Return_L300_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:ClassDef_L125_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L302_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L302_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L303_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:ClassDef_L125_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L305_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L305_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L306_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L305_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L307_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L305_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L308_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L305_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L310_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L305_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:While_L311_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:While_L311_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Try_L312_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:Try_L312_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Expr_L313_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:Try_L312_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Expr_L314_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L305_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L320_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L305_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L322_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L322_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L324_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L322_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:While_L327_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:While_L327_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Try_L328_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:Try_L328_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L329_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:Try_L328_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L330_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L330_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Expr_L331_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:Try_L328_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L332_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:ClassDef_L125_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L336_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L336_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Expr_L337_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L336_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Expr_L338_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L336_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Expr_L339_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L336_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Expr_L340_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L336_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Expr_L341_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L336_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Expr_L342_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:FunctionDef_L336_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Expr_L343_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L347_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Import_L349_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L347_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L350_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L347_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Expr_L351_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L347_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L353_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L347_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L354_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L347_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:For_L356_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:For_L356_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L357_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:For_L356_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L358_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:For_L356_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L360_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:For_L356_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L361_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:For_L356_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L362_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:For_L356_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L363_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:For_L356_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:While_L364_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:While_L364_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L367_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L367_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Expr_L368_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L367_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L370_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L367_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Expr_L372_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:While_L364_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L373_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L373_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Expr_L374_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L373_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L375_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:While_L364_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L377_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:For_L356_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L380_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:For_L356_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L381_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:For_L356_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L382_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:For_L356_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:While_L384_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:While_L384_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L387_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L387_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Expr_L388_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L387_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L390_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L387_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Expr_L392_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:While_L384_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L393_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L393_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Expr_L394_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L393_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L395_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:While_L384_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L397_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:For_L356_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L400_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:For_L356_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L401_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:For_L356_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L402_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:For_L356_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L404_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:For_L356_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Expr_L405_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:For_L356_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Expr_L406_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:For_L356_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Expr_L407_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:For_L356_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Expr_L409_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:For_L356_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Expr_L410_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:For_L356_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:While_L412_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:While_L412_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L413_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L413_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Expr_L414_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L413_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L415_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:While_L412_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L417_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L347_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Expr_L420_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L347_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Expr_L421_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L347_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Import_L424_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L347_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L425_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L347_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L426_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L347_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L427_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L347_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Assign_L428_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L347_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:For_L429_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:For_L429_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Expr_L430_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:For_L429_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Expr_L431_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L347_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:For_L432_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:For_L432_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Expr_L433_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:For_L432_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Expr_L434_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L347_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Expr_L435_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99565:If_L347_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99565:Expr_L436_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 Hai Nguyen (Healthcare Robotics Lab, Georgia Tech.) # \author Marc Killpack (Healthcare Robotics Lab, Georgia Tech.) import roslib; roslib.load_manifest('hrl_segway_omni') from hrl_lib.msg import PlanarBaseVel from geometry_msgs.msg import Twist import rospy import segway import numpy as np def callback(cmd): #print 'segway_node:', cmd.xvel, cmd.yvel, cmd.angular_velocity mecanum.set_velocity(cmd.xvel, cmd.yvel, cmd.angular_velocity) def callback_ros(cmd): #print 'segway_node:', cmd.linear.x, cmd.linear.y, cmd.angular.z avel = cmd.angular.z * 0.5 avel = np.clip(avel,-0.2,0.2) mecanum.set_velocity(cmd.linear.x, cmd.linear.y, avel) rospy.init_node("segway_node", anonymous=False) rospy.Subscriber("base", PlanarBaseVel, callback, None, 1) rospy.Subscriber("cmd_vel", Twist, callback_ros, None, 1) #mecanum = segway.Mecanum(init_ros_node=False) mecanum = segway.Mecanum() rospy.spin()
ajibawa-2023/Python-Code-Large/train/row_99567
18
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_99567:Import_L30_C0", "label": "roslib import roslib", "type": "import", "loc": [30, 30], "level": 0, "parent": null, "vector": [1, 0, 0.566, 0.0189, 0, 0.66, 0.0, 796, 0, 1, 0, 0, 796, 0, 0], "semantic": {"name": "roslib", "arg_names": [], "import_names": ["roslib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('hrl_segway_omni')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99567:Expr_L30_C15", "label": "load_manifest()", "type": "expression", "loc": [30, 30], "level": 0, "parent": null, "vector": [8, 0, 0.566, 0.0189, 0, 0.66, 0.0769, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('hrl_segway_omni')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99567:ImportFrom_L31_C0", "label": "from hrl_lib.msg import PlanarBaseVel", "type": "import", "loc": [31, 31], "level": 0, "parent": null, "vector": [1, 0, 0.5849, 0.0189, 0, 0.66, 0.1538, 842, 0, 1, 0, 0, 842, 0, 0], "semantic": {"name": "hrl_lib.msg", "arg_names": [], "import_names": ["PlanarBaseVel"], "rhs_call_name": "", "annotation": ""}, "snippet": "from hrl_lib.msg import PlanarBaseVel"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99567:ImportFrom_L32_C0", "label": "from geometry_msgs.msg import Twist", "type": "import", "loc": [32, 32], "level": 0, "parent": null, "vector": [1, 0, 0.6038, 0.0189, 0, 0.66, 0.2308, 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_99567:Import_L33_C0", "label": "rospy import rospy", "type": "import", "loc": [33, 33], "level": 0, "parent": null, "vector": [1, 0, 0.6226, 0.0189, 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_99567:Import_L34_C0", "label": "segway import segway", "type": "import", "loc": [34, 34], "level": 0, "parent": null, "vector": [1, 0, 0.6415, 0.0189, 0, 0.66, 0.3846, 380, 0, 1, 0, 0, 380, 0, 0], "semantic": {"name": "segway", "arg_names": [], "import_names": ["segway"], "rhs_call_name": "", "annotation": ""}, "snippet": "import segway"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99567:Import_L35_C0", "label": "numpy import np", "type": "import", "loc": [35, 35], "level": 0, "parent": null, "vector": [1, 0, 0.6604, 0.0189, 0, 0.66, 0.4615, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np"], "rhs_call_name": "", "annotation": ""}, "snippet": "import numpy as np"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99567:FunctionDef_L37_C0", "label": "callback", "type": "function", "loc": [37, 39], "level": 0, "parent": null, "vector": [2, 0, 0.717, 0.0566, 0, 0.66, 0.5385, 342, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "callback", "arg_names": ["cmd"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def callback(cmd):\n #print 'segway_node:', cmd.xvel, cmd.yvel, cmd.angular_velocity\n mecanum.set_velocity(cmd.xvel, cmd.yvel, cmd.angular_velocity)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99567:Expr_L39_C4", "label": "set_velocity()", "type": "expression", "loc": [39, 39], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99567:FunctionDef_L37_C0", "vector": [8, 1, 0.7358, 0.0189, 1, 0.51, 0.0, 855, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "set_velocity", "arg_names": [], "import_names": [], "rhs_call_name": "set_velocity", "annotation": ""}, "snippet": " mecanum.set_velocity(cmd.xvel, cmd.yvel, cmd.angular_velocity)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99567:FunctionDef_L41_C0", "label": "callback_ros", "type": "function", "loc": [41, 45], "level": 0, "parent": null, "vector": [2, 0, 0.8113, 0.0943, 0, 0.66, 0.6154, 205, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "callback_ros", "arg_names": ["cmd"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def callback_ros(cmd):\n #print 'segway_node:', cmd.linear.x, cmd.linear.y, cmd.angular.z\n avel = cmd.angular.z * 0.5\n avel = np.clip(avel,-0.2,0.2)\n mecanum.set_velocity(cmd.linear.x, cmd.linear.y, avel)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99567:Assign_L43_C4", "label": "avel =", "type": "assigned_variable", "loc": [43, 43], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99567:FunctionDef_L41_C0", "vector": [14, 1, 0.8113, 0.0189, 1, 0.76, 0.0, 290, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "avel", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " avel = cmd.angular.z * 0.5"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99567:Assign_L44_C4", "label": "avel = clip()", "type": "assigned_variable", "loc": [44, 44], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99567:FunctionDef_L41_C0", "vector": [14, 1, 0.8302, 0.0189, 1, 0.76, 0.5, 290, 3, 3, 0, 0, 689, 10, 1], "semantic": {"name": "avel", "arg_names": [], "import_names": [], "rhs_call_name": "clip", "annotation": ""}, "snippet": " avel = np.clip(avel,-0.2,0.2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99567:Expr_L45_C4", "label": "set_velocity()", "type": "expression", "loc": [45, 45], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99567:FunctionDef_L41_C0", "vector": [8, 1, 0.8491, 0.0189, 1, 0.76, 1.0, 855, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "set_velocity", "arg_names": [], "import_names": [], "rhs_call_name": "set_velocity", "annotation": ""}, "snippet": " mecanum.set_velocity(cmd.linear.x, cmd.linear.y, avel)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99567:Expr_L47_C0", "label": "init_node()", "type": "expression", "loc": [47, 47], "level": 0, "parent": null, "vector": [8, 0, 0.8868, 0.0189, 0, 0.66, 0.6923, 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(\"segway_node\", anonymous=False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99567:Expr_L48_C0", "label": "Subscriber()", "type": "expression", "loc": [48, 48], "level": 0, "parent": null, "vector": [8, 0, 0.9057, 0.0189, 0, 0.66, 0.7692, 455, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "Subscriber", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": "rospy.Subscriber(\"base\", PlanarBaseVel, callback, None, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99567:Expr_L49_C0", "label": "Subscriber()", "type": "expression", "loc": [49, 49], "level": 0, "parent": null, "vector": [8, 0, 0.9245, 0.0189, 0, 0.66, 0.8462, 455, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "Subscriber", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": "rospy.Subscriber(\"cmd_vel\", Twist, callback_ros, None, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99567:Assign_L51_C0", "label": "mecanum = Mecanum()", "type": "assigned_variable", "loc": [51, 51], "level": 0, "parent": null, "vector": [14, 0, 0.9623, 0.0189, 0, 0.66, 0.9231, 296, 3, 0, 0, 0, 751, 10, 1], "semantic": {"name": "mecanum", "arg_names": [], "import_names": [], "rhs_call_name": "Mecanum", "annotation": ""}, "snippet": "mecanum = segway.Mecanum()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99567:Expr_L52_C0", "label": "spin()", "type": "expression", "loc": [52, 52], "level": 0, "parent": null, "vector": [8, 0, 0.9811, 0.0189, 0, 0.66, 1.0, 17, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "spin", "arg_names": [], "import_names": [], "rhs_call_name": "spin", "annotation": ""}, "snippet": "rospy.spin()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99567:FunctionDef_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99567:Expr_L39_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99567:FunctionDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99567:Assign_L43_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99567:FunctionDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99567:Assign_L44_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99567:FunctionDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99567:Expr_L45_C4"}]
#!/usr/bin/python # # Copyright (c) 2009, Georgia Tech Research Corporation # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # * Neither the name of the Georgia Tech Research Corporation nor the # names of its contributors may be used to endorse or promote products # derived from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY GEORGIA TECH RESEARCH CORPORATION ''AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL GEORGIA TECH BE LIABLE FOR ANY DIRECT, INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # \author Advait Jain (Healthcare Robotics Lab, Georgia Tech.) # \author Cressel Anderson (Healthcare Robotics Lab, Georgia Tech.) # \author Hai Nguyen (Healthcare Robotics Lab, Georgia Tech.) import roslib; roslib.load_manifest('force_torque') import rospy from hrl_msgs.msg import FloatArray #import hrl_lib.rutils as ru import AMTIForce2 as af import threading import time #import rutils as ru class AMTIForceServer(threading.Thread): def __init__(self, device_path, str_id): threading.Thread.__init__(self) try: rospy.init_node('AMTIForceServer') print 'AMTIForceServer: ros is up!' except rospy.ROSException: pass print 'AMTIForceServer: connecting to', device_path self.force_plate = af.AMTI_force(device_path) name = 'force_torque_' + str_id print 'AMTIForceServer: publishing', name, 'with type FloatArray' self.channel = rospy.Publisher(name, FloatArray, tcp_nodelay=True) def broadcast(self): print 'AMTIForceServer: started!' while not rospy.is_shutdown(): time.sleep(1/5000.0) self.channel.publish(FloatArray(None, self.force_plate.read().T.tolist()[0])) #DEPRECATED, use FTClient from ROSFTSensor with id = 0 #def AMTIForceClient(): # return ru.FloatArrayListener('AMTIForceClient', 'force_plate', 100.0) #import roslib; roslib.load_manifest('force_torque') #import force_torque.ROSAMTIForce as ft if __name__ == '__main__': import optparse p = optparse.OptionParser() p.add_option('--path', action='store', default='/dev/robot/force_plate0', type = 'string', dest='path', help='path to force torque device in (linux)') p.add_option('--name', action='store', default='ft1', type='string', dest='name', help='name given to FTSensor') opt, args = p.parse_args() server = AMTIForceServer(opt.path, opt.name) server.broadcast()
ajibawa-2023/Python-Code-Large/train/row_99568
31
84
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99568:Import_L33_C0", "label": "roslib import roslib", "type": "import", "loc": [33, 33], "level": 0, "parent": null, "vector": [1, 0, 0.3929, 0.0119, 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('force_torque')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99568:Expr_L33_C15", "label": "load_manifest()", "type": "expression", "loc": [33, 33], "level": 0, "parent": null, "vector": [8, 0, 0.3929, 0.0119, 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('force_torque')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99568:Import_L34_C0", "label": "rospy import rospy", "type": "import", "loc": [34, 34], "level": 0, "parent": null, "vector": [1, 0, 0.4048, 0.0119, 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_99568:ImportFrom_L35_C0", "label": "from hrl_msgs.msg import FloatArray", "type": "import", "loc": [35, 35], "level": 0, "parent": null, "vector": [1, 0, 0.4167, 0.0119, 0, 0.66, 0.375, 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_99568:Import_L38_C0", "label": "AMTIForce2 import af", "type": "import", "loc": [38, 38], "level": 0, "parent": null, "vector": [1, 0, 0.4524, 0.0119, 0, 0.66, 0.5, 237, 0, 1, 0, 0, 237, 0, 0], "semantic": {"name": "AMTIForce2", "arg_names": [], "import_names": ["af"], "rhs_call_name": "", "annotation": ""}, "snippet": "import AMTIForce2 as af"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99568:Import_L40_C0", "label": "threading import threading", "type": "import", "loc": [40, 40], "level": 0, "parent": null, "vector": [1, 0, 0.4762, 0.0119, 0, 0.66, 0.625, 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_99568:Import_L41_C0", "label": "time import time", "type": "import", "loc": [41, 41], "level": 0, "parent": null, "vector": [1, 0, 0.4881, 0.0119, 0, 0.66, 0.75, 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_99568:ClassDef_L45_C0", "label": "AMTIForceServer", "type": "class", "loc": [45, 64], "level": 0, "parent": null, "vector": [3, 0, 0.6488, 0.2381, 0, 0.66, 0.875, 362, 0, 2, 0, 0, 634, 0, 14], "semantic": {"name": "AMTIForceServer", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class AMTIForceServer(threading.Thread):\n def __init__(self, device_path, str_id):\n threading.Thread.__init__(self)\n try:\n rospy.init_node('AMTIForceServer')\n print('AMTIForceServer: ros is up!')\n except rospy.ROSException:\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99568:FunctionDef_L46_C4", "label": "__init__", "type": "function", "loc": [46, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99568:ClassDef_L45_C0", "vector": [2, 1, 0.619, 0.1548, 1, 0.46, 0.0, 555, 0, 3, 0, 0, 0, 0, 7], "semantic": {"name": "__init__", "arg_names": ["self", "device_path", "str_id"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, device_path, str_id):\n threading.Thread.__init__(self)\n try:\n rospy.init_node('AMTIForceServer')\n print('AMTIForceServer: ros is up!')\n except rospy.ROSException:\n pass\n print('AMTIForceServer: connecting to', device_path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99568:Expr_L47_C8", "label": "__init__()", "type": "expression", "loc": [47, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99568:FunctionDef_L46_C4", "vector": [8, 2, 0.5595, 0.0119, 2, 0.89, 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_99568:Try_L48_C8", "label": "try", "type": "try", "loc": [48, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99568:FunctionDef_L46_C4", "vector": [7, 2, 0.5952, 0.0595, 2, 0.89, 0.1667, 0, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n rospy.init_node('AMTIForceServer')\n print('AMTIForceServer: ros is up!')\n except rospy.ROSException:\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99568:Expr_L49_C12", "label": "init_node()", "type": "expression", "loc": [49, 49], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99568:Try_L48_C8", "vector": [8, 3, 0.5833, 0.0119, 3, 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('AMTIForceServer')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99568:Expr_L50_C12", "label": "print()", "type": "expression", "loc": [50, 50], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99568:Try_L48_C8", "vector": [8, 3, 0.5952, 0.0119, 3, 0.45, 1.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('AMTIForceServer: ros is up!')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99568:Expr_L53_C8", "label": "print()", "type": "expression", "loc": [53, 53], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99568:FunctionDef_L46_C4", "vector": [8, 2, 0.631, 0.0119, 2, 0.89, 0.3333, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('AMTIForceServer: connecting to', device_path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99568:Assign_L54_C8", "label": "self.force_plate = AMTI_force()", "type": "assigned_variable", "loc": [54, 54], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99568:FunctionDef_L46_C4", "vector": [14, 2, 0.6429, 0.0119, 2, 0.89, 0.5, 119, 3, 1, 0, 0, 808, 10, 1], "semantic": {"name": "self.force_plate", "arg_names": [], "import_names": [], "rhs_call_name": "AMTI_force", "annotation": ""}, "snippet": " self.force_plate = af.AMTI_force(device_path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99568:Assign_L56_C8", "label": "name =", "type": "assigned_variable", "loc": [56, 56], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99568:FunctionDef_L46_C4", "vector": [14, 2, 0.6667, 0.0119, 2, 0.89, 0.6667, 57, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " name = 'force_torque_' + str_id"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99568:Expr_L57_C8", "label": "print()", "type": "expression", "loc": [57, 57], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99568:FunctionDef_L46_C4", "vector": [8, 2, 0.6786, 0.0119, 2, 0.89, 0.8333, 535, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('AMTIForceServer: publishing', name, 'with type FloatArray')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99568:Assign_L58_C8", "label": "self.channel = Publisher()", "type": "assigned_variable", "loc": [58, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99568:FunctionDef_L46_C4", "vector": [14, 2, 0.6905, 0.0119, 2, 0.89, 1.0, 503, 3, 3, 0, 0, 45, 10, 1], "semantic": {"name": "self.channel", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " self.channel = rospy.Publisher(name, FloatArray, tcp_nodelay=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99568:FunctionDef_L60_C4", "label": "broadcast", "type": "function", "loc": [60, 64], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99568:ClassDef_L45_C0", "vector": [2, 1, 0.7381, 0.0595, 1, 0.46, 1.0, 803, 0, 1, 0, 0, 0, 0, 7], "semantic": {"name": "broadcast", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def broadcast(self):\n print('AMTIForceServer: started!')\n while not rospy.is_shutdown():\n time.sleep(1/5000.0)\n self.channel.publish(FloatArray(None, self.force_plate.read().T.tolist()[0]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99568:Expr_L61_C8", "label": "print()", "type": "expression", "loc": [61, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99568:FunctionDef_L60_C4", "vector": [8, 2, 0.7262, 0.0119, 2, 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('AMTIForceServer: started!')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99568:While_L62_C8", "label": "while", "type": "while", "loc": [62, 64], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99568:FunctionDef_L60_C4", "vector": [5, 2, 0.75, 0.0357, 2, 0.79, 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 time.sleep(1/5000.0)\n self.channel.publish(FloatArray(None, self.force_plate.read().T.tolist()[0]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99568:Expr_L63_C12", "label": "sleep()", "type": "expression", "loc": [63, 63], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99568:While_L62_C8", "vector": [8, 3, 0.75, 0.0119, 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": " time.sleep(1/5000.0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99568:Expr_L64_C12", "label": "publish()", "type": "expression", "loc": [64, 64], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99568:While_L62_C8", "vector": [8, 3, 0.7619, 0.0119, 3, 0.61, 1.0, 102, 3, 1, 0, 0, 0, 0, 4], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.channel.publish(FloatArray(None, self.force_plate.read().T.tolist()[0]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99568:If_L72_C0", "label": "if", "type": "if", "loc": [72, 82], "level": 0, "parent": null, "vector": [4, 0, 0.9167, 0.131, 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 import optparse\n p = optparse.OptionParser()\n p.add_option('--path', action='store', default='/dev/robot/force_plate0', type = 'string',\n dest='path', help='path to force torque device in (linux)')\n p.add_option('--name', action='store', default='ft1', type='string', \n dest='name', help='name given to FTSensor')\n opt, args = p.parse_args()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99568:Import_L73_C4", "label": "optparse import optparse", "type": "import", "loc": [73, 73], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99568:If_L72_C0", "vector": [1, 1, 0.869, 0.0119, 1, 0.9, 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_99568:Assign_L74_C4", "label": "p = OptionParser()", "type": "assigned_variable", "loc": [74, 74], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99568:If_L72_C0", "vector": [14, 1, 0.881, 0.0119, 1, 0.9, 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_99568:Expr_L75_C4", "label": "add_option()", "type": "expression", "loc": [75, 76], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99568:If_L72_C0", "vector": [8, 1, 0.8988, 0.0238, 1, 0.9, 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('--path', action='store', default='/dev/robot/force_plate0', type = 'string',\n dest='path', help='path to force torque device in (linux)')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99568:Expr_L77_C4", "label": "add_option()", "type": "expression", "loc": [77, 78], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99568:If_L72_C0", "vector": [8, 1, 0.9226, 0.0238, 1, 0.9, 0.5, 176, 3, 6, 0, 0, 0, 0, 1], "semantic": {"name": "add_option", "arg_names": [], "import_names": [], "rhs_call_name": "add_option", "annotation": ""}, "snippet": " p.add_option('--name', action='store', default='ft1', type='string', \n dest='name', help='name given to FTSensor')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99568:Assign_L79_C4", "label": "opt, args = parse_args()", "type": "assigned_variable", "loc": [79, 79], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99568:If_L72_C0", "vector": [14, 1, 0.9405, 0.0119, 1, 0.9, 0.6667, 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_99568:Assign_L81_C4", "label": "server = AMTIForceServer()", "type": "assigned_variable", "loc": [81, 81], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99568:If_L72_C0", "vector": [14, 1, 0.9643, 0.0119, 1, 0.9, 0.8333, 268, 3, 2, 0, 0, 362, 10, 1], "semantic": {"name": "server", "arg_names": [], "import_names": [], "rhs_call_name": "AMTIForceServer", "annotation": ""}, "snippet": " server = AMTIForceServer(opt.path, opt.name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99568:Expr_L82_C4", "label": "broadcast()", "type": "expression", "loc": [82, 82], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99568:If_L72_C0", "vector": [8, 1, 0.9762, 0.0119, 1, 0.9, 1.0, 803, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "broadcast", "arg_names": [], "import_names": [], "rhs_call_name": "broadcast", "annotation": ""}, "snippet": " server.broadcast()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99568:ClassDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99568:FunctionDef_L46_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99568:FunctionDef_L46_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99568:Expr_L47_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99568:FunctionDef_L46_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99568:Try_L48_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99568:Try_L48_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99568:Expr_L49_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99568:Try_L48_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99568:Expr_L50_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99568:FunctionDef_L46_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99568:Expr_L53_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99568:FunctionDef_L46_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99568:Assign_L54_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99568:FunctionDef_L46_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99568:Assign_L56_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99568:FunctionDef_L46_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99568:Expr_L57_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99568:FunctionDef_L46_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99568:Assign_L58_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99568:ClassDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99568:FunctionDef_L60_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99568:FunctionDef_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99568:Expr_L61_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99568:FunctionDef_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99568:While_L62_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99568:While_L62_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99568:Expr_L63_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99568:While_L62_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99568:Expr_L64_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99568:If_L72_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99568:Import_L73_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99568:If_L72_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99568:Assign_L74_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99568:If_L72_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99568:Expr_L75_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99568:If_L72_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99568:Expr_L77_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99568:If_L72_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99568:Assign_L79_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99568:If_L72_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99568:Assign_L81_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99568:If_L72_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99568:Expr_L82_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 (Healthcare Robotics Lab, Georgia Tech.) # \author Cressel Anderson (Healthcare Robotics Lab, Georgia Tech.) # \author Hai Nguyen (Healthcare Robotics Lab, Georgia Tech.) import time, os, copy import serial, numpy as np import threading from threading import RLock class AMTI_force: def __init__(self, dev_name="/dev/robot/force_plate0", broadcast=True): self.dev_name = dev_name self.serial_dev = open_serial(dev_name, 57600) self.offset = None if not self._reset(): while not self._reset(): time.sleep(50/1000.0) self.last_value = self._read_once() def read(self): reading = self._read_once() while (reading == self.last_value).all(): time.sleep(8/1000.0) reading = self._read_once() return reading def _reset(self): self.serial_dev.write('R') self.serial_dev.flushInput() self.serial_dev.flushOutput() self.serial_dev.write('Q') x = self.serial_dev.read(1) print 'AMTI_force._reset: resetting.' return x == 'U' def _read_once(self): #Read until succeeds while True: x = self.serial_dev.read(24) if len(x) > 0: ret, error = stream_to_values(x) ret[0,0] = 4.448221628254617 * ret[0,0] ret[1,0] = 4.448221628254617 * ret[1,0] ret[2,0] = 4.448221628254617 * ret[2,0] ret[3,0] = 4.448221628254617 * 0.0254 * ret[3,0] ret[4,0] = 4.448221628254617 * 0.0254 * ret[4,0] ret[5,0] = 4.448221628254617 * 0.0254 * ret[5,0] if error: time.sleep(50/1000.0) self._reset() else: ft_vector = ret ft_vector[0,0] = -ft_vector[0,0] * 1.8 ft_vector[1,0] = ft_vector[1,0] * 1.7 ft_vector[2,0] = -ft_vector[2,0] ft_vector[3,0] = -ft_vector[3,0] ft_vector[5,0] = -ft_vector[5,0] return ft_vector COEFF_MAT = np.matrix([[ 0.0032206,-0.0000321,0.0003082,-0.0032960,-0.0000117,-0.0002678,0.0032446,0.0000940,0.0001793,-0.0031230,-0.0000715,-0.0002365], [ -0.0001470,0.0032134,0.0004389,0.0000222,0.0032134,0.0003946,0.0000684,-0.0031486,0.0000523,-0.0000209,-0.0031797,-0.0001470], [ -0.0006416,-0.0005812,-0.0087376,-0.0006207,-0.0005215,-0.0086779,-0.0006731,-0.0008607,-0.0087900,-0.0005766,-0.0007237,-0.0084300], [ 0.0000000,0.0000000,-0.0279669,0.0000000,0.0000000,-0.0269454,0.0000000,0.0000000,0.0281477,0.0000000,0.0000000,0.0268347], [ 0.0000000,0.0000000,0.0273877,0.0000000,0.0000000,-0.0269034,0.0000000,0.0000000,0.0278664,0.0000000,0.0000000,-0.0272117], [ -0.0123918,0.0124854,0.0000917,0.0126818,-0.0124854,0.0000911,0.0124843,-0.0122338,0.0000923,-0.0120165,0.0123544,0.0000885]]) def open_serial(dev_name, baudrate): serial_dev = serial.Serial(dev_name, timeout=4.) serial_dev.setBaudrate(baudrate) serial_dev.setParity('N') serial_dev.setStopbits(1) serial_dev.open() serial_dev.flushOutput() serial_dev.flushInput() serial_dev.write('R') time.sleep(1.) if(serial_dev == None): raise RuntimeError("AMTI_force: Serial port not found!\n") return serial_dev def stream_to_values(data): val = np.matrix(np.zeros((12,1))) val[0,0] = ord(data[0]) + 256*(ord(data[1])%16) val[1,0] = ord(data[2]) + 256*(ord(data[3])%16) val[2,0] = ord(data[4]) + 256*(ord(data[5])%16) val[3,0] = ord(data[6]) + 256*(ord(data[7])%16) val[4,0] = ord(data[8]) + 256*(ord(data[9])%16) val[5,0] = ord(data[10]) + 256*(ord(data[11])%16) val[6,0] = ord(data[12]) + 256*(ord(data[13])%16) val[7,0] = ord(data[14]) + 256*(ord(data[15])%16) val[8,0] = ord(data[16]) + 256*(ord(data[17])%16) val[9,0] = ord(data[18]) + 256*(ord(data[19])%16) val[10,0] = ord(data[20]) + 256*(ord(data[21])%16) val[11,0] = ord(data[22]) + 256*(ord(data[23])%16) error = ord(data[1])/16 != 0 or ord(data[3])/16 != 1 or ord(data[5])/16 != 2 or \ ord(data[7])/16 != 3 or ord(data[9])/16 != 4 or ord(data[11])/16 != 5 or\ ord(data[13])/16 != 6 or ord(data[15])/16 != 7 or ord(data[17])/16 != 8 or \ ord(data[19])/16 != 9 or ord(data[21])/16 != 10 or ord(data[23])/16 != 11 return COEFF_MAT * val, error
ajibawa-2023/Python-Code-Large/train/row_99569
77
130
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99569:Import_L32_C0", "label": "time import time, os, copy", "type": "import", "loc": [32, 32], "level": 0, "parent": null, "vector": [1, 0, 0.2462, 0.0077, 0, 0.66, 0.0, 654, 0, 3, 0, 0, 654, 0, 0], "semantic": {"name": "time", "arg_names": [], "import_names": ["time", "os", "copy"], "rhs_call_name": "", "annotation": ""}, "snippet": "import time, os, copy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99569:Import_L33_C0", "label": "serial import serial, np", "type": "import", "loc": [33, 33], "level": 0, "parent": null, "vector": [1, 0, 0.2538, 0.0077, 0, 0.66, 0.1429, 601, 0, 2, 0, 0, 601, 0, 0], "semantic": {"name": "serial", "arg_names": [], "import_names": ["serial", "np"], "rhs_call_name": "", "annotation": ""}, "snippet": "import serial, numpy as np"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99569:Import_L34_C0", "label": "threading import threading", "type": "import", "loc": [34, 34], "level": 0, "parent": null, "vector": [1, 0, 0.2615, 0.0077, 0, 0.66, 0.2857, 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_99569:ImportFrom_L35_C0", "label": "from threading import RLock", "type": "import", "loc": [35, 35], "level": 0, "parent": null, "vector": [1, 0, 0.2692, 0.0077, 0, 0.66, 0.4286, 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_99569:ClassDef_L37_C0", "label": "AMTI_force", "type": "class", "loc": [37, 85], "level": 0, "parent": null, "vector": [3, 0, 0.4692, 0.3769, 0, 0.66, 0.5714, 808, 0, 4, 0, 0, 0, 0, 20], "semantic": {"name": "AMTI_force", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class AMTI_force:\n def __init__(self, dev_name=\"/dev/robot/force_plate0\", broadcast=True):\n self.dev_name = dev_name\n self.serial_dev = open_serial(dev_name, 57600)\n self.offset = None\n if not self._reset():\n while not self._reset():\n time.sleep(50/1000.0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99569:FunctionDef_L38_C4", "label": "__init__", "type": "function", "loc": [38, 45], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99569:ClassDef_L37_C0", "vector": [2, 1, 0.3192, 0.0615, 1, 0.99, 0.0, 555, 0, 3, 0, 0, 0, 0, 5], "semantic": {"name": "__init__", "arg_names": ["self", "dev_name", "broadcast"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, dev_name=\"/dev/robot/force_plate0\", broadcast=True):\n self.dev_name = dev_name\n self.serial_dev = open_serial(dev_name, 57600)\n self.offset = None\n if not self._reset():\n while not self._reset():\n time.sleep(50/1000.0)\n self.last_value = self._read_once()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99569:Assign_L39_C8", "label": "self.dev_name =", "type": "assigned_variable", "loc": [39, 39], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99569:FunctionDef_L38_C4", "vector": [14, 2, 0.3, 0.0077, 2, 0.41, 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_99569:Assign_L40_C8", "label": "self.serial_dev = open_serial()", "type": "assigned_variable", "loc": [40, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99569:FunctionDef_L38_C4", "vector": [14, 2, 0.3077, 0.0077, 2, 0.41, 0.25, 390, 3, 2, 0, 0, 329, 10, 1], "semantic": {"name": "self.serial_dev", "arg_names": [], "import_names": [], "rhs_call_name": "open_serial", "annotation": ""}, "snippet": " self.serial_dev = open_serial(dev_name, 57600)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99569:Assign_L41_C8", "label": "self.offset =", "type": "assigned_variable", "loc": [41, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99569:FunctionDef_L38_C4", "vector": [14, 2, 0.3154, 0.0077, 2, 0.41, 0.5, 746, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.offset", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.offset = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99569:If_L42_C8", "label": "if", "type": "if", "loc": [42, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99569:FunctionDef_L38_C4", "vector": [4, 2, 0.3308, 0.0231, 2, 0.41, 0.75, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self._reset():\n while not self._reset():\n time.sleep(50/1000.0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99569:While_L43_C12", "label": "while", "type": "while", "loc": [43, 44], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99569:If_L42_C8", "vector": [5, 3, 0.3346, 0.0154, 3, 0.61, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while not self._reset():\n time.sleep(50/1000.0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99569:Expr_L44_C16", "label": "sleep()", "type": "expression", "loc": [44, 44], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99569:While_L43_C12", "vector": [8, 4, 0.3385, 0.0077, 4, 0.98, 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(50/1000.0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99569:Assign_L45_C8", "label": "self.last_value = _read_once()", "type": "assigned_variable", "loc": [45, 45], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99569:FunctionDef_L38_C4", "vector": [14, 2, 0.3462, 0.0077, 2, 0.41, 1.0, 589, 3, 0, 0, 0, 458, 10, 1], "semantic": {"name": "self.last_value", "arg_names": [], "import_names": [], "rhs_call_name": "_read_once", "annotation": ""}, "snippet": " self.last_value = self._read_once()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99569:FunctionDef_L47_C4", "label": "read", "type": "function", "loc": [47, 52], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99569:ClassDef_L37_C0", "vector": [2, 1, 0.3808, 0.0462, 1, 0.99, 0.3333, 453, 0, 1, 1, 0, 0, 0, 4], "semantic": {"name": "read", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def read(self):\n reading = self._read_once()\n while (reading == self.last_value).all():\n time.sleep(8/1000.0)\n reading = self._read_once()\n return reading"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99569:Assign_L48_C8", "label": "reading = _read_once()", "type": "assigned_variable", "loc": [48, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99569:FunctionDef_L47_C4", "vector": [14, 2, 0.3692, 0.0077, 2, 0.77, 0.0, 549, 3, 0, 0, 0, 458, 10, 1], "semantic": {"name": "reading", "arg_names": [], "import_names": [], "rhs_call_name": "_read_once", "annotation": ""}, "snippet": " reading = self._read_once()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99569:While_L49_C8", "label": "while", "type": "while", "loc": [49, 51], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99569:FunctionDef_L47_C4", "vector": [5, 2, 0.3846, 0.0231, 2, 0.77, 0.5, 0, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while (reading == self.last_value).all():\n time.sleep(8/1000.0)\n reading = self._read_once()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99569:Expr_L50_C12", "label": "sleep()", "type": "expression", "loc": [50, 50], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99569:While_L49_C8", "vector": [8, 3, 0.3846, 0.0077, 3, 0.98, 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(8/1000.0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99569:Assign_L51_C12", "label": "reading = _read_once()", "type": "assigned_variable", "loc": [51, 51], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99569:While_L49_C8", "vector": [14, 3, 0.3923, 0.0077, 3, 0.98, 1.0, 549, 3, 0, 0, 0, 458, 10, 1], "semantic": {"name": "reading", "arg_names": [], "import_names": [], "rhs_call_name": "_read_once", "annotation": ""}, "snippet": " reading = self._read_once()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99569:Return_L52_C8", "label": "return", "type": "return", "loc": [52, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99569:FunctionDef_L47_C4", "vector": [13, 2, 0.4, 0.0077, 2, 0.77, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return reading"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99569:FunctionDef_L54_C4", "label": "_reset", "type": "function", "loc": [54, 61], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99569:ClassDef_L37_C0", "vector": [2, 1, 0.4423, 0.0615, 1, 0.99, 0.6667, 382, 0, 1, 1, 0, 0, 0, 6], "semantic": {"name": "_reset", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _reset(self):\n self.serial_dev.write('R')\n self.serial_dev.flushInput()\n self.serial_dev.flushOutput()\n self.serial_dev.write('Q')\n x = self.serial_dev.read(1)\n print('AMTI_force._reset: resetting.')\n return x == 'U'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99569:Expr_L55_C8", "label": "write()", "type": "expression", "loc": [55, 55], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99569:FunctionDef_L54_C4", "vector": [8, 2, 0.4231, 0.0077, 2, 0.53, 0.0, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " self.serial_dev.write('R')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99569:Expr_L56_C8", "label": "flushInput()", "type": "expression", "loc": [56, 56], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99569:FunctionDef_L54_C4", "vector": [8, 2, 0.4308, 0.0077, 2, 0.53, 0.1667, 284, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "flushInput", "arg_names": [], "import_names": [], "rhs_call_name": "flushInput", "annotation": ""}, "snippet": " self.serial_dev.flushInput()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99569:Expr_L57_C8", "label": "flushOutput()", "type": "expression", "loc": [57, 57], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99569:FunctionDef_L54_C4", "vector": [8, 2, 0.4385, 0.0077, 2, 0.53, 0.3333, 24, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "flushOutput", "arg_names": [], "import_names": [], "rhs_call_name": "flushOutput", "annotation": ""}, "snippet": " self.serial_dev.flushOutput()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99569:Expr_L58_C8", "label": "write()", "type": "expression", "loc": [58, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99569:FunctionDef_L54_C4", "vector": [8, 2, 0.4462, 0.0077, 2, 0.53, 0.5, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " self.serial_dev.write('Q')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99569:Assign_L59_C8", "label": "x = read()", "type": "assigned_variable", "loc": [59, 59], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99569:FunctionDef_L54_C4", "vector": [14, 2, 0.4538, 0.0077, 2, 0.53, 0.6667, 190, 3, 1, 0, 0, 453, 10, 1], "semantic": {"name": "x", "arg_names": [], "import_names": [], "rhs_call_name": "read", "annotation": ""}, "snippet": " x = self.serial_dev.read(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99569:Expr_L60_C8", "label": "print()", "type": "expression", "loc": [60, 60], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99569:FunctionDef_L54_C4", "vector": [8, 2, 0.4615, 0.0077, 2, 0.53, 0.8333, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('AMTI_force._reset: resetting.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99569:Return_L61_C8", "label": "return", "type": "return", "loc": [61, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99569:FunctionDef_L54_C4", "vector": [13, 2, 0.4692, 0.0077, 2, 0.53, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return x == 'U'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99569:FunctionDef_L63_C4", "label": "_read_once", "type": "function", "loc": [63, 85], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99569:ClassDef_L37_C0", "vector": [2, 1, 0.5692, 0.1769, 1, 0.99, 1.0, 458, 0, 1, 1, 0, 0, 0, 5], "semantic": {"name": "_read_once", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _read_once(self):\n #Read until succeeds\n while True:\n x = self.serial_dev.read(24)\n if len(x) > 0:\n ret, error = stream_to_values(x)\n ret[0,0] = 4.448221628254617 * ret[0,0]\n ret[1,0] = 4.448221628254617 * ret[1,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99569:While_L65_C8", "label": "while", "type": "while", "loc": [65, 85], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99569:FunctionDef_L63_C4", "vector": [5, 2, 0.5769, 0.1615, 2, 0.58, 0.0, 0, 1, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while True:\n x = self.serial_dev.read(24)\n if len(x) > 0:\n ret, error = stream_to_values(x)\n ret[0,0] = 4.448221628254617 * ret[0,0]\n ret[1,0] = 4.448221628254617 * ret[1,0]\n ret[2,0] = 4.448221628254617 * ret[2,0]\n ret[3,0] = 4.448221628254617 * 0.0254 * ret[3,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99569:Assign_L66_C12", "label": "x = read()", "type": "assigned_variable", "loc": [66, 66], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99569:While_L65_C8", "vector": [14, 3, 0.5077, 0.0077, 3, 0.02, 0.0, 190, 3, 1, 0, 0, 453, 10, 1], "semantic": {"name": "x", "arg_names": [], "import_names": [], "rhs_call_name": "read", "annotation": ""}, "snippet": " x = self.serial_dev.read(24)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99569:If_L67_C12", "label": "if", "type": "if", "loc": [67, 85], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99569:While_L65_C8", "vector": [4, 3, 0.5846, 0.1462, 3, 0.02, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(x) > 0:\n ret, error = stream_to_values(x)\n ret[0,0] = 4.448221628254617 * ret[0,0]\n ret[1,0] = 4.448221628254617 * ret[1,0]\n ret[2,0] = 4.448221628254617 * ret[2,0]\n ret[3,0] = 4.448221628254617 * 0.0254 * ret[3,0]\n ret[4,0] = 4.448221628254617 * 0.0254 * ret[4,0]\n ret[5,0] = 4.448221628254617 * 0.0254 * ret[5,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99569:Assign_L68_C16", "label": "ret, error = stream_to_values()", "type": "assigned_variable", "loc": [68, 68], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99569:If_L67_C12", "vector": [14, 4, 0.5231, 0.0077, 4, 0.92, 0.0, 439, 3, 1, 0, 0, 201, 10, 1], "semantic": {"name": "ret, error", "arg_names": [], "import_names": [], "rhs_call_name": "stream_to_values", "annotation": ""}, "snippet": " ret, error = stream_to_values(x)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99569:Assign_L69_C16", "label": "assign", "type": "assigned_variable", "loc": [69, 69], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99569:If_L67_C12", "vector": [14, 4, 0.5308, 0.0077, 4, 0.92, 0.1429, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ret[0,0] = 4.448221628254617 * ret[0,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99569:Assign_L70_C16", "label": "assign", "type": "assigned_variable", "loc": [70, 70], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99569:If_L67_C12", "vector": [14, 4, 0.5385, 0.0077, 4, 0.92, 0.2857, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ret[1,0] = 4.448221628254617 * ret[1,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99569:Assign_L71_C16", "label": "assign", "type": "assigned_variable", "loc": [71, 71], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99569:If_L67_C12", "vector": [14, 4, 0.5462, 0.0077, 4, 0.92, 0.4286, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ret[2,0] = 4.448221628254617 * ret[2,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99569:Assign_L72_C16", "label": "assign", "type": "assigned_variable", "loc": [72, 72], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99569:If_L67_C12", "vector": [14, 4, 0.5538, 0.0077, 4, 0.92, 0.5714, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ret[3,0] = 4.448221628254617 * 0.0254 * ret[3,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99569:Assign_L73_C16", "label": "assign", "type": "assigned_variable", "loc": [73, 73], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99569:If_L67_C12", "vector": [14, 4, 0.5615, 0.0077, 4, 0.92, 0.7143, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ret[4,0] = 4.448221628254617 * 0.0254 * ret[4,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99569:Assign_L74_C16", "label": "assign", "type": "assigned_variable", "loc": [74, 74], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99569:If_L67_C12", "vector": [14, 4, 0.5692, 0.0077, 4, 0.92, 0.8571, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ret[5,0] = 4.448221628254617 * 0.0254 * ret[5,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99569:If_L75_C16", "label": "if", "type": "if", "loc": [75, 85], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99569:If_L67_C12", "vector": [4, 4, 0.6154, 0.0846, 4, 0.92, 1.0, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if error:\n time.sleep(50/1000.0)\n self._reset()\n else:\n ft_vector = ret\n ft_vector[0,0] = -ft_vector[0,0] * 1.8\n ft_vector[1,0] = ft_vector[1,0] * 1.7\n ft_vector[2,0] = -ft_vector[2,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99569:Expr_L76_C20", "label": "sleep()", "type": "expression", "loc": [76, 76], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99569:If_L75_C16", "vector": [8, 5, 0.5846, 0.0077, 5, 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(50/1000.0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99569:Expr_L77_C20", "label": "_reset()", "type": "expression", "loc": [77, 77], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99569:If_L75_C16", "vector": [8, 5, 0.5923, 0.0077, 5, 0.23, 0.125, 382, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_reset", "arg_names": [], "import_names": [], "rhs_call_name": "_reset", "annotation": ""}, "snippet": " self._reset()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99569:Assign_L79_C20", "label": "ft_vector =", "type": "assigned_variable", "loc": [79, 79], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99569:If_L75_C16", "vector": [14, 5, 0.6077, 0.0077, 5, 0.23, 0.25, 542, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ft_vector", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ft_vector = ret"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99569:Assign_L80_C20", "label": "assign", "type": "assigned_variable", "loc": [80, 80], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99569:If_L75_C16", "vector": [14, 5, 0.6154, 0.0077, 5, 0.23, 0.375, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ft_vector[0,0] = -ft_vector[0,0] * 1.8"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99569:Assign_L81_C20", "label": "assign", "type": "assigned_variable", "loc": [81, 81], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99569:If_L75_C16", "vector": [14, 5, 0.6231, 0.0077, 5, 0.23, 0.5, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ft_vector[1,0] = ft_vector[1,0] * 1.7"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99569:Assign_L82_C20", "label": "assign", "type": "assigned_variable", "loc": [82, 82], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99569:If_L75_C16", "vector": [14, 5, 0.6308, 0.0077, 5, 0.23, 0.625, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ft_vector[2,0] = -ft_vector[2,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99569:Assign_L83_C20", "label": "assign", "type": "assigned_variable", "loc": [83, 83], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99569:If_L75_C16", "vector": [14, 5, 0.6385, 0.0077, 5, 0.23, 0.75, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ft_vector[3,0] = -ft_vector[3,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99569:Assign_L84_C20", "label": "assign", "type": "assigned_variable", "loc": [84, 84], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99569:If_L75_C16", "vector": [14, 5, 0.6462, 0.0077, 5, 0.23, 0.875, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ft_vector[5,0] = -ft_vector[5,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99569:Return_L85_C20", "label": "return", "type": "return", "loc": [85, 85], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99569:If_L75_C16", "vector": [13, 5, 0.6538, 0.0077, 5, 0.23, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ft_vector"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99569:Assign_L88_C0", "label": "COEFF_MAT = matrix()", "type": "assigned_variable", "loc": [88, 93], "level": 0, "parent": null, "vector": [14, 0, 0.6962, 0.0462, 0, 0.66, 0.7143, 12, 3, 1, 0, 0, 162, 10, 1], "semantic": {"name": "COEFF_MAT", "arg_names": [], "import_names": [], "rhs_call_name": "matrix", "annotation": ""}, "snippet": "COEFF_MAT = np.matrix([[ 0.0032206,-0.0000321,0.0003082,-0.0032960,-0.0000117,-0.0002678,0.0032446,0.0000940,0.0001793,-0.0031230,-0.0000715,-0.0002365],\n [ -0.0001470,0.0032134,0.0004389,0.0000222,0.0032134,0.0003946,0.0000684,-0.0031486,0.0000523,-0.0000209,-0.0031797,-0.0001470],\n [ -0.0006416,-0.0005812,-0.0087376,-0.0006207,-0.0005215,-0.0086779,-0.0006731,-0.0008607,-0.0087900,-0.0005766,-0.0007237,-0.0084300],\n [ 0.0000000,0.0000000,-0.0279669,0.0000000,0.0000000,-0.0269454,0.0000000,0.0000000,0.0281477,0.0000000,0.0000000,0.0268347],\n [ 0.0000000,0.0000000,0.0273877,0.0000000,0.0000000,-0.0269034,0.0000000,0.0000000,0.0278664,0.0000000,0.0000000,-0.0272117],\n [ -0.0123918,0.0124854,0.0000917,0.0126818,-0.0124854,0.0000911,0.0124843,-0.0122338,0.0000923,-0.0120165,0.0123544,0.0000885]])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99569:FunctionDef_L95_C0", "label": "open_serial", "type": "function", "loc": [95, 108], "level": 0, "parent": null, "vector": [2, 0, 0.7808, 0.1077, 0, 0.66, 0.8571, 329, 0, 2, 1, 0, 0, 0, 10], "semantic": {"name": "open_serial", "arg_names": ["dev_name", "baudrate"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def open_serial(dev_name, baudrate):\n serial_dev = serial.Serial(dev_name, timeout=4.)\n serial_dev.setBaudrate(baudrate)\n serial_dev.setParity('N')\n serial_dev.setStopbits(1)\n serial_dev.open()\n\n serial_dev.flushOutput()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99569:Assign_L96_C4", "label": "serial_dev = Serial()", "type": "assigned_variable", "loc": [96, 96], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99569:FunctionDef_L95_C0", "vector": [14, 1, 0.7385, 0.0077, 1, 0.51, 0.0, 230, 3, 2, 0, 0, 658, 10, 1], "semantic": {"name": "serial_dev", "arg_names": [], "import_names": [], "rhs_call_name": "Serial", "annotation": ""}, "snippet": " serial_dev = serial.Serial(dev_name, timeout=4.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99569:Expr_L97_C4", "label": "setBaudrate()", "type": "expression", "loc": [97, 97], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99569:FunctionDef_L95_C0", "vector": [8, 1, 0.7462, 0.0077, 1, 0.51, 0.1, 209, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setBaudrate", "arg_names": [], "import_names": [], "rhs_call_name": "setBaudrate", "annotation": ""}, "snippet": " serial_dev.setBaudrate(baudrate)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99569:Expr_L98_C4", "label": "setParity()", "type": "expression", "loc": [98, 98], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99569:FunctionDef_L95_C0", "vector": [8, 1, 0.7538, 0.0077, 1, 0.51, 0.2, 205, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setParity", "arg_names": [], "import_names": [], "rhs_call_name": "setParity", "annotation": ""}, "snippet": " serial_dev.setParity('N')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99569:Expr_L99_C4", "label": "setStopbits()", "type": "expression", "loc": [99, 99], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99569:FunctionDef_L95_C0", "vector": [8, 1, 0.7615, 0.0077, 1, 0.51, 0.3, 918, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setStopbits", "arg_names": [], "import_names": [], "rhs_call_name": "setStopbits", "annotation": ""}, "snippet": " serial_dev.setStopbits(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99569:Expr_L100_C4", "label": "open()", "type": "expression", "loc": [100, 100], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99569:FunctionDef_L95_C0", "vector": [8, 1, 0.7692, 0.0077, 1, 0.51, 0.4, 693, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "open", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": " serial_dev.open()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99569:Expr_L102_C4", "label": "flushOutput()", "type": "expression", "loc": [102, 102], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99569:FunctionDef_L95_C0", "vector": [8, 1, 0.7846, 0.0077, 1, 0.51, 0.5, 24, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "flushOutput", "arg_names": [], "import_names": [], "rhs_call_name": "flushOutput", "annotation": ""}, "snippet": " serial_dev.flushOutput()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99569:Expr_L103_C4", "label": "flushInput()", "type": "expression", "loc": [103, 103], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99569:FunctionDef_L95_C0", "vector": [8, 1, 0.7923, 0.0077, 1, 0.51, 0.6, 284, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "flushInput", "arg_names": [], "import_names": [], "rhs_call_name": "flushInput", "annotation": ""}, "snippet": " serial_dev.flushInput()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99569:Expr_L104_C4", "label": "write()", "type": "expression", "loc": [104, 104], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99569:FunctionDef_L95_C0", "vector": [8, 1, 0.8, 0.0077, 1, 0.51, 0.7, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " serial_dev.write('R')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99569:Expr_L105_C4", "label": "sleep()", "type": "expression", "loc": [105, 105], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99569:FunctionDef_L95_C0", "vector": [8, 1, 0.8077, 0.0077, 1, 0.51, 0.8, 476, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " time.sleep(1.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99569:If_L106_C4", "label": "if", "type": "if", "loc": [106, 107], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99569:FunctionDef_L95_C0", "vector": [4, 1, 0.8192, 0.0154, 1, 0.51, 0.9, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if(serial_dev == None):\n raise RuntimeError(\"AMTI_force: Serial port not found!\\n\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99569:Return_L108_C4", "label": "return", "type": "return", "loc": [108, 108], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99569:FunctionDef_L95_C0", "vector": [13, 1, 0.8308, 0.0077, 1, 0.51, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return serial_dev"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99569:FunctionDef_L110_C0", "label": "stream_to_values", "type": "function", "loc": [110, 129], "level": 0, "parent": null, "vector": [2, 0, 0.9192, 0.1538, 0, 0.66, 1.0, 201, 0, 1, 1, 0, 0, 0, 38], "semantic": {"name": "stream_to_values", "arg_names": ["data"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def stream_to_values(data):\n val = np.matrix(np.zeros((12,1)))\n val[0,0] = ord(data[0]) + 256*(ord(data[1])%16)\n val[1,0] = ord(data[2]) + 256*(ord(data[3])%16)\n val[2,0] = ord(data[4]) + 256*(ord(data[5])%16)\n val[3,0] = ord(data[6]) + 256*(ord(data[7])%16)\n val[4,0] = ord(data[8]) + 256*(ord(data[9])%16)\n val[5,0] = ord(data[10]) + 256*(ord(data[11])%16)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99569:Assign_L111_C4", "label": "val = matrix()", "type": "assigned_variable", "loc": [111, 111], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99569:FunctionDef_L110_C0", "vector": [14, 1, 0.8538, 0.0077, 1, 0.09, 0.0, 618, 3, 1, 0, 0, 162, 10, 2], "semantic": {"name": "val", "arg_names": [], "import_names": [], "rhs_call_name": "matrix", "annotation": ""}, "snippet": " val = np.matrix(np.zeros((12,1)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99569:Assign_L112_C4", "label": "assign", "type": "assigned_variable", "loc": [112, 112], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99569:FunctionDef_L110_C0", "vector": [14, 1, 0.8615, 0.0077, 1, 0.09, 0.0714, 0, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " val[0,0] = ord(data[0]) + 256*(ord(data[1])%16)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99569:Assign_L113_C4", "label": "assign", "type": "assigned_variable", "loc": [113, 113], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99569:FunctionDef_L110_C0", "vector": [14, 1, 0.8692, 0.0077, 1, 0.09, 0.1429, 0, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " val[1,0] = ord(data[2]) + 256*(ord(data[3])%16)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99569:Assign_L114_C4", "label": "assign", "type": "assigned_variable", "loc": [114, 114], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99569:FunctionDef_L110_C0", "vector": [14, 1, 0.8769, 0.0077, 1, 0.09, 0.2143, 0, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " val[2,0] = ord(data[4]) + 256*(ord(data[5])%16)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99569:Assign_L115_C4", "label": "assign", "type": "assigned_variable", "loc": [115, 115], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99569:FunctionDef_L110_C0", "vector": [14, 1, 0.8846, 0.0077, 1, 0.09, 0.2857, 0, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " val[3,0] = ord(data[6]) + 256*(ord(data[7])%16)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99569:Assign_L116_C4", "label": "assign", "type": "assigned_variable", "loc": [116, 116], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99569:FunctionDef_L110_C0", "vector": [14, 1, 0.8923, 0.0077, 1, 0.09, 0.3571, 0, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " val[4,0] = ord(data[8]) + 256*(ord(data[9])%16)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99569:Assign_L117_C4", "label": "assign", "type": "assigned_variable", "loc": [117, 117], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99569:FunctionDef_L110_C0", "vector": [14, 1, 0.9, 0.0077, 1, 0.09, 0.4286, 0, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " val[5,0] = ord(data[10]) + 256*(ord(data[11])%16)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99569:Assign_L118_C4", "label": "assign", "type": "assigned_variable", "loc": [118, 118], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99569:FunctionDef_L110_C0", "vector": [14, 1, 0.9077, 0.0077, 1, 0.09, 0.5, 0, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " val[6,0] = ord(data[12]) + 256*(ord(data[13])%16)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99569:Assign_L119_C4", "label": "assign", "type": "assigned_variable", "loc": [119, 119], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99569:FunctionDef_L110_C0", "vector": [14, 1, 0.9154, 0.0077, 1, 0.09, 0.5714, 0, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " val[7,0] = ord(data[14]) + 256*(ord(data[15])%16)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99569:Assign_L120_C4", "label": "assign", "type": "assigned_variable", "loc": [120, 120], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99569:FunctionDef_L110_C0", "vector": [14, 1, 0.9231, 0.0077, 1, 0.09, 0.6429, 0, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " val[8,0] = ord(data[16]) + 256*(ord(data[17])%16)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99569:Assign_L121_C4", "label": "assign", "type": "assigned_variable", "loc": [121, 121], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99569:FunctionDef_L110_C0", "vector": [14, 1, 0.9308, 0.0077, 1, 0.09, 0.7143, 0, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " val[9,0] = ord(data[18]) + 256*(ord(data[19])%16)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99569:Assign_L122_C4", "label": "assign", "type": "assigned_variable", "loc": [122, 122], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99569:FunctionDef_L110_C0", "vector": [14, 1, 0.9385, 0.0077, 1, 0.09, 0.7857, 0, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " val[10,0] = ord(data[20]) + 256*(ord(data[21])%16)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99569:Assign_L123_C4", "label": "assign", "type": "assigned_variable", "loc": [123, 123], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99569:FunctionDef_L110_C0", "vector": [14, 1, 0.9462, 0.0077, 1, 0.09, 0.8571, 0, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " val[11,0] = ord(data[22]) + 256*(ord(data[23])%16)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99569:Assign_L124_C4", "label": "error =", "type": "assigned_variable", "loc": [124, 127], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99569:FunctionDef_L110_C0", "vector": [14, 1, 0.9654, 0.0308, 1, 0.09, 0.9286, 771, 0, 0, 0, 0, 0, 0, 12], "semantic": {"name": "error", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " error = ord(data[1])/16 != 0 or ord(data[3])/16 != 1 or ord(data[5])/16 != 2 or \\\n ord(data[7])/16 != 3 or ord(data[9])/16 != 4 or ord(data[11])/16 != 5 or\\\n ord(data[13])/16 != 6 or ord(data[15])/16 != 7 or ord(data[17])/16 != 8 or \\\n ord(data[19])/16 != 9 or ord(data[21])/16 != 10 or ord(data[23])/16 != 11"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99569:Return_L129_C4", "label": "return", "type": "return", "loc": [129, 129], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99569:FunctionDef_L110_C0", "vector": [13, 1, 0.9923, 0.0077, 1, 0.09, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return COEFF_MAT * val, error"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99569:ClassDef_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99569:FunctionDef_L38_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99569:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99569:Assign_L39_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99569:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99569:Assign_L40_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99569:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99569:Assign_L41_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99569:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99569:If_L42_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99569:If_L42_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99569:While_L43_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99569:While_L43_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99569:Expr_L44_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99569:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99569:Assign_L45_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99569:ClassDef_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99569:FunctionDef_L47_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99569:FunctionDef_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99569:Assign_L48_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99569:FunctionDef_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99569:While_L49_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99569:While_L49_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99569:Expr_L50_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99569:While_L49_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99569:Assign_L51_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99569:FunctionDef_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99569:Return_L52_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99569:ClassDef_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99569:FunctionDef_L54_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99569:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99569:Expr_L55_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99569:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99569:Expr_L56_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99569:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99569:Expr_L57_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99569:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99569:Expr_L58_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99569:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99569:Assign_L59_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99569:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99569:Expr_L60_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99569:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99569:Return_L61_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99569:ClassDef_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99569:FunctionDef_L63_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99569:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99569:While_L65_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99569:While_L65_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99569:Assign_L66_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99569:While_L65_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99569:If_L67_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99569:If_L67_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99569:Assign_L68_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99569:If_L67_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99569:Assign_L69_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99569:If_L67_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99569:Assign_L70_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99569:If_L67_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99569:Assign_L71_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99569:If_L67_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99569:Assign_L72_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99569:If_L67_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99569:Assign_L73_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99569:If_L67_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99569:Assign_L74_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99569:If_L67_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99569:If_L75_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99569:If_L75_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99569:Expr_L76_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99569:If_L75_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99569:Expr_L77_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99569:If_L75_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99569:Assign_L79_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99569:If_L75_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99569:Assign_L80_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99569:If_L75_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99569:Assign_L81_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99569:If_L75_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99569:Assign_L82_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99569:If_L75_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99569:Assign_L83_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99569:If_L75_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99569:Assign_L84_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99569:If_L75_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99569:Return_L85_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99569:FunctionDef_L95_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99569:Assign_L96_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99569:FunctionDef_L95_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99569:Expr_L97_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99569:FunctionDef_L95_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99569:Expr_L98_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99569:FunctionDef_L95_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99569:Expr_L99_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99569:FunctionDef_L95_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99569:Expr_L100_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99569:FunctionDef_L95_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99569:Expr_L102_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99569:FunctionDef_L95_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99569:Expr_L103_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99569:FunctionDef_L95_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99569:Expr_L104_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99569:FunctionDef_L95_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99569:Expr_L105_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99569:FunctionDef_L95_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99569:If_L106_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99569:FunctionDef_L95_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99569:Return_L108_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99569:FunctionDef_L110_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99569:Assign_L111_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99569:FunctionDef_L110_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99569:Assign_L112_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99569:FunctionDef_L110_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99569:Assign_L113_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99569:FunctionDef_L110_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99569:Assign_L114_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99569:FunctionDef_L110_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99569:Assign_L115_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99569:FunctionDef_L110_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99569:Assign_L116_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99569:FunctionDef_L110_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99569:Assign_L117_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99569:FunctionDef_L110_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99569:Assign_L118_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99569:FunctionDef_L110_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99569:Assign_L119_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99569:FunctionDef_L110_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99569:Assign_L120_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99569:FunctionDef_L110_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99569:Assign_L121_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99569:FunctionDef_L110_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99569:Assign_L122_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99569:FunctionDef_L110_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99569:Assign_L123_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99569:FunctionDef_L110_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99569:Assign_L124_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99569:FunctionDef_L110_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99569:Return_L129_C4"}]
import roslib; roslib.load_manifest('hrl_lib') import rospy import std_srvs.srv as srv from hrl_msgs.msg import FloatArray import time def cb( msg ): print 'Received msg: ', msg, '\n\tType: ', msg.__class__ return x = 3.0 rospy.init_node('trial_subscriber') sub = rospy.Subscriber('trial_pub', FloatArray, cb) while not rospy.is_shutdown(): rospy.spin()
ajibawa-2023/Python-Code-Large/train/row_99570
14
17
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99570:Import_L1_C0", "label": "roslib import roslib", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0588, 0.0588, 0, 0.66, 0.0, 796, 0, 1, 0, 0, 796, 0, 0], "semantic": {"name": "roslib", "arg_names": [], "import_names": ["roslib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('hrl_lib')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99570:Expr_L1_C15", "label": "load_manifest()", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.0588, 0.0588, 0, 0.66, 0.1, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('hrl_lib')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99570:Import_L2_C0", "label": "rospy import rospy", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.1176, 0.0588, 0, 0.66, 0.2, 164, 0, 1, 0, 0, 164, 0, 0], "semantic": {"name": "rospy", "arg_names": [], "import_names": ["rospy"], "rhs_call_name": "", "annotation": ""}, "snippet": "import rospy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99570:Import_L3_C0", "label": "std_srvs.srv import srv", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.1765, 0.0588, 0, 0.66, 0.3, 261, 0, 1, 0, 0, 261, 0, 0], "semantic": {"name": "std_srvs.srv", "arg_names": [], "import_names": ["srv"], "rhs_call_name": "", "annotation": ""}, "snippet": "import std_srvs.srv as srv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99570:ImportFrom_L4_C0", "label": "from hrl_msgs.msg import FloatArray", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.2353, 0.0588, 0, 0.66, 0.4, 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_99570:Import_L6_C0", "label": "time import time", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.3529, 0.0588, 0, 0.66, 0.5, 654, 0, 1, 0, 0, 654, 0, 0], "semantic": {"name": "time", "arg_names": [], "import_names": ["time"], "rhs_call_name": "", "annotation": ""}, "snippet": "import time"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99570:FunctionDef_L8_C0", "label": "cb", "type": "function", "loc": [8, 10], "level": 0, "parent": null, "vector": [2, 0, 0.5294, 0.1765, 0, 0.66, 0.6, 540, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "cb", "arg_names": ["msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def cb( msg ):\n print('Received msg: ', msg, '\\n\\tType: ', msg.__class__)\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99570:Expr_L9_C4", "label": "print()", "type": "expression", "loc": [9, 9], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99570:FunctionDef_L8_C0", "vector": [8, 1, 0.5294, 0.0588, 1, 0.7, 0.0, 535, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Received msg: ', msg, '\\n\\tType: ', msg.__class__)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99570:Return_L10_C4", "label": "return", "type": "return", "loc": [10, 10], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99570:FunctionDef_L8_C0", "vector": [13, 1, 0.5882, 0.0588, 1, 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_99570:Assign_L12_C0", "label": "x =", "type": "assigned_variable", "loc": [12, 12], "level": 0, "parent": null, "vector": [14, 0, 0.7059, 0.0588, 0, 0.66, 0.7, 190, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "x = 3.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99570:Expr_L13_C0", "label": "init_node()", "type": "expression", "loc": [13, 13], "level": 0, "parent": null, "vector": [8, 0, 0.7647, 0.0588, 0, 0.66, 0.8, 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_subscriber')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99570:Assign_L14_C0", "label": "sub = Subscriber()", "type": "assigned_variable", "loc": [14, 14], "level": 0, "parent": null, "vector": [14, 0, 0.8235, 0.0588, 0, 0.66, 0.9, 819, 3, 3, 0, 0, 455, 10, 1], "semantic": {"name": "sub", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": "sub = rospy.Subscriber('trial_pub', FloatArray, cb)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99570:While_L16_C0", "label": "while", "type": "while", "loc": [16, 17], "level": 0, "parent": null, "vector": [5, 0, 0.9706, 0.1176, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "while not rospy.is_shutdown():\n rospy.spin()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99570:Expr_L17_C4", "label": "spin()", "type": "expression", "loc": [17, 17], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99570:While_L16_C0", "vector": [8, 1, 1.0, 0.0588, 1, 0.54, 0.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_99570:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99570:Expr_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99570:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99570:Return_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99570:While_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99570:Expr_L17_C4"}]
#!/usr/bin/python import roslib roslib.load_manifest('force_torque') import rospy from geometry_msgs.msg import Vector3Stamped from threading import RLock ## 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 FTRelay: def __init__(self): self.lock = RLock() self.fresh = False def set_ft(self, value, time_acquired): self.lock.acquire() self.data = value, time_acquired self.fresh = True self.lock.release() #print 'got', value, time_acquired def get_msg(self): r = None self.lock.acquire() if self.fresh: self.fresh = False r = self.data self.lock.release() return r def FTread_to_Force( ftval, frame_id ): retval = Vector3Stamped() retval.header.stamp = rospy.rostime.get_rostime() retval.header.frame_id = frame_id retval.vector.x = ftval[0] retval.vector.y = ftval[1] retval.vector.z = ftval[2] return retval if __name__ == '__main__': import roslib; roslib.load_manifest('force_torque') import rospy from force_torque.srv import * from hrl_msgs.msg import FloatArray as FloatArray import hrl_lib.rutils as ru import time import force_torque.FTSensor as ftc import numpy as np import optparse p = optparse.OptionParser() p.add_option('--name', action='store', default='ft1', type='string', dest='name', help='name given to FTSensor') opt, args = p.parse_args() node_name = 'FTRelay_' + opt.name ft_channel_name = 'force_torque_' + opt.name service_name = node_name + '_set_ft' print node_name + ': serving service', service_name ftserver = FTRelay() rospy.init_node(node_name) rospy.Service(service_name, StringService, ru.wrap(ftserver.set_ft, ['value', 'time'], response=StringServiceResponse)) channel = rospy.Publisher(ft_channel_name, FloatArray, tcp_nodelay=True) channel2 = rospy.Publisher(ft_channel_name + '_raw', FloatArray, tcp_nodelay=True) chan_vec3 = rospy.Publisher(ft_channel_name + '_Vec3', Vector3Stamped, tcp_nodelay=True) print node_name + ': publishing on channel', ft_channel_name P_force = [1., 1., 1.] xhat_force = [0., 0., 0., 0., 0., 0.] while not rospy.is_shutdown(): msg = ftserver.get_msg() if msg is not None: data, tme = msg ftvalue = ftc.binary_to_ft(data) ftvalue = np.array(ftvalue) for i in range(3): xhat, p = kalman_update(xhat_force[i], P_force[i], 1e-3, 0.04, ftvalue[i]) P_force[i] = p xhat_force[i] = xhat #ftvalue[i] = xhat xhat_force[3] = ftvalue[3] xhat_force[4] = ftvalue[4] xhat_force[5] = ftvalue[5] ftvalue = ftvalue.tolist() channel.publish(FloatArray(rospy.Header(stamp=rospy.Time.from_seconds(tme)), xhat_force)) channel2.publish(FloatArray(rospy.Header(stamp=rospy.Time.from_seconds(tme)), ftvalue)) chan_vec3.publish( FTread_to_Force( ftvalue, opt.name )) #times.append(time.time()) #else: # time.sleep(1/5000.0) time.sleep(1/5000.0) #import pylab as pl #import numpy as np #a = np.array(times) #pl.plot(a[1:] - a[:-1], '.') #pl.show()
ajibawa-2023/Python-Code-Large/train/row_99571
82
126
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99571:Import_L2_C0", "label": "roslib import roslib", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0159, 0.0079, 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_99571:Expr_L3_C0", "label": "load_manifest()", "type": "expression", "loc": [3, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0238, 0.0079, 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('force_torque')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99571:Import_L4_C0", "label": "rospy import rospy", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0317, 0.0079, 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_99571:ImportFrom_L5_C0", "label": "from geometry_msgs.msg import Vector3Stamped", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0397, 0.0079, 0, 0.66, 0.375, 951, 0, 1, 0, 0, 951, 0, 0], "semantic": {"name": "geometry_msgs.msg", "arg_names": [], "import_names": ["Vector3Stamped"], "rhs_call_name": "", "annotation": ""}, "snippet": "from geometry_msgs.msg import Vector3Stamped"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99571:ImportFrom_L8_C0", "label": "from threading import RLock", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.0635, 0.0079, 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_99571:FunctionDef_L13_C0", "label": "kalman_update", "type": "function", "loc": [13, 21], "level": 0, "parent": null, "vector": [2, 0, 0.1349, 0.0714, 0, 0.66, 0.625, 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_99571:Assign_L15_C4", "label": "xhatminus =", "type": "assigned_variable", "loc": [15, 15], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99571:FunctionDef_L13_C0", "vector": [14, 1, 0.119, 0.0079, 1, 0.74, 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_99571:Assign_L16_C4", "label": "Pminus =", "type": "assigned_variable", "loc": [16, 16], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99571:FunctionDef_L13_C0", "vector": [14, 1, 0.127, 0.0079, 1, 0.74, 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_99571:Assign_L18_C4", "label": "K =", "type": "assigned_variable", "loc": [18, 18], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99571:FunctionDef_L13_C0", "vector": [14, 1, 0.1429, 0.0079, 1, 0.74, 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_99571:Assign_L19_C4", "label": "xhat =", "type": "assigned_variable", "loc": [19, 19], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99571:FunctionDef_L13_C0", "vector": [14, 1, 0.1508, 0.0079, 1, 0.74, 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_99571:Assign_L20_C4", "label": "P =", "type": "assigned_variable", "loc": [20, 20], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99571:FunctionDef_L13_C0", "vector": [14, 1, 0.1587, 0.0079, 1, 0.74, 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_99571:Return_L21_C4", "label": "return", "type": "return", "loc": [21, 21], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99571:FunctionDef_L13_C0", "vector": [13, 1, 0.1667, 0.0079, 1, 0.74, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return xhat, P"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99571:ClassDef_L25_C0", "label": "FTRelay", "type": "class", "loc": [25, 44], "level": 0, "parent": null, "vector": [3, 0, 0.2738, 0.1587, 0, 0.66, 0.75, 145, 0, 3, 0, 0, 0, 0, 5], "semantic": {"name": "FTRelay", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class FTRelay:\n def __init__(self):\n self.lock = RLock()\n self.fresh = False\n\n def set_ft(self, value, time_acquired):\n self.lock.acquire()\n self.data = value, time_acquired"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99571:FunctionDef_L26_C4", "label": "__init__", "type": "function", "loc": [26, 28], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99571:ClassDef_L25_C0", "vector": [2, 1, 0.2143, 0.0238, 1, 0.95, 0.0, 555, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self):\n self.lock = RLock()\n self.fresh = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99571:Assign_L27_C8", "label": "self.lock = RLock()", "type": "assigned_variable", "loc": [27, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99571:FunctionDef_L26_C4", "vector": [14, 2, 0.2143, 0.0079, 2, 0.2, 0.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_99571:Assign_L28_C8", "label": "self.fresh =", "type": "assigned_variable", "loc": [28, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99571:FunctionDef_L26_C4", "vector": [14, 2, 0.2222, 0.0079, 2, 0.2, 1.0, 547, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.fresh", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.fresh = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99571:FunctionDef_L30_C4", "label": "set_ft", "type": "function", "loc": [30, 34], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99571:ClassDef_L25_C0", "vector": [2, 1, 0.254, 0.0397, 1, 0.95, 0.5, 211, 0, 3, 0, 0, 0, 0, 2], "semantic": {"name": "set_ft", "arg_names": ["self", "value", "time_acquired"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def set_ft(self, value, time_acquired):\n self.lock.acquire()\n self.data = value, time_acquired\n self.fresh = True\n self.lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99571:Expr_L31_C8", "label": "acquire()", "type": "expression", "loc": [31, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99571:FunctionDef_L30_C4", "vector": [8, 2, 0.246, 0.0079, 2, 0.68, 0.0, 229, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "acquire", "arg_names": [], "import_names": [], "rhs_call_name": "acquire", "annotation": ""}, "snippet": " self.lock.acquire()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99571:Assign_L32_C8", "label": "self.data =", "type": "assigned_variable", "loc": [32, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99571:FunctionDef_L30_C4", "vector": [14, 2, 0.254, 0.0079, 2, 0.68, 0.3333, 838, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "self.data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.data = value, time_acquired"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99571:Assign_L33_C8", "label": "self.fresh =", "type": "assigned_variable", "loc": [33, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99571:FunctionDef_L30_C4", "vector": [14, 2, 0.2619, 0.0079, 2, 0.68, 0.6667, 547, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.fresh", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.fresh = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99571:Expr_L34_C8", "label": "release()", "type": "expression", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99571:FunctionDef_L30_C4", "vector": [8, 2, 0.2698, 0.0079, 2, 0.68, 1.0, 784, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "release", "arg_names": [], "import_names": [], "rhs_call_name": "release", "annotation": ""}, "snippet": " self.lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99571:FunctionDef_L37_C4", "label": "get_msg", "type": "function", "loc": [37, 44], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99571:ClassDef_L25_C0", "vector": [2, 1, 0.3214, 0.0635, 1, 0.95, 1.0, 977, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "get_msg", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_msg(self):\n r = None\n self.lock.acquire()\n if self.fresh:\n self.fresh = False\n r = self.data\n self.lock.release()\n return r"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99571:Assign_L38_C8", "label": "r =", "type": "assigned_variable", "loc": [38, 38], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99571:FunctionDef_L37_C4", "vector": [14, 2, 0.3016, 0.0079, 2, 0.91, 0.0, 436, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " r = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99571:Expr_L39_C8", "label": "acquire()", "type": "expression", "loc": [39, 39], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99571:FunctionDef_L37_C4", "vector": [8, 2, 0.3095, 0.0079, 2, 0.91, 0.25, 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_99571:If_L40_C8", "label": "if", "type": "if", "loc": [40, 42], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99571:FunctionDef_L37_C4", "vector": [4, 2, 0.3254, 0.0238, 2, 0.91, 0.5, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.fresh:\n self.fresh = False\n r = self.data"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99571:Assign_L41_C12", "label": "self.fresh =", "type": "assigned_variable", "loc": [41, 41], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99571:If_L40_C8", "vector": [14, 3, 0.3254, 0.0079, 3, 0.07, 0.0, 547, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.fresh", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.fresh = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99571:Assign_L42_C12", "label": "r =", "type": "assigned_variable", "loc": [42, 42], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99571:If_L40_C8", "vector": [14, 3, 0.3333, 0.0079, 3, 0.07, 1.0, 436, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " r = self.data"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99571:Expr_L43_C8", "label": "release()", "type": "expression", "loc": [43, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99571:FunctionDef_L37_C4", "vector": [8, 2, 0.3413, 0.0079, 2, 0.91, 0.75, 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_99571:Return_L44_C8", "label": "return", "type": "return", "loc": [44, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99571:FunctionDef_L37_C4", "vector": [13, 2, 0.3492, 0.0079, 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 r"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99571:FunctionDef_L46_C0", "label": "FTread_to_Force", "type": "function", "loc": [46, 54], "level": 0, "parent": null, "vector": [2, 0, 0.3968, 0.0714, 0, 0.66, 0.875, 639, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "FTread_to_Force", "arg_names": ["ftval", "frame_id"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def FTread_to_Force( ftval, frame_id ):\n retval = Vector3Stamped()\n retval.header.stamp = rospy.rostime.get_rostime()\n retval.header.frame_id = frame_id\n retval.vector.x = ftval[0]\n retval.vector.y = ftval[1]\n retval.vector.z = ftval[2]\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99571:Assign_L47_C4", "label": "retval = Vector3Stamped()", "type": "assigned_variable", "loc": [47, 47], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99571:FunctionDef_L46_C0", "vector": [14, 1, 0.373, 0.0079, 1, 0.79, 0.0, 991, 3, 0, 0, 0, 444, 10, 1], "semantic": {"name": "retval", "arg_names": [], "import_names": [], "rhs_call_name": "Vector3Stamped", "annotation": ""}, "snippet": " retval = Vector3Stamped()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99571:Assign_L48_C4", "label": "retval.header.stamp = get_rostime()", "type": "assigned_variable", "loc": [48, 48], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99571:FunctionDef_L46_C0", "vector": [14, 1, 0.381, 0.0079, 1, 0.79, 0.1667, 387, 3, 0, 0, 0, 173, 10, 1], "semantic": {"name": "retval.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "get_rostime", "annotation": ""}, "snippet": " retval.header.stamp = rospy.rostime.get_rostime()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99571:Assign_L49_C4", "label": "retval.header.frame_id =", "type": "assigned_variable", "loc": [49, 49], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99571:FunctionDef_L46_C0", "vector": [14, 1, 0.3889, 0.0079, 1, 0.79, 0.3333, 809, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "retval.header.frame_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " retval.header.frame_id = frame_id"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99571:Assign_L50_C4", "label": "retval.vector.x =", "type": "assigned_variable", "loc": [50, 50], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99571:FunctionDef_L46_C0", "vector": [14, 1, 0.3968, 0.0079, 1, 0.79, 0.5, 297, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "retval.vector.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " retval.vector.x = ftval[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99571:Assign_L51_C4", "label": "retval.vector.y =", "type": "assigned_variable", "loc": [51, 51], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99571:FunctionDef_L46_C0", "vector": [14, 1, 0.4048, 0.0079, 1, 0.79, 0.6667, 364, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "retval.vector.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " retval.vector.y = ftval[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99571:Assign_L52_C4", "label": "retval.vector.z =", "type": "assigned_variable", "loc": [52, 52], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99571:FunctionDef_L46_C0", "vector": [14, 1, 0.4127, 0.0079, 1, 0.79, 0.8333, 462, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "retval.vector.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " retval.vector.z = ftval[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99571:Return_L54_C4", "label": "return", "type": "return", "loc": [54, 54], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99571:FunctionDef_L46_C0", "vector": [13, 1, 0.4286, 0.0079, 1, 0.79, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return retval"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99571:If_L56_C0", "label": "if", "type": "if", "loc": [56, 113], "level": 0, "parent": null, "vector": [4, 0, 0.6706, 0.4603, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 31], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n import roslib; roslib.load_manifest('force_torque')\n import rospy\n from force_torque.srv import *\n from hrl_msgs.msg import FloatArray as FloatArray\n import hrl_lib.rutils as ru\n import time\n import force_torque.FTSensor as ftc"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99571:Import_L57_C4", "label": "roslib import roslib", "type": "import", "loc": [57, 57], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99571:If_L56_C0", "vector": [1, 1, 0.4524, 0.0079, 1, 0.05, 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('force_torque')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99571:Expr_L57_C19", "label": "load_manifest()", "type": "expression", "loc": [57, 57], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99571:If_L56_C0", "vector": [8, 1, 0.4524, 0.0079, 1, 0.05, 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": " import roslib; roslib.load_manifest('force_torque')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99571:Import_L58_C4", "label": "rospy import rospy", "type": "import", "loc": [58, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99571:If_L56_C0", "vector": [1, 1, 0.4603, 0.0079, 1, 0.05, 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_99571:ImportFrom_L59_C4", "label": "from force_torque.srv import *", "type": "import", "loc": [59, 59], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99571:If_L56_C0", "vector": [1, 1, 0.4683, 0.0079, 1, 0.05, 0.1154, 550, 0, 1, 0, 0, 550, 0, 0], "semantic": {"name": "force_torque.srv", "arg_names": [], "import_names": ["*"], "rhs_call_name": "", "annotation": ""}, "snippet": " from force_torque.srv import *"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99571:ImportFrom_L60_C4", "label": "from hrl_msgs.msg import FloatArray", "type": "import", "loc": [60, 60], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99571:If_L56_C0", "vector": [1, 1, 0.4762, 0.0079, 1, 0.05, 0.1538, 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 as FloatArray"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99571:Import_L61_C4", "label": "hrl_lib.rutils import ru", "type": "import", "loc": [61, 61], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99571:If_L56_C0", "vector": [1, 1, 0.4841, 0.0079, 1, 0.05, 0.1923, 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_99571:Import_L62_C4", "label": "time import time", "type": "import", "loc": [62, 62], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99571:If_L56_C0", "vector": [1, 1, 0.4921, 0.0079, 1, 0.05, 0.2308, 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_99571:Import_L63_C4", "label": "force_torque.FTSensor import ftc", "type": "import", "loc": [63, 63], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99571:If_L56_C0", "vector": [1, 1, 0.5, 0.0079, 1, 0.05, 0.2692, 987, 0, 1, 0, 0, 987, 0, 0], "semantic": {"name": "force_torque.FTSensor", "arg_names": [], "import_names": ["ftc"], "rhs_call_name": "", "annotation": ""}, "snippet": " import force_torque.FTSensor as ftc"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99571:Import_L64_C4", "label": "numpy import np", "type": "import", "loc": [64, 64], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99571:If_L56_C0", "vector": [1, 1, 0.5079, 0.0079, 1, 0.05, 0.3077, 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_99571:Import_L66_C4", "label": "optparse import optparse", "type": "import", "loc": [66, 66], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99571:If_L56_C0", "vector": [1, 1, 0.5238, 0.0079, 1, 0.05, 0.3462, 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_99571:Assign_L67_C4", "label": "p = OptionParser()", "type": "assigned_variable", "loc": [67, 67], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99571:If_L56_C0", "vector": [14, 1, 0.5317, 0.0079, 1, 0.05, 0.3846, 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_99571:Expr_L68_C4", "label": "add_option()", "type": "expression", "loc": [68, 69], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99571:If_L56_C0", "vector": [8, 1, 0.5437, 0.0159, 1, 0.05, 0.4231, 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('--name', action='store', default='ft1', type='string', \n dest='name', help='name given to FTSensor')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99571:Assign_L70_C4", "label": "opt, args = parse_args()", "type": "assigned_variable", "loc": [70, 70], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99571:If_L56_C0", "vector": [14, 1, 0.5556, 0.0079, 1, 0.05, 0.4615, 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_99571:Assign_L72_C4", "label": "node_name =", "type": "assigned_variable", "loc": [72, 72], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99571:If_L56_C0", "vector": [14, 1, 0.5714, 0.0079, 1, 0.05, 0.5, 516, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "node_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " node_name = 'FTRelay_' + opt.name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99571:Assign_L73_C4", "label": "ft_channel_name =", "type": "assigned_variable", "loc": [73, 73], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99571:If_L56_C0", "vector": [14, 1, 0.5794, 0.0079, 1, 0.05, 0.5385, 868, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ft_channel_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ft_channel_name = 'force_torque_' + opt.name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99571:Assign_L74_C4", "label": "service_name =", "type": "assigned_variable", "loc": [74, 74], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99571:If_L56_C0", "vector": [14, 1, 0.5873, 0.0079, 1, 0.05, 0.5769, 649, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "service_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " service_name = node_name + '_set_ft'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99571:Expr_L75_C4", "label": "print()", "type": "expression", "loc": [75, 75], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99571:If_L56_C0", "vector": [8, 1, 0.5952, 0.0079, 1, 0.05, 0.6154, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(node_name + ': serving service', service_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99571:Assign_L76_C4", "label": "ftserver = FTRelay()", "type": "assigned_variable", "loc": [76, 76], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99571:If_L56_C0", "vector": [14, 1, 0.6032, 0.0079, 1, 0.05, 0.6538, 930, 3, 0, 0, 0, 145, 10, 1], "semantic": {"name": "ftserver", "arg_names": [], "import_names": [], "rhs_call_name": "FTRelay", "annotation": ""}, "snippet": " ftserver = FTRelay()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99571:Expr_L78_C4", "label": "init_node()", "type": "expression", "loc": [78, 78], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99571:If_L56_C0", "vector": [8, 1, 0.619, 0.0079, 1, 0.05, 0.6923, 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_99571:Expr_L79_C4", "label": "Service()", "type": "expression", "loc": [79, 81], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99571:If_L56_C0", "vector": [8, 1, 0.6349, 0.0238, 1, 0.05, 0.7308, 451, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "Service", "arg_names": [], "import_names": [], "rhs_call_name": "Service", "annotation": ""}, "snippet": " rospy.Service(service_name, StringService, \n ru.wrap(ftserver.set_ft, ['value', 'time'], \n response=StringServiceResponse))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99571:Assign_L83_C4", "label": "channel = Publisher()", "type": "assigned_variable", "loc": [83, 83], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99571:If_L56_C0", "vector": [14, 1, 0.6587, 0.0079, 1, 0.05, 0.7692, 721, 3, 3, 0, 0, 45, 10, 1], "semantic": {"name": "channel", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " channel = rospy.Publisher(ft_channel_name, FloatArray, tcp_nodelay=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99571:Assign_L84_C4", "label": "channel2 = Publisher()", "type": "assigned_variable", "loc": [84, 84], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99571:If_L56_C0", "vector": [14, 1, 0.6667, 0.0079, 1, 0.05, 0.8077, 518, 3, 3, 0, 0, 45, 10, 1], "semantic": {"name": "channel2", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " channel2 = rospy.Publisher(ft_channel_name + '_raw', FloatArray, tcp_nodelay=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99571:Assign_L85_C4", "label": "chan_vec3 = Publisher()", "type": "assigned_variable", "loc": [85, 85], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99571:If_L56_C0", "vector": [14, 1, 0.6746, 0.0079, 1, 0.05, 0.8462, 451, 3, 3, 0, 0, 45, 10, 1], "semantic": {"name": "chan_vec3", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " chan_vec3 = rospy.Publisher(ft_channel_name + '_Vec3', Vector3Stamped, tcp_nodelay=True) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99571:Expr_L86_C4", "label": "print()", "type": "expression", "loc": [86, 86], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99571:If_L56_C0", "vector": [8, 1, 0.6825, 0.0079, 1, 0.05, 0.8846, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(node_name + ': publishing on channel', ft_channel_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99571:Assign_L87_C4", "label": "P_force =", "type": "assigned_variable", "loc": [87, 87], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99571:If_L56_C0", "vector": [14, 1, 0.6905, 0.0079, 1, 0.05, 0.9231, 609, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "P_force", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " P_force = [1., 1., 1.]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99571:Assign_L88_C4", "label": "xhat_force =", "type": "assigned_variable", "loc": [88, 88], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99571:If_L56_C0", "vector": [14, 1, 0.6984, 0.0079, 1, 0.05, 0.9615, 157, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "xhat_force", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " xhat_force = [0., 0., 0., 0., 0., 0.]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99571:While_L89_C4", "label": "while", "type": "while", "loc": [89, 113], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99571:If_L56_C0", "vector": [5, 1, 0.8016, 0.1984, 1, 0.05, 1.0, 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 msg = ftserver.get_msg()\n if msg is not None:\n data, tme = msg\n ftvalue = ftc.binary_to_ft(data)\n ftvalue = np.array(ftvalue)\n for i in range(3):\n xhat, p = kalman_update(xhat_force[i], P_force[i],"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99571:Assign_L90_C8", "label": "msg = get_msg()", "type": "assigned_variable", "loc": [90, 90], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99571:While_L89_C4", "vector": [14, 2, 0.7143, 0.0079, 2, 0.07, 0.0, 712, 3, 0, 0, 0, 977, 10, 1], "semantic": {"name": "msg", "arg_names": [], "import_names": [], "rhs_call_name": "get_msg", "annotation": ""}, "snippet": " msg = ftserver.get_msg()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99571:If_L91_C8", "label": "if", "type": "if", "loc": [91, 109], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99571:While_L89_C4", "vector": [4, 2, 0.7937, 0.1508, 2, 0.07, 0.5, 0, 0, 0, 0, 0, 0, 0, 15], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if msg is not None:\n data, tme = msg\n ftvalue = ftc.binary_to_ft(data)\n ftvalue = np.array(ftvalue)\n for i in range(3):\n xhat, p = kalman_update(xhat_force[i], P_force[i],\n 1e-3, 0.04, ftvalue[i])\n P_force[i] = p"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99571:Assign_L92_C12", "label": "data, tme =", "type": "assigned_variable", "loc": [92, 92], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99571:If_L91_C8", "vector": [14, 3, 0.7302, 0.0079, 3, 0.41, 0.0, 628, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "data, tme", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " data, tme = msg"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99571:Assign_L93_C12", "label": "ftvalue = binary_to_ft()", "type": "assigned_variable", "loc": [93, 93], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99571:If_L91_C8", "vector": [14, 3, 0.7381, 0.0079, 3, 0.41, 0.1, 476, 3, 1, 0, 0, 642, 10, 1], "semantic": {"name": "ftvalue", "arg_names": [], "import_names": [], "rhs_call_name": "binary_to_ft", "annotation": ""}, "snippet": " ftvalue = ftc.binary_to_ft(data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99571:Assign_L94_C12", "label": "ftvalue = array()", "type": "assigned_variable", "loc": [94, 94], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99571:If_L91_C8", "vector": [14, 3, 0.746, 0.0079, 3, 0.41, 0.2, 476, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "ftvalue", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " ftvalue = np.array(ftvalue)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99571:For_L95_C12", "label": "for i", "type": "for", "loc": [95, 99], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99571:If_L91_C8", "vector": [6, 3, 0.7698, 0.0397, 3, 0.41, 0.3, 826, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(3):\n xhat, p = kalman_update(xhat_force[i], P_force[i],\n 1e-3, 0.04, ftvalue[i])\n P_force[i] = p\n xhat_force[i] = xhat"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99571:Assign_L96_C16", "label": "xhat, p = kalman_update()", "type": "assigned_variable", "loc": [96, 97], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99571:For_L95_C12", "vector": [14, 4, 0.7659, 0.0159, 4, 0.12, 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(xhat_force[i], P_force[i],\n 1e-3, 0.04, ftvalue[i])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99571:Assign_L98_C16", "label": "assign", "type": "assigned_variable", "loc": [98, 98], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99571:For_L95_C12", "vector": [14, 4, 0.7778, 0.0079, 4, 0.12, 0.5, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " P_force[i] = p"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99571:Assign_L99_C16", "label": "assign", "type": "assigned_variable", "loc": [99, 99], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99571:For_L95_C12", "vector": [14, 4, 0.7857, 0.0079, 4, 0.12, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " xhat_force[i] = xhat"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99571:Assign_L101_C12", "label": "assign", "type": "assigned_variable", "loc": [101, 101], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99571:If_L91_C8", "vector": [14, 3, 0.8016, 0.0079, 3, 0.41, 0.4, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " xhat_force[3] = ftvalue[3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99571:Assign_L102_C12", "label": "assign", "type": "assigned_variable", "loc": [102, 102], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99571:If_L91_C8", "vector": [14, 3, 0.8095, 0.0079, 3, 0.41, 0.5, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " xhat_force[4] = ftvalue[4]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99571:Assign_L103_C12", "label": "assign", "type": "assigned_variable", "loc": [103, 103], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99571:If_L91_C8", "vector": [14, 3, 0.8175, 0.0079, 3, 0.41, 0.6, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " xhat_force[5] = ftvalue[5]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99571:Assign_L104_C12", "label": "ftvalue = tolist()", "type": "assigned_variable", "loc": [104, 104], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99571:If_L91_C8", "vector": [14, 3, 0.8254, 0.0079, 3, 0.41, 0.7, 476, 3, 0, 0, 0, 185, 10, 1], "semantic": {"name": "ftvalue", "arg_names": [], "import_names": [], "rhs_call_name": "tolist", "annotation": ""}, "snippet": " ftvalue = ftvalue.tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99571:Expr_L106_C12", "label": "publish()", "type": "expression", "loc": [106, 107], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99571:If_L91_C8", "vector": [8, 3, 0.8452, 0.0159, 3, 0.41, 0.8, 102, 3, 1, 0, 0, 0, 0, 4], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " channel.publish(FloatArray(rospy.Header(stamp=rospy.Time.from_seconds(tme)),\n xhat_force))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99571:Expr_L108_C12", "label": "publish()", "type": "expression", "loc": [108, 108], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99571:If_L91_C8", "vector": [8, 3, 0.8571, 0.0079, 3, 0.41, 0.9, 102, 3, 1, 0, 0, 0, 0, 4], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " channel2.publish(FloatArray(rospy.Header(stamp=rospy.Time.from_seconds(tme)), ftvalue))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99571:Expr_L109_C12", "label": "publish()", "type": "expression", "loc": [109, 109], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99571:If_L91_C8", "vector": [8, 3, 0.8651, 0.0079, 3, 0.41, 1.0, 102, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " chan_vec3.publish( FTread_to_Force( ftvalue, opt.name ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99571:Expr_L113_C8", "label": "sleep()", "type": "expression", "loc": [113, 113], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99571:While_L89_C4", "vector": [8, 2, 0.8968, 0.0079, 2, 0.07, 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(1/5000.0)"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99571:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99571:Assign_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99571:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99571:Assign_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99571:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99571:Assign_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99571:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99571:Assign_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99571:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99571:Assign_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99571:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99571:Return_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99571:ClassDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99571:FunctionDef_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99571:FunctionDef_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99571:Assign_L27_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99571:FunctionDef_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99571:Assign_L28_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99571:ClassDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99571:FunctionDef_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99571:FunctionDef_L30_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99571:Expr_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99571:FunctionDef_L30_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99571:Assign_L32_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99571:FunctionDef_L30_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99571:Assign_L33_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99571:FunctionDef_L30_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99571:Expr_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99571:ClassDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99571:FunctionDef_L37_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99571:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99571:Assign_L38_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99571:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99571:Expr_L39_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99571:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99571:If_L40_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99571:If_L40_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99571:Assign_L41_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99571:If_L40_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99571:Assign_L42_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99571:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99571:Expr_L43_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99571:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99571:Return_L44_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99571:FunctionDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99571:Assign_L47_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99571:FunctionDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99571:Assign_L48_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99571:FunctionDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99571:Assign_L49_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99571:FunctionDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99571:Assign_L50_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99571:FunctionDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99571:Assign_L51_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99571:FunctionDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99571:Assign_L52_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99571:FunctionDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99571:Return_L54_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99571:If_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99571:Import_L57_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99571:If_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99571:Expr_L57_C19"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99571:If_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99571:Import_L58_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99571:If_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99571:ImportFrom_L59_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99571:If_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99571:ImportFrom_L60_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99571:If_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99571:Import_L61_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99571:If_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99571:Import_L62_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99571:If_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99571:Import_L63_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99571:If_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99571:Import_L64_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99571:If_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99571:Import_L66_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99571:If_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99571:Assign_L67_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99571:If_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99571:Expr_L68_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99571:If_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99571:Assign_L70_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99571:If_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99571:Assign_L72_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99571:If_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99571:Assign_L73_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99571:If_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99571:Assign_L74_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99571:If_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99571:Expr_L75_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99571:If_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99571:Assign_L76_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99571:If_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99571:Expr_L78_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99571:If_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99571:Expr_L79_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99571:If_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99571:Assign_L83_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99571:If_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99571:Assign_L84_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99571:If_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99571:Assign_L85_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99571:If_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99571:Expr_L86_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99571:If_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99571:Assign_L87_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99571:If_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99571:Assign_L88_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99571:If_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99571:While_L89_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99571:While_L89_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99571:Assign_L90_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99571:While_L89_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99571:If_L91_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99571:If_L91_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99571:Assign_L92_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99571:If_L91_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99571:Assign_L93_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99571:If_L91_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99571:Assign_L94_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99571:If_L91_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99571:For_L95_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99571:For_L95_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99571:Assign_L96_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99571:For_L95_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99571:Assign_L98_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99571:For_L95_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99571:Assign_L99_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99571:If_L91_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99571:Assign_L101_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99571:If_L91_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99571:Assign_L102_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99571:If_L91_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99571:Assign_L103_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99571:If_L91_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99571:Assign_L104_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99571:If_L91_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99571:Expr_L106_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99571:If_L91_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99571:Expr_L108_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99571:If_L91_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99571:Expr_L109_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99571:While_L89_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99571:Expr_L113_C8"}]
#!/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 (Healthcare Robotics Lab, Georgia Tech.) # \author Cressel Anderson (Healthcare Robotics Lab, Georgia Tech.) # \author Hai Nguyen (Healthcare Robotics Lab, Georgia Tech.) import roslib; roslib.load_manifest('force_torque') import rospy import hrl_lib.rutils as ru import hrl_lib.util as ut from hrl_msgs.msg import FloatArray from geometry_msgs.msg import WrenchStamped import numpy as np ## # Corresponding client class class FTClient(ru.GenericListener): def __init__(self, topic_name, netft=False): if netft: def msg_converter(msg): fx, fy, fz = msg.wrench.force.x, msg.wrench.force.y, msg.wrench.force.z tx, ty, tz = msg.wrench.torque.x, msg.wrench.torque.y, msg.wrench.torque.z msg_time = rospy.get_time() return -np.matrix([fx, fy, fz, tx, ty, tz]).T, msg_time msg_type=WrenchStamped else: def msg_converter(msg): m = np.matrix(msg.data, 'f').T msg_time = msg.header.stamp.to_time() return m, msg_time msg_type = FloatArray ru.GenericListener.__init__(self, 'FTClient', msg_type, topic_name, 50.0, message_extractor = msg_converter, queue_size = None) self.bias_val = np.matrix([0, 0, 0, 0, 0, 0.]).T ## # Read a force torque value # @param avg how many force torque value to average # @param without_bias # @param fresh # @param with_time_stamp # @return an averaged force torque value (6x1 matrix) def read(self, avg=1, without_bias=False, fresh=False, with_time_stamp=False): assert(avg > 0) if avg > 1: fresh = True if with_time_stamp: raise RuntimeError('Can\'t request averaging and timestamping at the same time') rs = [] for i in range(avg): if fresh: r, msg_time = ru.GenericListener.read(self, allow_duplication=False, willing_to_wait=True) else: r, msg_time = ru.GenericListener.read(self, allow_duplication=True, willing_to_wait=False) rs.append(r) readings = ut.list_mat_to_mat(rs, axis=1) if not without_bias: #print 'readiings.mean(1)', readings.mean(1) #print 'self.bias_val', self.bias_val ret = readings.mean(1) - self.bias_val else: ret = readings.mean(1) if with_time_stamp: return ret, msg_time else: return ret def bias(self): print '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!' print 'BIASING FT' print '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!' b_list = [] for i in range(20): r, msg_time = ru.GenericListener.read(self, allow_duplication=False, willing_to_wait=True) b_list.append(r) if b_list[0] != None: r = np.mean(np.column_stack(b_list), 1) self.bias_val = r print '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!' print 'DONE biasing ft' print '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!' if __name__ == '__main__': import optparse import time p = optparse.OptionParser() p.add_option('-t', action='store', default='force_torque_ft1', type='string', dest='topic', help='which topic to listen to (default force_torque_ft1)') p.add_option('--netft', action='store_true', dest='netft', help='is this a NetFT sensor') opt, args = p.parse_args() client = FTClient(opt.topic, opt.netft) client.bias() while not rospy.is_shutdown(): el = client.read() if el != None: #print np.linalg.norm(el.T) f = el.A1 print ' %.2f %.2f %.2f'%(f[0], f[1], f[2]) time.sleep(1/100.0)
ajibawa-2023/Python-Code-Large/train/row_99572
70
148
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99572:Import_L32_C0", "label": "roslib import roslib", "type": "import", "loc": [32, 32], "level": 0, "parent": null, "vector": [1, 0, 0.2162, 0.0068, 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('force_torque')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99572:Expr_L32_C15", "label": "load_manifest()", "type": "expression", "loc": [32, 32], "level": 0, "parent": null, "vector": [8, 0, 0.2162, 0.0068, 0, 0.66, 0.1111, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('force_torque')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99572:Import_L33_C0", "label": "rospy import rospy", "type": "import", "loc": [33, 33], "level": 0, "parent": null, "vector": [1, 0, 0.223, 0.0068, 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_99572:Import_L34_C0", "label": "hrl_lib.rutils import ru", "type": "import", "loc": [34, 34], "level": 0, "parent": null, "vector": [1, 0, 0.2297, 0.0068, 0, 0.66, 0.3333, 847, 0, 1, 0, 0, 847, 0, 0], "semantic": {"name": "hrl_lib.rutils", "arg_names": [], "import_names": ["ru"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.rutils as ru"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99572:Import_L35_C0", "label": "hrl_lib.util import ut", "type": "import", "loc": [35, 35], "level": 0, "parent": null, "vector": [1, 0, 0.2365, 0.0068, 0, 0.66, 0.4444, 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_99572:ImportFrom_L36_C0", "label": "from hrl_msgs.msg import FloatArray", "type": "import", "loc": [36, 36], "level": 0, "parent": null, "vector": [1, 0, 0.2432, 0.0068, 0, 0.66, 0.5556, 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_99572:ImportFrom_L37_C0", "label": "from geometry_msgs.msg import WrenchStamped", "type": "import", "loc": [37, 37], "level": 0, "parent": null, "vector": [1, 0, 0.25, 0.0068, 0, 0.66, 0.6667, 951, 0, 1, 0, 0, 951, 0, 0], "semantic": {"name": "geometry_msgs.msg", "arg_names": [], "import_names": ["WrenchStamped"], "rhs_call_name": "", "annotation": ""}, "snippet": "from geometry_msgs.msg import WrenchStamped"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99572:Import_L38_C0", "label": "numpy import np", "type": "import", "loc": [38, 38], "level": 0, "parent": null, "vector": [1, 0, 0.2568, 0.0068, 0, 0.66, 0.7778, 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_99572:ClassDef_L42_C0", "label": "FTClient", "type": "class", "loc": [42, 116], "level": 0, "parent": null, "vector": [3, 0, 0.5338, 0.5068, 0, 0.66, 0.8889, 78, 0, 5, 0, 0, 342, 0, 25], "semantic": {"name": "FTClient", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class FTClient(ru.GenericListener):\n def __init__(self, topic_name, netft=False):\n if netft:\n def msg_converter(msg):\n fx, fy, fz = msg.wrench.force.x, msg.wrench.force.y, msg.wrench.force.z\n tx, ty, tz = msg.wrench.torque.x, msg.wrench.torque.y, msg.wrench.torque.z\n msg_time = rospy.get_time()\n return -np.matrix([fx, fy, fz, tx, ty, tz]).T, msg_time"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99572:FunctionDef_L43_C4", "label": "__init__", "type": "function", "loc": [43, 62], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99572:ClassDef_L42_C0", "vector": [2, 1, 0.3547, 0.1351, 1, 0.39, 0.0, 555, 0, 3, 1, 0, 0, 0, 6], "semantic": {"name": "__init__", "arg_names": ["self", "topic_name", "netft"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, topic_name, netft=False):\n if netft:\n def msg_converter(msg):\n fx, fy, fz = msg.wrench.force.x, msg.wrench.force.y, msg.wrench.force.z\n tx, ty, tz = msg.wrench.torque.x, msg.wrench.torque.y, msg.wrench.torque.z\n msg_time = rospy.get_time()\n return -np.matrix([fx, fy, fz, tx, ty, tz]).T, msg_time\n msg_type=WrenchStamped"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99572:If_L44_C8", "label": "if", "type": "if", "loc": [44, 56], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99572:FunctionDef_L43_C4", "vector": [4, 2, 0.3378, 0.0878, 2, 0.82, 0.0, 0, 2, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if netft:\n def msg_converter(msg):\n fx, fy, fz = msg.wrench.force.x, msg.wrench.force.y, msg.wrench.force.z\n tx, ty, tz = msg.wrench.torque.x, msg.wrench.torque.y, msg.wrench.torque.z\n msg_time = rospy.get_time()\n return -np.matrix([fx, fy, fz, tx, ty, tz]).T, msg_time\n msg_type=WrenchStamped\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99572:FunctionDef_L45_C12", "label": "msg_converter", "type": "function", "loc": [45, 49], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99572:If_L44_C8", "vector": [2, 3, 0.3176, 0.0338, 3, 0.19, 0.0, 549, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "msg_converter", "arg_names": ["msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def msg_converter(msg):\n fx, fy, fz = msg.wrench.force.x, msg.wrench.force.y, msg.wrench.force.z\n tx, ty, tz = msg.wrench.torque.x, msg.wrench.torque.y, msg.wrench.torque.z\n msg_time = rospy.get_time()\n return -np.matrix([fx, fy, fz, tx, ty, tz]).T, msg_time"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99572:Assign_L46_C16", "label": "fx, fy, fz =", "type": "assigned_variable", "loc": [46, 46], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99572:FunctionDef_L45_C12", "vector": [14, 4, 0.3108, 0.0068, 4, 0.36, 0.0, 183, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "fx, fy, fz", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " fx, fy, fz = msg.wrench.force.x, msg.wrench.force.y, msg.wrench.force.z"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99572:Assign_L47_C16", "label": "tx, ty, tz =", "type": "assigned_variable", "loc": [47, 47], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99572:FunctionDef_L45_C12", "vector": [14, 4, 0.3176, 0.0068, 4, 0.36, 0.3333, 564, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "tx, ty, tz", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tx, ty, tz = msg.wrench.torque.x, msg.wrench.torque.y, msg.wrench.torque.z"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99572:Assign_L48_C16", "label": "msg_time = get_time()", "type": "assigned_variable", "loc": [48, 48], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99572:FunctionDef_L45_C12", "vector": [14, 4, 0.3243, 0.0068, 4, 0.36, 0.6667, 757, 3, 0, 0, 0, 164, 10, 1], "semantic": {"name": "msg_time", "arg_names": [], "import_names": [], "rhs_call_name": "get_time", "annotation": ""}, "snippet": " msg_time = rospy.get_time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99572:Return_L49_C16", "label": "return", "type": "return", "loc": [49, 49], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99572:FunctionDef_L45_C12", "vector": [13, 4, 0.3311, 0.0068, 4, 0.36, 1.0, 0, 0, 0, 0, 0, 0, 8, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return -np.matrix([fx, fy, fz, tx, ty, tz]).T, msg_time"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99572:Assign_L50_C12", "label": "msg_type =", "type": "assigned_variable", "loc": [50, 50], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99572:If_L44_C8", "vector": [14, 3, 0.3378, 0.0068, 3, 0.19, 0.3333, 412, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "msg_type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " msg_type=WrenchStamped"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99572:FunctionDef_L52_C12", "label": "msg_converter", "type": "function", "loc": [52, 55], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99572:If_L44_C8", "vector": [2, 3, 0.3615, 0.027, 3, 0.19, 0.6667, 549, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "msg_converter", "arg_names": ["msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def msg_converter(msg):\n m = np.matrix(msg.data, 'f').T\n msg_time = msg.header.stamp.to_time()\n return m, msg_time"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99572:Assign_L53_C16", "label": "m =", "type": "assigned_variable", "loc": [53, 53], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99572:FunctionDef_L52_C12", "vector": [14, 4, 0.3581, 0.0068, 4, 0.79, 0.0, 711, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " m = np.matrix(msg.data, 'f').T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99572:Assign_L54_C16", "label": "msg_time = to_time()", "type": "assigned_variable", "loc": [54, 54], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99572:FunctionDef_L52_C12", "vector": [14, 4, 0.3649, 0.0068, 4, 0.79, 0.5, 757, 3, 0, 0, 0, 739, 10, 1], "semantic": {"name": "msg_time", "arg_names": [], "import_names": [], "rhs_call_name": "to_time", "annotation": ""}, "snippet": " msg_time = msg.header.stamp.to_time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99572:Return_L55_C16", "label": "return", "type": "return", "loc": [55, 55], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99572:FunctionDef_L52_C12", "vector": [13, 4, 0.3716, 0.0068, 4, 0.79, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return m, msg_time"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99572:Assign_L56_C12", "label": "msg_type =", "type": "assigned_variable", "loc": [56, 56], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99572:If_L44_C8", "vector": [14, 3, 0.3784, 0.0068, 3, 0.19, 1.0, 412, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "msg_type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " msg_type = FloatArray"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99572:Expr_L58_C8", "label": "__init__()", "type": "expression", "loc": [58, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99572:FunctionDef_L43_C4", "vector": [8, 2, 0.402, 0.027, 2, 0.82, 0.5, 555, 3, 7, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " ru.GenericListener.__init__(self, 'FTClient', msg_type,\n topic_name, 50.0,\n message_extractor = msg_converter,\n queue_size = None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99572:Assign_L62_C8", "label": "self.bias_val =", "type": "assigned_variable", "loc": [62, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99572:FunctionDef_L43_C4", "vector": [14, 2, 0.4189, 0.0068, 2, 0.82, 1.0, 674, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.bias_val", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.bias_val = np.matrix([0, 0, 0, 0, 0, 0.]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99572:FunctionDef_L71_C4", "label": "read", "type": "function", "loc": [71, 98], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99572:ClassDef_L42_C0", "vector": [2, 1, 0.5709, 0.1892, 1, 0.39, 0.5, 453, 0, 5, 1, 0, 0, 0, 8], "semantic": {"name": "read", "arg_names": ["self", "avg", "without_bias", "fresh", "with_time_stamp"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def read(self, avg=1, without_bias=False, fresh=False, with_time_stamp=False):\n assert(avg > 0)\n if avg > 1:\n fresh = True\n if with_time_stamp:\n raise RuntimeError('Can\\'t request averaging and timestamping at the same time')\n\n rs = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99572:If_L73_C8", "label": "if", "type": "if", "loc": [73, 76], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99572:FunctionDef_L71_C4", "vector": [4, 2, 0.5034, 0.027, 2, 0.23, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if avg > 1:\n fresh = True\n if with_time_stamp:\n raise RuntimeError('Can\\'t request averaging and timestamping at the same time')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99572:Assign_L74_C12", "label": "fresh =", "type": "assigned_variable", "loc": [74, 74], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99572:If_L73_C8", "vector": [14, 3, 0.5, 0.0068, 3, 0.87, 0.0, 195, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "fresh", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " fresh = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99572:If_L75_C12", "label": "if", "type": "if", "loc": [75, 76], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99572:If_L73_C8", "vector": [4, 3, 0.5101, 0.0135, 3, 0.87, 1.0, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if with_time_stamp:\n raise RuntimeError('Can\\'t request averaging and timestamping at the same time')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99572:Assign_L78_C8", "label": "rs =", "type": "assigned_variable", "loc": [78, 78], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99572:FunctionDef_L71_C4", "vector": [14, 2, 0.527, 0.0068, 2, 0.23, 0.2, 594, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "rs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rs = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99572:For_L79_C8", "label": "for i", "type": "for", "loc": [79, 84], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99572:FunctionDef_L71_C4", "vector": [6, 2, 0.5507, 0.0405, 2, 0.23, 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(avg):\n if fresh:\n r, msg_time = ru.GenericListener.read(self, allow_duplication=False, willing_to_wait=True) \n else:\n r, msg_time = ru.GenericListener.read(self, allow_duplication=True, willing_to_wait=False) \n rs.append(r)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99572:If_L80_C12", "label": "if", "type": "if", "loc": [80, 83], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99572:For_L79_C8", "vector": [4, 3, 0.5507, 0.027, 3, 0.74, 0.0, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if fresh:\n r, msg_time = ru.GenericListener.read(self, allow_duplication=False, willing_to_wait=True) \n else:\n r, msg_time = ru.GenericListener.read(self, allow_duplication=True, willing_to_wait=False) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99572:Assign_L81_C16", "label": "r, msg_time = read()", "type": "assigned_variable", "loc": [81, 81], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99572:If_L80_C12", "vector": [14, 4, 0.5473, 0.0068, 4, 0.47, 0.0, 178, 3, 3, 0, 0, 453, 10, 1], "semantic": {"name": "r, msg_time", "arg_names": [], "import_names": [], "rhs_call_name": "read", "annotation": ""}, "snippet": " r, msg_time = ru.GenericListener.read(self, allow_duplication=False, willing_to_wait=True) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99572:Assign_L83_C16", "label": "r, msg_time = read()", "type": "assigned_variable", "loc": [83, 83], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99572:If_L80_C12", "vector": [14, 4, 0.5608, 0.0068, 4, 0.47, 1.0, 178, 3, 3, 0, 0, 453, 10, 1], "semantic": {"name": "r, msg_time", "arg_names": [], "import_names": [], "rhs_call_name": "read", "annotation": ""}, "snippet": " r, msg_time = ru.GenericListener.read(self, allow_duplication=True, willing_to_wait=False) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99572:Expr_L84_C12", "label": "append()", "type": "expression", "loc": [84, 84], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99572:For_L79_C8", "vector": [8, 3, 0.5676, 0.0068, 3, 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": " rs.append(r)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99572:Assign_L85_C8", "label": "readings = list_mat_to_mat()", "type": "assigned_variable", "loc": [85, 85], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99572:FunctionDef_L71_C4", "vector": [14, 2, 0.5743, 0.0068, 2, 0.23, 0.6, 608, 3, 2, 0, 0, 162, 10, 1], "semantic": {"name": "readings", "arg_names": [], "import_names": [], "rhs_call_name": "list_mat_to_mat", "annotation": ""}, "snippet": " readings = ut.list_mat_to_mat(rs, axis=1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99572:If_L87_C8", "label": "if", "type": "if", "loc": [87, 93], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99572:FunctionDef_L71_C4", "vector": [4, 2, 0.6081, 0.0473, 2, 0.23, 0.8, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not without_bias:\n #print 'readiings.mean(1)', readings.mean(1)\n #print 'self.bias_val', self.bias_val\n\n ret = readings.mean(1) - self.bias_val\n else:\n ret = readings.mean(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99572:Assign_L91_C12", "label": "ret =", "type": "assigned_variable", "loc": [91, 91], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99572:If_L87_C8", "vector": [14, 3, 0.6149, 0.0068, 3, 0.11, 0.0, 501, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "ret", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ret = readings.mean(1) - self.bias_val"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99572:Assign_L93_C12", "label": "ret = mean()", "type": "assigned_variable", "loc": [93, 93], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99572:If_L87_C8", "vector": [14, 3, 0.6284, 0.0068, 3, 0.11, 1.0, 501, 3, 1, 0, 0, 856, 10, 1], "semantic": {"name": "ret", "arg_names": [], "import_names": [], "rhs_call_name": "mean", "annotation": ""}, "snippet": " ret = readings.mean(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99572:If_L95_C8", "label": "if", "type": "if", "loc": [95, 98], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99572:FunctionDef_L71_C4", "vector": [4, 2, 0.652, 0.027, 2, 0.23, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if with_time_stamp:\n return ret, msg_time\n else:\n return ret"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99572:Return_L96_C12", "label": "return", "type": "return", "loc": [96, 96], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99572:If_L95_C8", "vector": [13, 3, 0.6486, 0.0068, 3, 0.62, 0.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ret, msg_time"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99572:Return_L98_C12", "label": "return", "type": "return", "loc": [98, 98], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99572:If_L95_C8", "vector": [13, 3, 0.6622, 0.0068, 3, 0.62, 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_99572:FunctionDef_L100_C4", "label": "bias", "type": "function", "loc": [100, 116], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99572:ClassDef_L42_C0", "vector": [2, 1, 0.7297, 0.1149, 1, 0.39, 1.0, 354, 0, 1, 0, 0, 0, 0, 11], "semantic": {"name": "bias", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def bias(self):\n print('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!')\n print('BIASING FT')\n print('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!')\n\n b_list = []\n for i in range(20):\n r, msg_time = ru.GenericListener.read(self, allow_duplication=False, willing_to_wait=True) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99572:Expr_L101_C8", "label": "print()", "type": "expression", "loc": [101, 101], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99572:FunctionDef_L100_C4", "vector": [8, 2, 0.6824, 0.0068, 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": " print('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99572:Expr_L102_C8", "label": "print()", "type": "expression", "loc": [102, 102], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99572:FunctionDef_L100_C4", "vector": [8, 2, 0.6892, 0.0068, 2, 0.07, 0.125, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('BIASING FT')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99572:Expr_L103_C8", "label": "print()", "type": "expression", "loc": [103, 103], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99572:FunctionDef_L100_C4", "vector": [8, 2, 0.6959, 0.0068, 2, 0.07, 0.25, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99572:Assign_L105_C8", "label": "b_list =", "type": "assigned_variable", "loc": [105, 105], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99572:FunctionDef_L100_C4", "vector": [14, 2, 0.7095, 0.0068, 2, 0.07, 0.375, 694, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "b_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " b_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99572:For_L106_C8", "label": "for i", "type": "for", "loc": [106, 108], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99572:FunctionDef_L100_C4", "vector": [6, 2, 0.723, 0.0203, 2, 0.07, 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(20):\n r, msg_time = ru.GenericListener.read(self, allow_duplication=False, willing_to_wait=True) \n b_list.append(r)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99572:Assign_L107_C12", "label": "r, msg_time = read()", "type": "assigned_variable", "loc": [107, 107], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99572:For_L106_C8", "vector": [14, 3, 0.723, 0.0068, 3, 0.36, 0.0, 178, 3, 3, 0, 0, 453, 10, 1], "semantic": {"name": "r, msg_time", "arg_names": [], "import_names": [], "rhs_call_name": "read", "annotation": ""}, "snippet": " r, msg_time = ru.GenericListener.read(self, allow_duplication=False, willing_to_wait=True) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99572:Expr_L108_C12", "label": "append()", "type": "expression", "loc": [108, 108], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99572:For_L106_C8", "vector": [8, 3, 0.7297, 0.0068, 3, 0.36, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " b_list.append(r)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99572:If_L110_C8", "label": "if", "type": "if", "loc": [110, 112], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99572:FunctionDef_L100_C4", "vector": [4, 2, 0.75, 0.0203, 2, 0.07, 0.625, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if b_list[0] != None:\n r = np.mean(np.column_stack(b_list), 1)\n self.bias_val = r"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99572:Assign_L111_C12", "label": "r = mean()", "type": "assigned_variable", "loc": [111, 111], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99572:If_L110_C8", "vector": [14, 3, 0.75, 0.0068, 3, 0.63, 0.0, 436, 3, 2, 0, 0, 856, 10, 2], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "mean", "annotation": ""}, "snippet": " r = np.mean(np.column_stack(b_list), 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99572:Assign_L112_C12", "label": "self.bias_val =", "type": "assigned_variable", "loc": [112, 112], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99572:If_L110_C8", "vector": [14, 3, 0.7568, 0.0068, 3, 0.63, 1.0, 674, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.bias_val", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.bias_val = r"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99572:Expr_L114_C8", "label": "print()", "type": "expression", "loc": [114, 114], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99572:FunctionDef_L100_C4", "vector": [8, 2, 0.7703, 0.0068, 2, 0.07, 0.75, 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_99572:Expr_L115_C8", "label": "print()", "type": "expression", "loc": [115, 115], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99572:FunctionDef_L100_C4", "vector": [8, 2, 0.777, 0.0068, 2, 0.07, 0.875, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('DONE biasing ft')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99572:Expr_L116_C8", "label": "print()", "type": "expression", "loc": [116, 116], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99572:FunctionDef_L100_C4", "vector": [8, 2, 0.7838, 0.0068, 2, 0.07, 1.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99572:If_L118_C0", "label": "if", "type": "if", "loc": [118, 136], "level": 0, "parent": null, "vector": [4, 0, 0.8581, 0.1284, 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 import time\n p = optparse.OptionParser()\n p.add_option('-t', action='store', default='force_torque_ft1', type='string', \n dest='topic', help='which topic to listen to (default force_torque_ft1)')\n p.add_option('--netft', action='store_true', dest='netft',\n help='is this a NetFT sensor')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99572:Import_L119_C4", "label": "optparse import optparse", "type": "import", "loc": [119, 119], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99572:If_L118_C0", "vector": [1, 1, 0.8041, 0.0068, 1, 0.71, 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_99572:Import_L120_C4", "label": "time import time", "type": "import", "loc": [120, 120], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99572:If_L118_C0", "vector": [1, 1, 0.8108, 0.0068, 1, 0.71, 0.125, 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_99572:Assign_L121_C4", "label": "p = OptionParser()", "type": "assigned_variable", "loc": [121, 121], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99572:If_L118_C0", "vector": [14, 1, 0.8176, 0.0068, 1, 0.71, 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_99572:Expr_L122_C4", "label": "add_option()", "type": "expression", "loc": [122, 123], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99572:If_L118_C0", "vector": [8, 1, 0.8277, 0.0135, 1, 0.71, 0.375, 176, 3, 6, 0, 0, 0, 0, 1], "semantic": {"name": "add_option", "arg_names": [], "import_names": [], "rhs_call_name": "add_option", "annotation": ""}, "snippet": " p.add_option('-t', action='store', default='force_torque_ft1', type='string', \n dest='topic', help='which topic to listen to (default force_torque_ft1)')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99572:Expr_L124_C4", "label": "add_option()", "type": "expression", "loc": [124, 125], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99572:If_L118_C0", "vector": [8, 1, 0.8412, 0.0135, 1, 0.71, 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('--netft', action='store_true', dest='netft',\n help='is this a NetFT sensor')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99572:Assign_L126_C4", "label": "opt, args = parse_args()", "type": "assigned_variable", "loc": [126, 126], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99572:If_L118_C0", "vector": [14, 1, 0.8514, 0.0068, 1, 0.71, 0.625, 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_99572:Assign_L128_C4", "label": "client = FTClient()", "type": "assigned_variable", "loc": [128, 128], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99572:If_L118_C0", "vector": [14, 1, 0.8649, 0.0068, 1, 0.71, 0.75, 608, 3, 2, 0, 0, 78, 10, 1], "semantic": {"name": "client", "arg_names": [], "import_names": [], "rhs_call_name": "FTClient", "annotation": ""}, "snippet": " client = FTClient(opt.topic, opt.netft)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99572:Expr_L129_C4", "label": "bias()", "type": "expression", "loc": [129, 129], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99572:If_L118_C0", "vector": [8, 1, 0.8716, 0.0068, 1, 0.71, 0.875, 354, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "bias", "arg_names": [], "import_names": [], "rhs_call_name": "bias", "annotation": ""}, "snippet": " client.bias()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99572:While_L130_C4", "label": "while", "type": "while", "loc": [130, 136], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99572:If_L118_C0", "vector": [5, 1, 0.8986, 0.0473, 1, 0.71, 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 el = client.read()\n if el != None:\n #print np.linalg.norm(el.T)\n f = el.A1\n print(' %.2f %.2f %.2f'%(f[0], f[1], f[2]))\n time.sleep(1/100.0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99572:Assign_L131_C8", "label": "el = read()", "type": "assigned_variable", "loc": [131, 131], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99572:While_L130_C4", "vector": [14, 2, 0.8851, 0.0068, 2, 0.55, 0.0, 144, 3, 0, 0, 0, 453, 10, 1], "semantic": {"name": "el", "arg_names": [], "import_names": [], "rhs_call_name": "read", "annotation": ""}, "snippet": " el = client.read()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99572:If_L132_C8", "label": "if", "type": "if", "loc": [132, 135], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99572:While_L130_C4", "vector": [4, 2, 0.902, 0.027, 2, 0.55, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if el != None:\n #print np.linalg.norm(el.T)\n f = el.A1\n print(' %.2f %.2f %.2f'%(f[0], f[1], f[2]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99572:Assign_L134_C12", "label": "f =", "type": "assigned_variable", "loc": [134, 134], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99572:If_L132_C8", "vector": [14, 3, 0.9054, 0.0068, 3, 0.18, 0.0, 899, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " f = el.A1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99572:Expr_L135_C12", "label": "print()", "type": "expression", "loc": [135, 135], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99572:If_L132_C8", "vector": [8, 3, 0.9122, 0.0068, 3, 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(' %.2f %.2f %.2f'%(f[0], f[1], f[2]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99572:Expr_L136_C8", "label": "sleep()", "type": "expression", "loc": [136, 136], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99572:While_L130_C4", "vector": [8, 2, 0.9189, 0.0068, 2, 0.55, 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(1/100.0)"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99572:ClassDef_L42_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99572:FunctionDef_L43_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99572:FunctionDef_L43_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99572:If_L44_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99572:If_L44_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99572:FunctionDef_L45_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99572:FunctionDef_L45_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99572:Assign_L46_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99572:FunctionDef_L45_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99572:Assign_L47_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99572:FunctionDef_L45_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99572:Assign_L48_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99572:FunctionDef_L45_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99572:Return_L49_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99572:If_L44_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99572:Assign_L50_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99572:If_L44_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99572:FunctionDef_L52_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99572:FunctionDef_L52_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99572:Assign_L53_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99572:FunctionDef_L52_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99572:Assign_L54_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99572:FunctionDef_L52_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99572:Return_L55_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99572:If_L44_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99572:Assign_L56_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99572:FunctionDef_L43_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99572:Expr_L58_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99572:FunctionDef_L43_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99572:Assign_L62_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99572:ClassDef_L42_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99572:FunctionDef_L71_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99572:FunctionDef_L71_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99572:If_L73_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99572:If_L73_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99572:Assign_L74_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99572:If_L73_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99572:If_L75_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99572:FunctionDef_L71_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99572:Assign_L78_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99572:FunctionDef_L71_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99572:For_L79_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99572:For_L79_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99572:If_L80_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99572:If_L80_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99572:Assign_L81_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99572:If_L80_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99572:Assign_L83_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99572:For_L79_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99572:Expr_L84_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99572:FunctionDef_L71_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99572:Assign_L85_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99572:FunctionDef_L71_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99572:If_L87_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99572:If_L87_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99572:Assign_L91_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99572:If_L87_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99572:Assign_L93_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99572:FunctionDef_L71_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99572:If_L95_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99572:If_L95_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99572:Return_L96_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99572:If_L95_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99572:Return_L98_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99572:ClassDef_L42_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99572:FunctionDef_L100_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99572:FunctionDef_L100_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99572:Expr_L101_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99572:FunctionDef_L100_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99572:Expr_L102_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99572:FunctionDef_L100_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99572:Expr_L103_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99572:FunctionDef_L100_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99572:Assign_L105_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99572:FunctionDef_L100_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99572:For_L106_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99572:For_L106_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99572:Assign_L107_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99572:For_L106_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99572:Expr_L108_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99572:FunctionDef_L100_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99572:If_L110_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99572:If_L110_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99572:Assign_L111_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99572:If_L110_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99572:Assign_L112_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99572:FunctionDef_L100_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99572:Expr_L114_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99572:FunctionDef_L100_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99572:Expr_L115_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99572:FunctionDef_L100_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99572:Expr_L116_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99572:If_L118_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99572:Import_L119_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99572:If_L118_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99572:Import_L120_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99572:If_L118_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99572:Assign_L121_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99572:If_L118_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99572:Expr_L122_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99572:If_L118_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99572:Expr_L124_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99572:If_L118_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99572:Assign_L126_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99572:If_L118_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99572:Assign_L128_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99572:If_L118_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99572:Expr_L129_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99572:If_L118_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99572:While_L130_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99572:While_L130_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99572:Assign_L131_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99572:While_L130_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99572:If_L132_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99572:If_L132_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99572:Assign_L134_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99572:If_L132_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99572:Expr_L135_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99572:While_L130_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99572:Expr_L136_C8"}]
#!/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 (Healthcare Robotics Lab, Georgia Tech.) # \author Cressel Anderson (Healthcare Robotics Lab, Georgia Tech.) # \author Hai Nguyen (Healthcare Robotics Lab, Georgia Tech.) import roslib; roslib.load_manifest('force_torque') import rospy from hrl_msgs.msg import FloatArray #import hrl_lib.rutils as ru import AMTIForce2 as af import threading import time #import rutils as ru class AMTIForceServer(threading.Thread): def __init__(self, device_path, str_id): threading.Thread.__init__(self) try: rospy.init_node('AMTIForceServer') print 'AMTIForceServer: ros is up!' except rospy.ROSException: pass print 'AMTIForceServer: connecting to', device_path self.force_plate = af.AMTI_force(device_path) name = 'force_torque_' + str_id print 'AMTIForceServer: publishing', name, 'with type FloatArray' self.channel = rospy.Publisher(name, FloatArray, tcp_nodelay=True) def broadcast(self): print 'AMTIForceServer: started!' while not rospy.is_shutdown(): time.sleep(1/5000.0) self.channel.publish(FloatArray(None, self.force_plate.read().T.tolist()[0])) #DEPRECATED, use FTClient from ROSFTSensor with id = 0 #def AMTIForceClient(): # return ru.FloatArrayListener('AMTIForceClient', 'force_plate', 100.0) #import roslib; roslib.load_manifest('force_torque') #import force_torque.ROSAMTIForce as ft if __name__ == '__main__': import optparse p = optparse.OptionParser() p.add_option('--path', action='store', default='/dev/robot/force_plate0', type = 'string', dest='path', help='path to force torque device in (linux)') p.add_option('--name', action='store', default='ft1', type='string', dest='name', help='name given to FTSensor') opt, args = p.parse_args() server = AMTIForceServer(opt.path, opt.name) server.broadcast()
ajibawa-2023/Python-Code-Large/train/row_99573
31
84
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99573:Import_L33_C0", "label": "roslib import roslib", "type": "import", "loc": [33, 33], "level": 0, "parent": null, "vector": [1, 0, 0.3929, 0.0119, 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('force_torque')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99573:Expr_L33_C15", "label": "load_manifest()", "type": "expression", "loc": [33, 33], "level": 0, "parent": null, "vector": [8, 0, 0.3929, 0.0119, 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('force_torque')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99573:Import_L34_C0", "label": "rospy import rospy", "type": "import", "loc": [34, 34], "level": 0, "parent": null, "vector": [1, 0, 0.4048, 0.0119, 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_99573:ImportFrom_L35_C0", "label": "from hrl_msgs.msg import FloatArray", "type": "import", "loc": [35, 35], "level": 0, "parent": null, "vector": [1, 0, 0.4167, 0.0119, 0, 0.66, 0.375, 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_99573:Import_L38_C0", "label": "AMTIForce2 import af", "type": "import", "loc": [38, 38], "level": 0, "parent": null, "vector": [1, 0, 0.4524, 0.0119, 0, 0.66, 0.5, 237, 0, 1, 0, 0, 237, 0, 0], "semantic": {"name": "AMTIForce2", "arg_names": [], "import_names": ["af"], "rhs_call_name": "", "annotation": ""}, "snippet": "import AMTIForce2 as af"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99573:Import_L40_C0", "label": "threading import threading", "type": "import", "loc": [40, 40], "level": 0, "parent": null, "vector": [1, 0, 0.4762, 0.0119, 0, 0.66, 0.625, 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_99573:Import_L41_C0", "label": "time import time", "type": "import", "loc": [41, 41], "level": 0, "parent": null, "vector": [1, 0, 0.4881, 0.0119, 0, 0.66, 0.75, 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_99573:ClassDef_L45_C0", "label": "AMTIForceServer", "type": "class", "loc": [45, 64], "level": 0, "parent": null, "vector": [3, 0, 0.6488, 0.2381, 0, 0.66, 0.875, 362, 0, 2, 0, 0, 634, 0, 14], "semantic": {"name": "AMTIForceServer", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class AMTIForceServer(threading.Thread):\n def __init__(self, device_path, str_id):\n threading.Thread.__init__(self)\n try:\n rospy.init_node('AMTIForceServer')\n print('AMTIForceServer: ros is up!')\n except rospy.ROSException:\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99573:FunctionDef_L46_C4", "label": "__init__", "type": "function", "loc": [46, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99573:ClassDef_L45_C0", "vector": [2, 1, 0.619, 0.1548, 1, 0.35, 0.0, 555, 0, 3, 0, 0, 0, 0, 7], "semantic": {"name": "__init__", "arg_names": ["self", "device_path", "str_id"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, device_path, str_id):\n threading.Thread.__init__(self)\n try:\n rospy.init_node('AMTIForceServer')\n print('AMTIForceServer: ros is up!')\n except rospy.ROSException:\n pass\n print('AMTIForceServer: connecting to', device_path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99573:Expr_L47_C8", "label": "__init__()", "type": "expression", "loc": [47, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99573:FunctionDef_L46_C4", "vector": [8, 2, 0.5595, 0.0119, 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": " threading.Thread.__init__(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99573:Try_L48_C8", "label": "try", "type": "try", "loc": [48, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99573:FunctionDef_L46_C4", "vector": [7, 2, 0.5952, 0.0595, 2, 0.93, 0.1667, 0, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n rospy.init_node('AMTIForceServer')\n print('AMTIForceServer: ros is up!')\n except rospy.ROSException:\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99573:Expr_L49_C12", "label": "init_node()", "type": "expression", "loc": [49, 49], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99573:Try_L48_C8", "vector": [8, 3, 0.5833, 0.0119, 3, 0.6, 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('AMTIForceServer')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99573:Expr_L50_C12", "label": "print()", "type": "expression", "loc": [50, 50], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99573:Try_L48_C8", "vector": [8, 3, 0.5952, 0.0119, 3, 0.6, 1.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('AMTIForceServer: ros is up!')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99573:Expr_L53_C8", "label": "print()", "type": "expression", "loc": [53, 53], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99573:FunctionDef_L46_C4", "vector": [8, 2, 0.631, 0.0119, 2, 0.93, 0.3333, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('AMTIForceServer: connecting to', device_path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99573:Assign_L54_C8", "label": "self.force_plate = AMTI_force()", "type": "assigned_variable", "loc": [54, 54], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99573:FunctionDef_L46_C4", "vector": [14, 2, 0.6429, 0.0119, 2, 0.93, 0.5, 119, 3, 1, 0, 0, 808, 10, 1], "semantic": {"name": "self.force_plate", "arg_names": [], "import_names": [], "rhs_call_name": "AMTI_force", "annotation": ""}, "snippet": " self.force_plate = af.AMTI_force(device_path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99573:Assign_L56_C8", "label": "name =", "type": "assigned_variable", "loc": [56, 56], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99573:FunctionDef_L46_C4", "vector": [14, 2, 0.6667, 0.0119, 2, 0.93, 0.6667, 57, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " name = 'force_torque_' + str_id"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99573:Expr_L57_C8", "label": "print()", "type": "expression", "loc": [57, 57], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99573:FunctionDef_L46_C4", "vector": [8, 2, 0.6786, 0.0119, 2, 0.93, 0.8333, 535, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('AMTIForceServer: publishing', name, 'with type FloatArray')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99573:Assign_L58_C8", "label": "self.channel = Publisher()", "type": "assigned_variable", "loc": [58, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99573:FunctionDef_L46_C4", "vector": [14, 2, 0.6905, 0.0119, 2, 0.93, 1.0, 503, 3, 3, 0, 0, 45, 10, 1], "semantic": {"name": "self.channel", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " self.channel = rospy.Publisher(name, FloatArray, tcp_nodelay=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99573:FunctionDef_L60_C4", "label": "broadcast", "type": "function", "loc": [60, 64], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99573:ClassDef_L45_C0", "vector": [2, 1, 0.7381, 0.0595, 1, 0.35, 1.0, 803, 0, 1, 0, 0, 0, 0, 7], "semantic": {"name": "broadcast", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def broadcast(self):\n print('AMTIForceServer: started!')\n while not rospy.is_shutdown():\n time.sleep(1/5000.0)\n self.channel.publish(FloatArray(None, self.force_plate.read().T.tolist()[0]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99573:Expr_L61_C8", "label": "print()", "type": "expression", "loc": [61, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99573:FunctionDef_L60_C4", "vector": [8, 2, 0.7262, 0.0119, 2, 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('AMTIForceServer: started!')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99573:While_L62_C8", "label": "while", "type": "while", "loc": [62, 64], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99573:FunctionDef_L60_C4", "vector": [5, 2, 0.75, 0.0357, 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 rospy.is_shutdown():\n time.sleep(1/5000.0)\n self.channel.publish(FloatArray(None, self.force_plate.read().T.tolist()[0]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99573:Expr_L63_C12", "label": "sleep()", "type": "expression", "loc": [63, 63], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99573:While_L62_C8", "vector": [8, 3, 0.75, 0.0119, 3, 0.1, 0.0, 476, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " time.sleep(1/5000.0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99573:Expr_L64_C12", "label": "publish()", "type": "expression", "loc": [64, 64], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99573:While_L62_C8", "vector": [8, 3, 0.7619, 0.0119, 3, 0.1, 1.0, 102, 3, 1, 0, 0, 0, 0, 4], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.channel.publish(FloatArray(None, self.force_plate.read().T.tolist()[0]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99573:If_L72_C0", "label": "if", "type": "if", "loc": [72, 82], "level": 0, "parent": null, "vector": [4, 0, 0.9167, 0.131, 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 import optparse\n p = optparse.OptionParser()\n p.add_option('--path', action='store', default='/dev/robot/force_plate0', type = 'string',\n dest='path', help='path to force torque device in (linux)')\n p.add_option('--name', action='store', default='ft1', type='string', \n dest='name', help='name given to FTSensor')\n opt, args = p.parse_args()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99573:Import_L73_C4", "label": "optparse import optparse", "type": "import", "loc": [73, 73], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99573:If_L72_C0", "vector": [1, 1, 0.869, 0.0119, 1, 0.23, 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_99573:Assign_L74_C4", "label": "p = OptionParser()", "type": "assigned_variable", "loc": [74, 74], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99573:If_L72_C0", "vector": [14, 1, 0.881, 0.0119, 1, 0.23, 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_99573:Expr_L75_C4", "label": "add_option()", "type": "expression", "loc": [75, 76], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99573:If_L72_C0", "vector": [8, 1, 0.8988, 0.0238, 1, 0.23, 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('--path', action='store', default='/dev/robot/force_plate0', type = 'string',\n dest='path', help='path to force torque device in (linux)')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99573:Expr_L77_C4", "label": "add_option()", "type": "expression", "loc": [77, 78], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99573:If_L72_C0", "vector": [8, 1, 0.9226, 0.0238, 1, 0.23, 0.5, 176, 3, 6, 0, 0, 0, 0, 1], "semantic": {"name": "add_option", "arg_names": [], "import_names": [], "rhs_call_name": "add_option", "annotation": ""}, "snippet": " p.add_option('--name', action='store', default='ft1', type='string', \n dest='name', help='name given to FTSensor')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99573:Assign_L79_C4", "label": "opt, args = parse_args()", "type": "assigned_variable", "loc": [79, 79], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99573:If_L72_C0", "vector": [14, 1, 0.9405, 0.0119, 1, 0.23, 0.6667, 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_99573:Assign_L81_C4", "label": "server = AMTIForceServer()", "type": "assigned_variable", "loc": [81, 81], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99573:If_L72_C0", "vector": [14, 1, 0.9643, 0.0119, 1, 0.23, 0.8333, 268, 3, 2, 0, 0, 362, 10, 1], "semantic": {"name": "server", "arg_names": [], "import_names": [], "rhs_call_name": "AMTIForceServer", "annotation": ""}, "snippet": " server = AMTIForceServer(opt.path, opt.name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99573:Expr_L82_C4", "label": "broadcast()", "type": "expression", "loc": [82, 82], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99573:If_L72_C0", "vector": [8, 1, 0.9762, 0.0119, 1, 0.23, 1.0, 803, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "broadcast", "arg_names": [], "import_names": [], "rhs_call_name": "broadcast", "annotation": ""}, "snippet": " server.broadcast()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99573:ClassDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99573:FunctionDef_L46_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99573:FunctionDef_L46_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99573:Expr_L47_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99573:FunctionDef_L46_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99573:Try_L48_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99573:Try_L48_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99573:Expr_L49_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99573:Try_L48_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99573:Expr_L50_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99573:FunctionDef_L46_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99573:Expr_L53_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99573:FunctionDef_L46_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99573:Assign_L54_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99573:FunctionDef_L46_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99573:Assign_L56_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99573:FunctionDef_L46_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99573:Expr_L57_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99573:FunctionDef_L46_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99573:Assign_L58_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99573:ClassDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99573:FunctionDef_L60_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99573:FunctionDef_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99573:Expr_L61_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99573:FunctionDef_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99573:While_L62_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99573:While_L62_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99573:Expr_L63_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99573:While_L62_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99573:Expr_L64_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99573:If_L72_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99573:Import_L73_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99573:If_L72_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99573:Assign_L74_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99573:If_L72_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99573:Expr_L75_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99573:If_L72_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99573:Expr_L77_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99573:If_L72_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99573:Assign_L79_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99573:If_L72_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99573:Assign_L81_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99573:If_L72_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99573:Expr_L82_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 (Healthcare Robotics Lab, Georgia Tech.) # \author Cressel Anderson (Healthcare Robotics Lab, Georgia Tech.) # \author Hai Nguyen (Healthcare Robotics Lab, Georgia Tech.)
ajibawa-2023/Python-Code-Large/train/row_99575
0
30
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[]
[]
import roslib; roslib.load_manifest('hrl_lib') import rospy import std_srvs.srv as srv from hrl_msgs.msg import FloatArray import time x = 3.0 rospy.init_node('trial_publisher') pub = rospy.Publisher( 'trial_pub', FloatArray) while not rospy.is_shutdown(): x += 0.1 fa = FloatArray() fa.data = [ x, x+1.0, x+2.0 ] pub.publish( fa ) time.sleep( 0.3 )
ajibawa-2023/Python-Code-Large/train/row_99576
14
16
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99576:Import_L1_C0", "label": "roslib import roslib", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0625, 0.0625, 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_lib')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99576:Expr_L1_C15", "label": "load_manifest()", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.0625, 0.0625, 0, 0.66, 0.1111, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('hrl_lib')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99576:Import_L2_C0", "label": "rospy import rospy", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.125, 0.0625, 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_99576:Import_L3_C0", "label": "std_srvs.srv import srv", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.1875, 0.0625, 0, 0.66, 0.3333, 261, 0, 1, 0, 0, 261, 0, 0], "semantic": {"name": "std_srvs.srv", "arg_names": [], "import_names": ["srv"], "rhs_call_name": "", "annotation": ""}, "snippet": "import std_srvs.srv as srv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99576:ImportFrom_L4_C0", "label": "from hrl_msgs.msg import FloatArray", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.25, 0.0625, 0, 0.66, 0.4444, 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_99576:Import_L6_C0", "label": "time import time", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.375, 0.0625, 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_99576:Assign_L8_C0", "label": "x =", "type": "assigned_variable", "loc": [8, 8], "level": 0, "parent": null, "vector": [14, 0, 0.5, 0.0625, 0, 0.66, 0.6667, 190, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "x = 3.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99576:Expr_L9_C0", "label": "init_node()", "type": "expression", "loc": [9, 9], "level": 0, "parent": null, "vector": [8, 0, 0.5625, 0.0625, 0, 0.66, 0.7778, 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_publisher')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99576:Assign_L10_C0", "label": "pub = Publisher()", "type": "assigned_variable", "loc": [10, 10], "level": 0, "parent": null, "vector": [14, 0, 0.625, 0.0625, 0, 0.66, 0.8889, 41, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": "pub = rospy.Publisher( 'trial_pub', FloatArray)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99576:While_L11_C0", "label": "while", "type": "while", "loc": [11, 16], "level": 0, "parent": null, "vector": [5, 0, 0.8438, 0.375, 0, 0.66, 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 x += 0.1\n fa = FloatArray()\n fa.data = [ x, x+1.0, x+2.0 ]\n pub.publish( fa )\n time.sleep( 0.3 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99576:Assign_L13_C4", "label": "fa = FloatArray()", "type": "assigned_variable", "loc": [13, 13], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99576:While_L11_C0", "vector": [14, 1, 0.8125, 0.0625, 1, 0.03, 0.0, 730, 3, 0, 0, 0, 755, 10, 1], "semantic": {"name": "fa", "arg_names": [], "import_names": [], "rhs_call_name": "FloatArray", "annotation": ""}, "snippet": " fa = FloatArray()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99576:Assign_L14_C4", "label": "fa.data =", "type": "assigned_variable", "loc": [14, 14], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99576:While_L11_C0", "vector": [14, 1, 0.875, 0.0625, 1, 0.03, 0.3333, 706, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "fa.data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " fa.data = [ x, x+1.0, x+2.0 ]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99576:Expr_L15_C4", "label": "publish()", "type": "expression", "loc": [15, 15], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99576:While_L11_C0", "vector": [8, 1, 0.9375, 0.0625, 1, 0.03, 0.6667, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " pub.publish( fa )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99576:Expr_L16_C4", "label": "sleep()", "type": "expression", "loc": [16, 16], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99576:While_L11_C0", "vector": [8, 1, 1.0, 0.0625, 1, 0.03, 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 )"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99576:While_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99576:Assign_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99576:While_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99576:Assign_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99576:While_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99576:Expr_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99576:While_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99576:Expr_L16_C4"}]
#!/usr/bin/python # # Copyright (c) 2009, Georgia Tech Research Corporation # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # * Neither the name of the Georgia Tech Research Corporation nor the # names of its contributors may be used to endorse or promote products # derived from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY GEORGIA TECH RESEARCH CORPORATION ''AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL GEORGIA TECH BE LIABLE FOR ANY DIRECT, INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # \author Advait Jain (Healthcare Robotics Lab, Georgia Tech.) # \author Cressel Anderson (Healthcare Robotics Lab, Georgia Tech.) # \author Hai Nguyen (Healthcare Robotics Lab, Georgia Tech.) import roslib; roslib.load_manifest('force_torque') import rospy import hrl_lib.rutils as ru import hrl_lib.util as ut from hrl_msgs.msg import FloatArray from geometry_msgs.msg import WrenchStamped import numpy as np ## # Corresponding client class class FTClient(ru.GenericListener): def __init__(self, topic_name, netft=False): if netft: def msg_converter(msg): fx, fy, fz = msg.wrench.force.x, msg.wrench.force.y, msg.wrench.force.z tx, ty, tz = msg.wrench.torque.x, msg.wrench.torque.y, msg.wrench.torque.z msg_time = rospy.get_time() return -np.matrix([fx, fy, fz, tx, ty, tz]).T, msg_time msg_type=WrenchStamped else: def msg_converter(msg): m = np.matrix(msg.data, 'f').T msg_time = msg.header.stamp.to_time() return m, msg_time msg_type = FloatArray ru.GenericListener.__init__(self, 'FTClient', msg_type, topic_name, 50.0, message_extractor = msg_converter, queue_size = None) self.bias_val = np.matrix([0, 0, 0, 0, 0, 0.]).T ## # Read a force torque value # @param avg how many force torque value to average # @param without_bias # @param fresh # @param with_time_stamp # @return an averaged force torque value (6x1 matrix) def read(self, avg=1, without_bias=False, fresh=False, with_time_stamp=False): assert(avg > 0) if avg > 1: fresh = True if with_time_stamp: raise RuntimeError('Can\'t request averaging and timestamping at the same time') rs = [] for i in range(avg): if fresh: r, msg_time = ru.GenericListener.read(self, allow_duplication=False, willing_to_wait=True) else: r, msg_time = ru.GenericListener.read(self, allow_duplication=True, willing_to_wait=False) rs.append(r) readings = ut.list_mat_to_mat(rs, axis=1) if not without_bias: #print 'readiings.mean(1)', readings.mean(1) #print 'self.bias_val', self.bias_val ret = readings.mean(1) - self.bias_val else: ret = readings.mean(1) if with_time_stamp: return ret, msg_time else: return ret def bias(self): print '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!' print 'BIASING FT' print '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!' b_list = [] for i in range(20): r, msg_time = ru.GenericListener.read(self, allow_duplication=False, willing_to_wait=True) b_list.append(r) if b_list[0] != None: r = np.mean(np.column_stack(b_list), 1) self.bias_val = r print '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!' print 'DONE biasing ft' print '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!' if __name__ == '__main__': import optparse import time p = optparse.OptionParser() p.add_option('-t', action='store', default='force_torque_ft1', type='string', dest='topic', help='which topic to listen to (default force_torque_ft1)') p.add_option('--netft', action='store_true', dest='netft', help='is this a NetFT sensor') opt, args = p.parse_args() client = FTClient(opt.topic, opt.netft) client.bias() while not rospy.is_shutdown(): el = client.read() if el != None: #print np.linalg.norm(el.T) f = el.A1 print ' %.2f %.2f %.2f'%(f[0], f[1], f[2]) time.sleep(1/100.0)
ajibawa-2023/Python-Code-Large/train/row_99577
70
148
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99577:Import_L32_C0", "label": "roslib import roslib", "type": "import", "loc": [32, 32], "level": 0, "parent": null, "vector": [1, 0, 0.2162, 0.0068, 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('force_torque')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99577:Expr_L32_C15", "label": "load_manifest()", "type": "expression", "loc": [32, 32], "level": 0, "parent": null, "vector": [8, 0, 0.2162, 0.0068, 0, 0.66, 0.1111, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('force_torque')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99577:Import_L33_C0", "label": "rospy import rospy", "type": "import", "loc": [33, 33], "level": 0, "parent": null, "vector": [1, 0, 0.223, 0.0068, 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_99577:Import_L34_C0", "label": "hrl_lib.rutils import ru", "type": "import", "loc": [34, 34], "level": 0, "parent": null, "vector": [1, 0, 0.2297, 0.0068, 0, 0.66, 0.3333, 847, 0, 1, 0, 0, 847, 0, 0], "semantic": {"name": "hrl_lib.rutils", "arg_names": [], "import_names": ["ru"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.rutils as ru"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99577:Import_L35_C0", "label": "hrl_lib.util import ut", "type": "import", "loc": [35, 35], "level": 0, "parent": null, "vector": [1, 0, 0.2365, 0.0068, 0, 0.66, 0.4444, 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_99577:ImportFrom_L36_C0", "label": "from hrl_msgs.msg import FloatArray", "type": "import", "loc": [36, 36], "level": 0, "parent": null, "vector": [1, 0, 0.2432, 0.0068, 0, 0.66, 0.5556, 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_99577:ImportFrom_L37_C0", "label": "from geometry_msgs.msg import WrenchStamped", "type": "import", "loc": [37, 37], "level": 0, "parent": null, "vector": [1, 0, 0.25, 0.0068, 0, 0.66, 0.6667, 951, 0, 1, 0, 0, 951, 0, 0], "semantic": {"name": "geometry_msgs.msg", "arg_names": [], "import_names": ["WrenchStamped"], "rhs_call_name": "", "annotation": ""}, "snippet": "from geometry_msgs.msg import WrenchStamped"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99577:Import_L38_C0", "label": "numpy import np", "type": "import", "loc": [38, 38], "level": 0, "parent": null, "vector": [1, 0, 0.2568, 0.0068, 0, 0.66, 0.7778, 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_99577:ClassDef_L42_C0", "label": "FTClient", "type": "class", "loc": [42, 116], "level": 0, "parent": null, "vector": [3, 0, 0.5338, 0.5068, 0, 0.66, 0.8889, 78, 0, 5, 0, 0, 342, 0, 25], "semantic": {"name": "FTClient", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class FTClient(ru.GenericListener):\n def __init__(self, topic_name, netft=False):\n if netft:\n def msg_converter(msg):\n fx, fy, fz = msg.wrench.force.x, msg.wrench.force.y, msg.wrench.force.z\n tx, ty, tz = msg.wrench.torque.x, msg.wrench.torque.y, msg.wrench.torque.z\n msg_time = rospy.get_time()\n return -np.matrix([fx, fy, fz, tx, ty, tz]).T, msg_time"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99577:FunctionDef_L43_C4", "label": "__init__", "type": "function", "loc": [43, 62], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99577:ClassDef_L42_C0", "vector": [2, 1, 0.3547, 0.1351, 1, 0.79, 0.0, 555, 0, 3, 1, 0, 0, 0, 6], "semantic": {"name": "__init__", "arg_names": ["self", "topic_name", "netft"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, topic_name, netft=False):\n if netft:\n def msg_converter(msg):\n fx, fy, fz = msg.wrench.force.x, msg.wrench.force.y, msg.wrench.force.z\n tx, ty, tz = msg.wrench.torque.x, msg.wrench.torque.y, msg.wrench.torque.z\n msg_time = rospy.get_time()\n return -np.matrix([fx, fy, fz, tx, ty, tz]).T, msg_time\n msg_type=WrenchStamped"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99577:If_L44_C8", "label": "if", "type": "if", "loc": [44, 56], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99577:FunctionDef_L43_C4", "vector": [4, 2, 0.3378, 0.0878, 2, 0.36, 0.0, 0, 2, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if netft:\n def msg_converter(msg):\n fx, fy, fz = msg.wrench.force.x, msg.wrench.force.y, msg.wrench.force.z\n tx, ty, tz = msg.wrench.torque.x, msg.wrench.torque.y, msg.wrench.torque.z\n msg_time = rospy.get_time()\n return -np.matrix([fx, fy, fz, tx, ty, tz]).T, msg_time\n msg_type=WrenchStamped\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99577:FunctionDef_L45_C12", "label": "msg_converter", "type": "function", "loc": [45, 49], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99577:If_L44_C8", "vector": [2, 3, 0.3176, 0.0338, 3, 0.44, 0.0, 549, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "msg_converter", "arg_names": ["msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def msg_converter(msg):\n fx, fy, fz = msg.wrench.force.x, msg.wrench.force.y, msg.wrench.force.z\n tx, ty, tz = msg.wrench.torque.x, msg.wrench.torque.y, msg.wrench.torque.z\n msg_time = rospy.get_time()\n return -np.matrix([fx, fy, fz, tx, ty, tz]).T, msg_time"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99577:Assign_L46_C16", "label": "fx, fy, fz =", "type": "assigned_variable", "loc": [46, 46], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99577:FunctionDef_L45_C12", "vector": [14, 4, 0.3108, 0.0068, 4, 0.16, 0.0, 183, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "fx, fy, fz", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " fx, fy, fz = msg.wrench.force.x, msg.wrench.force.y, msg.wrench.force.z"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99577:Assign_L47_C16", "label": "tx, ty, tz =", "type": "assigned_variable", "loc": [47, 47], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99577:FunctionDef_L45_C12", "vector": [14, 4, 0.3176, 0.0068, 4, 0.16, 0.3333, 564, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "tx, ty, tz", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tx, ty, tz = msg.wrench.torque.x, msg.wrench.torque.y, msg.wrench.torque.z"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99577:Assign_L48_C16", "label": "msg_time = get_time()", "type": "assigned_variable", "loc": [48, 48], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99577:FunctionDef_L45_C12", "vector": [14, 4, 0.3243, 0.0068, 4, 0.16, 0.6667, 757, 3, 0, 0, 0, 164, 10, 1], "semantic": {"name": "msg_time", "arg_names": [], "import_names": [], "rhs_call_name": "get_time", "annotation": ""}, "snippet": " msg_time = rospy.get_time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99577:Return_L49_C16", "label": "return", "type": "return", "loc": [49, 49], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99577:FunctionDef_L45_C12", "vector": [13, 4, 0.3311, 0.0068, 4, 0.16, 1.0, 0, 0, 0, 0, 0, 0, 8, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return -np.matrix([fx, fy, fz, tx, ty, tz]).T, msg_time"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99577:Assign_L50_C12", "label": "msg_type =", "type": "assigned_variable", "loc": [50, 50], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99577:If_L44_C8", "vector": [14, 3, 0.3378, 0.0068, 3, 0.44, 0.3333, 412, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "msg_type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " msg_type=WrenchStamped"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99577:FunctionDef_L52_C12", "label": "msg_converter", "type": "function", "loc": [52, 55], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99577:If_L44_C8", "vector": [2, 3, 0.3615, 0.027, 3, 0.44, 0.6667, 549, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "msg_converter", "arg_names": ["msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def msg_converter(msg):\n m = np.matrix(msg.data, 'f').T\n msg_time = msg.header.stamp.to_time()\n return m, msg_time"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99577:Assign_L53_C16", "label": "m =", "type": "assigned_variable", "loc": [53, 53], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99577:FunctionDef_L52_C12", "vector": [14, 4, 0.3581, 0.0068, 4, 0.36, 0.0, 711, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " m = np.matrix(msg.data, 'f').T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99577:Assign_L54_C16", "label": "msg_time = to_time()", "type": "assigned_variable", "loc": [54, 54], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99577:FunctionDef_L52_C12", "vector": [14, 4, 0.3649, 0.0068, 4, 0.36, 0.5, 757, 3, 0, 0, 0, 739, 10, 1], "semantic": {"name": "msg_time", "arg_names": [], "import_names": [], "rhs_call_name": "to_time", "annotation": ""}, "snippet": " msg_time = msg.header.stamp.to_time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99577:Return_L55_C16", "label": "return", "type": "return", "loc": [55, 55], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99577:FunctionDef_L52_C12", "vector": [13, 4, 0.3716, 0.0068, 4, 0.36, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return m, msg_time"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99577:Assign_L56_C12", "label": "msg_type =", "type": "assigned_variable", "loc": [56, 56], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99577:If_L44_C8", "vector": [14, 3, 0.3784, 0.0068, 3, 0.44, 1.0, 412, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "msg_type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " msg_type = FloatArray"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99577:Expr_L58_C8", "label": "__init__()", "type": "expression", "loc": [58, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99577:FunctionDef_L43_C4", "vector": [8, 2, 0.402, 0.027, 2, 0.36, 0.5, 555, 3, 7, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " ru.GenericListener.__init__(self, 'FTClient', msg_type,\n topic_name, 50.0,\n message_extractor = msg_converter,\n queue_size = None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99577:Assign_L62_C8", "label": "self.bias_val =", "type": "assigned_variable", "loc": [62, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99577:FunctionDef_L43_C4", "vector": [14, 2, 0.4189, 0.0068, 2, 0.36, 1.0, 674, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.bias_val", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.bias_val = np.matrix([0, 0, 0, 0, 0, 0.]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99577:FunctionDef_L71_C4", "label": "read", "type": "function", "loc": [71, 98], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99577:ClassDef_L42_C0", "vector": [2, 1, 0.5709, 0.1892, 1, 0.79, 0.5, 453, 0, 5, 1, 0, 0, 0, 8], "semantic": {"name": "read", "arg_names": ["self", "avg", "without_bias", "fresh", "with_time_stamp"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def read(self, avg=1, without_bias=False, fresh=False, with_time_stamp=False):\n assert(avg > 0)\n if avg > 1:\n fresh = True\n if with_time_stamp:\n raise RuntimeError('Can\\'t request averaging and timestamping at the same time')\n\n rs = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99577:If_L73_C8", "label": "if", "type": "if", "loc": [73, 76], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99577:FunctionDef_L71_C4", "vector": [4, 2, 0.5034, 0.027, 2, 0.28, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if avg > 1:\n fresh = True\n if with_time_stamp:\n raise RuntimeError('Can\\'t request averaging and timestamping at the same time')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99577:Assign_L74_C12", "label": "fresh =", "type": "assigned_variable", "loc": [74, 74], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99577:If_L73_C8", "vector": [14, 3, 0.5, 0.0068, 3, 0.06, 0.0, 195, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "fresh", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " fresh = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99577:If_L75_C12", "label": "if", "type": "if", "loc": [75, 76], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99577:If_L73_C8", "vector": [4, 3, 0.5101, 0.0135, 3, 0.06, 1.0, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if with_time_stamp:\n raise RuntimeError('Can\\'t request averaging and timestamping at the same time')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99577:Assign_L78_C8", "label": "rs =", "type": "assigned_variable", "loc": [78, 78], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99577:FunctionDef_L71_C4", "vector": [14, 2, 0.527, 0.0068, 2, 0.28, 0.2, 594, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "rs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rs = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99577:For_L79_C8", "label": "for i", "type": "for", "loc": [79, 84], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99577:FunctionDef_L71_C4", "vector": [6, 2, 0.5507, 0.0405, 2, 0.28, 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(avg):\n if fresh:\n r, msg_time = ru.GenericListener.read(self, allow_duplication=False, willing_to_wait=True) \n else:\n r, msg_time = ru.GenericListener.read(self, allow_duplication=True, willing_to_wait=False) \n rs.append(r)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99577:If_L80_C12", "label": "if", "type": "if", "loc": [80, 83], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99577:For_L79_C8", "vector": [4, 3, 0.5507, 0.027, 3, 0.85, 0.0, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if fresh:\n r, msg_time = ru.GenericListener.read(self, allow_duplication=False, willing_to_wait=True) \n else:\n r, msg_time = ru.GenericListener.read(self, allow_duplication=True, willing_to_wait=False) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99577:Assign_L81_C16", "label": "r, msg_time = read()", "type": "assigned_variable", "loc": [81, 81], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99577:If_L80_C12", "vector": [14, 4, 0.5473, 0.0068, 4, 0.47, 0.0, 178, 3, 3, 0, 0, 453, 10, 1], "semantic": {"name": "r, msg_time", "arg_names": [], "import_names": [], "rhs_call_name": "read", "annotation": ""}, "snippet": " r, msg_time = ru.GenericListener.read(self, allow_duplication=False, willing_to_wait=True) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99577:Assign_L83_C16", "label": "r, msg_time = read()", "type": "assigned_variable", "loc": [83, 83], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99577:If_L80_C12", "vector": [14, 4, 0.5608, 0.0068, 4, 0.47, 1.0, 178, 3, 3, 0, 0, 453, 10, 1], "semantic": {"name": "r, msg_time", "arg_names": [], "import_names": [], "rhs_call_name": "read", "annotation": ""}, "snippet": " r, msg_time = ru.GenericListener.read(self, allow_duplication=True, willing_to_wait=False) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99577:Expr_L84_C12", "label": "append()", "type": "expression", "loc": [84, 84], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99577:For_L79_C8", "vector": [8, 3, 0.5676, 0.0068, 3, 0.85, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " rs.append(r)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99577:Assign_L85_C8", "label": "readings = list_mat_to_mat()", "type": "assigned_variable", "loc": [85, 85], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99577:FunctionDef_L71_C4", "vector": [14, 2, 0.5743, 0.0068, 2, 0.28, 0.6, 608, 3, 2, 0, 0, 162, 10, 1], "semantic": {"name": "readings", "arg_names": [], "import_names": [], "rhs_call_name": "list_mat_to_mat", "annotation": ""}, "snippet": " readings = ut.list_mat_to_mat(rs, axis=1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99577:If_L87_C8", "label": "if", "type": "if", "loc": [87, 93], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99577:FunctionDef_L71_C4", "vector": [4, 2, 0.6081, 0.0473, 2, 0.28, 0.8, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not without_bias:\n #print 'readiings.mean(1)', readings.mean(1)\n #print 'self.bias_val', self.bias_val\n\n ret = readings.mean(1) - self.bias_val\n else:\n ret = readings.mean(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99577:Assign_L91_C12", "label": "ret =", "type": "assigned_variable", "loc": [91, 91], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99577:If_L87_C8", "vector": [14, 3, 0.6149, 0.0068, 3, 0.31, 0.0, 501, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "ret", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ret = readings.mean(1) - self.bias_val"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99577:Assign_L93_C12", "label": "ret = mean()", "type": "assigned_variable", "loc": [93, 93], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99577:If_L87_C8", "vector": [14, 3, 0.6284, 0.0068, 3, 0.31, 1.0, 501, 3, 1, 0, 0, 856, 10, 1], "semantic": {"name": "ret", "arg_names": [], "import_names": [], "rhs_call_name": "mean", "annotation": ""}, "snippet": " ret = readings.mean(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99577:If_L95_C8", "label": "if", "type": "if", "loc": [95, 98], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99577:FunctionDef_L71_C4", "vector": [4, 2, 0.652, 0.027, 2, 0.28, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if with_time_stamp:\n return ret, msg_time\n else:\n return ret"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99577:Return_L96_C12", "label": "return", "type": "return", "loc": [96, 96], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99577:If_L95_C8", "vector": [13, 3, 0.6486, 0.0068, 3, 0.02, 0.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ret, msg_time"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99577:Return_L98_C12", "label": "return", "type": "return", "loc": [98, 98], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99577:If_L95_C8", "vector": [13, 3, 0.6622, 0.0068, 3, 0.02, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ret"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99577:FunctionDef_L100_C4", "label": "bias", "type": "function", "loc": [100, 116], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99577:ClassDef_L42_C0", "vector": [2, 1, 0.7297, 0.1149, 1, 0.79, 1.0, 354, 0, 1, 0, 0, 0, 0, 11], "semantic": {"name": "bias", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def bias(self):\n print('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!')\n print('BIASING FT')\n print('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!')\n\n b_list = []\n for i in range(20):\n r, msg_time = ru.GenericListener.read(self, allow_duplication=False, willing_to_wait=True) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99577:Expr_L101_C8", "label": "print()", "type": "expression", "loc": [101, 101], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99577:FunctionDef_L100_C4", "vector": [8, 2, 0.6824, 0.0068, 2, 0.59, 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_99577:Expr_L102_C8", "label": "print()", "type": "expression", "loc": [102, 102], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99577:FunctionDef_L100_C4", "vector": [8, 2, 0.6892, 0.0068, 2, 0.59, 0.125, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('BIASING FT')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99577:Expr_L103_C8", "label": "print()", "type": "expression", "loc": [103, 103], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99577:FunctionDef_L100_C4", "vector": [8, 2, 0.6959, 0.0068, 2, 0.59, 0.25, 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_99577:Assign_L105_C8", "label": "b_list =", "type": "assigned_variable", "loc": [105, 105], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99577:FunctionDef_L100_C4", "vector": [14, 2, 0.7095, 0.0068, 2, 0.59, 0.375, 694, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "b_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " b_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99577:For_L106_C8", "label": "for i", "type": "for", "loc": [106, 108], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99577:FunctionDef_L100_C4", "vector": [6, 2, 0.723, 0.0203, 2, 0.59, 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(20):\n r, msg_time = ru.GenericListener.read(self, allow_duplication=False, willing_to_wait=True) \n b_list.append(r)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99577:Assign_L107_C12", "label": "r, msg_time = read()", "type": "assigned_variable", "loc": [107, 107], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99577:For_L106_C8", "vector": [14, 3, 0.723, 0.0068, 3, 0.38, 0.0, 178, 3, 3, 0, 0, 453, 10, 1], "semantic": {"name": "r, msg_time", "arg_names": [], "import_names": [], "rhs_call_name": "read", "annotation": ""}, "snippet": " r, msg_time = ru.GenericListener.read(self, allow_duplication=False, willing_to_wait=True) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99577:Expr_L108_C12", "label": "append()", "type": "expression", "loc": [108, 108], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99577:For_L106_C8", "vector": [8, 3, 0.7297, 0.0068, 3, 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": " b_list.append(r)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99577:If_L110_C8", "label": "if", "type": "if", "loc": [110, 112], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99577:FunctionDef_L100_C4", "vector": [4, 2, 0.75, 0.0203, 2, 0.59, 0.625, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if b_list[0] != None:\n r = np.mean(np.column_stack(b_list), 1)\n self.bias_val = r"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99577:Assign_L111_C12", "label": "r = mean()", "type": "assigned_variable", "loc": [111, 111], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99577:If_L110_C8", "vector": [14, 3, 0.75, 0.0068, 3, 0.89, 0.0, 436, 3, 2, 0, 0, 856, 10, 2], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "mean", "annotation": ""}, "snippet": " r = np.mean(np.column_stack(b_list), 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99577:Assign_L112_C12", "label": "self.bias_val =", "type": "assigned_variable", "loc": [112, 112], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99577:If_L110_C8", "vector": [14, 3, 0.7568, 0.0068, 3, 0.89, 1.0, 674, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.bias_val", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.bias_val = r"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99577:Expr_L114_C8", "label": "print()", "type": "expression", "loc": [114, 114], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99577:FunctionDef_L100_C4", "vector": [8, 2, 0.7703, 0.0068, 2, 0.59, 0.75, 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_99577:Expr_L115_C8", "label": "print()", "type": "expression", "loc": [115, 115], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99577:FunctionDef_L100_C4", "vector": [8, 2, 0.777, 0.0068, 2, 0.59, 0.875, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('DONE biasing ft')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99577:Expr_L116_C8", "label": "print()", "type": "expression", "loc": [116, 116], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99577:FunctionDef_L100_C4", "vector": [8, 2, 0.7838, 0.0068, 2, 0.59, 1.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99577:If_L118_C0", "label": "if", "type": "if", "loc": [118, 136], "level": 0, "parent": null, "vector": [4, 0, 0.8581, 0.1284, 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 import time\n p = optparse.OptionParser()\n p.add_option('-t', action='store', default='force_torque_ft1', type='string', \n dest='topic', help='which topic to listen to (default force_torque_ft1)')\n p.add_option('--netft', action='store_true', dest='netft',\n help='is this a NetFT sensor')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99577:Import_L119_C4", "label": "optparse import optparse", "type": "import", "loc": [119, 119], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99577:If_L118_C0", "vector": [1, 1, 0.8041, 0.0068, 1, 0.89, 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_99577:Import_L120_C4", "label": "time import time", "type": "import", "loc": [120, 120], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99577:If_L118_C0", "vector": [1, 1, 0.8108, 0.0068, 1, 0.89, 0.125, 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_99577:Assign_L121_C4", "label": "p = OptionParser()", "type": "assigned_variable", "loc": [121, 121], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99577:If_L118_C0", "vector": [14, 1, 0.8176, 0.0068, 1, 0.89, 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_99577:Expr_L122_C4", "label": "add_option()", "type": "expression", "loc": [122, 123], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99577:If_L118_C0", "vector": [8, 1, 0.8277, 0.0135, 1, 0.89, 0.375, 176, 3, 6, 0, 0, 0, 0, 1], "semantic": {"name": "add_option", "arg_names": [], "import_names": [], "rhs_call_name": "add_option", "annotation": ""}, "snippet": " p.add_option('-t', action='store', default='force_torque_ft1', type='string', \n dest='topic', help='which topic to listen to (default force_torque_ft1)')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99577:Expr_L124_C4", "label": "add_option()", "type": "expression", "loc": [124, 125], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99577:If_L118_C0", "vector": [8, 1, 0.8412, 0.0135, 1, 0.89, 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('--netft', action='store_true', dest='netft',\n help='is this a NetFT sensor')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99577:Assign_L126_C4", "label": "opt, args = parse_args()", "type": "assigned_variable", "loc": [126, 126], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99577:If_L118_C0", "vector": [14, 1, 0.8514, 0.0068, 1, 0.89, 0.625, 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_99577:Assign_L128_C4", "label": "client = FTClient()", "type": "assigned_variable", "loc": [128, 128], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99577:If_L118_C0", "vector": [14, 1, 0.8649, 0.0068, 1, 0.89, 0.75, 608, 3, 2, 0, 0, 78, 10, 1], "semantic": {"name": "client", "arg_names": [], "import_names": [], "rhs_call_name": "FTClient", "annotation": ""}, "snippet": " client = FTClient(opt.topic, opt.netft)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99577:Expr_L129_C4", "label": "bias()", "type": "expression", "loc": [129, 129], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99577:If_L118_C0", "vector": [8, 1, 0.8716, 0.0068, 1, 0.89, 0.875, 354, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "bias", "arg_names": [], "import_names": [], "rhs_call_name": "bias", "annotation": ""}, "snippet": " client.bias()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99577:While_L130_C4", "label": "while", "type": "while", "loc": [130, 136], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99577:If_L118_C0", "vector": [5, 1, 0.8986, 0.0473, 1, 0.89, 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 el = client.read()\n if el != None:\n #print np.linalg.norm(el.T)\n f = el.A1\n print(' %.2f %.2f %.2f'%(f[0], f[1], f[2]))\n time.sleep(1/100.0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99577:Assign_L131_C8", "label": "el = read()", "type": "assigned_variable", "loc": [131, 131], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99577:While_L130_C4", "vector": [14, 2, 0.8851, 0.0068, 2, 0.48, 0.0, 144, 3, 0, 0, 0, 453, 10, 1], "semantic": {"name": "el", "arg_names": [], "import_names": [], "rhs_call_name": "read", "annotation": ""}, "snippet": " el = client.read()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99577:If_L132_C8", "label": "if", "type": "if", "loc": [132, 135], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99577:While_L130_C4", "vector": [4, 2, 0.902, 0.027, 2, 0.48, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if el != None:\n #print np.linalg.norm(el.T)\n f = el.A1\n print(' %.2f %.2f %.2f'%(f[0], f[1], f[2]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99577:Assign_L134_C12", "label": "f =", "type": "assigned_variable", "loc": [134, 134], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99577:If_L132_C8", "vector": [14, 3, 0.9054, 0.0068, 3, 0.67, 0.0, 899, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " f = el.A1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99577:Expr_L135_C12", "label": "print()", "type": "expression", "loc": [135, 135], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99577:If_L132_C8", "vector": [8, 3, 0.9122, 0.0068, 3, 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(' %.2f %.2f %.2f'%(f[0], f[1], f[2]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99577:Expr_L136_C8", "label": "sleep()", "type": "expression", "loc": [136, 136], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99577:While_L130_C4", "vector": [8, 2, 0.9189, 0.0068, 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(1/100.0)"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99577:ClassDef_L42_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99577:FunctionDef_L43_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99577:FunctionDef_L43_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99577:If_L44_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99577:If_L44_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99577:FunctionDef_L45_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99577:FunctionDef_L45_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99577:Assign_L46_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99577:FunctionDef_L45_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99577:Assign_L47_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99577:FunctionDef_L45_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99577:Assign_L48_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99577:FunctionDef_L45_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99577:Return_L49_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99577:If_L44_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99577:Assign_L50_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99577:If_L44_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99577:FunctionDef_L52_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99577:FunctionDef_L52_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99577:Assign_L53_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99577:FunctionDef_L52_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99577:Assign_L54_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99577:FunctionDef_L52_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99577:Return_L55_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99577:If_L44_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99577:Assign_L56_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99577:FunctionDef_L43_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99577:Expr_L58_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99577:FunctionDef_L43_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99577:Assign_L62_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99577:ClassDef_L42_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99577:FunctionDef_L71_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99577:FunctionDef_L71_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99577:If_L73_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99577:If_L73_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99577:Assign_L74_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99577:If_L73_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99577:If_L75_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99577:FunctionDef_L71_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99577:Assign_L78_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99577:FunctionDef_L71_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99577:For_L79_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99577:For_L79_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99577:If_L80_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99577:If_L80_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99577:Assign_L81_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99577:If_L80_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99577:Assign_L83_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99577:For_L79_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99577:Expr_L84_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99577:FunctionDef_L71_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99577:Assign_L85_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99577:FunctionDef_L71_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99577:If_L87_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99577:If_L87_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99577:Assign_L91_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99577:If_L87_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99577:Assign_L93_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99577:FunctionDef_L71_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99577:If_L95_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99577:If_L95_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99577:Return_L96_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99577:If_L95_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99577:Return_L98_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99577:ClassDef_L42_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99577:FunctionDef_L100_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99577:FunctionDef_L100_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99577:Expr_L101_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99577:FunctionDef_L100_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99577:Expr_L102_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99577:FunctionDef_L100_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99577:Expr_L103_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99577:FunctionDef_L100_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99577:Assign_L105_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99577:FunctionDef_L100_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99577:For_L106_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99577:For_L106_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99577:Assign_L107_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99577:For_L106_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99577:Expr_L108_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99577:FunctionDef_L100_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99577:If_L110_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99577:If_L110_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99577:Assign_L111_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99577:If_L110_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99577:Assign_L112_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99577:FunctionDef_L100_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99577:Expr_L114_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99577:FunctionDef_L100_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99577:Expr_L115_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99577:FunctionDef_L100_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99577:Expr_L116_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99577:If_L118_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99577:Import_L119_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99577:If_L118_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99577:Import_L120_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99577:If_L118_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99577:Assign_L121_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99577:If_L118_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99577:Expr_L122_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99577:If_L118_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99577:Expr_L124_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99577:If_L118_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99577:Assign_L126_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99577:If_L118_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99577:Assign_L128_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99577:If_L118_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99577:Expr_L129_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99577:If_L118_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99577:While_L130_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99577:While_L130_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99577:Assign_L131_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99577:While_L130_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99577:If_L132_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99577:If_L132_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99577:Assign_L134_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99577:If_L132_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99577:Expr_L135_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99577:While_L130_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99577:Expr_L136_C8"}]
#!/usr/bin/python import roslib roslib.load_manifest('force_torque') import rospy from geometry_msgs.msg import Vector3Stamped from threading import RLock ## 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 FTRelay: def __init__(self): self.lock = RLock() self.fresh = False def set_ft(self, value, time_acquired): self.lock.acquire() self.data = value, time_acquired self.fresh = True self.lock.release() #print 'got', value, time_acquired def get_msg(self): r = None self.lock.acquire() if self.fresh: self.fresh = False r = self.data self.lock.release() return r def FTread_to_Force( ftval, frame_id ): retval = Vector3Stamped() retval.header.stamp = rospy.rostime.get_rostime() retval.header.frame_id = frame_id retval.vector.x = ftval[0] retval.vector.y = ftval[1] retval.vector.z = ftval[2] return retval if __name__ == '__main__': import roslib; roslib.load_manifest('force_torque') import rospy from force_torque.srv import * from hrl_msgs.msg import FloatArray as FloatArray import hrl_lib.rutils as ru import time import force_torque.FTSensor as ftc import numpy as np import optparse p = optparse.OptionParser() p.add_option('--name', action='store', default='ft1', type='string', dest='name', help='name given to FTSensor') opt, args = p.parse_args() node_name = 'FTRelay_' + opt.name ft_channel_name = 'force_torque_' + opt.name service_name = node_name + '_set_ft' print node_name + ': serving service', service_name ftserver = FTRelay() rospy.init_node(node_name) rospy.Service(service_name, StringService, ru.wrap(ftserver.set_ft, ['value', 'time'], response=StringServiceResponse)) channel = rospy.Publisher(ft_channel_name, FloatArray, tcp_nodelay=True) channel2 = rospy.Publisher(ft_channel_name + '_raw', FloatArray, tcp_nodelay=True) chan_vec3 = rospy.Publisher(ft_channel_name + '_Vec3', Vector3Stamped, tcp_nodelay=True) print node_name + ': publishing on channel', ft_channel_name P_force = [1., 1., 1.] xhat_force = [0., 0., 0., 0., 0., 0.] while not rospy.is_shutdown(): msg = ftserver.get_msg() if msg is not None: data, tme = msg ftvalue = ftc.binary_to_ft(data) ftvalue = np.array(ftvalue) for i in range(3): xhat, p = kalman_update(xhat_force[i], P_force[i], 1e-3, 0.04, ftvalue[i]) P_force[i] = p xhat_force[i] = xhat #ftvalue[i] = xhat xhat_force[3] = ftvalue[3] xhat_force[4] = ftvalue[4] xhat_force[5] = ftvalue[5] ftvalue = ftvalue.tolist() channel.publish(FloatArray(rospy.Header(stamp=rospy.Time.from_seconds(tme)), xhat_force)) channel2.publish(FloatArray(rospy.Header(stamp=rospy.Time.from_seconds(tme)), ftvalue)) chan_vec3.publish( FTread_to_Force( ftvalue, opt.name )) #times.append(time.time()) #else: # time.sleep(1/5000.0) time.sleep(1/5000.0) #import pylab as pl #import numpy as np #a = np.array(times) #pl.plot(a[1:] - a[:-1], '.') #pl.show()
ajibawa-2023/Python-Code-Large/train/row_99579
82
126
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99579:Import_L2_C0", "label": "roslib import roslib", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0159, 0.0079, 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_99579:Expr_L3_C0", "label": "load_manifest()", "type": "expression", "loc": [3, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0238, 0.0079, 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('force_torque')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99579:Import_L4_C0", "label": "rospy import rospy", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0317, 0.0079, 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_99579:ImportFrom_L5_C0", "label": "from geometry_msgs.msg import Vector3Stamped", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0397, 0.0079, 0, 0.66, 0.375, 951, 0, 1, 0, 0, 951, 0, 0], "semantic": {"name": "geometry_msgs.msg", "arg_names": [], "import_names": ["Vector3Stamped"], "rhs_call_name": "", "annotation": ""}, "snippet": "from geometry_msgs.msg import Vector3Stamped"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99579:ImportFrom_L8_C0", "label": "from threading import RLock", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.0635, 0.0079, 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_99579:FunctionDef_L13_C0", "label": "kalman_update", "type": "function", "loc": [13, 21], "level": 0, "parent": null, "vector": [2, 0, 0.1349, 0.0714, 0, 0.66, 0.625, 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_99579:Assign_L15_C4", "label": "xhatminus =", "type": "assigned_variable", "loc": [15, 15], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99579:FunctionDef_L13_C0", "vector": [14, 1, 0.119, 0.0079, 1, 0.49, 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_99579:Assign_L16_C4", "label": "Pminus =", "type": "assigned_variable", "loc": [16, 16], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99579:FunctionDef_L13_C0", "vector": [14, 1, 0.127, 0.0079, 1, 0.49, 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_99579:Assign_L18_C4", "label": "K =", "type": "assigned_variable", "loc": [18, 18], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99579:FunctionDef_L13_C0", "vector": [14, 1, 0.1429, 0.0079, 1, 0.49, 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_99579:Assign_L19_C4", "label": "xhat =", "type": "assigned_variable", "loc": [19, 19], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99579:FunctionDef_L13_C0", "vector": [14, 1, 0.1508, 0.0079, 1, 0.49, 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_99579:Assign_L20_C4", "label": "P =", "type": "assigned_variable", "loc": [20, 20], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99579:FunctionDef_L13_C0", "vector": [14, 1, 0.1587, 0.0079, 1, 0.49, 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_99579:Return_L21_C4", "label": "return", "type": "return", "loc": [21, 21], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99579:FunctionDef_L13_C0", "vector": [13, 1, 0.1667, 0.0079, 1, 0.49, 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_99579:ClassDef_L25_C0", "label": "FTRelay", "type": "class", "loc": [25, 44], "level": 0, "parent": null, "vector": [3, 0, 0.2738, 0.1587, 0, 0.66, 0.75, 145, 0, 3, 0, 0, 0, 0, 5], "semantic": {"name": "FTRelay", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class FTRelay:\n def __init__(self):\n self.lock = RLock()\n self.fresh = False\n\n def set_ft(self, value, time_acquired):\n self.lock.acquire()\n self.data = value, time_acquired"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99579:FunctionDef_L26_C4", "label": "__init__", "type": "function", "loc": [26, 28], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99579:ClassDef_L25_C0", "vector": [2, 1, 0.2143, 0.0238, 1, 0.15, 0.0, 555, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self):\n self.lock = RLock()\n self.fresh = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99579:Assign_L27_C8", "label": "self.lock = RLock()", "type": "assigned_variable", "loc": [27, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99579:FunctionDef_L26_C4", "vector": [14, 2, 0.2143, 0.0079, 2, 0.73, 0.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_99579:Assign_L28_C8", "label": "self.fresh =", "type": "assigned_variable", "loc": [28, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99579:FunctionDef_L26_C4", "vector": [14, 2, 0.2222, 0.0079, 2, 0.73, 1.0, 547, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.fresh", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.fresh = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99579:FunctionDef_L30_C4", "label": "set_ft", "type": "function", "loc": [30, 34], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99579:ClassDef_L25_C0", "vector": [2, 1, 0.254, 0.0397, 1, 0.15, 0.5, 211, 0, 3, 0, 0, 0, 0, 2], "semantic": {"name": "set_ft", "arg_names": ["self", "value", "time_acquired"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def set_ft(self, value, time_acquired):\n self.lock.acquire()\n self.data = value, time_acquired\n self.fresh = True\n self.lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99579:Expr_L31_C8", "label": "acquire()", "type": "expression", "loc": [31, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99579:FunctionDef_L30_C4", "vector": [8, 2, 0.246, 0.0079, 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.lock.acquire()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99579:Assign_L32_C8", "label": "self.data =", "type": "assigned_variable", "loc": [32, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99579:FunctionDef_L30_C4", "vector": [14, 2, 0.254, 0.0079, 2, 0.52, 0.3333, 838, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "self.data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.data = value, time_acquired"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99579:Assign_L33_C8", "label": "self.fresh =", "type": "assigned_variable", "loc": [33, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99579:FunctionDef_L30_C4", "vector": [14, 2, 0.2619, 0.0079, 2, 0.52, 0.6667, 547, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.fresh", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.fresh = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99579:Expr_L34_C8", "label": "release()", "type": "expression", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99579:FunctionDef_L30_C4", "vector": [8, 2, 0.2698, 0.0079, 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.lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99579:FunctionDef_L37_C4", "label": "get_msg", "type": "function", "loc": [37, 44], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99579:ClassDef_L25_C0", "vector": [2, 1, 0.3214, 0.0635, 1, 0.15, 1.0, 977, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "get_msg", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_msg(self):\n r = None\n self.lock.acquire()\n if self.fresh:\n self.fresh = False\n r = self.data\n self.lock.release()\n return r"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99579:Assign_L38_C8", "label": "r =", "type": "assigned_variable", "loc": [38, 38], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99579:FunctionDef_L37_C4", "vector": [14, 2, 0.3016, 0.0079, 2, 0.82, 0.0, 436, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " r = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99579:Expr_L39_C8", "label": "acquire()", "type": "expression", "loc": [39, 39], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99579:FunctionDef_L37_C4", "vector": [8, 2, 0.3095, 0.0079, 2, 0.82, 0.25, 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_99579:If_L40_C8", "label": "if", "type": "if", "loc": [40, 42], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99579:FunctionDef_L37_C4", "vector": [4, 2, 0.3254, 0.0238, 2, 0.82, 0.5, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.fresh:\n self.fresh = False\n r = self.data"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99579:Assign_L41_C12", "label": "self.fresh =", "type": "assigned_variable", "loc": [41, 41], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99579:If_L40_C8", "vector": [14, 3, 0.3254, 0.0079, 3, 0.45, 0.0, 547, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.fresh", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.fresh = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99579:Assign_L42_C12", "label": "r =", "type": "assigned_variable", "loc": [42, 42], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99579:If_L40_C8", "vector": [14, 3, 0.3333, 0.0079, 3, 0.45, 1.0, 436, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " r = self.data"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99579:Expr_L43_C8", "label": "release()", "type": "expression", "loc": [43, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99579:FunctionDef_L37_C4", "vector": [8, 2, 0.3413, 0.0079, 2, 0.82, 0.75, 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_99579:Return_L44_C8", "label": "return", "type": "return", "loc": [44, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99579:FunctionDef_L37_C4", "vector": [13, 2, 0.3492, 0.0079, 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 r"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99579:FunctionDef_L46_C0", "label": "FTread_to_Force", "type": "function", "loc": [46, 54], "level": 0, "parent": null, "vector": [2, 0, 0.3968, 0.0714, 0, 0.66, 0.875, 639, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "FTread_to_Force", "arg_names": ["ftval", "frame_id"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def FTread_to_Force( ftval, frame_id ):\n retval = Vector3Stamped()\n retval.header.stamp = rospy.rostime.get_rostime()\n retval.header.frame_id = frame_id\n retval.vector.x = ftval[0]\n retval.vector.y = ftval[1]\n retval.vector.z = ftval[2]\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99579:Assign_L47_C4", "label": "retval = Vector3Stamped()", "type": "assigned_variable", "loc": [47, 47], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99579:FunctionDef_L46_C0", "vector": [14, 1, 0.373, 0.0079, 1, 0.93, 0.0, 991, 3, 0, 0, 0, 444, 10, 1], "semantic": {"name": "retval", "arg_names": [], "import_names": [], "rhs_call_name": "Vector3Stamped", "annotation": ""}, "snippet": " retval = Vector3Stamped()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99579:Assign_L48_C4", "label": "retval.header.stamp = get_rostime()", "type": "assigned_variable", "loc": [48, 48], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99579:FunctionDef_L46_C0", "vector": [14, 1, 0.381, 0.0079, 1, 0.93, 0.1667, 387, 3, 0, 0, 0, 173, 10, 1], "semantic": {"name": "retval.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "get_rostime", "annotation": ""}, "snippet": " retval.header.stamp = rospy.rostime.get_rostime()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99579:Assign_L49_C4", "label": "retval.header.frame_id =", "type": "assigned_variable", "loc": [49, 49], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99579:FunctionDef_L46_C0", "vector": [14, 1, 0.3889, 0.0079, 1, 0.93, 0.3333, 809, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "retval.header.frame_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " retval.header.frame_id = frame_id"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99579:Assign_L50_C4", "label": "retval.vector.x =", "type": "assigned_variable", "loc": [50, 50], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99579:FunctionDef_L46_C0", "vector": [14, 1, 0.3968, 0.0079, 1, 0.93, 0.5, 297, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "retval.vector.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " retval.vector.x = ftval[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99579:Assign_L51_C4", "label": "retval.vector.y =", "type": "assigned_variable", "loc": [51, 51], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99579:FunctionDef_L46_C0", "vector": [14, 1, 0.4048, 0.0079, 1, 0.93, 0.6667, 364, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "retval.vector.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " retval.vector.y = ftval[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99579:Assign_L52_C4", "label": "retval.vector.z =", "type": "assigned_variable", "loc": [52, 52], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99579:FunctionDef_L46_C0", "vector": [14, 1, 0.4127, 0.0079, 1, 0.93, 0.8333, 462, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "retval.vector.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " retval.vector.z = ftval[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99579:Return_L54_C4", "label": "return", "type": "return", "loc": [54, 54], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99579:FunctionDef_L46_C0", "vector": [13, 1, 0.4286, 0.0079, 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 retval"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99579:If_L56_C0", "label": "if", "type": "if", "loc": [56, 113], "level": 0, "parent": null, "vector": [4, 0, 0.6706, 0.4603, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 31], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n import roslib; roslib.load_manifest('force_torque')\n import rospy\n from force_torque.srv import *\n from hrl_msgs.msg import FloatArray as FloatArray\n import hrl_lib.rutils as ru\n import time\n import force_torque.FTSensor as ftc"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99579:Import_L57_C4", "label": "roslib import roslib", "type": "import", "loc": [57, 57], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99579:If_L56_C0", "vector": [1, 1, 0.4524, 0.0079, 1, 0.5, 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('force_torque')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99579:Expr_L57_C19", "label": "load_manifest()", "type": "expression", "loc": [57, 57], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99579:If_L56_C0", "vector": [8, 1, 0.4524, 0.0079, 1, 0.5, 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": " import roslib; roslib.load_manifest('force_torque')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99579:Import_L58_C4", "label": "rospy import rospy", "type": "import", "loc": [58, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99579:If_L56_C0", "vector": [1, 1, 0.4603, 0.0079, 1, 0.5, 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_99579:ImportFrom_L59_C4", "label": "from force_torque.srv import *", "type": "import", "loc": [59, 59], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99579:If_L56_C0", "vector": [1, 1, 0.4683, 0.0079, 1, 0.5, 0.1154, 550, 0, 1, 0, 0, 550, 0, 0], "semantic": {"name": "force_torque.srv", "arg_names": [], "import_names": ["*"], "rhs_call_name": "", "annotation": ""}, "snippet": " from force_torque.srv import *"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99579:ImportFrom_L60_C4", "label": "from hrl_msgs.msg import FloatArray", "type": "import", "loc": [60, 60], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99579:If_L56_C0", "vector": [1, 1, 0.4762, 0.0079, 1, 0.5, 0.1538, 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 as FloatArray"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99579:Import_L61_C4", "label": "hrl_lib.rutils import ru", "type": "import", "loc": [61, 61], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99579:If_L56_C0", "vector": [1, 1, 0.4841, 0.0079, 1, 0.5, 0.1923, 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_99579:Import_L62_C4", "label": "time import time", "type": "import", "loc": [62, 62], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99579:If_L56_C0", "vector": [1, 1, 0.4921, 0.0079, 1, 0.5, 0.2308, 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_99579:Import_L63_C4", "label": "force_torque.FTSensor import ftc", "type": "import", "loc": [63, 63], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99579:If_L56_C0", "vector": [1, 1, 0.5, 0.0079, 1, 0.5, 0.2692, 987, 0, 1, 0, 0, 987, 0, 0], "semantic": {"name": "force_torque.FTSensor", "arg_names": [], "import_names": ["ftc"], "rhs_call_name": "", "annotation": ""}, "snippet": " import force_torque.FTSensor as ftc"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99579:Import_L64_C4", "label": "numpy import np", "type": "import", "loc": [64, 64], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99579:If_L56_C0", "vector": [1, 1, 0.5079, 0.0079, 1, 0.5, 0.3077, 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_99579:Import_L66_C4", "label": "optparse import optparse", "type": "import", "loc": [66, 66], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99579:If_L56_C0", "vector": [1, 1, 0.5238, 0.0079, 1, 0.5, 0.3462, 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_99579:Assign_L67_C4", "label": "p = OptionParser()", "type": "assigned_variable", "loc": [67, 67], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99579:If_L56_C0", "vector": [14, 1, 0.5317, 0.0079, 1, 0.5, 0.3846, 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_99579:Expr_L68_C4", "label": "add_option()", "type": "expression", "loc": [68, 69], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99579:If_L56_C0", "vector": [8, 1, 0.5437, 0.0159, 1, 0.5, 0.4231, 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('--name', action='store', default='ft1', type='string', \n dest='name', help='name given to FTSensor')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99579:Assign_L70_C4", "label": "opt, args = parse_args()", "type": "assigned_variable", "loc": [70, 70], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99579:If_L56_C0", "vector": [14, 1, 0.5556, 0.0079, 1, 0.5, 0.4615, 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_99579:Assign_L72_C4", "label": "node_name =", "type": "assigned_variable", "loc": [72, 72], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99579:If_L56_C0", "vector": [14, 1, 0.5714, 0.0079, 1, 0.5, 0.5, 516, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "node_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " node_name = 'FTRelay_' + opt.name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99579:Assign_L73_C4", "label": "ft_channel_name =", "type": "assigned_variable", "loc": [73, 73], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99579:If_L56_C0", "vector": [14, 1, 0.5794, 0.0079, 1, 0.5, 0.5385, 868, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ft_channel_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ft_channel_name = 'force_torque_' + opt.name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99579:Assign_L74_C4", "label": "service_name =", "type": "assigned_variable", "loc": [74, 74], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99579:If_L56_C0", "vector": [14, 1, 0.5873, 0.0079, 1, 0.5, 0.5769, 649, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "service_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " service_name = node_name + '_set_ft'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99579:Expr_L75_C4", "label": "print()", "type": "expression", "loc": [75, 75], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99579:If_L56_C0", "vector": [8, 1, 0.5952, 0.0079, 1, 0.5, 0.6154, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(node_name + ': serving service', service_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99579:Assign_L76_C4", "label": "ftserver = FTRelay()", "type": "assigned_variable", "loc": [76, 76], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99579:If_L56_C0", "vector": [14, 1, 0.6032, 0.0079, 1, 0.5, 0.6538, 930, 3, 0, 0, 0, 145, 10, 1], "semantic": {"name": "ftserver", "arg_names": [], "import_names": [], "rhs_call_name": "FTRelay", "annotation": ""}, "snippet": " ftserver = FTRelay()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99579:Expr_L78_C4", "label": "init_node()", "type": "expression", "loc": [78, 78], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99579:If_L56_C0", "vector": [8, 1, 0.619, 0.0079, 1, 0.5, 0.6923, 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_99579:Expr_L79_C4", "label": "Service()", "type": "expression", "loc": [79, 81], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99579:If_L56_C0", "vector": [8, 1, 0.6349, 0.0238, 1, 0.5, 0.7308, 451, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "Service", "arg_names": [], "import_names": [], "rhs_call_name": "Service", "annotation": ""}, "snippet": " rospy.Service(service_name, StringService, \n ru.wrap(ftserver.set_ft, ['value', 'time'], \n response=StringServiceResponse))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99579:Assign_L83_C4", "label": "channel = Publisher()", "type": "assigned_variable", "loc": [83, 83], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99579:If_L56_C0", "vector": [14, 1, 0.6587, 0.0079, 1, 0.5, 0.7692, 721, 3, 3, 0, 0, 45, 10, 1], "semantic": {"name": "channel", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " channel = rospy.Publisher(ft_channel_name, FloatArray, tcp_nodelay=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99579:Assign_L84_C4", "label": "channel2 = Publisher()", "type": "assigned_variable", "loc": [84, 84], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99579:If_L56_C0", "vector": [14, 1, 0.6667, 0.0079, 1, 0.5, 0.8077, 518, 3, 3, 0, 0, 45, 10, 1], "semantic": {"name": "channel2", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " channel2 = rospy.Publisher(ft_channel_name + '_raw', FloatArray, tcp_nodelay=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99579:Assign_L85_C4", "label": "chan_vec3 = Publisher()", "type": "assigned_variable", "loc": [85, 85], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99579:If_L56_C0", "vector": [14, 1, 0.6746, 0.0079, 1, 0.5, 0.8462, 451, 3, 3, 0, 0, 45, 10, 1], "semantic": {"name": "chan_vec3", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " chan_vec3 = rospy.Publisher(ft_channel_name + '_Vec3', Vector3Stamped, tcp_nodelay=True) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99579:Expr_L86_C4", "label": "print()", "type": "expression", "loc": [86, 86], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99579:If_L56_C0", "vector": [8, 1, 0.6825, 0.0079, 1, 0.5, 0.8846, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(node_name + ': publishing on channel', ft_channel_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99579:Assign_L87_C4", "label": "P_force =", "type": "assigned_variable", "loc": [87, 87], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99579:If_L56_C0", "vector": [14, 1, 0.6905, 0.0079, 1, 0.5, 0.9231, 609, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "P_force", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " P_force = [1., 1., 1.]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99579:Assign_L88_C4", "label": "xhat_force =", "type": "assigned_variable", "loc": [88, 88], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99579:If_L56_C0", "vector": [14, 1, 0.6984, 0.0079, 1, 0.5, 0.9615, 157, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "xhat_force", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " xhat_force = [0., 0., 0., 0., 0., 0.]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99579:While_L89_C4", "label": "while", "type": "while", "loc": [89, 113], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99579:If_L56_C0", "vector": [5, 1, 0.8016, 0.1984, 1, 0.5, 1.0, 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 msg = ftserver.get_msg()\n if msg is not None:\n data, tme = msg\n ftvalue = ftc.binary_to_ft(data)\n ftvalue = np.array(ftvalue)\n for i in range(3):\n xhat, p = kalman_update(xhat_force[i], P_force[i],"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99579:Assign_L90_C8", "label": "msg = get_msg()", "type": "assigned_variable", "loc": [90, 90], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99579:While_L89_C4", "vector": [14, 2, 0.7143, 0.0079, 2, 0.51, 0.0, 712, 3, 0, 0, 0, 977, 10, 1], "semantic": {"name": "msg", "arg_names": [], "import_names": [], "rhs_call_name": "get_msg", "annotation": ""}, "snippet": " msg = ftserver.get_msg()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99579:If_L91_C8", "label": "if", "type": "if", "loc": [91, 109], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99579:While_L89_C4", "vector": [4, 2, 0.7937, 0.1508, 2, 0.51, 0.5, 0, 0, 0, 0, 0, 0, 0, 15], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if msg is not None:\n data, tme = msg\n ftvalue = ftc.binary_to_ft(data)\n ftvalue = np.array(ftvalue)\n for i in range(3):\n xhat, p = kalman_update(xhat_force[i], P_force[i],\n 1e-3, 0.04, ftvalue[i])\n P_force[i] = p"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99579:Assign_L92_C12", "label": "data, tme =", "type": "assigned_variable", "loc": [92, 92], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99579:If_L91_C8", "vector": [14, 3, 0.7302, 0.0079, 3, 0.76, 0.0, 628, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "data, tme", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " data, tme = msg"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99579:Assign_L93_C12", "label": "ftvalue = binary_to_ft()", "type": "assigned_variable", "loc": [93, 93], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99579:If_L91_C8", "vector": [14, 3, 0.7381, 0.0079, 3, 0.76, 0.1, 476, 3, 1, 0, 0, 642, 10, 1], "semantic": {"name": "ftvalue", "arg_names": [], "import_names": [], "rhs_call_name": "binary_to_ft", "annotation": ""}, "snippet": " ftvalue = ftc.binary_to_ft(data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99579:Assign_L94_C12", "label": "ftvalue = array()", "type": "assigned_variable", "loc": [94, 94], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99579:If_L91_C8", "vector": [14, 3, 0.746, 0.0079, 3, 0.76, 0.2, 476, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "ftvalue", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " ftvalue = np.array(ftvalue)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99579:For_L95_C12", "label": "for i", "type": "for", "loc": [95, 99], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99579:If_L91_C8", "vector": [6, 3, 0.7698, 0.0397, 3, 0.76, 0.3, 826, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(3):\n xhat, p = kalman_update(xhat_force[i], P_force[i],\n 1e-3, 0.04, ftvalue[i])\n P_force[i] = p\n xhat_force[i] = xhat"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99579:Assign_L96_C16", "label": "xhat, p = kalman_update()", "type": "assigned_variable", "loc": [96, 97], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99579:For_L95_C12", "vector": [14, 4, 0.7659, 0.0159, 4, 0.93, 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(xhat_force[i], P_force[i],\n 1e-3, 0.04, ftvalue[i])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99579:Assign_L98_C16", "label": "assign", "type": "assigned_variable", "loc": [98, 98], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99579:For_L95_C12", "vector": [14, 4, 0.7778, 0.0079, 4, 0.93, 0.5, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " P_force[i] = p"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99579:Assign_L99_C16", "label": "assign", "type": "assigned_variable", "loc": [99, 99], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99579:For_L95_C12", "vector": [14, 4, 0.7857, 0.0079, 4, 0.93, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " xhat_force[i] = xhat"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99579:Assign_L101_C12", "label": "assign", "type": "assigned_variable", "loc": [101, 101], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99579:If_L91_C8", "vector": [14, 3, 0.8016, 0.0079, 3, 0.76, 0.4, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " xhat_force[3] = ftvalue[3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99579:Assign_L102_C12", "label": "assign", "type": "assigned_variable", "loc": [102, 102], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99579:If_L91_C8", "vector": [14, 3, 0.8095, 0.0079, 3, 0.76, 0.5, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " xhat_force[4] = ftvalue[4]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99579:Assign_L103_C12", "label": "assign", "type": "assigned_variable", "loc": [103, 103], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99579:If_L91_C8", "vector": [14, 3, 0.8175, 0.0079, 3, 0.76, 0.6, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " xhat_force[5] = ftvalue[5]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99579:Assign_L104_C12", "label": "ftvalue = tolist()", "type": "assigned_variable", "loc": [104, 104], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99579:If_L91_C8", "vector": [14, 3, 0.8254, 0.0079, 3, 0.76, 0.7, 476, 3, 0, 0, 0, 185, 10, 1], "semantic": {"name": "ftvalue", "arg_names": [], "import_names": [], "rhs_call_name": "tolist", "annotation": ""}, "snippet": " ftvalue = ftvalue.tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99579:Expr_L106_C12", "label": "publish()", "type": "expression", "loc": [106, 107], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99579:If_L91_C8", "vector": [8, 3, 0.8452, 0.0159, 3, 0.76, 0.8, 102, 3, 1, 0, 0, 0, 0, 4], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " channel.publish(FloatArray(rospy.Header(stamp=rospy.Time.from_seconds(tme)),\n xhat_force))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99579:Expr_L108_C12", "label": "publish()", "type": "expression", "loc": [108, 108], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99579:If_L91_C8", "vector": [8, 3, 0.8571, 0.0079, 3, 0.76, 0.9, 102, 3, 1, 0, 0, 0, 0, 4], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " channel2.publish(FloatArray(rospy.Header(stamp=rospy.Time.from_seconds(tme)), ftvalue))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99579:Expr_L109_C12", "label": "publish()", "type": "expression", "loc": [109, 109], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99579:If_L91_C8", "vector": [8, 3, 0.8651, 0.0079, 3, 0.76, 1.0, 102, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " chan_vec3.publish( FTread_to_Force( ftvalue, opt.name ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99579:Expr_L113_C8", "label": "sleep()", "type": "expression", "loc": [113, 113], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99579:While_L89_C4", "vector": [8, 2, 0.8968, 0.0079, 2, 0.51, 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(1/5000.0)"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99579:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99579:Assign_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99579:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99579:Assign_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99579:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99579:Assign_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99579:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99579:Assign_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99579:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99579:Assign_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99579:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99579:Return_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99579:ClassDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99579:FunctionDef_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99579:FunctionDef_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99579:Assign_L27_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99579:FunctionDef_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99579:Assign_L28_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99579:ClassDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99579:FunctionDef_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99579:FunctionDef_L30_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99579:Expr_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99579:FunctionDef_L30_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99579:Assign_L32_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99579:FunctionDef_L30_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99579:Assign_L33_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99579:FunctionDef_L30_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99579:Expr_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99579:ClassDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99579:FunctionDef_L37_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99579:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99579:Assign_L38_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99579:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99579:Expr_L39_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99579:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99579:If_L40_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99579:If_L40_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99579:Assign_L41_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99579:If_L40_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99579:Assign_L42_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99579:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99579:Expr_L43_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99579:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99579:Return_L44_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99579:FunctionDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99579:Assign_L47_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99579:FunctionDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99579:Assign_L48_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99579:FunctionDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99579:Assign_L49_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99579:FunctionDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99579:Assign_L50_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99579:FunctionDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99579:Assign_L51_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99579:FunctionDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99579:Assign_L52_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99579:FunctionDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99579:Return_L54_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99579:If_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99579:Import_L57_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99579:If_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99579:Expr_L57_C19"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99579:If_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99579:Import_L58_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99579:If_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99579:ImportFrom_L59_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99579:If_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99579:ImportFrom_L60_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99579:If_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99579:Import_L61_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99579:If_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99579:Import_L62_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99579:If_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99579:Import_L63_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99579:If_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99579:Import_L64_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99579:If_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99579:Import_L66_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99579:If_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99579:Assign_L67_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99579:If_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99579:Expr_L68_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99579:If_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99579:Assign_L70_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99579:If_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99579:Assign_L72_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99579:If_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99579:Assign_L73_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99579:If_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99579:Assign_L74_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99579:If_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99579:Expr_L75_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99579:If_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99579:Assign_L76_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99579:If_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99579:Expr_L78_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99579:If_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99579:Expr_L79_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99579:If_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99579:Assign_L83_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99579:If_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99579:Assign_L84_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99579:If_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99579:Assign_L85_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99579:If_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99579:Expr_L86_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99579:If_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99579:Assign_L87_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99579:If_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99579:Assign_L88_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99579:If_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99579:While_L89_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99579:While_L89_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99579:Assign_L90_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99579:While_L89_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99579:If_L91_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99579:If_L91_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99579:Assign_L92_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99579:If_L91_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99579:Assign_L93_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99579:If_L91_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99579:Assign_L94_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99579:If_L91_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99579:For_L95_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99579:For_L95_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99579:Assign_L96_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99579:For_L95_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99579:Assign_L98_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99579:For_L95_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99579:Assign_L99_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99579:If_L91_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99579:Assign_L101_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99579:If_L91_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99579:Assign_L102_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99579:If_L91_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99579:Assign_L103_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99579:If_L91_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99579:Assign_L104_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99579:If_L91_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99579:Expr_L106_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99579:If_L91_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99579:Expr_L108_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99579:If_L91_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99579:Expr_L109_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99579:While_L89_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99579:Expr_L113_C8"}]
import pygame import pygame.locals import numpy as np import time import copy #------ Slider class is code copied from the internet. (http://www.pygame.org/project/668/) class Slider(object): #Constructs the object def __init__(self, pos, value=0): self.pos = pos self.size = (275,15) self.bar = pygame.Surface((275, 15)) self.bar.fill((200, 200, 200)) self.slider = pygame.Surface((20, 15)) self.slider.fill((230, 230, 230)) pygame.draw.rect(self.bar, (0, 0, 0), (0, 0, 275, 15), 2) pygame.draw.rect(self.slider, (0, 0, 0), (-1, -1, 20, 15), 2) self.slider.set_at((19, 14), (0, 0, 0)) self.brect = self.bar.get_rect(topleft = pos) self.srect = self.slider.get_rect(topleft = pos) self.srect.left = value+pos[0] self.clicked = False self.value = value self.font_size = 15 self.font = pygame.font.SysFont("Times New Roman", self.font_size) self.text = '' def set_text(self, text): ''' set the text to be displayed below the slider ''' self.text = text #Called once every frame def update(self): mousebutton = pygame.mouse.get_pressed() cursor = pygame.locals.Rect(pygame.mouse.get_pos()[0], pygame.mouse.get_pos()[1], 1, 1) if cursor.colliderect(self.brect): if mousebutton[0]: self.clicked = True else: self.clicked = False if not mousebutton[0]: self.clicked = False if self.clicked: self.srect.center = cursor.center self.srect.clamp_ip(self.brect) self.value = self.srect.left - self.brect.left #Draws the slider def render(self, surface): surface.blit(self.bar, self.brect) surface.blit(self.slider, self.srect) ren = self.font.render(self.text,1,(0,0,0)) surface.blit(ren, (self.pos[0], self.pos[1]+self.font_size+2))
ajibawa-2023/Python-Code-Large/train/row_99580
45
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_99580:Import_L1_C0", "label": "pygame import pygame", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0169, 0.0169, 0, 0.66, 0.0, 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_99580:Import_L2_C0", "label": "pygame.locals import pygame.locals", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0339, 0.0169, 0, 0.66, 0.2, 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_99580:Import_L3_C0", "label": "numpy import np", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0508, 0.0169, 0, 0.66, 0.4, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np"], "rhs_call_name": "", "annotation": ""}, "snippet": "import numpy as np"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99580:Import_L4_C0", "label": "time import time", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0678, 0.0169, 0, 0.66, 0.6, 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_99580:Import_L5_C0", "label": "copy import copy", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0847, 0.0169, 0, 0.66, 0.8, 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_99580:ClassDef_L8_C0", "label": "Slider", "type": "class", "loc": [8, 57], "level": 0, "parent": null, "vector": [3, 0, 0.5508, 0.8475, 0, 0.66, 1.0, 203, 0, 4, 0, 0, 186, 0, 20], "semantic": {"name": "Slider", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Slider(object):\n\n #Constructs the object\n def __init__(self, pos, value=0):\n self.pos = pos\n self.size = (275,15)\n\n self.bar = pygame.Surface((275, 15))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99580:FunctionDef_L11_C4", "label": "__init__", "type": "function", "loc": [11, 29], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99580:ClassDef_L8_C0", "vector": [2, 1, 0.339, 0.322, 1, 0.17, 0.0, 555, 0, 3, 0, 0, 0, 0, 10], "semantic": {"name": "__init__", "arg_names": ["self", "pos", "value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, pos, value=0):\n self.pos = pos\n self.size = (275,15)\n\n self.bar = pygame.Surface((275, 15))\n self.bar.fill((200, 200, 200))\n self.slider = pygame.Surface((20, 15))\n self.slider.fill((230, 230, 230))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99580:Assign_L12_C8", "label": "self.pos =", "type": "assigned_variable", "loc": [12, 12], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99580:FunctionDef_L11_C4", "vector": [14, 2, 0.2034, 0.0169, 2, 0.93, 0.0, 283, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.pos", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.pos = pos"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99580:Assign_L13_C8", "label": "self.size =", "type": "assigned_variable", "loc": [13, 13], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99580:FunctionDef_L11_C4", "vector": [14, 2, 0.2203, 0.0169, 2, 0.93, 0.0625, 183, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "self.size", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.size = (275,15)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99580:Assign_L15_C8", "label": "self.bar = Surface()", "type": "assigned_variable", "loc": [15, 15], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99580:FunctionDef_L11_C4", "vector": [14, 2, 0.2542, 0.0169, 2, 0.93, 0.125, 791, 3, 1, 0, 0, 719, 10, 1], "semantic": {"name": "self.bar", "arg_names": [], "import_names": [], "rhs_call_name": "Surface", "annotation": ""}, "snippet": " self.bar = pygame.Surface((275, 15))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99580:Expr_L16_C8", "label": "fill()", "type": "expression", "loc": [16, 16], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99580:FunctionDef_L11_C4", "vector": [8, 2, 0.2712, 0.0169, 2, 0.93, 0.1875, 346, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "fill", "arg_names": [], "import_names": [], "rhs_call_name": "fill", "annotation": ""}, "snippet": " self.bar.fill((200, 200, 200))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99580:Assign_L17_C8", "label": "self.slider = Surface()", "type": "assigned_variable", "loc": [17, 17], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99580:FunctionDef_L11_C4", "vector": [14, 2, 0.2881, 0.0169, 2, 0.93, 0.25, 296, 3, 1, 0, 0, 719, 10, 1], "semantic": {"name": "self.slider", "arg_names": [], "import_names": [], "rhs_call_name": "Surface", "annotation": ""}, "snippet": " self.slider = pygame.Surface((20, 15))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99580:Expr_L18_C8", "label": "fill()", "type": "expression", "loc": [18, 18], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99580:FunctionDef_L11_C4", "vector": [8, 2, 0.3051, 0.0169, 2, 0.93, 0.3125, 346, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "fill", "arg_names": [], "import_names": [], "rhs_call_name": "fill", "annotation": ""}, "snippet": " self.slider.fill((230, 230, 230))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99580:Expr_L19_C8", "label": "rect()", "type": "expression", "loc": [19, 19], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99580:FunctionDef_L11_C4", "vector": [8, 2, 0.322, 0.0169, 2, 0.93, 0.375, 902, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "rect", "arg_names": [], "import_names": [], "rhs_call_name": "rect", "annotation": ""}, "snippet": " pygame.draw.rect(self.bar, (0, 0, 0), (0, 0, 275, 15), 2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99580:Expr_L20_C8", "label": "rect()", "type": "expression", "loc": [20, 20], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99580:FunctionDef_L11_C4", "vector": [8, 2, 0.339, 0.0169, 2, 0.93, 0.4375, 902, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "rect", "arg_names": [], "import_names": [], "rhs_call_name": "rect", "annotation": ""}, "snippet": " pygame.draw.rect(self.slider, (0, 0, 0), (-1, -1, 20, 15), 2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99580:Expr_L21_C8", "label": "set_at()", "type": "expression", "loc": [21, 21], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99580:FunctionDef_L11_C4", "vector": [8, 2, 0.3559, 0.0169, 2, 0.93, 0.5, 803, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "set_at", "arg_names": [], "import_names": [], "rhs_call_name": "set_at", "annotation": ""}, "snippet": " self.slider.set_at((19, 14), (0, 0, 0))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99580:Assign_L22_C8", "label": "self.brect = get_rect()", "type": "assigned_variable", "loc": [22, 22], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99580:FunctionDef_L11_C4", "vector": [14, 2, 0.3729, 0.0169, 2, 0.93, 0.5625, 427, 3, 1, 0, 0, 129, 10, 1], "semantic": {"name": "self.brect", "arg_names": [], "import_names": [], "rhs_call_name": "get_rect", "annotation": ""}, "snippet": " self.brect = self.bar.get_rect(topleft = pos)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99580:Assign_L23_C8", "label": "self.srect = get_rect()", "type": "assigned_variable", "loc": [23, 23], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99580:FunctionDef_L11_C4", "vector": [14, 2, 0.3898, 0.0169, 2, 0.93, 0.625, 964, 3, 1, 0, 0, 129, 10, 1], "semantic": {"name": "self.srect", "arg_names": [], "import_names": [], "rhs_call_name": "get_rect", "annotation": ""}, "snippet": " self.srect = self.slider.get_rect(topleft = pos)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99580:Assign_L24_C8", "label": "self.srect.left =", "type": "assigned_variable", "loc": [24, 24], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99580:FunctionDef_L11_C4", "vector": [14, 2, 0.4068, 0.0169, 2, 0.93, 0.6875, 456, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.srect.left", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.srect.left = value+pos[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99580:Assign_L25_C8", "label": "self.clicked =", "type": "assigned_variable", "loc": [25, 25], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99580:FunctionDef_L11_C4", "vector": [14, 2, 0.4237, 0.0169, 2, 0.93, 0.75, 341, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.clicked", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.clicked = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99580:Assign_L26_C8", "label": "self.value =", "type": "assigned_variable", "loc": [26, 26], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99580:FunctionDef_L11_C4", "vector": [14, 2, 0.4407, 0.0169, 2, 0.93, 0.8125, 966, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.value", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.value = value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99580:Assign_L27_C8", "label": "self.font_size =", "type": "assigned_variable", "loc": [27, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99580:FunctionDef_L11_C4", "vector": [14, 2, 0.4576, 0.0169, 2, 0.93, 0.875, 837, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.font_size", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.font_size = 15"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99580:Assign_L28_C8", "label": "self.font = SysFont()", "type": "assigned_variable", "loc": [28, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99580:FunctionDef_L11_C4", "vector": [14, 2, 0.4746, 0.0169, 2, 0.93, 0.9375, 545, 3, 2, 0, 0, 541, 10, 1], "semantic": {"name": "self.font", "arg_names": [], "import_names": [], "rhs_call_name": "SysFont", "annotation": ""}, "snippet": " self.font = pygame.font.SysFont(\"Times New Roman\", self.font_size)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99580:Assign_L29_C8", "label": "self.text =", "type": "assigned_variable", "loc": [29, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99580:FunctionDef_L11_C4", "vector": [14, 2, 0.4915, 0.0169, 2, 0.93, 1.0, 320, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self.text", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.text = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99580:FunctionDef_L31_C4", "label": "set_text", "type": "function", "loc": [31, 34], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99580:ClassDef_L8_C0", "vector": [2, 1, 0.5508, 0.0678, 1, 0.17, 0.3333, 592, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "set_text", "arg_names": ["self", "text"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def set_text(self, text):\n ''' set the text to be displayed below the slider\n '''\n self.text = text"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99580:Expr_L32_C8", "label": "expression", "type": "expression", "loc": [32, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99580:FunctionDef_L31_C4", "vector": [8, 2, 0.5508, 0.0339, 2, 0.57, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' set the text to be displayed below the slider\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99580:Assign_L34_C8", "label": "self.text =", "type": "assigned_variable", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99580:FunctionDef_L31_C4", "vector": [14, 2, 0.5763, 0.0169, 2, 0.57, 1.0, 320, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.text", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.text = text"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99580:FunctionDef_L37_C4", "label": "update", "type": "function", "loc": [37, 50], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99580:ClassDef_L8_C0", "vector": [2, 1, 0.7373, 0.2373, 1, 0.17, 0.6667, 637, 0, 1, 0, 0, 0, 0, 6], "semantic": {"name": "update", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def update(self):\n mousebutton = pygame.mouse.get_pressed()\n cursor = pygame.locals.Rect(pygame.mouse.get_pos()[0], pygame.mouse.get_pos()[1], 1, 1)\n if cursor.colliderect(self.brect):\n if mousebutton[0]:\n self.clicked = True\n else:\n self.clicked = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99580:Assign_L38_C8", "label": "mousebutton = get_pressed()", "type": "assigned_variable", "loc": [38, 38], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99580:FunctionDef_L37_C4", "vector": [14, 2, 0.6441, 0.0169, 2, 0.76, 0.0, 194, 3, 0, 0, 0, 19, 10, 1], "semantic": {"name": "mousebutton", "arg_names": [], "import_names": [], "rhs_call_name": "get_pressed", "annotation": ""}, "snippet": " mousebutton = pygame.mouse.get_pressed()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99580:Assign_L39_C8", "label": "cursor = Rect()", "type": "assigned_variable", "loc": [39, 39], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99580:FunctionDef_L37_C4", "vector": [14, 2, 0.661, 0.0169, 2, 0.76, 0.1667, 231, 3, 4, 0, 0, 333, 10, 3], "semantic": {"name": "cursor", "arg_names": [], "import_names": [], "rhs_call_name": "Rect", "annotation": ""}, "snippet": " cursor = pygame.locals.Rect(pygame.mouse.get_pos()[0], pygame.mouse.get_pos()[1], 1, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99580:If_L40_C8", "label": "if", "type": "if", "loc": [40, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99580:FunctionDef_L37_C4", "vector": [4, 2, 0.7119, 0.0847, 2, 0.76, 0.3333, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if cursor.colliderect(self.brect):\n if mousebutton[0]:\n self.clicked = True\n else:\n self.clicked = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99580:If_L41_C12", "label": "if", "type": "if", "loc": [41, 44], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99580:If_L40_C8", "vector": [4, 3, 0.7203, 0.0678, 3, 0.27, 0.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if mousebutton[0]:\n self.clicked = True\n else:\n self.clicked = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99580:Assign_L42_C16", "label": "self.clicked =", "type": "assigned_variable", "loc": [42, 42], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99580:If_L41_C12", "vector": [14, 4, 0.7119, 0.0169, 4, 0.4, 0.0, 341, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.clicked", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.clicked = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99580:Assign_L44_C16", "label": "self.clicked =", "type": "assigned_variable", "loc": [44, 44], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99580:If_L41_C12", "vector": [14, 4, 0.7458, 0.0169, 4, 0.4, 1.0, 341, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.clicked", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.clicked = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99580:If_L45_C8", "label": "if", "type": "if", "loc": [45, 46], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99580:FunctionDef_L37_C4", "vector": [4, 2, 0.7712, 0.0339, 2, 0.76, 0.5, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not mousebutton[0]:\n self.clicked = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99580:Assign_L46_C12", "label": "self.clicked =", "type": "assigned_variable", "loc": [46, 46], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99580:If_L45_C8", "vector": [14, 3, 0.7797, 0.0169, 3, 0.44, 0.0, 341, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.clicked", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.clicked = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99580:If_L47_C8", "label": "if", "type": "if", "loc": [47, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99580:FunctionDef_L37_C4", "vector": [4, 2, 0.8051, 0.0339, 2, 0.76, 0.6667, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.clicked:\n self.srect.center = cursor.center"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99580:Assign_L48_C12", "label": "self.srect.center =", "type": "assigned_variable", "loc": [48, 48], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99580:If_L47_C8", "vector": [14, 3, 0.8136, 0.0169, 3, 0.81, 0.0, 856, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.srect.center", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.srect.center = cursor.center"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99580:Expr_L49_C8", "label": "clamp_ip()", "type": "expression", "loc": [49, 49], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99580:FunctionDef_L37_C4", "vector": [8, 2, 0.8305, 0.0169, 2, 0.76, 0.8333, 775, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "clamp_ip", "arg_names": [], "import_names": [], "rhs_call_name": "clamp_ip", "annotation": ""}, "snippet": " self.srect.clamp_ip(self.brect)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99580:Assign_L50_C8", "label": "self.value =", "type": "assigned_variable", "loc": [50, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99580:FunctionDef_L37_C4", "vector": [14, 2, 0.8475, 0.0169, 2, 0.76, 1.0, 966, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.value", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.value = self.srect.left - self.brect.left"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99580:FunctionDef_L53_C4", "label": "render", "type": "function", "loc": [53, 57], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99580:ClassDef_L8_C0", "vector": [2, 1, 0.9322, 0.0847, 1, 0.17, 1.0, 24, 0, 2, 0, 0, 0, 0, 4], "semantic": {"name": "render", "arg_names": ["self", "surface"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def render(self, surface):\n surface.blit(self.bar, self.brect)\n surface.blit(self.slider, self.srect)\n ren = self.font.render(self.text,1,(0,0,0))\n surface.blit(ren, (self.pos[0], self.pos[1]+self.font_size+2))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99580:Expr_L54_C8", "label": "blit()", "type": "expression", "loc": [54, 54], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99580:FunctionDef_L53_C4", "vector": [8, 2, 0.9153, 0.0169, 2, 0.38, 0.0, 951, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "blit", "arg_names": [], "import_names": [], "rhs_call_name": "blit", "annotation": ""}, "snippet": " surface.blit(self.bar, self.brect)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99580:Expr_L55_C8", "label": "blit()", "type": "expression", "loc": [55, 55], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99580:FunctionDef_L53_C4", "vector": [8, 2, 0.9322, 0.0169, 2, 0.38, 0.3333, 951, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "blit", "arg_names": [], "import_names": [], "rhs_call_name": "blit", "annotation": ""}, "snippet": " surface.blit(self.slider, self.srect)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99580:Assign_L56_C8", "label": "ren = render()", "type": "assigned_variable", "loc": [56, 56], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99580:FunctionDef_L53_C4", "vector": [14, 2, 0.9492, 0.0169, 2, 0.38, 0.6667, 195, 3, 3, 0, 0, 24, 10, 1], "semantic": {"name": "ren", "arg_names": [], "import_names": [], "rhs_call_name": "render", "annotation": ""}, "snippet": " ren = self.font.render(self.text,1,(0,0,0))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99580:Expr_L57_C8", "label": "blit()", "type": "expression", "loc": [57, 57], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99580:FunctionDef_L53_C4", "vector": [8, 2, 0.9661, 0.0169, 2, 0.38, 1.0, 951, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "blit", "arg_names": [], "import_names": [], "rhs_call_name": "blit", "annotation": ""}, "snippet": " surface.blit(ren, (self.pos[0], self.pos[1]+self.font_size+2))"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99580:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99580:FunctionDef_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99580:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99580:Assign_L12_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99580:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99580:Assign_L13_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99580:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99580:Assign_L15_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99580:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99580:Expr_L16_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99580:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99580:Assign_L17_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99580:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99580:Expr_L18_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99580:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99580:Expr_L19_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99580:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99580:Expr_L20_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99580:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99580:Expr_L21_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99580:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99580:Assign_L22_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99580:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99580:Assign_L23_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99580:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99580:Assign_L24_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99580:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99580:Assign_L25_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99580:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99580:Assign_L26_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99580:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99580:Assign_L27_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99580:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99580:Assign_L28_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99580:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99580:Assign_L29_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99580:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99580:FunctionDef_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99580:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99580:Expr_L32_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99580:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99580:Assign_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99580:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99580:FunctionDef_L37_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99580:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99580:Assign_L38_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99580:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99580:Assign_L39_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99580:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99580:If_L40_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99580:If_L40_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99580:If_L41_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99580:If_L41_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99580:Assign_L42_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99580:If_L41_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99580:Assign_L44_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99580:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99580:If_L45_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99580:If_L45_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99580:Assign_L46_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99580:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99580:If_L47_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99580:If_L47_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99580:Assign_L48_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99580:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99580:Expr_L49_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99580:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99580:Assign_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99580:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99580:FunctionDef_L53_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99580:FunctionDef_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99580:Expr_L54_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99580:FunctionDef_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99580:Expr_L55_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99580:FunctionDef_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99580:Assign_L56_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99580:FunctionDef_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99580:Expr_L57_C8"}]
# # Copyright (c) 2009, Georgia Tech Research Corporation # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # * Neither the name of the Georgia Tech Research Corporation nor the # names of its contributors may be used to endorse or promote products # derived from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY GEORGIA TECH RESEARCH CORPORATION ''AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL GEORGIA TECH BE LIABLE FOR ANY DIRECT, INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # \author Advait Jain (Healthcare Robotics Lab, Georgia Tech.) # functions to use scans from hokuyos. import roslib roslib.load_manifest('hrl_hokuyo') import pygame import pygame.locals import hokuyo_scan as hs import hrl_lib.transforms as tr import hrl_lib.util as ut #import util as uto import math, numpy as np import scipy.ndimage as ni import pylab as pl import sys, time import optparse import copy import pygame_utils as pu # Need to switch to Willow's OpenCV 2.0 python bindings at some point of time. # from opencv.cv import * # from opencv.highgui import * from ctypes import POINTER MAX_DIST=1.0 # pixel coordinates of origin org_x,org_y = 320,240+150 color_list = [(255,255,0),(255,0,0),(0,255,255),(0,255,0),(0,0,255),(0,100,100),(100,100,0), (100,0,100),(100,200,100),(200,100,100),(100,100,200),(100,0,200),(0,200,100), (0,0,0),(0,100,200),(200,0,100),(100,0,100),(255,152,7) ] def angle_to_index(scan, angle): ''' returns index corresponding to angle (radians). ''' return int(min(scan.n_points-1, max(0.,int(round((angle-scan.start_angle)/scan.angular_res))))) def index_to_angle(scan, index): ''' returns angle (radians) corresponding to index. ''' return scan.start_angle+index*scan.angular_res def get_xy_map(scan,start_angle=math.radians(-360),end_angle=math.radians(360),reject_zero_ten=True,max_dist=np.Inf,min_dist=-np.Inf,sigmoid_hack=False, get_intensities=False): """ start_angle - starting angle for points to be considered (hokuyo coord) end_angle - ending angle in hokuyo coord frame. scan - object of class HokuyoScan reject_zero_ten - ignore points at 0 or 10. meters returns - 2xN matrix, if get_intensities=True returns (2xN matrix, 1xN matrix) """ start_index = angle_to_index(scan,start_angle) end_index = angle_to_index(scan,end_angle) if sigmoid_hack: #------ sigmoid hack to increase ranges of points with small range(<0.3) ---- # short_range_idxs = np.where(scan.ranges<0.3) # scan.ranges[short_range_idxs] = scan.ranges[short_range_idxs]*1.05 #--- test1 # scan.ranges = np.multiply(scan.ranges, 1+(1-np.divide(1.,1+np.power(np.e,-5*(scan.ranges-0.3))))*0.1) #--- test2 scan.ranges = np.multiply(scan.ranges, 1+(1-np.divide(1.,1+np.power(np.e,-5*(scan.ranges-0.2))))*0.20) #--- test3 # scan.ranges = np.multiply(scan.ranges, 1+(1-np.divide(1.,1+np.power(np.e,-5*(scan.ranges-0.3))))*0.2) #--- test4 # scan.ranges = np.multiply(scan.ranges, 1+(1-np.divide(1.,1+np.power(np.e,-5*(scan.ranges-0.25))))*0.15) #------------------ xy_map = np.matrix(np.row_stack((np.multiply(scan.ranges,np.cos(scan.angles)), np.multiply(scan.ranges,np.sin(scan.angles))*-1))) sub_range = scan.ranges[:,start_index:end_index+1] keep_condition = np.multiply(sub_range<=max_dist,sub_range>=min_dist) if reject_zero_ten == True: keep_condition = np.multiply(keep_condition,np.multiply(sub_range > 0.01,sub_range <= 10.)) xy_map = xy_map[:,start_index:end_index+1] idxs = np.where(keep_condition) xy_map = np.row_stack((xy_map[idxs],xy_map[idxs[0]+1,idxs[1]])) if get_intensities == True: intensities = scan.intensities[:,start_index:end_index+1] intensities = intensities[idxs] return xy_map, intensities else: return xy_map def connected_components(p, dist_threshold): ''' p - 2xN numpy matrix of euclidean points points (indices give neighbours). dist_threshold - max distance between two points in the same connected component. typical value is .02 meters returns a list of (p1,p2, p1_index, p2_index): (start euclidean point, end euclidean point, start index, end index) p1 and p2 are 2X1 matrices ''' nPoints = p.shape[1] q = p[:,0:nPoints-1] r = p[:,1:nPoints] diff = r-q dists = ut.norm(diff).T idx = np.where(dists>dist_threshold) # boundaries of the connected components end_list = idx[0].A1.tolist() end_list.append(nPoints-1) cc_list = [] start = 0 for i in end_list: cc_list.append((p[:,start], p[:,i], start, i)) start = i+1 return cc_list def find_objects(scan, max_dist, max_size, min_size, min_angle, max_angle, connect_dist_thresh, all_pts=False): ''' max_dist - objects with centroid greater than max_dist will be ignored. (meters) max_size - objects greater than this are ignored. (meters) min_size - smaller than this are ignored (meters) min_angle, max_angle - part of scan to consider. connect_dist_thresh - points in scan greater than this will be treated as separate connected components. all_pts == True: returns [ np matrix: 2xN1, 2xN2 ...] each matrix consists of all the points in the object. all_pts == False: returns list of (p,q,centroid): (end points,object centroid (2x1 matrices.)) ''' xy_map = get_xy_map(scan,min_angle,max_angle) cc_list = connected_components(xy_map,connect_dist_thresh) object_list = [] all_pts_list = [] for i,(p,q,p_idx,q_idx) in enumerate(cc_list): object_pts = xy_map[:,p_idx:q_idx+1] centroid = object_pts.sum(1)/(q_idx-p_idx+1) size = np.linalg.norm(p-q) if size>max_size: continue if size<min_size: continue if np.linalg.norm(centroid) > max_dist: continue object_list.append((p,q,centroid)) all_pts_list.append(object_pts) if all_pts == True: return all_pts_list else: return object_list def find_closest_object_point(scan, pt_interest=np.matrix([0.,0.]).T, min_angle=math.radians(-60), max_angle=math.radians(60),max_dist=0.6,min_size=0.01,max_size=0.3): ''' returns 2x1 matrix - centroid of connected component in hokuyo frame closest to pt_interest pt_interest - 2x1 matrix in hokuyo coord frame. None if no object found. ''' obj_list = find_objects(scan,max_dist,max_size,min_size,min_angle,max_angle, connect_dist_thresh=0.02, all_pts=True) if obj_list == []: return None min_dist_list = [] for pts in obj_list: min_dist_list.append(np.min(ut.norm(pts-pt_interest))) min_idx = np.argmin(np.matrix(min_dist_list)) return obj_list[min_idx].mean(1) def remove_graze_effect(ranges, angles, skip=1, graze_angle_threshold=math.radians(169.)): ''' ranges,angles - 1xN numpy matrix skip - which two rays to consider. this function changes ranges. ''' nPoints = ranges.shape[1] p = ranges[:,0:nPoints-(1+skip)] q = ranges[:,(1+skip):nPoints] d_mat = np.abs(p-q) angles_diff = np.abs(angles[:,(1+skip):nPoints]-angles[:,0:nPoints-(1+skip)]) l_mat = np.max(np.row_stack((p,q)),0) l_mat = np.multiply(l_mat,np.sin(angles_diff))/math.sin(graze_angle_threshold) thresh_exceed = d_mat>l_mat l1_greater = p>q idx_remove_1 = np.where(np.all(np.row_stack((thresh_exceed,l1_greater)),0)) idx_remove_2 = np.where(np.all(np.row_stack((thresh_exceed,1-l1_greater)),0)) # print 'idx_remove_1:', idx_remove_1 p[idx_remove_1] = 1000. q[idx_remove_2] = 1000. def remove_graze_effect_scan(scan, graze_angle_threshold=math.radians(169.)): ''' changes scan ''' remove_graze_effect(scan.ranges,scan.angles,1,graze_angle_threshold) def subtract_scans(scan2,scan1,threshold=0.01): if scan1.ranges.shape != scan2.ranges.shape: print 'hokuyo_processing.subtract_scans: the two scan.ranges have different shapes.' print 'remember to pass remove_graze_effect = False' print 'Exiting...' sys.exit() diff_range = scan2.ranges-scan1.ranges idxs = np.where(np.abs(diff_range)<threshold) #idxs = np.where(np.abs(diff_range)<0.04) # idxs = np.where(np.abs(diff_range)<0.01) # idxs = np.where(np.abs(diff_range)<0.005) hscan = hs.HokuyoScan(scan2.hokuyo_type,scan2.angular_res, scan2.max_range,scan2.min_range, scan2.start_angle,scan2.end_angle) hscan.ranges = copy.copy(scan2.ranges) hscan.ranges[idxs] = 0. return hscan def find_door(start_pts_list,end_pts_list,pt_interest=None): ''' returns [p1x,p1y], [p2x,p2y] ([],[] if no door found) returns line closest to the pt_interest. pt_interest - 2x1 matrix ''' if start_pts_list == []: return [],[] # print 'start_pts_list,end_pts_list',start_pts_list,end_pts_list start_pts = np.matrix(start_pts_list).T end_pts = np.matrix(end_pts_list).T line_vecs = end_pts-start_pts line_vecs_ang = np.arctan2(line_vecs[1,:],line_vecs[0,:]) idxs = np.where(np.add(np.multiply(line_vecs_ang>math.radians(45), line_vecs_ang<math.radians(135)), np.multiply(line_vecs_ang<math.radians(-45), line_vecs_ang>math.radians(-135)) ) > 0 )[1].A1.tolist() if idxs == []: return [],[] start_pts = start_pts[:,idxs] end_pts = end_pts[:,idxs] # print 'start_pts,end_pts',start_pts.A1.tolist(),end_pts.A1.tolist() if pt_interest == None: print 'hokuyo_processing.find_door: pt_interest in None so returning the longest line.' length = ut.norm(end_pts-start_pts) longest_line_idx = np.argmax(length) vec_door = (end_pts-start_pts)[:,longest_line_idx] return start_pts[:,longest_line_idx].A1.tolist(),end_pts[:,longest_line_idx].A1.tolist() else: v = end_pts-start_pts q_dot_v = pt_interest.T*v p1_dot_v = np.sum(np.multiply(start_pts,v),0) v_dot_v = ut.norm(v) lam = np.divide((q_dot_v-p1_dot_v),v_dot_v) r = start_pts + np.multiply(lam,v) dist = ut.norm(pt_interest-r) edge_idxs = np.where(np.multiply(lam>1.,lam<0.))[1].A1.tolist() min_end_dist = np.minimum(ut.norm(start_pts-pt_interest),ut.norm(end_pts-pt_interest)) dist[:,edge_idxs] = min_end_dist[:,edge_idxs] # dist - distance of closest point within the line segment # or distance of the closest end point. # keep line segments that are within some distance threshold. keep_idxs = np.where(dist<0.5)[1].A1.tolist() if len(keep_idxs) == 0: return [],[] start_pts = start_pts[:,keep_idxs] end_pts = end_pts[:,keep_idxs] # find distance from the robot and select furthest line. p_robot = np.matrix([0.,0.]).T v = end_pts-start_pts q_dot_v = p_robot.T*v p1_dot_v = np.sum(np.multiply(start_pts,v),0) v_dot_v = ut.norm(v) lam = np.divide((q_dot_v-p1_dot_v),v_dot_v) r = start_pts + np.multiply(lam,v) dist = ut.norm(p_robot-r) door_idx = np.argmax(dist) return start_pts[:,door_idx].A1.tolist(),end_pts[:,door_idx].A1.tolist() def xy_map_to_np_image(xy_map,m_per_pixel,dilation_count=0,padding=50): ''' returns binary numpy image. (255 for occupied pixels, 0 for unoccupied) 2d array ''' min_x = np.min(xy_map[0,:]) max_x = np.max(xy_map[0,:]) min_y = np.min(xy_map[1,:]) max_y = np.max(xy_map[1,:]) br = np.matrix([min_x,min_y]).T n_x = int(round((max_x-min_x)/m_per_pixel)) + padding n_y = int(round((max_y-min_y)/m_per_pixel)) + padding img = np.zeros((n_x+padding,n_y+padding),dtype='int') occupied_pixels = np.matrix([n_x,n_y]).T - np.round((xy_map-br)/m_per_pixel).astype('int') if dilation_count == 0: img[(occupied_pixels[0,:],occupied_pixels[1,:])] = 255 else: img[(occupied_pixels[0,:],occupied_pixels[1,:])] = 1 connect_structure = np.empty((3,3),dtype='int') connect_structure[:,:] = 1 img = ni.binary_closing(img,connect_structure,iterations=dilation_count) img = ni.binary_dilation(img,connect_structure,iterations=1) img = img*255 return img,n_x,n_y,br def xy_map_to_cv_image(xy_map,m_per_pixel,dilation_count=0,padding=10): np_im,n_x,n_y,br = xy_map_to_np_image(xy_map,m_per_pixel,dilation_count,padding) cv_im = uto.np2cv(np_im) return cv_im,n_x,n_y,br def hough_lines(xy_map,save_lines=False): ''' xy_map - 2xN matrix of points. returns start_list, end_list. [[p1x,p1y],[p2x,p2y]...],[[q1x,q1y]...] [],[] if no lines were found. ''' # save_lines=True m_per_pixel = 0.005 img_cv,n_x,n_y,br = xy_map_to_cv_image(xy_map,m_per_pixel,dilation_count=1,padding=50) time_str = str(time.time()) # for i in range(3): # cvSmooth(img_cv,img_cv,CV_GAUSSIAN,3,3) # cvSaveImage('aloha'+str(time.time())+'.png',img_cv) storage = cvCreateMemStorage(0) method = CV_HOUGH_PROBABILISTIC rho = max(int(round(0.01/m_per_pixel)),1) rho = 1 theta = math.radians(1) min_line_length = int(0.3/m_per_pixel) max_gap = int(0.1/m_per_pixel) n_points_thresh = int(0.2/m_per_pixel) # cvCanny(img_cv,img_cv,50,200) # cvSaveImage('aloha.png',img_cv) lines = cvHoughLines2(img_cv, storage, method, rho, theta, n_points_thresh, min_line_length, max_gap) if lines.total == 0: return [],[] pts_start = np.zeros((2, lines.total)) pts_end = np.zeros((2, lines.total)) if save_lines: color_dst = cvCreateImage( cvGetSize(img_cv), 8, 3 ) cvCvtColor( img_cv, color_dst, CV_GRAY2BGR ) n_lines = lines.total for idx, line in enumerate(lines.asarrayptr(POINTER(CvPoint))): pts_start[0, idx] = line[0].y pts_start[1, idx] = line[0].x pts_end[0, idx] = line[1].y pts_end[1, idx] = line[1].x if save_lines: pts_start_pixel = pts_start pts_end_pixel = pts_end pts_start = (np.matrix([n_x,n_y]).T - pts_start)*m_per_pixel + br pts_end = (np.matrix([n_x,n_y]).T - pts_end)*m_per_pixel + br along_vec = pts_end - pts_start along_vec = along_vec/ut.norm(along_vec) ang_vec = np.arctan2(-along_vec[0,:],along_vec[1,:]) res_list = [] keep_indices = [] for i in range(n_lines): ang = ang_vec[0,i] if ang>math.radians(90): ang = ang - math.radians(180) if ang<math.radians(-90): ang = ang + math.radians(180) rot_mat = tr.Rz(ang)[0:2,0:2] st = rot_mat*pts_start[:,i] en = rot_mat*pts_end[:,i] pts = rot_mat*xy_map x_all = pts[0,:] y_all = pts[1,:] min_x = min(st[0,0],en[0,0]) - 0.1 max_x = max(st[0,0],en[0,0]) + 0.1 min_y = min(st[1,0],en[1,0]) + 0.01 max_y = max(st[1,0],en[1,0]) - 0.01 keep = np.multiply(np.multiply(x_all>min_x,x_all<max_x), np.multiply(y_all>min_y,y_all<max_y)) xy_sub = xy_map[:,np.where(keep)[1].A1.tolist()] if xy_sub.shape[1] == 0: continue a,b,res = uto.fitLine_highslope(xy_sub[0,:].T, xy_sub[1,:].T) if res<0.0002: res_list.append(res) keep_indices.append(i) if keep_indices == []: return [],[] pts_start = pts_start[:,keep_indices] pts_end = pts_end[:,keep_indices] print 'number of lines:', len(keep_indices) if save_lines: ut.save_pickle(res_list,'residual_list_'+time_str+'.pkl') for i, idx in enumerate(keep_indices): s = pts_start_pixel[:,idx] e = pts_end_pixel[:,idx] cvLine(color_dst, cvPoint(int(s[1]),int(s[0])), cvPoint(int(e[1]),int(e[0])), CV_RGB(*(color_list[i])), 3, 8) cvSaveImage('lines_'+time_str+'.png',color_dst) # cvReleaseMemStorage(storage) return pts_start.T.tolist(),pts_end.T.tolist() #------------- displaying in pygame ----------- def pixel_to_real(x,y, max_dist): ''' pixel to hokuyo x,y - NX1 matrices (N points) max_dist - dist which will be drawn at row 0 ''' return (org_y-y)*max_dist/400.,(org_x-x)*max_dist/400. # return org_x-(400./max_dist)*y, org_y-(400./max_dist)*x def coord(x,y, max_dist): '''hokuyo coord frame to pixel (x,y) - floats x,y - NX1 matrices (N points) max_dist - dist which will be drawn at row 0 ''' return org_x-(400./max_dist)*y, org_y-(400./max_dist)*x def draw_points(srf,x,y,color,max_dist,step=1): ''' step - set > 1 if you don't want to draw all the points. ''' if len(x.A1) == 0: return x_pixel, y_pixel = coord(x.T,y.T,max_dist) for i in range(0,x_pixel.shape[0],step): pygame.draw.circle(srf, color, (int(x_pixel[i,0]+0.5), int(y_pixel[i,0]+0.5)), 2, 0) def draw_hokuyo_scan(srf, scan, ang1, ang2, color, reject_zero_ten=True,step=1): ''' reject_zero_ten - don't show points with 0 or 10. range readings. step - set > 1 if you don't want to draw all the points. ''' pts = get_xy_map(scan, ang1, ang2, reject_zero_ten=reject_zero_ten) # pts = get_xy_map(scan, reject_zero_ten=reject_zero_ten) max_dist = MAX_DIST draw_points(srf,pts[0,:],pts[1,:],color,max_dist,step=step) def test_connected_comps(srf, scan): #colors_list = [(200,0,0), (0,255,0), (100,100,0), (100,0,100), (0,100,100)] n_colors = len(color_list) cc_list = connected_components(get_xy_map(scan,math.radians(-60),math.radians(60)),0.03) # draw the connected components as lines for i,(p,q,p_idx,q_idx) in enumerate(cc_list): c1,c2 = p.A1.tolist(),q.A1.tolist() c1,c2 = coord(c1[0],c1[1], max_dist=MAX_DIST), coord(c2[0],c2[1], max_dist=MAX_DIST) pygame.draw.line(srf,color_list[i%n_colors],c1,c2,2) def test_find_objects(srf, scan): obj_list = find_objects(scan, max_dist=0.6, max_size=0.3, min_size=0.01, min_angle=math.radians(-60), max_angle=math.radians(60), connect_dist_thresh=0.02) print 'number of objects:', len(obj_list) #colors_list = [(200,0,0), (0,255,0), (100,100,0), (100,0,100), (0,100,100)] for i,(p,q,c) in enumerate(obj_list): if i>4: break c1,c2 = p.A1.tolist(),q.A1.tolist() c1,c2 = coord(c1[0],c1[1], max_dist=MAX_DIST), coord(c2[0],c2[1], max_dist=MAX_DIST) pygame.draw.line(srf,color_list[i],c1,c2,2) def test_find_closest_object_point(srf, scan): pt_interest = np.matrix([0.,0.]).T # pt_interest = np.matrix([0.3,-0.04]).T p = find_closest_object_point(scan, pt_interest) if p == None: return c1,c2 = coord(p[0,0],p[1,0], max_dist=MAX_DIST) pygame.draw.circle(srf, (0,200,0), (c1,c2), 3, 0) c1,c2 = coord(pt_interest[0,0],pt_interest[1,0], max_dist=MAX_DIST) pygame.draw.circle(srf, (200,200,0), (c1,c2), 3, 0) def tune_graze_effect_init(): sl = pu.Slider((340, 20), 10) return sl def tune_graze_effect_update(sl, srf, scan): sl.update() val = sl.value/255. angle = 160+val*20 remove_graze_effect_scan(scan,graze_angle_threshold=math.radians(angle)) draw_hokuyo_scan(srf,scan,math.radians(-90), math.radians(90),color=(200,0,0),reject_zero_ten=False) points_removed = np.where(np.matrix(scan.ranges)>10.)[0].shape[1] sl.set_text('angle: %.2f, points_removed: %d'%(angle, points_removed)) sl.render(srf) if sl.clicked: return True else: return False def test_find_handle_init(): fr = np.matrix([1.28184669,0.05562259]).T bl = np.matrix([1.19585711,-0.06184923]).T max_dist = MAX_DIST x_fr, y_fr = coord(fr[0,0],fr[1,0],max_dist) x_bl, y_bl = coord(bl[0,0],bl[1,0],max_dist) pygame.draw.rect(srf,(200,0,200),pygame.Rect(x_bl,y_bl,x_fr-x_bl,y_fr-y_bl),1) cv_handle_template = create_handle_template(dict['scan'],dict['bk_lt'],dict['fr_rt']) def test_find_lines(): pts = get_xy_map(scan,math.radians(-60),math.radians(60)) p_start_list,p_end_list = hough_lines(pts) if p_start_list == []: return #------- to test door finding ---------- # p_start,p_end = find_door(p_start_list,p_end_list) # if p_start == []: # return # p_start_list,p_end_list = [p_start],[p_end] n_colors = len(color_list) for i,(p1,p2) in enumerate(zip(p_start_list,p_end_list)): c1,c2 = coord(p1[0],p1[1], max_dist=MAX_DIST), coord(p2[0],p2[1], max_dist=MAX_DIST) pygame.draw.line(srf,color_list[i%n_colors],c1,c2,2) if __name__ == '__main__': p = optparse.OptionParser() p.add_option('-t', action='store', type='string', dest='hokuyo_type', help='hokuyo_type. urg or utm') p.add_option('-a', action='store', type='int', dest='avg', help='number of scans to average', default=1) p.add_option('-n', action='store', type='int', dest='hokuyo_number', help='hokuyo number. 0,1,2 ...') p.add_option('-f', action='store_true', dest='flip', help='flip the hokuyo scan') p.add_option('--ang_range', type='float', dest='ang_range', help='max angle of the ray to display (degrees)', default=360.) opt, args = p.parse_args() hokuyo_type = opt.hokuyo_type hokuyo_number = opt.hokuyo_number avg_number = opt.avg flip = opt.flip ang_range = opt.ang_range ang_range = math.radians(ang_range) #------- which things to test --------- test_graze_effect_flag = False test_find_objects_flag = False test_find_closest_object_point_flag = False test_show_change_flag = False test_find_lines_flag = False #-------------------------------------- # Initialize pygame # pygame.init() # Open a display srf = pygame.display.set_mode((640,480)) pygame.display.set_caption(hokuyo_type+' '+str(hokuyo_number)) fps = 100 loopFlag = True clk = pygame.time.Clock() if hokuyo_type == 'utm': h = hs.Hokuyo('utm',hokuyo_number,start_angle=-ang_range, end_angle=ang_range,flip=flip) elif hokuyo_type == 'urg': h = hs.Hokuyo('urg',hokuyo_number,flip=flip) else: print 'unknown hokuyo type: ', hokuyo_type print 'Exiting...' sys.exit() # scan1 = h.get_scan(avoid_duplicate=True) # sys.exit() #---------- initializations ------------- if test_graze_effect_flag: sl = tune_graze_effect_init() #--------- and now loop ----------- if test_show_change_flag: scan_prev = h.get_scan(avoid_duplicate=True, avg=avg_number, remove_graze=False) n_ch_pts_list = [] while loopFlag: widget_clicked = False # Clear the screen srf.fill((255,255,255)) # Draw the urg pygame.draw.circle(srf, (200,0,0), (org_x,org_y), 10, 0) #display all the points if test_graze_effect_flag or test_show_change_flag: # here we don't want any filtering on the scan. scan = h.get_scan(avoid_duplicate=True, avg=avg_number, remove_graze=False) else: scan = h.get_scan(avoid_duplicate=True, avg=avg_number, remove_graze=True) if test_show_change_flag == False: #draw_hokuyo_scan(srf,scan,math.radians(-70), math.radians(70),color=(0,0,200)) #draw_hokuyo_scan(srf,scan,math.radians(-90), math.radians(90),color=(0,0,200)) draw_hokuyo_scan(srf,scan,math.radians(-135),math.radians(135),color=(0,0,200)) else: diff_scan = subtract_scans(scan,scan_prev) scan_prev = scan pts = get_xy_map(diff_scan,math.radians(-40), math.radians(40),reject_zero_ten=True) n_ch_pts_list.append(pts.shape[1]) max_dist = MAX_DIST draw_points(srf,pts[0,:],pts[1,:],color=(0,200,0),max_dist=max_dist) # test_connected_comps(srf, scan) if test_find_objects_flag: test_find_objects(srf, scan) if test_find_closest_object_point_flag: test_find_closest_object_point(srf, scan) if test_graze_effect_flag: widget_clicked |= tune_graze_effect_update(sl,srf, scan) if test_find_lines_flag: test_find_lines() 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 widget_clicked == False: if e.type==pygame.locals.MOUSEMOTION: if e.buttons[0] == 1: # left button org_x += e.rel[0] org_y += e.rel[1] if e.buttons[2] == 1: # right button MAX_DIST *= (1+e.rel[1]*0.01) MAX_DIST = max(MAX_DIST,0.1) # Try to keep the specified framerate clk.tick(fps) if test_show_change_flag: ut.save_pickle(n_ch_pts_list,ut.formatted_time()+'_ch_pts_list.pkl')
ajibawa-2023/Python-Code-Large/train/row_99581
406
713
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Import_L34_C0", "label": "roslib import roslib", "type": "import", "loc": [34, 34], "level": 0, "parent": null, "vector": [1, 0, 0.0477, 0.0014, 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_99581:Expr_L35_C0", "label": "load_manifest()", "type": "expression", "loc": [35, 35], "level": 0, "parent": null, "vector": [8, 0, 0.0491, 0.0014, 0, 0.66, 0.0238, 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_hokuyo')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Import_L37_C0", "label": "pygame import pygame", "type": "import", "loc": [37, 37], "level": 0, "parent": null, "vector": [1, 0, 0.0519, 0.0014, 0, 0.66, 0.0476, 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_99581:Import_L38_C0", "label": "pygame.locals import pygame.locals", "type": "import", "loc": [38, 38], "level": 0, "parent": null, "vector": [1, 0, 0.0533, 0.0014, 0, 0.66, 0.0714, 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_99581:Import_L39_C0", "label": "hokuyo_scan import hs", "type": "import", "loc": [39, 39], "level": 0, "parent": null, "vector": [1, 0, 0.0547, 0.0014, 0, 0.66, 0.0952, 196, 0, 1, 0, 0, 196, 0, 0], "semantic": {"name": "hokuyo_scan", "arg_names": [], "import_names": ["hs"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hokuyo_scan as hs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Import_L41_C0", "label": "hrl_lib.transforms import tr", "type": "import", "loc": [41, 41], "level": 0, "parent": null, "vector": [1, 0, 0.0575, 0.0014, 0, 0.66, 0.119, 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_99581:Import_L42_C0", "label": "hrl_lib.util import ut", "type": "import", "loc": [42, 42], "level": 0, "parent": null, "vector": [1, 0, 0.0589, 0.0014, 0, 0.66, 0.1429, 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_99581:Import_L44_C0", "label": "math import math, np", "type": "import", "loc": [44, 44], "level": 0, "parent": null, "vector": [1, 0, 0.0617, 0.0014, 0, 0.66, 0.1667, 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_99581:Import_L45_C0", "label": "scipy.ndimage import ni", "type": "import", "loc": [45, 45], "level": 0, "parent": null, "vector": [1, 0, 0.0631, 0.0014, 0, 0.66, 0.1905, 348, 0, 1, 0, 0, 348, 0, 0], "semantic": {"name": "scipy.ndimage", "arg_names": [], "import_names": ["ni"], "rhs_call_name": "", "annotation": ""}, "snippet": "import scipy.ndimage as ni"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Import_L46_C0", "label": "pylab import pl", "type": "import", "loc": [46, 46], "level": 0, "parent": null, "vector": [1, 0, 0.0645, 0.0014, 0, 0.66, 0.2143, 735, 0, 1, 0, 0, 735, 0, 0], "semantic": {"name": "pylab", "arg_names": [], "import_names": ["pl"], "rhs_call_name": "", "annotation": ""}, "snippet": "import pylab as pl"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Import_L48_C0", "label": "sys import sys, time", "type": "import", "loc": [48, 48], "level": 0, "parent": null, "vector": [1, 0, 0.0673, 0.0014, 0, 0.66, 0.2381, 509, 0, 2, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys", "time"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys, time"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Import_L49_C0", "label": "optparse import optparse", "type": "import", "loc": [49, 49], "level": 0, "parent": null, "vector": [1, 0, 0.0687, 0.0014, 0, 0.66, 0.2619, 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_99581:Import_L50_C0", "label": "copy import copy", "type": "import", "loc": [50, 50], "level": 0, "parent": null, "vector": [1, 0, 0.0701, 0.0014, 0, 0.66, 0.2857, 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_99581:Import_L52_C0", "label": "pygame_utils import pu", "type": "import", "loc": [52, 52], "level": 0, "parent": null, "vector": [1, 0, 0.0729, 0.0014, 0, 0.66, 0.3095, 157, 0, 1, 0, 0, 157, 0, 0], "semantic": {"name": "pygame_utils", "arg_names": [], "import_names": ["pu"], "rhs_call_name": "", "annotation": ""}, "snippet": "import pygame_utils as pu"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:ImportFrom_L59_C0", "label": "from ctypes import POINTER", "type": "import", "loc": [59, 59], "level": 0, "parent": null, "vector": [1, 0, 0.0827, 0.0014, 0, 0.66, 0.3333, 182, 0, 1, 0, 0, 182, 0, 0], "semantic": {"name": "ctypes", "arg_names": [], "import_names": ["POINTER"], "rhs_call_name": "", "annotation": ""}, "snippet": "from ctypes import POINTER"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L61_C0", "label": "MAX_DIST =", "type": "assigned_variable", "loc": [61, 61], "level": 0, "parent": null, "vector": [14, 0, 0.0856, 0.0014, 0, 0.66, 0.3571, 507, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "MAX_DIST", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "MAX_DIST=1.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L63_C0", "label": "org_x, org_y =", "type": "assigned_variable", "loc": [63, 63], "level": 0, "parent": null, "vector": [14, 0, 0.0884, 0.0014, 0, 0.66, 0.381, 248, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "org_x, org_y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "org_x,org_y = 320,240+150"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L65_C0", "label": "color_list =", "type": "assigned_variable", "loc": [65, 67], "level": 0, "parent": null, "vector": [14, 0, 0.0926, 0.0042, 0, 0.66, 0.4048, 570, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "color_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "color_list = [(255,255,0),(255,0,0),(0,255,255),(0,255,0),(0,0,255),(0,100,100),(100,100,0),\n (100,0,100),(100,200,100),(200,100,100),(100,100,200),(100,0,200),(0,200,100),\n (0,0,0),(0,100,200),(200,0,100),(100,0,100),(255,152,7) ]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L70_C0", "label": "angle_to_index", "type": "function", "loc": [70, 73], "level": 0, "parent": null, "vector": [2, 0, 0.1003, 0.0056, 0, 0.66, 0.4286, 126, 0, 2, 1, 0, 0, 0, 5], "semantic": {"name": "angle_to_index", "arg_names": ["scan", "angle"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def angle_to_index(scan, angle):\n ''' returns index corresponding to angle (radians).\n '''\n return int(min(scan.n_points-1, max(0.,int(round((angle-scan.start_angle)/scan.angular_res)))))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L71_C4", "label": "expression", "type": "expression", "loc": [71, 72], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L70_C0", "vector": [8, 1, 0.1003, 0.0028, 1, 0.74, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' returns index corresponding to angle (radians).\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Return_L73_C4", "label": "return", "type": "return", "loc": [73, 73], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L70_C0", "vector": [13, 1, 0.1024, 0.0014, 1, 0.74, 1.0, 0, 3, 0, 0, 0, 0, 10, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return int(min(scan.n_points-1, max(0.,int(round((angle-scan.start_angle)/scan.angular_res)))))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L75_C0", "label": "index_to_angle", "type": "function", "loc": [75, 78], "level": 0, "parent": null, "vector": [2, 0, 0.1073, 0.0056, 0, 0.66, 0.4524, 628, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "index_to_angle", "arg_names": ["scan", "index"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def index_to_angle(scan, index):\n ''' returns angle (radians) corresponding to index.\n '''\n return scan.start_angle+index*scan.angular_res"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L76_C4", "label": "expression", "type": "expression", "loc": [76, 77], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L75_C0", "vector": [8, 1, 0.1073, 0.0028, 1, 0.5, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' returns angle (radians) corresponding to index.\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Return_L78_C4", "label": "return", "type": "return", "loc": [78, 78], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L75_C0", "vector": [13, 1, 0.1094, 0.0014, 1, 0.5, 1.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return scan.start_angle+index*scan.angular_res"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L80_C0", "label": "get_xy_map", "type": "function", "loc": [80, 128], "level": 0, "parent": null, "vector": [2, 0, 0.1459, 0.0687, 0, 0.66, 0.4762, 476, 0, 8, 1, 0, 0, 0, 18], "semantic": {"name": "get_xy_map", "arg_names": ["scan", "start_angle", "end_angle", "reject_zero_ten", "max_dist", "min_dist", "sigmoid_hack", "get_intensities"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def get_xy_map(scan,start_angle=math.radians(-360),end_angle=math.radians(360),reject_zero_ten=True,max_dist=np.Inf,min_dist=-np.Inf,sigmoid_hack=False, get_intensities=False):\n \"\"\" start_angle - starting angle for points to be considered (hokuyo coord)\n end_angle - ending angle in hokuyo coord frame.\n scan - object of class HokuyoScan\n reject_zero_ten - ignore points at 0 or 10. meters\n\t\t\n returns - 2xN matrix, if get_intensities=True returns (2xN matrix, 1xN matrix)\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L81_C4", "label": "expression", "type": "expression", "loc": [81, 87], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L80_C0", "vector": [8, 1, 0.1178, 0.0098, 1, 0.62, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\" start_angle - starting angle for points to be considered (hokuyo coord)\n end_angle - ending angle in hokuyo coord frame.\n scan - object of class HokuyoScan\n reject_zero_ten - ignore points at 0 or 10. meters\n\t\t\n returns - 2xN matrix, if get_intensities=True returns (2xN matrix, 1xN matrix)\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L88_C4", "label": "start_index = angle_to_index()", "type": "assigned_variable", "loc": [88, 88], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L80_C0", "vector": [14, 1, 0.1234, 0.0014, 1, 0.62, 0.0909, 553, 3, 2, 0, 0, 126, 10, 1], "semantic": {"name": "start_index", "arg_names": [], "import_names": [], "rhs_call_name": "angle_to_index", "annotation": ""}, "snippet": " start_index = angle_to_index(scan,start_angle)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L89_C4", "label": "end_index = angle_to_index()", "type": "assigned_variable", "loc": [89, 89], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L80_C0", "vector": [14, 1, 0.1248, 0.0014, 1, 0.62, 0.1818, 48, 3, 2, 0, 0, 126, 10, 1], "semantic": {"name": "end_index", "arg_names": [], "import_names": [], "rhs_call_name": "angle_to_index", "annotation": ""}, "snippet": " end_index = angle_to_index(scan,end_angle)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L91_C4", "label": "if", "type": "if", "loc": [91, 100], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L80_C0", "vector": [4, 1, 0.1339, 0.014, 1, 0.62, 0.2727, 0, 2, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if sigmoid_hack:\n#------ sigmoid hack to increase ranges of points with small range(<0.3) ----\n # short_range_idxs = np.where(scan.ranges<0.3)\n # scan.ranges[short_range_idxs] = scan.ranges[short_range_idxs]*1.05\n\n#--- test1\n# scan.ranges = np.multiply(scan.ranges, 1+(1-np.divide(1.,1+np.power(np.e,-5*(scan.ranges-0.3))))*0.1)\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L100_C8", "label": "scan.ranges = multiply()", "type": "assigned_variable", "loc": [100, 100], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L91_C4", "vector": [14, 2, 0.1403, 0.0014, 2, 0.61, 0.0, 255, 3, 2, 0, 0, 960, 10, 3], "semantic": {"name": "scan.ranges", "arg_names": [], "import_names": [], "rhs_call_name": "multiply", "annotation": ""}, "snippet": " scan.ranges = np.multiply(scan.ranges, 1+(1-np.divide(1.,1+np.power(np.e,-5*(scan.ranges-0.2))))*0.20)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L109_C4", "label": "xy_map = matrix()", "type": "assigned_variable", "loc": [109, 110], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L80_C0", "vector": [14, 1, 0.1536, 0.0028, 1, 0.62, 0.3636, 336, 3, 1, 0, 0, 162, 10, 6], "semantic": {"name": "xy_map", "arg_names": [], "import_names": [], "rhs_call_name": "matrix", "annotation": ""}, "snippet": " xy_map = np.matrix(np.row_stack((np.multiply(scan.ranges,np.cos(scan.angles)),\n np.multiply(scan.ranges,np.sin(scan.angles))*-1)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L112_C4", "label": "sub_range =", "type": "assigned_variable", "loc": [112, 112], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L80_C0", "vector": [14, 1, 0.1571, 0.0014, 1, 0.62, 0.4545, 629, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "sub_range", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " sub_range = scan.ranges[:,start_index:end_index+1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L113_C4", "label": "keep_condition = multiply()", "type": "assigned_variable", "loc": [113, 113], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L80_C0", "vector": [14, 1, 0.1585, 0.0014, 1, 0.62, 0.5455, 990, 3, 2, 0, 0, 960, 10, 1], "semantic": {"name": "keep_condition", "arg_names": [], "import_names": [], "rhs_call_name": "multiply", "annotation": ""}, "snippet": " keep_condition = np.multiply(sub_range<=max_dist,sub_range>=min_dist)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L115_C4", "label": "if", "type": "if", "loc": [115, 116], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L80_C0", "vector": [4, 1, 0.162, 0.0028, 1, 0.62, 0.6364, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if reject_zero_ten == True:\n keep_condition = np.multiply(keep_condition,np.multiply(sub_range > 0.01,sub_range <= 10.))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L116_C8", "label": "keep_condition = multiply()", "type": "assigned_variable", "loc": [116, 116], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L115_C4", "vector": [14, 2, 0.1627, 0.0014, 2, 0.48, 0.0, 990, 3, 2, 0, 0, 960, 10, 2], "semantic": {"name": "keep_condition", "arg_names": [], "import_names": [], "rhs_call_name": "multiply", "annotation": ""}, "snippet": " keep_condition = np.multiply(keep_condition,np.multiply(sub_range > 0.01,sub_range <= 10.))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L118_C4", "label": "xy_map =", "type": "assigned_variable", "loc": [118, 118], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L80_C0", "vector": [14, 1, 0.1655, 0.0014, 1, 0.62, 0.7273, 336, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "xy_map", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " xy_map = xy_map[:,start_index:end_index+1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L120_C4", "label": "idxs = where()", "type": "assigned_variable", "loc": [120, 120], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L80_C0", "vector": [14, 1, 0.1683, 0.0014, 1, 0.62, 0.8182, 677, 3, 1, 0, 0, 169, 10, 1], "semantic": {"name": "idxs", "arg_names": [], "import_names": [], "rhs_call_name": "where", "annotation": ""}, "snippet": " idxs = np.where(keep_condition)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L121_C4", "label": "xy_map = row_stack()", "type": "assigned_variable", "loc": [121, 121], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L80_C0", "vector": [14, 1, 0.1697, 0.0014, 1, 0.62, 0.9091, 336, 3, 1, 0, 0, 612, 10, 1], "semantic": {"name": "xy_map", "arg_names": [], "import_names": [], "rhs_call_name": "row_stack", "annotation": ""}, "snippet": " xy_map = np.row_stack((xy_map[idxs],xy_map[idxs[0]+1,idxs[1]]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L123_C4", "label": "if", "type": "if", "loc": [123, 128], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L80_C0", "vector": [4, 1, 0.176, 0.0084, 1, 0.62, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if get_intensities == True:\n intensities = scan.intensities[:,start_index:end_index+1]\n intensities = intensities[idxs]\n return xy_map, intensities\n else:\n return xy_map"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L124_C8", "label": "intensities =", "type": "assigned_variable", "loc": [124, 124], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L123_C4", "vector": [14, 2, 0.1739, 0.0014, 2, 0.02, 0.0, 725, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "intensities", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " intensities = scan.intensities[:,start_index:end_index+1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L125_C8", "label": "intensities =", "type": "assigned_variable", "loc": [125, 125], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L123_C4", "vector": [14, 2, 0.1753, 0.0014, 2, 0.02, 0.3333, 725, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "intensities", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " intensities = intensities[idxs]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Return_L126_C8", "label": "return", "type": "return", "loc": [126, 126], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L123_C4", "vector": [13, 2, 0.1767, 0.0014, 2, 0.02, 0.6667, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return xy_map, intensities"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Return_L128_C8", "label": "return", "type": "return", "loc": [128, 128], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L123_C4", "vector": [13, 2, 0.1795, 0.0014, 2, 0.02, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return xy_map"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L131_C0", "label": "connected_components", "type": "function", "loc": [131, 154], "level": 0, "parent": null, "vector": [2, 0, 0.1999, 0.0337, 0, 0.66, 0.5, 659, 0, 2, 1, 0, 0, 0, 5], "semantic": {"name": "connected_components", "arg_names": ["p", "dist_threshold"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def connected_components(p, dist_threshold):\n ''' p - 2xN numpy matrix of euclidean points points (indices give neighbours).\n dist_threshold - max distance between two points in the same connected component.\n typical value is .02 meters\n returns a list of (p1,p2, p1_index, p2_index): (start euclidean point, end euclidean point, start index, end index) \n p1 and p2 are 2X1 matrices\n '''\n nPoints = p.shape[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L132_C4", "label": "expression", "type": "expression", "loc": [132, 137], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L131_C0", "vector": [8, 1, 0.1886, 0.0084, 1, 0.72, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' p - 2xN numpy matrix of euclidean points points (indices give neighbours).\n dist_threshold - max distance between two points in the same connected component.\n typical value is .02 meters\n returns a list of (p1,p2, p1_index, p2_index): (start euclidean point, end euclidean point, start index, end index) \n p1 and p2 are 2X1 matrices\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L138_C4", "label": "nPoints =", "type": "assigned_variable", "loc": [138, 138], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L131_C0", "vector": [14, 1, 0.1935, 0.0014, 1, 0.72, 0.0833, 378, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "nPoints", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " nPoints = p.shape[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L139_C4", "label": "q =", "type": "assigned_variable", "loc": [139, 139], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L131_C0", "vector": [14, 1, 0.195, 0.0014, 1, 0.72, 0.1667, 516, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "q", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " q = p[:,0:nPoints-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L140_C4", "label": "r =", "type": "assigned_variable", "loc": [140, 140], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L131_C0", "vector": [14, 1, 0.1964, 0.0014, 1, 0.72, 0.25, 436, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " r = p[:,1:nPoints]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L141_C4", "label": "diff =", "type": "assigned_variable", "loc": [141, 141], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L131_C0", "vector": [14, 1, 0.1978, 0.0014, 1, 0.72, 0.3333, 833, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "diff", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " diff = r-q"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L142_C4", "label": "dists =", "type": "assigned_variable", "loc": [142, 142], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L131_C0", "vector": [14, 1, 0.1992, 0.0014, 1, 0.72, 0.4167, 975, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "dists", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " dists = ut.norm(diff).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L143_C4", "label": "idx = where()", "type": "assigned_variable", "loc": [143, 143], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L131_C0", "vector": [14, 1, 0.2006, 0.0014, 1, 0.72, 0.5, 187, 3, 1, 0, 0, 169, 10, 1], "semantic": {"name": "idx", "arg_names": [], "import_names": [], "rhs_call_name": "where", "annotation": ""}, "snippet": " idx = np.where(dists>dist_threshold) # boundaries of the connected components"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L145_C4", "label": "end_list = tolist()", "type": "assigned_variable", "loc": [145, 145], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L131_C0", "vector": [14, 1, 0.2034, 0.0014, 1, 0.72, 0.5833, 663, 3, 0, 0, 0, 185, 10, 1], "semantic": {"name": "end_list", "arg_names": [], "import_names": [], "rhs_call_name": "tolist", "annotation": ""}, "snippet": " end_list = idx[0].A1.tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L146_C4", "label": "append()", "type": "expression", "loc": [146, 146], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L131_C0", "vector": [8, 1, 0.2048, 0.0014, 1, 0.72, 0.6667, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " end_list.append(nPoints-1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L148_C4", "label": "cc_list =", "type": "assigned_variable", "loc": [148, 148], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L131_C0", "vector": [14, 1, 0.2076, 0.0014, 1, 0.72, 0.75, 542, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "cc_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cc_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L149_C4", "label": "start =", "type": "assigned_variable", "loc": [149, 149], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L131_C0", "vector": [14, 1, 0.209, 0.0014, 1, 0.72, 0.8333, 511, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "start", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " start = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L150_C4", "label": "for i", "type": "for", "loc": [150, 152], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L131_C0", "vector": [6, 1, 0.2118, 0.0042, 1, 0.72, 0.9167, 826, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in end_list:\n cc_list.append((p[:,start], p[:,i], start, i))\n start = i+1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L151_C8", "label": "append()", "type": "expression", "loc": [151, 151], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L150_C4", "vector": [8, 2, 0.2118, 0.0014, 2, 0.84, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " cc_list.append((p[:,start], p[:,i], start, i))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L152_C8", "label": "start =", "type": "assigned_variable", "loc": [152, 152], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L150_C4", "vector": [14, 2, 0.2132, 0.0014, 2, 0.84, 1.0, 511, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "start", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " start = i+1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Return_L154_C4", "label": "return", "type": "return", "loc": [154, 154], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L131_C0", "vector": [13, 1, 0.216, 0.0014, 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 cc_list"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L156_C0", "label": "find_objects", "type": "function", "loc": [156, 190], "level": 0, "parent": null, "vector": [2, 0, 0.2426, 0.0491, 0, 0.66, 0.5238, 936, 0, 8, 1, 0, 0, 0, 8], "semantic": {"name": "find_objects", "arg_names": ["scan", "max_dist", "max_size", "min_size", "min_angle", "max_angle", "connect_dist_thresh", "all_pts"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def find_objects(scan, max_dist, max_size, min_size, min_angle, max_angle, \n connect_dist_thresh, all_pts=False):\n ''' max_dist - objects with centroid greater than max_dist will be ignored. (meters)\n max_size - objects greater than this are ignored. (meters)\n min_size - smaller than this are ignored (meters)\n min_angle, max_angle - part of scan to consider.\n connect_dist_thresh - points in scan greater than this will be treated as separate\n connected components."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L158_C4", "label": "expression", "type": "expression", "loc": [158, 169], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L156_C0", "vector": [8, 1, 0.2293, 0.0168, 1, 0.31, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' max_dist - objects with centroid greater than max_dist will be ignored. (meters)\n max_size - objects greater than this are ignored. (meters)\n min_size - smaller than this are ignored (meters)\n min_angle, max_angle - part of scan to consider.\n connect_dist_thresh - points in scan greater than this will be treated as separate\n connected components.\n\n all_pts == True:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L170_C4", "label": "xy_map = get_xy_map()", "type": "assigned_variable", "loc": [170, 170], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L156_C0", "vector": [14, 1, 0.2384, 0.0014, 1, 0.31, 0.1667, 336, 3, 3, 0, 0, 476, 10, 1], "semantic": {"name": "xy_map", "arg_names": [], "import_names": [], "rhs_call_name": "get_xy_map", "annotation": ""}, "snippet": " xy_map = get_xy_map(scan,min_angle,max_angle)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L171_C4", "label": "cc_list = connected_components()", "type": "assigned_variable", "loc": [171, 171], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L156_C0", "vector": [14, 1, 0.2398, 0.0014, 1, 0.31, 0.3333, 542, 3, 2, 0, 0, 659, 10, 1], "semantic": {"name": "cc_list", "arg_names": [], "import_names": [], "rhs_call_name": "connected_components", "annotation": ""}, "snippet": " cc_list = connected_components(xy_map,connect_dist_thresh)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L172_C4", "label": "object_list =", "type": "assigned_variable", "loc": [172, 172], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L156_C0", "vector": [14, 1, 0.2412, 0.0014, 1, 0.31, 0.5, 809, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "object_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " object_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L173_C4", "label": "all_pts_list =", "type": "assigned_variable", "loc": [173, 173], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L156_C0", "vector": [14, 1, 0.2426, 0.0014, 1, 0.31, 0.6667, 930, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "all_pts_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " all_pts_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L174_C4", "label": "for i", "type": "for", "loc": [174, 185], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L156_C0", "vector": [6, 1, 0.2518, 0.0168, 1, 0.31, 0.8333, 826, 3, 0, 0, 0, 0, 0, 6], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i,(p,q,p_idx,q_idx) in enumerate(cc_list):\n object_pts = xy_map[:,p_idx:q_idx+1]\n centroid = object_pts.sum(1)/(q_idx-p_idx+1)\n size = np.linalg.norm(p-q)\n if size>max_size:\n continue\n if size<min_size:\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L175_C8", "label": "object_pts =", "type": "assigned_variable", "loc": [175, 175], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L174_C4", "vector": [14, 2, 0.2454, 0.0014, 2, 0.93, 0.0, 34, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "object_pts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " object_pts = xy_map[:,p_idx:q_idx+1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L176_C8", "label": "centroid =", "type": "assigned_variable", "loc": [176, 176], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L174_C4", "vector": [14, 2, 0.2468, 0.0014, 2, 0.93, 0.1429, 439, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "centroid", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " centroid = object_pts.sum(1)/(q_idx-p_idx+1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L177_C8", "label": "size = norm()", "type": "assigned_variable", "loc": [177, 177], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L174_C4", "vector": [14, 2, 0.2482, 0.0014, 2, 0.93, 0.2857, 714, 3, 1, 0, 0, 902, 10, 1], "semantic": {"name": "size", "arg_names": [], "import_names": [], "rhs_call_name": "norm", "annotation": ""}, "snippet": " size = np.linalg.norm(p-q)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L178_C8", "label": "if", "type": "if", "loc": [178, 179], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L174_C4", "vector": [4, 2, 0.2504, 0.0028, 2, 0.93, 0.4286, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if size>max_size:\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L180_C8", "label": "if", "type": "if", "loc": [180, 181], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L174_C4", "vector": [4, 2, 0.2532, 0.0028, 2, 0.93, 0.5714, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if size<min_size:\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L182_C8", "label": "if", "type": "if", "loc": [182, 183], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L174_C4", "vector": [4, 2, 0.256, 0.0028, 2, 0.93, 0.7143, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if np.linalg.norm(centroid) > max_dist:\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L184_C8", "label": "append()", "type": "expression", "loc": [184, 184], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L174_C4", "vector": [8, 2, 0.2581, 0.0014, 2, 0.93, 0.8571, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " object_list.append((p,q,centroid))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L185_C8", "label": "append()", "type": "expression", "loc": [185, 185], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L174_C4", "vector": [8, 2, 0.2595, 0.0014, 2, 0.93, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " all_pts_list.append(object_pts)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L187_C4", "label": "if", "type": "if", "loc": [187, 190], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L156_C0", "vector": [4, 1, 0.2644, 0.0056, 1, 0.31, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if all_pts == True:\n return all_pts_list\n else:\n return object_list"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Return_L188_C8", "label": "return", "type": "return", "loc": [188, 188], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L187_C4", "vector": [13, 2, 0.2637, 0.0014, 2, 0.98, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return all_pts_list"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Return_L190_C8", "label": "return", "type": "return", "loc": [190, 190], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L187_C4", "vector": [13, 2, 0.2665, 0.0014, 2, 0.98, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return object_list"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L192_C0", "label": "find_closest_object_point", "type": "function", "loc": [192, 209], "level": 0, "parent": null, "vector": [2, 0, 0.2812, 0.0252, 0, 0.66, 0.5476, 567, 0, 7, 1, 0, 0, 0, 10], "semantic": {"name": "find_closest_object_point", "arg_names": ["scan", "pt_interest", "min_angle", "max_angle", "max_dist", "min_size", "max_size"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def find_closest_object_point(scan, pt_interest=np.matrix([0.,0.]).T, min_angle=math.radians(-60),\n max_angle=math.radians(60),max_dist=0.6,min_size=0.01,max_size=0.3):\n ''' returns 2x1 matrix - centroid of connected component in hokuyo frame closest to pt_interest\n pt_interest - 2x1 matrix in hokuyo coord frame.\n None if no object found.\n '''\n obj_list = find_objects(scan,max_dist,max_size,min_size,min_angle,max_angle,\n connect_dist_thresh=0.02, all_pts=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L194_C4", "label": "expression", "type": "expression", "loc": [194, 197], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L192_C0", "vector": [8, 1, 0.2742, 0.0056, 1, 0.91, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' returns 2x1 matrix - centroid of connected component in hokuyo frame closest to pt_interest\n pt_interest - 2x1 matrix in hokuyo coord frame.\n None if no object found.\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L198_C4", "label": "obj_list = find_objects()", "type": "assigned_variable", "loc": [198, 199], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L192_C0", "vector": [14, 1, 0.2784, 0.0028, 1, 0.91, 0.1667, 342, 3, 8, 0, 0, 936, 10, 1], "semantic": {"name": "obj_list", "arg_names": [], "import_names": [], "rhs_call_name": "find_objects", "annotation": ""}, "snippet": " obj_list = find_objects(scan,max_dist,max_size,min_size,min_angle,max_angle,\n connect_dist_thresh=0.02, all_pts=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L201_C4", "label": "if", "type": "if", "loc": [201, 202], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L192_C0", "vector": [4, 1, 0.2826, 0.0028, 1, 0.91, 0.3333, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if obj_list == []:\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Return_L202_C8", "label": "return", "type": "return", "loc": [202, 202], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L201_C4", "vector": [13, 2, 0.2833, 0.0014, 2, 0.99, 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_99581:Assign_L204_C4", "label": "min_dist_list =", "type": "assigned_variable", "loc": [204, 204], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L192_C0", "vector": [14, 1, 0.2861, 0.0014, 1, 0.91, 0.5, 450, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "min_dist_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " min_dist_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L205_C4", "label": "for pts", "type": "for", "loc": [205, 206], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L192_C0", "vector": [6, 1, 0.2882, 0.0028, 1, 0.91, 0.6667, 195, 2, 0, 0, 0, 0, 0, 3], "semantic": {"name": "pts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for pts in obj_list:\n min_dist_list.append(np.min(ut.norm(pts-pt_interest)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L206_C8", "label": "append()", "type": "expression", "loc": [206, 206], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L205_C4", "vector": [8, 2, 0.2889, 0.0014, 2, 0.4, 0.0, 243, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " min_dist_list.append(np.min(ut.norm(pts-pt_interest)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L208_C4", "label": "min_idx = argmin()", "type": "assigned_variable", "loc": [208, 208], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L192_C0", "vector": [14, 1, 0.2917, 0.0014, 1, 0.91, 0.8333, 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(np.matrix(min_dist_list))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Return_L209_C4", "label": "return", "type": "return", "loc": [209, 209], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L192_C0", "vector": [13, 1, 0.2931, 0.0014, 1, 0.91, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return obj_list[min_idx].mean(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L211_C0", "label": "remove_graze_effect", "type": "function", "loc": [211, 230], "level": 0, "parent": null, "vector": [2, 0, 0.3093, 0.0281, 0, 0.66, 0.5714, 924, 0, 4, 0, 0, 0, 0, 14], "semantic": {"name": "remove_graze_effect", "arg_names": ["ranges", "angles", "skip", "graze_angle_threshold"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def remove_graze_effect(ranges, angles, skip=1, graze_angle_threshold=math.radians(169.)):\n ''' ranges,angles - 1xN numpy matrix\n skip - which two rays to consider.\n this function changes ranges.\n '''\n nPoints = ranges.shape[1]\n p = ranges[:,0:nPoints-(1+skip)]\n q = ranges[:,(1+skip):nPoints]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L212_C4", "label": "expression", "type": "expression", "loc": [212, 215], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L211_C0", "vector": [8, 1, 0.2994, 0.0056, 1, 0.67, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' ranges,angles - 1xN numpy matrix\n skip - which two rays to consider.\n this function changes ranges.\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L216_C4", "label": "nPoints =", "type": "assigned_variable", "loc": [216, 216], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L211_C0", "vector": [14, 1, 0.3029, 0.0014, 1, 0.67, 0.0769, 378, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "nPoints", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " nPoints = ranges.shape[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L217_C4", "label": "p =", "type": "assigned_variable", "loc": [217, 217], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L211_C0", "vector": [14, 1, 0.3043, 0.0014, 1, 0.67, 0.1538, 491, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p = ranges[:,0:nPoints-(1+skip)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L218_C4", "label": "q =", "type": "assigned_variable", "loc": [218, 218], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L211_C0", "vector": [14, 1, 0.3058, 0.0014, 1, 0.67, 0.2308, 516, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "q", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " q = ranges[:,(1+skip):nPoints]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L219_C4", "label": "d_mat = abs()", "type": "assigned_variable", "loc": [219, 219], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L211_C0", "vector": [14, 1, 0.3072, 0.0014, 1, 0.67, 0.3077, 949, 3, 1, 0, 0, 799, 10, 1], "semantic": {"name": "d_mat", "arg_names": [], "import_names": [], "rhs_call_name": "abs", "annotation": ""}, "snippet": " d_mat = np.abs(p-q)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L220_C4", "label": "angles_diff = abs()", "type": "assigned_variable", "loc": [220, 220], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L211_C0", "vector": [14, 1, 0.3086, 0.0014, 1, 0.67, 0.3846, 434, 3, 1, 0, 0, 799, 10, 1], "semantic": {"name": "angles_diff", "arg_names": [], "import_names": [], "rhs_call_name": "abs", "annotation": ""}, "snippet": " angles_diff = np.abs(angles[:,(1+skip):nPoints]-angles[:,0:nPoints-(1+skip)])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L221_C4", "label": "l_mat = max()", "type": "assigned_variable", "loc": [221, 221], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L211_C0", "vector": [14, 1, 0.31, 0.0014, 1, 0.67, 0.4615, 934, 3, 2, 0, 0, 442, 10, 2], "semantic": {"name": "l_mat", "arg_names": [], "import_names": [], "rhs_call_name": "max", "annotation": ""}, "snippet": " l_mat = np.max(np.row_stack((p,q)),0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L222_C4", "label": "l_mat =", "type": "assigned_variable", "loc": [222, 222], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L211_C0", "vector": [14, 1, 0.3114, 0.0014, 1, 0.67, 0.5385, 934, 4, 0, 0, 0, 0, 0, 3], "semantic": {"name": "l_mat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " l_mat = np.multiply(l_mat,np.sin(angles_diff))/math.sin(graze_angle_threshold)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L224_C4", "label": "thresh_exceed =", "type": "assigned_variable", "loc": [224, 224], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L211_C0", "vector": [14, 1, 0.3142, 0.0014, 1, 0.67, 0.6154, 510, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "thresh_exceed", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " thresh_exceed = d_mat>l_mat"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L225_C4", "label": "l1_greater =", "type": "assigned_variable", "loc": [225, 225], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L211_C0", "vector": [14, 1, 0.3156, 0.0014, 1, 0.67, 0.6923, 24, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "l1_greater", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " l1_greater = p>q"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L226_C4", "label": "idx_remove_1 = where()", "type": "assigned_variable", "loc": [226, 226], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L211_C0", "vector": [14, 1, 0.317, 0.0014, 1, 0.67, 0.7692, 770, 3, 1, 0, 0, 169, 10, 3], "semantic": {"name": "idx_remove_1", "arg_names": [], "import_names": [], "rhs_call_name": "where", "annotation": ""}, "snippet": " idx_remove_1 = np.where(np.all(np.row_stack((thresh_exceed,l1_greater)),0))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L227_C4", "label": "idx_remove_2 = where()", "type": "assigned_variable", "loc": [227, 227], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L211_C0", "vector": [14, 1, 0.3184, 0.0014, 1, 0.67, 0.8462, 16, 3, 1, 0, 0, 169, 10, 3], "semantic": {"name": "idx_remove_2", "arg_names": [], "import_names": [], "rhs_call_name": "where", "annotation": ""}, "snippet": " idx_remove_2 = np.where(np.all(np.row_stack((thresh_exceed,1-l1_greater)),0))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L229_C4", "label": "assign", "type": "assigned_variable", "loc": [229, 229], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L211_C0", "vector": [14, 1, 0.3212, 0.0014, 1, 0.67, 0.9231, 0, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p[idx_remove_1] = 1000."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L230_C4", "label": "assign", "type": "assigned_variable", "loc": [230, 230], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L211_C0", "vector": [14, 1, 0.3226, 0.0014, 1, 0.67, 1.0, 0, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " q[idx_remove_2] = 1000."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L232_C0", "label": "remove_graze_effect_scan", "type": "function", "loc": [232, 235], "level": 0, "parent": null, "vector": [2, 0, 0.3275, 0.0056, 0, 0.66, 0.5952, 447, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "remove_graze_effect_scan", "arg_names": ["scan", "graze_angle_threshold"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def remove_graze_effect_scan(scan, graze_angle_threshold=math.radians(169.)):\n ''' changes scan\n '''\n remove_graze_effect(scan.ranges,scan.angles,1,graze_angle_threshold)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L233_C4", "label": "expression", "type": "expression", "loc": [233, 234], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L232_C0", "vector": [8, 1, 0.3275, 0.0028, 1, 0.92, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' changes scan\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L235_C4", "label": "remove_graze_effect()", "type": "expression", "loc": [235, 235], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L232_C0", "vector": [8, 1, 0.3296, 0.0014, 1, 0.92, 1.0, 924, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "remove_graze_effect", "arg_names": [], "import_names": [], "rhs_call_name": "remove_graze_effect", "annotation": ""}, "snippet": " remove_graze_effect(scan.ranges,scan.angles,1,graze_angle_threshold)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L237_C0", "label": "subtract_scans", "type": "function", "loc": [237, 254], "level": 0, "parent": null, "vector": [2, 0, 0.3443, 0.0252, 0, 0.66, 0.619, 993, 0, 3, 1, 0, 0, 0, 8], "semantic": {"name": "subtract_scans", "arg_names": ["scan2", "scan1", "threshold"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def subtract_scans(scan2,scan1,threshold=0.01):\n if scan1.ranges.shape != scan2.ranges.shape:\n print('hokuyo_processing.subtract_scans: the two scan.ranges have different shapes.')\n print('remember to pass remove_graze_effect = False')\n print('Exiting...')\n sys.exit()\n\n diff_range = scan2.ranges-scan1.ranges"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L238_C4", "label": "if", "type": "if", "loc": [238, 242], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L237_C0", "vector": [4, 1, 0.3366, 0.007, 1, 0.37, 0.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if scan1.ranges.shape != scan2.ranges.shape:\n print('hokuyo_processing.subtract_scans: the two scan.ranges have different shapes.')\n print('remember to pass remove_graze_effect = False')\n print('Exiting...')\n sys.exit()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L239_C8", "label": "print()", "type": "expression", "loc": [239, 239], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L238_C4", "vector": [8, 2, 0.3352, 0.0014, 2, 0.8, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('hokuyo_processing.subtract_scans: the two scan.ranges have different shapes.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L240_C8", "label": "print()", "type": "expression", "loc": [240, 240], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L238_C4", "vector": [8, 2, 0.3366, 0.0014, 2, 0.8, 0.3333, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('remember to pass remove_graze_effect = False')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L241_C8", "label": "print()", "type": "expression", "loc": [241, 241], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L238_C4", "vector": [8, 2, 0.338, 0.0014, 2, 0.8, 0.6667, 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_99581:Expr_L242_C8", "label": "exit()", "type": "expression", "loc": [242, 242], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L238_C4", "vector": [8, 2, 0.3394, 0.0014, 2, 0.8, 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_99581:Assign_L244_C4", "label": "diff_range =", "type": "assigned_variable", "loc": [244, 244], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L237_C0", "vector": [14, 1, 0.3422, 0.0014, 1, 0.37, 0.1667, 896, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "diff_range", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " diff_range = scan2.ranges-scan1.ranges"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L245_C4", "label": "idxs = where()", "type": "assigned_variable", "loc": [245, 245], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L237_C0", "vector": [14, 1, 0.3436, 0.0014, 1, 0.37, 0.3333, 677, 3, 1, 0, 0, 169, 10, 2], "semantic": {"name": "idxs", "arg_names": [], "import_names": [], "rhs_call_name": "where", "annotation": ""}, "snippet": " idxs = np.where(np.abs(diff_range)<threshold)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L249_C4", "label": "hscan = HokuyoScan()", "type": "assigned_variable", "loc": [249, 251], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L237_C0", "vector": [14, 1, 0.3506, 0.0042, 1, 0.37, 0.5, 160, 3, 6, 0, 0, 976, 10, 1], "semantic": {"name": "hscan", "arg_names": [], "import_names": [], "rhs_call_name": "HokuyoScan", "annotation": ""}, "snippet": " hscan = hs.HokuyoScan(scan2.hokuyo_type,scan2.angular_res,\n scan2.max_range,scan2.min_range,\n scan2.start_angle,scan2.end_angle)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L252_C4", "label": "hscan.ranges = copy()", "type": "assigned_variable", "loc": [252, 252], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L237_C0", "vector": [14, 1, 0.3534, 0.0014, 1, 0.37, 0.6667, 697, 3, 1, 0, 0, 739, 10, 1], "semantic": {"name": "hscan.ranges", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " hscan.ranges = copy.copy(scan2.ranges)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L253_C4", "label": "assign", "type": "assigned_variable", "loc": [253, 253], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L237_C0", "vector": [14, 1, 0.3548, 0.0014, 1, 0.37, 0.8333, 0, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " hscan.ranges[idxs] = 0."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Return_L254_C4", "label": "return", "type": "return", "loc": [254, 254], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L237_C0", "vector": [13, 1, 0.3562, 0.0014, 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 hscan"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L256_C0", "label": "find_door", "type": "function", "loc": [256, 321], "level": 0, "parent": null, "vector": [2, 0, 0.4046, 0.0926, 0, 0.66, 0.6429, 486, 0, 3, 1, 0, 0, 0, 42], "semantic": {"name": "find_door", "arg_names": ["start_pts_list", "end_pts_list", "pt_interest"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def find_door(start_pts_list,end_pts_list,pt_interest=None):\n ''' returns [p1x,p1y], [p2x,p2y] ([],[] if no door found)\n returns line closest to the pt_interest.\n pt_interest - 2x1 matrix\n '''\n if start_pts_list == []:\n return [],[]\n# print 'start_pts_list,end_pts_list',start_pts_list,end_pts_list"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L257_C4", "label": "expression", "type": "expression", "loc": [257, 260], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L256_C0", "vector": [8, 1, 0.3626, 0.0056, 1, 0.58, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' returns [p1x,p1y], [p2x,p2y] ([],[] if no door found)\n returns line closest to the pt_interest.\n pt_interest - 2x1 matrix\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L261_C4", "label": "if", "type": "if", "loc": [261, 262], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L256_C0", "vector": [4, 1, 0.3668, 0.0028, 1, 0.58, 0.1, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if start_pts_list == []:\n return [],[]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Return_L262_C8", "label": "return", "type": "return", "loc": [262, 262], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L261_C4", "vector": [13, 2, 0.3675, 0.0014, 2, 0.73, 0.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return [],[]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L264_C4", "label": "start_pts =", "type": "assigned_variable", "loc": [264, 264], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L256_C0", "vector": [14, 1, 0.3703, 0.0014, 1, 0.58, 0.2, 341, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "start_pts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " start_pts = np.matrix(start_pts_list).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L265_C4", "label": "end_pts =", "type": "assigned_variable", "loc": [265, 265], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L256_C0", "vector": [14, 1, 0.3717, 0.0014, 1, 0.58, 0.3, 790, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "end_pts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " end_pts = np.matrix(end_pts_list).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L266_C4", "label": "line_vecs =", "type": "assigned_variable", "loc": [266, 266], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L256_C0", "vector": [14, 1, 0.3731, 0.0014, 1, 0.58, 0.4, 21, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "line_vecs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " line_vecs = end_pts-start_pts"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L267_C4", "label": "line_vecs_ang = arctan2()", "type": "assigned_variable", "loc": [267, 267], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L256_C0", "vector": [14, 1, 0.3745, 0.0014, 1, 0.58, 0.5, 971, 3, 2, 0, 0, 895, 10, 1], "semantic": {"name": "line_vecs_ang", "arg_names": [], "import_names": [], "rhs_call_name": "arctan2", "annotation": ""}, "snippet": " line_vecs_ang = np.arctan2(line_vecs[1,:],line_vecs[0,:])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L269_C4", "label": "idxs = tolist()", "type": "assigned_variable", "loc": [269, 274], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L256_C0", "vector": [14, 1, 0.3808, 0.0084, 1, 0.58, 0.6, 677, 3, 0, 0, 0, 185, 10, 9], "semantic": {"name": "idxs", "arg_names": [], "import_names": [], "rhs_call_name": "tolist", "annotation": ""}, "snippet": " idxs = np.where(np.add(np.multiply(line_vecs_ang>math.radians(45),\n line_vecs_ang<math.radians(135)),\n np.multiply(line_vecs_ang<math.radians(-45),\n line_vecs_ang>math.radians(-135))\n ) > 0\n )[1].A1.tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L276_C4", "label": "if", "type": "if", "loc": [276, 277], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L256_C0", "vector": [4, 1, 0.3878, 0.0028, 1, 0.58, 0.7, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if idxs == []:\n return [],[]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Return_L277_C8", "label": "return", "type": "return", "loc": [277, 277], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L276_C4", "vector": [13, 2, 0.3885, 0.0014, 2, 0.22, 0.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return [],[]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L278_C4", "label": "start_pts =", "type": "assigned_variable", "loc": [278, 278], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L256_C0", "vector": [14, 1, 0.3899, 0.0014, 1, 0.58, 0.8, 341, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "start_pts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " start_pts = start_pts[:,idxs]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L279_C4", "label": "end_pts =", "type": "assigned_variable", "loc": [279, 279], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L256_C0", "vector": [14, 1, 0.3913, 0.0014, 1, 0.58, 0.9, 790, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "end_pts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " end_pts = end_pts[:,idxs]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L281_C4", "label": "if", "type": "if", "loc": [281, 321], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L256_C0", "vector": [4, 1, 0.4222, 0.0575, 1, 0.58, 1.0, 0, 0, 0, 0, 0, 0, 0, 30], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if pt_interest == None:\n print('hokuyo_processing.find_door: pt_interest in None so returning the longest line.')\n length = ut.norm(end_pts-start_pts)\n longest_line_idx = np.argmax(length)\n vec_door = (end_pts-start_pts)[:,longest_line_idx]\n return start_pts[:,longest_line_idx].A1.tolist(),end_pts[:,longest_line_idx].A1.tolist()\n else:\n v = end_pts-start_pts"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L282_C8", "label": "print()", "type": "expression", "loc": [282, 282], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L281_C4", "vector": [8, 2, 0.3955, 0.0014, 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('hokuyo_processing.find_door: pt_interest in None so returning the longest line.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L283_C8", "label": "length = norm()", "type": "assigned_variable", "loc": [283, 283], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L281_C4", "vector": [14, 2, 0.3969, 0.0014, 2, 0.12, 0.0357, 221, 3, 1, 0, 0, 902, 10, 1], "semantic": {"name": "length", "arg_names": [], "import_names": [], "rhs_call_name": "norm", "annotation": ""}, "snippet": " length = ut.norm(end_pts-start_pts)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L284_C8", "label": "longest_line_idx = argmax()", "type": "assigned_variable", "loc": [284, 284], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L281_C4", "vector": [14, 2, 0.3983, 0.0014, 2, 0.12, 0.0714, 293, 3, 1, 0, 0, 593, 10, 1], "semantic": {"name": "longest_line_idx", "arg_names": [], "import_names": [], "rhs_call_name": "argmax", "annotation": ""}, "snippet": " longest_line_idx = np.argmax(length)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L285_C8", "label": "vec_door =", "type": "assigned_variable", "loc": [285, 285], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L281_C4", "vector": [14, 2, 0.3997, 0.0014, 2, 0.12, 0.1071, 352, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "vec_door", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " vec_door = (end_pts-start_pts)[:,longest_line_idx]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Return_L286_C8", "label": "return", "type": "return", "loc": [286, 286], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L281_C4", "vector": [13, 2, 0.4011, 0.0014, 2, 0.12, 0.1429, 0, 0, 0, 0, 0, 0, 8, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return start_pts[:,longest_line_idx].A1.tolist(),end_pts[:,longest_line_idx].A1.tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L288_C8", "label": "v =", "type": "assigned_variable", "loc": [288, 288], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L281_C4", "vector": [14, 2, 0.4039, 0.0014, 2, 0.12, 0.1786, 553, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "v", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " v = end_pts-start_pts"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L289_C8", "label": "q_dot_v =", "type": "assigned_variable", "loc": [289, 289], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L281_C4", "vector": [14, 2, 0.4053, 0.0014, 2, 0.12, 0.2143, 432, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "q_dot_v", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " q_dot_v = pt_interest.T*v"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L290_C8", "label": "p1_dot_v = sum()", "type": "assigned_variable", "loc": [290, 290], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L281_C4", "vector": [14, 2, 0.4067, 0.0014, 2, 0.12, 0.25, 613, 3, 2, 0, 0, 824, 10, 2], "semantic": {"name": "p1_dot_v", "arg_names": [], "import_names": [], "rhs_call_name": "sum", "annotation": ""}, "snippet": " p1_dot_v = np.sum(np.multiply(start_pts,v),0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L291_C8", "label": "v_dot_v = norm()", "type": "assigned_variable", "loc": [291, 291], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L281_C4", "vector": [14, 2, 0.4081, 0.0014, 2, 0.12, 0.2857, 889, 3, 1, 0, 0, 902, 10, 1], "semantic": {"name": "v_dot_v", "arg_names": [], "import_names": [], "rhs_call_name": "norm", "annotation": ""}, "snippet": " v_dot_v = ut.norm(v)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L292_C8", "label": "lam = divide()", "type": "assigned_variable", "loc": [292, 292], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L281_C4", "vector": [14, 2, 0.4095, 0.0014, 2, 0.12, 0.3214, 704, 3, 2, 0, 0, 982, 10, 1], "semantic": {"name": "lam", "arg_names": [], "import_names": [], "rhs_call_name": "divide", "annotation": ""}, "snippet": " lam = np.divide((q_dot_v-p1_dot_v),v_dot_v)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L293_C8", "label": "r =", "type": "assigned_variable", "loc": [293, 293], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L281_C4", "vector": [14, 2, 0.4109, 0.0014, 2, 0.12, 0.3571, 436, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " r = start_pts + np.multiply(lam,v)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L294_C8", "label": "dist = norm()", "type": "assigned_variable", "loc": [294, 294], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L281_C4", "vector": [14, 2, 0.4123, 0.0014, 2, 0.12, 0.3929, 673, 3, 1, 0, 0, 902, 10, 1], "semantic": {"name": "dist", "arg_names": [], "import_names": [], "rhs_call_name": "norm", "annotation": ""}, "snippet": " dist = ut.norm(pt_interest-r)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L295_C8", "label": "edge_idxs = tolist()", "type": "assigned_variable", "loc": [295, 295], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L281_C4", "vector": [14, 2, 0.4137, 0.0014, 2, 0.12, 0.4286, 489, 3, 0, 0, 0, 185, 10, 3], "semantic": {"name": "edge_idxs", "arg_names": [], "import_names": [], "rhs_call_name": "tolist", "annotation": ""}, "snippet": " edge_idxs = np.where(np.multiply(lam>1.,lam<0.))[1].A1.tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L296_C8", "label": "min_end_dist = minimum()", "type": "assigned_variable", "loc": [296, 296], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L281_C4", "vector": [14, 2, 0.4151, 0.0014, 2, 0.12, 0.4643, 424, 3, 2, 0, 0, 908, 10, 3], "semantic": {"name": "min_end_dist", "arg_names": [], "import_names": [], "rhs_call_name": "minimum", "annotation": ""}, "snippet": " min_end_dist = np.minimum(ut.norm(start_pts-pt_interest),ut.norm(end_pts-pt_interest))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L297_C8", "label": "assign", "type": "assigned_variable", "loc": [297, 297], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L281_C4", "vector": [14, 2, 0.4165, 0.0014, 2, 0.12, 0.5, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " dist[:,edge_idxs] = min_end_dist[:,edge_idxs]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L303_C8", "label": "keep_idxs = tolist()", "type": "assigned_variable", "loc": [303, 303], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L281_C4", "vector": [14, 2, 0.425, 0.0014, 2, 0.12, 0.5357, 738, 3, 0, 0, 0, 185, 10, 2], "semantic": {"name": "keep_idxs", "arg_names": [], "import_names": [], "rhs_call_name": "tolist", "annotation": ""}, "snippet": " keep_idxs = np.where(dist<0.5)[1].A1.tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L304_C8", "label": "if", "type": "if", "loc": [304, 305], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L281_C4", "vector": [4, 2, 0.4271, 0.0028, 2, 0.12, 0.5714, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(keep_idxs) == 0:\n return [],[]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Return_L305_C12", "label": "return", "type": "return", "loc": [305, 305], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L304_C8", "vector": [13, 3, 0.4278, 0.0014, 3, 0.23, 0.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return [],[]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L307_C8", "label": "start_pts =", "type": "assigned_variable", "loc": [307, 307], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L281_C4", "vector": [14, 2, 0.4306, 0.0014, 2, 0.12, 0.6071, 341, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "start_pts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " start_pts = start_pts[:,keep_idxs]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L308_C8", "label": "end_pts =", "type": "assigned_variable", "loc": [308, 308], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L281_C4", "vector": [14, 2, 0.432, 0.0014, 2, 0.12, 0.6429, 790, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "end_pts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " end_pts = end_pts[:,keep_idxs]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L311_C8", "label": "p_robot =", "type": "assigned_variable", "loc": [311, 311], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L281_C4", "vector": [14, 2, 0.4362, 0.0014, 2, 0.12, 0.6786, 123, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "p_robot", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p_robot = np.matrix([0.,0.]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L312_C8", "label": "v =", "type": "assigned_variable", "loc": [312, 312], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L281_C4", "vector": [14, 2, 0.4376, 0.0014, 2, 0.12, 0.7143, 553, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "v", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " v = end_pts-start_pts"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L313_C8", "label": "q_dot_v =", "type": "assigned_variable", "loc": [313, 313], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L281_C4", "vector": [14, 2, 0.439, 0.0014, 2, 0.12, 0.75, 432, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "q_dot_v", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " q_dot_v = p_robot.T*v"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L314_C8", "label": "p1_dot_v = sum()", "type": "assigned_variable", "loc": [314, 314], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L281_C4", "vector": [14, 2, 0.4404, 0.0014, 2, 0.12, 0.7857, 613, 3, 2, 0, 0, 824, 10, 2], "semantic": {"name": "p1_dot_v", "arg_names": [], "import_names": [], "rhs_call_name": "sum", "annotation": ""}, "snippet": " p1_dot_v = np.sum(np.multiply(start_pts,v),0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L315_C8", "label": "v_dot_v = norm()", "type": "assigned_variable", "loc": [315, 315], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L281_C4", "vector": [14, 2, 0.4418, 0.0014, 2, 0.12, 0.8214, 889, 3, 1, 0, 0, 902, 10, 1], "semantic": {"name": "v_dot_v", "arg_names": [], "import_names": [], "rhs_call_name": "norm", "annotation": ""}, "snippet": " v_dot_v = ut.norm(v)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L316_C8", "label": "lam = divide()", "type": "assigned_variable", "loc": [316, 316], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L281_C4", "vector": [14, 2, 0.4432, 0.0014, 2, 0.12, 0.8571, 704, 3, 2, 0, 0, 982, 10, 1], "semantic": {"name": "lam", "arg_names": [], "import_names": [], "rhs_call_name": "divide", "annotation": ""}, "snippet": " lam = np.divide((q_dot_v-p1_dot_v),v_dot_v)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L317_C8", "label": "r =", "type": "assigned_variable", "loc": [317, 317], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L281_C4", "vector": [14, 2, 0.4446, 0.0014, 2, 0.12, 0.8929, 436, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " r = start_pts + np.multiply(lam,v)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L318_C8", "label": "dist = norm()", "type": "assigned_variable", "loc": [318, 318], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L281_C4", "vector": [14, 2, 0.446, 0.0014, 2, 0.12, 0.9286, 673, 3, 1, 0, 0, 902, 10, 1], "semantic": {"name": "dist", "arg_names": [], "import_names": [], "rhs_call_name": "norm", "annotation": ""}, "snippet": " dist = ut.norm(p_robot-r)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L320_C8", "label": "door_idx = argmax()", "type": "assigned_variable", "loc": [320, 320], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L281_C4", "vector": [14, 2, 0.4488, 0.0014, 2, 0.12, 0.9643, 656, 3, 1, 0, 0, 593, 10, 1], "semantic": {"name": "door_idx", "arg_names": [], "import_names": [], "rhs_call_name": "argmax", "annotation": ""}, "snippet": " door_idx = np.argmax(dist)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Return_L321_C8", "label": "return", "type": "return", "loc": [321, 321], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L281_C4", "vector": [13, 2, 0.4502, 0.0014, 2, 0.12, 1.0, 0, 0, 0, 0, 0, 0, 8, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return start_pts[:,door_idx].A1.tolist(),end_pts[:,door_idx].A1.tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L323_C0", "label": "xy_map_to_np_image", "type": "function", "loc": [323, 349], "level": 0, "parent": null, "vector": [2, 0, 0.4712, 0.0379, 0, 0.66, 0.6667, 376, 0, 4, 1, 0, 0, 0, 16], "semantic": {"name": "xy_map_to_np_image", "arg_names": ["xy_map", "m_per_pixel", "dilation_count", "padding"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def xy_map_to_np_image(xy_map,m_per_pixel,dilation_count=0,padding=50):\n ''' returns binary numpy image. (255 for occupied\n pixels, 0 for unoccupied)\n 2d array\n '''\n min_x = np.min(xy_map[0,:])\n max_x = np.max(xy_map[0,:])\n min_y = np.min(xy_map[1,:])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L324_C4", "label": "expression", "type": "expression", "loc": [324, 327], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L323_C0", "vector": [8, 1, 0.4565, 0.0056, 1, 0.23, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' returns binary numpy image. (255 for occupied\n pixels, 0 for unoccupied)\n 2d array\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L328_C4", "label": "min_x = min()", "type": "assigned_variable", "loc": [328, 328], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L323_C0", "vector": [14, 1, 0.46, 0.0014, 1, 0.23, 0.0909, 971, 3, 1, 0, 0, 867, 10, 1], "semantic": {"name": "min_x", "arg_names": [], "import_names": [], "rhs_call_name": "min", "annotation": ""}, "snippet": " min_x = np.min(xy_map[0,:])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L329_C4", "label": "max_x = max()", "type": "assigned_variable", "loc": [329, 329], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L323_C0", "vector": [14, 1, 0.4614, 0.0014, 1, 0.23, 0.1818, 64, 3, 1, 0, 0, 442, 10, 1], "semantic": {"name": "max_x", "arg_names": [], "import_names": [], "rhs_call_name": "max", "annotation": ""}, "snippet": " max_x = np.max(xy_map[0,:])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L330_C4", "label": "min_y = min()", "type": "assigned_variable", "loc": [330, 330], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L323_C0", "vector": [14, 1, 0.4628, 0.0014, 1, 0.23, 0.2727, 8, 3, 1, 0, 0, 867, 10, 1], "semantic": {"name": "min_y", "arg_names": [], "import_names": [], "rhs_call_name": "min", "annotation": ""}, "snippet": " min_y = np.min(xy_map[1,:])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L331_C4", "label": "max_y = max()", "type": "assigned_variable", "loc": [331, 331], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L323_C0", "vector": [14, 1, 0.4642, 0.0014, 1, 0.23, 0.3636, 742, 3, 1, 0, 0, 442, 10, 1], "semantic": {"name": "max_y", "arg_names": [], "import_names": [], "rhs_call_name": "max", "annotation": ""}, "snippet": " max_y = np.max(xy_map[1,:])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L332_C4", "label": "br =", "type": "assigned_variable", "loc": [332, 332], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L323_C0", "vector": [14, 1, 0.4656, 0.0014, 1, 0.23, 0.4545, 199, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "br", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " br = np.matrix([min_x,min_y]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L334_C4", "label": "n_x =", "type": "assigned_variable", "loc": [334, 334], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L323_C0", "vector": [14, 1, 0.4684, 0.0014, 1, 0.23, 0.5455, 489, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "n_x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " n_x = int(round((max_x-min_x)/m_per_pixel)) + padding"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L335_C4", "label": "n_y =", "type": "assigned_variable", "loc": [335, 335], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L323_C0", "vector": [14, 1, 0.4698, 0.0014, 1, 0.23, 0.6364, 7, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "n_y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " n_y = int(round((max_y-min_y)/m_per_pixel)) + padding"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L336_C4", "label": "img = zeros()", "type": "assigned_variable", "loc": [336, 336], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L323_C0", "vector": [14, 1, 0.4712, 0.0014, 1, 0.23, 0.7273, 200, 3, 2, 0, 0, 213, 10, 1], "semantic": {"name": "img", "arg_names": [], "import_names": [], "rhs_call_name": "zeros", "annotation": ""}, "snippet": " img = np.zeros((n_x+padding,n_y+padding),dtype='int')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L337_C4", "label": "occupied_pixels =", "type": "assigned_variable", "loc": [337, 337], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L323_C0", "vector": [14, 1, 0.4727, 0.0014, 1, 0.23, 0.8182, 465, 4, 0, 0, 0, 0, 0, 3], "semantic": {"name": "occupied_pixels", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " occupied_pixels = np.matrix([n_x,n_y]).T - np.round((xy_map-br)/m_per_pixel).astype('int')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L339_C4", "label": "if", "type": "if", "loc": [339, 347], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L323_C0", "vector": [4, 1, 0.4811, 0.0126, 1, 0.23, 0.9091, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if dilation_count == 0:\n img[(occupied_pixels[0,:],occupied_pixels[1,:])] = 255\n else:\n img[(occupied_pixels[0,:],occupied_pixels[1,:])] = 1\n connect_structure = np.empty((3,3),dtype='int')\n connect_structure[:,:] = 1\n img = ni.binary_closing(img,connect_structure,iterations=dilation_count)\n img = ni.binary_dilation(img,connect_structure,iterations=1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L340_C8", "label": "assign", "type": "assigned_variable", "loc": [340, 340], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L339_C4", "vector": [14, 2, 0.4769, 0.0014, 2, 0.03, 0.0, 0, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " img[(occupied_pixels[0,:],occupied_pixels[1,:])] = 255"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L342_C8", "label": "assign", "type": "assigned_variable", "loc": [342, 342], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L339_C4", "vector": [14, 2, 0.4797, 0.0014, 2, 0.03, 0.1667, 0, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " img[(occupied_pixels[0,:],occupied_pixels[1,:])] = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L343_C8", "label": "connect_structure = empty()", "type": "assigned_variable", "loc": [343, 343], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L339_C4", "vector": [14, 2, 0.4811, 0.0014, 2, 0.03, 0.3333, 297, 3, 2, 0, 0, 365, 10, 1], "semantic": {"name": "connect_structure", "arg_names": [], "import_names": [], "rhs_call_name": "empty", "annotation": ""}, "snippet": " connect_structure = np.empty((3,3),dtype='int')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L344_C8", "label": "assign", "type": "assigned_variable", "loc": [344, 344], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L339_C4", "vector": [14, 2, 0.4825, 0.0014, 2, 0.03, 0.5, 0, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " connect_structure[:,:] = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L345_C8", "label": "img = binary_closing()", "type": "assigned_variable", "loc": [345, 345], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L339_C4", "vector": [14, 2, 0.4839, 0.0014, 2, 0.03, 0.6667, 200, 3, 3, 0, 0, 145, 10, 1], "semantic": {"name": "img", "arg_names": [], "import_names": [], "rhs_call_name": "binary_closing", "annotation": ""}, "snippet": " img = ni.binary_closing(img,connect_structure,iterations=dilation_count)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L346_C8", "label": "img = binary_dilation()", "type": "assigned_variable", "loc": [346, 346], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L339_C4", "vector": [14, 2, 0.4853, 0.0014, 2, 0.03, 0.8333, 200, 3, 3, 0, 0, 202, 10, 1], "semantic": {"name": "img", "arg_names": [], "import_names": [], "rhs_call_name": "binary_dilation", "annotation": ""}, "snippet": " img = ni.binary_dilation(img,connect_structure,iterations=1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L347_C8", "label": "img =", "type": "assigned_variable", "loc": [347, 347], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L339_C4", "vector": [14, 2, 0.4867, 0.0014, 2, 0.03, 1.0, 200, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "img", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " img = img*255"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Return_L349_C4", "label": "return", "type": "return", "loc": [349, 349], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L323_C0", "vector": [13, 1, 0.4895, 0.0014, 1, 0.23, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return img,n_x,n_y,br"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L351_C0", "label": "xy_map_to_cv_image", "type": "function", "loc": [351, 354], "level": 0, "parent": null, "vector": [2, 0, 0.4944, 0.0056, 0, 0.66, 0.6905, 170, 0, 4, 1, 0, 0, 0, 2], "semantic": {"name": "xy_map_to_cv_image", "arg_names": ["xy_map", "m_per_pixel", "dilation_count", "padding"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def xy_map_to_cv_image(xy_map,m_per_pixel,dilation_count=0,padding=10):\n np_im,n_x,n_y,br = xy_map_to_np_image(xy_map,m_per_pixel,dilation_count,padding)\n cv_im = uto.np2cv(np_im)\n return cv_im,n_x,n_y,br"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L352_C4", "label": "np_im, n_x, n_y, br = xy_map_to_np_image()", "type": "assigned_variable", "loc": [352, 352], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L351_C0", "vector": [14, 1, 0.4937, 0.0014, 1, 0.16, 0.0, 423, 3, 4, 0, 0, 376, 10, 1], "semantic": {"name": "np_im, n_x, n_y, br", "arg_names": [], "import_names": [], "rhs_call_name": "xy_map_to_np_image", "annotation": ""}, "snippet": " np_im,n_x,n_y,br = xy_map_to_np_image(xy_map,m_per_pixel,dilation_count,padding)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L353_C4", "label": "cv_im = np2cv()", "type": "assigned_variable", "loc": [353, 353], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L351_C0", "vector": [14, 1, 0.4951, 0.0014, 1, 0.16, 0.5, 782, 3, 1, 0, 0, 672, 10, 1], "semantic": {"name": "cv_im", "arg_names": [], "import_names": [], "rhs_call_name": "np2cv", "annotation": ""}, "snippet": " cv_im = uto.np2cv(np_im)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Return_L354_C4", "label": "return", "type": "return", "loc": [354, 354], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L351_C0", "vector": [13, 1, 0.4965, 0.0014, 1, 0.16, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return cv_im,n_x,n_y,br"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L356_C0", "label": "hough_lines", "type": "function", "loc": [356, 462], "level": 0, "parent": null, "vector": [2, 0, 0.5736, 0.1501, 0, 0.66, 0.7143, 239, 0, 2, 1, 0, 0, 0, 57], "semantic": {"name": "hough_lines", "arg_names": ["xy_map", "save_lines"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def hough_lines(xy_map,save_lines=False):\n ''' xy_map - 2xN matrix of points.\n returns start_list, end_list. [[p1x,p1y],[p2x,p2y]...],[[q1x,q1y]...]\n [],[] if no lines were found.\n '''\n# save_lines=True\n m_per_pixel = 0.005\n img_cv,n_x,n_y,br = xy_map_to_cv_image(xy_map,m_per_pixel,dilation_count=1,padding=50)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L357_C4", "label": "expression", "type": "expression", "loc": [357, 360], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L356_C0", "vector": [8, 1, 0.5028, 0.0056, 1, 0.98, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' xy_map - 2xN matrix of points.\n returns start_list, end_list. [[p1x,p1y],[p2x,p2y]...],[[q1x,q1y]...]\n [],[] if no lines were found.\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L362_C4", "label": "m_per_pixel =", "type": "assigned_variable", "loc": [362, 362], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L356_C0", "vector": [14, 1, 0.5077, 0.0014, 1, 0.98, 0.0303, 171, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "m_per_pixel", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " m_per_pixel = 0.005"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L363_C4", "label": "img_cv, n_x, n_y, br = xy_map_to_cv_image()", "type": "assigned_variable", "loc": [363, 363], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L356_C0", "vector": [14, 1, 0.5091, 0.0014, 1, 0.98, 0.0606, 596, 3, 4, 0, 0, 170, 10, 1], "semantic": {"name": "img_cv, n_x, n_y, br", "arg_names": [], "import_names": [], "rhs_call_name": "xy_map_to_cv_image", "annotation": ""}, "snippet": " img_cv,n_x,n_y,br = xy_map_to_cv_image(xy_map,m_per_pixel,dilation_count=1,padding=50)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L365_C4", "label": "time_str = str()", "type": "assigned_variable", "loc": [365, 365], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L356_C0", "vector": [14, 1, 0.5119, 0.0014, 1, 0.98, 0.0909, 133, 3, 1, 0, 0, 52, 10, 2], "semantic": {"name": "time_str", "arg_names": [], "import_names": [], "rhs_call_name": "str", "annotation": ""}, "snippet": " time_str = str(time.time())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L371_C4", "label": "storage = cvCreateMemStorage()", "type": "assigned_variable", "loc": [371, 371], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L356_C0", "vector": [14, 1, 0.5203, 0.0014, 1, 0.98, 0.1212, 864, 3, 1, 0, 0, 487, 10, 1], "semantic": {"name": "storage", "arg_names": [], "import_names": [], "rhs_call_name": "cvCreateMemStorage", "annotation": ""}, "snippet": " storage = cvCreateMemStorage(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L372_C4", "label": "method =", "type": "assigned_variable", "loc": [372, 372], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L356_C0", "vector": [14, 1, 0.5217, 0.0014, 1, 0.98, 0.1515, 445, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "method", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " method = CV_HOUGH_PROBABILISTIC"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L373_C4", "label": "rho = max()", "type": "assigned_variable", "loc": [373, 373], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L356_C0", "vector": [14, 1, 0.5231, 0.0014, 1, 0.98, 0.1818, 498, 3, 2, 0, 0, 442, 10, 3], "semantic": {"name": "rho", "arg_names": [], "import_names": [], "rhs_call_name": "max", "annotation": ""}, "snippet": " rho = max(int(round(0.01/m_per_pixel)),1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L374_C4", "label": "rho =", "type": "assigned_variable", "loc": [374, 374], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L356_C0", "vector": [14, 1, 0.5245, 0.0014, 1, 0.98, 0.2121, 498, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "rho", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rho = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L375_C4", "label": "theta = radians()", "type": "assigned_variable", "loc": [375, 375], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L356_C0", "vector": [14, 1, 0.5259, 0.0014, 1, 0.98, 0.2424, 729, 3, 1, 0, 0, 383, 10, 1], "semantic": {"name": "theta", "arg_names": [], "import_names": [], "rhs_call_name": "radians", "annotation": ""}, "snippet": " theta = math.radians(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L376_C4", "label": "min_line_length = int()", "type": "assigned_variable", "loc": [376, 376], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L356_C0", "vector": [14, 1, 0.5273, 0.0014, 1, 0.98, 0.2727, 109, 3, 1, 0, 0, 901, 10, 1], "semantic": {"name": "min_line_length", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": " min_line_length = int(0.3/m_per_pixel)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L377_C4", "label": "max_gap = int()", "type": "assigned_variable", "loc": [377, 377], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L356_C0", "vector": [14, 1, 0.5288, 0.0014, 1, 0.98, 0.303, 649, 3, 1, 0, 0, 901, 10, 1], "semantic": {"name": "max_gap", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": " max_gap = int(0.1/m_per_pixel)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L378_C4", "label": "n_points_thresh = int()", "type": "assigned_variable", "loc": [378, 378], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L356_C0", "vector": [14, 1, 0.5302, 0.0014, 1, 0.98, 0.3333, 714, 3, 1, 0, 0, 901, 10, 1], "semantic": {"name": "n_points_thresh", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": " n_points_thresh = int(0.2/m_per_pixel)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L382_C4", "label": "lines = cvHoughLines2()", "type": "assigned_variable", "loc": [382, 382], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L356_C0", "vector": [14, 1, 0.5358, 0.0014, 1, 0.98, 0.3636, 73, 3, 8, 0, 0, 947, 10, 1], "semantic": {"name": "lines", "arg_names": [], "import_names": [], "rhs_call_name": "cvHoughLines2", "annotation": ""}, "snippet": " lines = cvHoughLines2(img_cv, storage, method, rho, theta, n_points_thresh, min_line_length, max_gap)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L384_C4", "label": "if", "type": "if", "loc": [384, 385], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L356_C0", "vector": [4, 1, 0.5393, 0.0028, 1, 0.98, 0.3939, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if lines.total == 0:\n return [],[]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Return_L385_C8", "label": "return", "type": "return", "loc": [385, 385], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L384_C4", "vector": [13, 2, 0.54, 0.0014, 2, 0.1, 0.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return [],[]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L386_C4", "label": "pts_start = zeros()", "type": "assigned_variable", "loc": [386, 386], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L356_C0", "vector": [14, 1, 0.5414, 0.0014, 1, 0.98, 0.4242, 938, 3, 1, 0, 0, 213, 10, 1], "semantic": {"name": "pts_start", "arg_names": [], "import_names": [], "rhs_call_name": "zeros", "annotation": ""}, "snippet": " pts_start = np.zeros((2, lines.total))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L387_C4", "label": "pts_end = zeros()", "type": "assigned_variable", "loc": [387, 387], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L356_C0", "vector": [14, 1, 0.5428, 0.0014, 1, 0.98, 0.4545, 783, 3, 1, 0, 0, 213, 10, 1], "semantic": {"name": "pts_end", "arg_names": [], "import_names": [], "rhs_call_name": "zeros", "annotation": ""}, "snippet": " pts_end = np.zeros((2, lines.total))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L389_C4", "label": "if", "type": "if", "loc": [389, 391], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L356_C0", "vector": [4, 1, 0.547, 0.0042, 1, 0.98, 0.4848, 0, 2, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if save_lines:\n color_dst = cvCreateImage( cvGetSize(img_cv), 8, 3 )\n cvCvtColor( img_cv, color_dst, CV_GRAY2BGR )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L390_C8", "label": "color_dst = cvCreateImage()", "type": "assigned_variable", "loc": [390, 390], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L389_C4", "vector": [14, 2, 0.547, 0.0014, 2, 0.15, 0.0, 396, 3, 3, 0, 0, 953, 10, 2], "semantic": {"name": "color_dst", "arg_names": [], "import_names": [], "rhs_call_name": "cvCreateImage", "annotation": ""}, "snippet": " color_dst = cvCreateImage( cvGetSize(img_cv), 8, 3 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L391_C8", "label": "cvCvtColor()", "type": "expression", "loc": [391, 391], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L389_C4", "vector": [8, 2, 0.5484, 0.0014, 2, 0.15, 1.0, 709, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "cvCvtColor", "arg_names": [], "import_names": [], "rhs_call_name": "cvCvtColor", "annotation": ""}, "snippet": " cvCvtColor( img_cv, color_dst, CV_GRAY2BGR )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L393_C4", "label": "n_lines =", "type": "assigned_variable", "loc": [393, 393], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L356_C0", "vector": [14, 1, 0.5512, 0.0014, 1, 0.98, 0.5152, 826, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "n_lines", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " n_lines = lines.total"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L394_C4", "label": "for idx, line", "type": "for", "loc": [394, 398], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L356_C0", "vector": [6, 1, 0.5554, 0.007, 1, 0.98, 0.5455, 260, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "idx, line", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for idx, line in enumerate(lines.asarrayptr(POINTER(CvPoint))):\n pts_start[0, idx] = line[0].y\n pts_start[1, idx] = line[0].x\n pts_end[0, idx] = line[1].y\n pts_end[1, idx] = line[1].x"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L395_C8", "label": "assign", "type": "assigned_variable", "loc": [395, 395], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L394_C4", "vector": [14, 2, 0.554, 0.0014, 2, 0.57, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pts_start[0, idx] = line[0].y"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L396_C8", "label": "assign", "type": "assigned_variable", "loc": [396, 396], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L394_C4", "vector": [14, 2, 0.5554, 0.0014, 2, 0.57, 0.3333, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pts_start[1, idx] = line[0].x"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L397_C8", "label": "assign", "type": "assigned_variable", "loc": [397, 397], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L394_C4", "vector": [14, 2, 0.5568, 0.0014, 2, 0.57, 0.6667, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pts_end[0, idx] = line[1].y"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L398_C8", "label": "assign", "type": "assigned_variable", "loc": [398, 398], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L394_C4", "vector": [14, 2, 0.5582, 0.0014, 2, 0.57, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pts_end[1, idx] = line[1].x"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L400_C4", "label": "if", "type": "if", "loc": [400, 402], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L356_C0", "vector": [4, 1, 0.5624, 0.0042, 1, 0.98, 0.5758, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if save_lines:\n pts_start_pixel = pts_start\n pts_end_pixel = pts_end"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L401_C8", "label": "pts_start_pixel =", "type": "assigned_variable", "loc": [401, 401], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L400_C4", "vector": [14, 2, 0.5624, 0.0014, 2, 0.69, 0.0, 626, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pts_start_pixel", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pts_start_pixel = pts_start"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L402_C8", "label": "pts_end_pixel =", "type": "assigned_variable", "loc": [402, 402], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L400_C4", "vector": [14, 2, 0.5638, 0.0014, 2, 0.69, 1.0, 38, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pts_end_pixel", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pts_end_pixel = pts_end"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L404_C4", "label": "pts_start =", "type": "assigned_variable", "loc": [404, 404], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L356_C0", "vector": [14, 1, 0.5666, 0.0014, 1, 0.98, 0.6061, 938, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "pts_start", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pts_start = (np.matrix([n_x,n_y]).T - pts_start)*m_per_pixel + br"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L405_C4", "label": "pts_end =", "type": "assigned_variable", "loc": [405, 405], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L356_C0", "vector": [14, 1, 0.568, 0.0014, 1, 0.98, 0.6364, 783, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "pts_end", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pts_end = (np.matrix([n_x,n_y]).T - pts_end)*m_per_pixel + br"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L407_C4", "label": "along_vec =", "type": "assigned_variable", "loc": [407, 407], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L356_C0", "vector": [14, 1, 0.5708, 0.0014, 1, 0.98, 0.6667, 693, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "along_vec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " along_vec = pts_end - pts_start"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L408_C4", "label": "along_vec =", "type": "assigned_variable", "loc": [408, 408], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L356_C0", "vector": [14, 1, 0.5722, 0.0014, 1, 0.98, 0.697, 693, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "along_vec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " along_vec = along_vec/ut.norm(along_vec)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L409_C4", "label": "ang_vec = arctan2()", "type": "assigned_variable", "loc": [409, 409], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L356_C0", "vector": [14, 1, 0.5736, 0.0014, 1, 0.98, 0.7273, 148, 3, 2, 0, 0, 895, 10, 1], "semantic": {"name": "ang_vec", "arg_names": [], "import_names": [], "rhs_call_name": "arctan2", "annotation": ""}, "snippet": " ang_vec = np.arctan2(-along_vec[0,:],along_vec[1,:])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L411_C4", "label": "res_list =", "type": "assigned_variable", "loc": [411, 411], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L356_C0", "vector": [14, 1, 0.5764, 0.0014, 1, 0.98, 0.7576, 270, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "res_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " res_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L412_C4", "label": "keep_indices =", "type": "assigned_variable", "loc": [412, 412], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L356_C0", "vector": [14, 1, 0.5778, 0.0014, 1, 0.98, 0.7879, 297, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "keep_indices", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " keep_indices = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L414_C4", "label": "for i", "type": "for", "loc": [414, 442], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L356_C0", "vector": [6, 1, 0.6003, 0.0407, 1, 0.98, 0.8182, 826, 3, 0, 0, 0, 0, 0, 18], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(n_lines):\n ang = ang_vec[0,i]\n if ang>math.radians(90):\n ang = ang - math.radians(180)\n if ang<math.radians(-90):\n ang = ang + math.radians(180)\n\n rot_mat = tr.Rz(ang)[0:2,0:2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L415_C8", "label": "ang =", "type": "assigned_variable", "loc": [415, 415], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L414_C4", "vector": [14, 2, 0.582, 0.0014, 2, 0.37, 0.0, 762, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ang", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ang = ang_vec[0,i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L416_C8", "label": "if", "type": "if", "loc": [416, 417], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L414_C4", "vector": [4, 2, 0.5842, 0.0028, 2, 0.37, 0.0588, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if ang>math.radians(90):\n ang = ang - math.radians(180)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L417_C12", "label": "ang =", "type": "assigned_variable", "loc": [417, 417], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L416_C8", "vector": [14, 3, 0.5849, 0.0014, 3, 0.64, 0.0, 762, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "ang", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ang = ang - math.radians(180)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L418_C8", "label": "if", "type": "if", "loc": [418, 419], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L414_C4", "vector": [4, 2, 0.587, 0.0028, 2, 0.37, 0.1176, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if ang<math.radians(-90):\n ang = ang + math.radians(180)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L419_C12", "label": "ang =", "type": "assigned_variable", "loc": [419, 419], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L418_C8", "vector": [14, 3, 0.5877, 0.0014, 3, 0.54, 0.0, 762, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "ang", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ang = ang + math.radians(180)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L421_C8", "label": "rot_mat =", "type": "assigned_variable", "loc": [421, 421], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L414_C4", "vector": [14, 2, 0.5905, 0.0014, 2, 0.37, 0.1765, 968, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "rot_mat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rot_mat = tr.Rz(ang)[0:2,0:2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L422_C8", "label": "st =", "type": "assigned_variable", "loc": [422, 422], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L414_C4", "vector": [14, 2, 0.5919, 0.0014, 2, 0.37, 0.2353, 93, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "st", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " st = rot_mat*pts_start[:,i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L423_C8", "label": "en =", "type": "assigned_variable", "loc": [423, 423], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L414_C4", "vector": [14, 2, 0.5933, 0.0014, 2, 0.37, 0.2941, 211, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "en", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " en = rot_mat*pts_end[:,i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L424_C8", "label": "pts =", "type": "assigned_variable", "loc": [424, 424], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L414_C4", "vector": [14, 2, 0.5947, 0.0014, 2, 0.37, 0.3529, 195, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pts = rot_mat*xy_map"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L425_C8", "label": "x_all =", "type": "assigned_variable", "loc": [425, 425], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L414_C4", "vector": [14, 2, 0.5961, 0.0014, 2, 0.37, 0.4118, 108, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "x_all", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " x_all = pts[0,:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L426_C8", "label": "y_all =", "type": "assigned_variable", "loc": [426, 426], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L414_C4", "vector": [14, 2, 0.5975, 0.0014, 2, 0.37, 0.4706, 45, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "y_all", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " y_all = pts[1,:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L427_C8", "label": "min_x =", "type": "assigned_variable", "loc": [427, 427], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L414_C4", "vector": [14, 2, 0.5989, 0.0014, 2, 0.37, 0.5294, 971, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "min_x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " min_x = min(st[0,0],en[0,0]) - 0.1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L428_C8", "label": "max_x =", "type": "assigned_variable", "loc": [428, 428], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L414_C4", "vector": [14, 2, 0.6003, 0.0014, 2, 0.37, 0.5882, 64, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "max_x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " max_x = max(st[0,0],en[0,0]) + 0.1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L429_C8", "label": "min_y =", "type": "assigned_variable", "loc": [429, 429], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L414_C4", "vector": [14, 2, 0.6017, 0.0014, 2, 0.37, 0.6471, 8, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "min_y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " min_y = min(st[1,0],en[1,0]) + 0.01"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L430_C8", "label": "max_y =", "type": "assigned_variable", "loc": [430, 430], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L414_C4", "vector": [14, 2, 0.6031, 0.0014, 2, 0.37, 0.7059, 742, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "max_y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " max_y = max(st[1,0],en[1,0]) - 0.01"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L432_C8", "label": "keep = multiply()", "type": "assigned_variable", "loc": [432, 433], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L414_C4", "vector": [14, 2, 0.6066, 0.0028, 2, 0.37, 0.7647, 918, 3, 2, 0, 0, 960, 10, 3], "semantic": {"name": "keep", "arg_names": [], "import_names": [], "rhs_call_name": "multiply", "annotation": ""}, "snippet": " keep = np.multiply(np.multiply(x_all>min_x,x_all<max_x),\n np.multiply(y_all>min_y,y_all<max_y))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L435_C8", "label": "xy_sub =", "type": "assigned_variable", "loc": [435, 435], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L414_C4", "vector": [14, 2, 0.6101, 0.0014, 2, 0.37, 0.8235, 6, 6, 0, 0, 0, 0, 0, 2], "semantic": {"name": "xy_sub", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " xy_sub = xy_map[:,np.where(keep)[1].A1.tolist()]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L436_C8", "label": "if", "type": "if", "loc": [436, 437], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L414_C4", "vector": [4, 2, 0.6122, 0.0028, 2, 0.37, 0.8824, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if xy_sub.shape[1] == 0:\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L439_C8", "label": "a, b, res = fitLine_highslope()", "type": "assigned_variable", "loc": [439, 439], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L414_C4", "vector": [14, 2, 0.6157, 0.0014, 2, 0.37, 0.9412, 863, 3, 2, 0, 0, 563, 10, 1], "semantic": {"name": "a, b, res", "arg_names": [], "import_names": [], "rhs_call_name": "fitLine_highslope", "annotation": ""}, "snippet": " a,b,res = uto.fitLine_highslope(xy_sub[0,:].T, xy_sub[1,:].T)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L440_C8", "label": "if", "type": "if", "loc": [440, 442], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L414_C4", "vector": [4, 2, 0.6185, 0.0042, 2, 0.37, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if res<0.0002:\n res_list.append(res)\n keep_indices.append(i)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L441_C12", "label": "append()", "type": "expression", "loc": [441, 441], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L440_C8", "vector": [8, 3, 0.6185, 0.0014, 3, 0.64, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " res_list.append(res)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L442_C12", "label": "append()", "type": "expression", "loc": [442, 442], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L440_C8", "vector": [8, 3, 0.6199, 0.0014, 3, 0.64, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " keep_indices.append(i)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L444_C4", "label": "if", "type": "if", "loc": [444, 445], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L356_C0", "vector": [4, 1, 0.6234, 0.0028, 1, 0.98, 0.8485, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if keep_indices == []:\n return [],[]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Return_L445_C8", "label": "return", "type": "return", "loc": [445, 445], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L444_C4", "vector": [13, 2, 0.6241, 0.0014, 2, 0.57, 0.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return [],[]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L447_C4", "label": "pts_start =", "type": "assigned_variable", "loc": [447, 447], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L356_C0", "vector": [14, 1, 0.6269, 0.0014, 1, 0.98, 0.8788, 938, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pts_start", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pts_start = pts_start[:,keep_indices]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L448_C4", "label": "pts_end =", "type": "assigned_variable", "loc": [448, 448], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L356_C0", "vector": [14, 1, 0.6283, 0.0014, 1, 0.98, 0.9091, 783, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pts_end", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pts_end = pts_end[:,keep_indices]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L450_C4", "label": "print()", "type": "expression", "loc": [450, 450], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L356_C0", "vector": [8, 1, 0.6311, 0.0014, 1, 0.98, 0.9394, 535, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('number of lines:', len(keep_indices))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L452_C4", "label": "if", "type": "if", "loc": [452, 459], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L356_C0", "vector": [4, 1, 0.6388, 0.0112, 1, 0.98, 0.9697, 0, 2, 0, 0, 0, 0, 0, 11], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if save_lines:\n ut.save_pickle(res_list,'residual_list_'+time_str+'.pkl')\n for i, idx in enumerate(keep_indices):\n s = pts_start_pixel[:,idx]\n e = pts_end_pixel[:,idx]\n cvLine(color_dst, cvPoint(int(s[1]),int(s[0])), cvPoint(int(e[1]),int(e[0])), CV_RGB(*(color_list[i])),\n 3, 8)\n cvSaveImage('lines_'+time_str+'.png',color_dst)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L453_C8", "label": "save_pickle()", "type": "expression", "loc": [453, 453], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L452_C4", "vector": [8, 2, 0.6353, 0.0014, 2, 0.32, 0.0, 390, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "save_pickle", "arg_names": [], "import_names": [], "rhs_call_name": "save_pickle", "annotation": ""}, "snippet": " ut.save_pickle(res_list,'residual_list_'+time_str+'.pkl')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L454_C8", "label": "for i, idx", "type": "for", "loc": [454, 458], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L452_C4", "vector": [6, 2, 0.6396, 0.007, 2, 0.32, 0.5, 506, 3, 0, 0, 0, 0, 0, 9], "semantic": {"name": "i, idx", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i, idx in enumerate(keep_indices):\n s = pts_start_pixel[:,idx]\n e = pts_end_pixel[:,idx]\n cvLine(color_dst, cvPoint(int(s[1]),int(s[0])), cvPoint(int(e[1]),int(e[0])), CV_RGB(*(color_list[i])),\n 3, 8)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L455_C12", "label": "s =", "type": "assigned_variable", "loc": [455, 455], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L454_C8", "vector": [14, 3, 0.6381, 0.0014, 3, 0.63, 0.0, 553, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "s", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " s = pts_start_pixel[:,idx]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L456_C12", "label": "e =", "type": "assigned_variable", "loc": [456, 456], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L454_C8", "vector": [14, 3, 0.6396, 0.0014, 3, 0.63, 0.5, 175, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "e", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " e = pts_end_pixel[:,idx]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L457_C12", "label": "cvLine()", "type": "expression", "loc": [457, 458], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L454_C8", "vector": [8, 3, 0.6417, 0.0028, 3, 0.63, 1.0, 569, 3, 6, 0, 0, 0, 0, 8], "semantic": {"name": "cvLine", "arg_names": [], "import_names": [], "rhs_call_name": "cvLine", "annotation": ""}, "snippet": " cvLine(color_dst, cvPoint(int(s[1]),int(s[0])), cvPoint(int(e[1]),int(e[0])), CV_RGB(*(color_list[i])),\n 3, 8)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L459_C8", "label": "cvSaveImage()", "type": "expression", "loc": [459, 459], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L452_C4", "vector": [8, 2, 0.6438, 0.0014, 2, 0.32, 1.0, 100, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "cvSaveImage", "arg_names": [], "import_names": [], "rhs_call_name": "cvSaveImage", "annotation": ""}, "snippet": " cvSaveImage('lines_'+time_str+'.png',color_dst)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Return_L462_C4", "label": "return", "type": "return", "loc": [462, 462], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L356_C0", "vector": [13, 1, 0.648, 0.0014, 1, 0.98, 1.0, 0, 0, 0, 0, 0, 0, 8, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return pts_start.T.tolist(),pts_end.T.tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L466_C0", "label": "pixel_to_real", "type": "function", "loc": [466, 471], "level": 0, "parent": null, "vector": [2, 0, 0.6571, 0.0084, 0, 0.66, 0.7381, 148, 0, 3, 1, 0, 0, 0, 0], "semantic": {"name": "pixel_to_real", "arg_names": ["x", "y", "max_dist"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def pixel_to_real(x,y, max_dist):\n ''' pixel to hokuyo\n x,y - NX1 matrices (N points)\n max_dist - dist which will be drawn at row 0\n '''\n return (org_y-y)*max_dist/400.,(org_x-x)*max_dist/400."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L467_C4", "label": "expression", "type": "expression", "loc": [467, 470], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L466_C0", "vector": [8, 1, 0.6571, 0.0056, 1, 0.54, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' pixel to hokuyo\n x,y - NX1 matrices (N points)\n max_dist - dist which will be drawn at row 0\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Return_L471_C4", "label": "return", "type": "return", "loc": [471, 471], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L466_C0", "vector": [13, 1, 0.6606, 0.0014, 1, 0.54, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return (org_y-y)*max_dist/400.,(org_x-x)*max_dist/400."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L474_C0", "label": "coord", "type": "function", "loc": [474, 479], "level": 0, "parent": null, "vector": [2, 0, 0.6683, 0.0084, 0, 0.66, 0.7619, 84, 0, 3, 1, 0, 0, 0, 0], "semantic": {"name": "coord", "arg_names": ["x", "y", "max_dist"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def coord(x,y, max_dist):\n '''hokuyo coord frame to pixel (x,y) - floats\n x,y - NX1 matrices (N points)\n max_dist - dist which will be drawn at row 0\n '''\n return org_x-(400./max_dist)*y, org_y-(400./max_dist)*x"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L475_C4", "label": "expression", "type": "expression", "loc": [475, 478], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L474_C0", "vector": [8, 1, 0.6683, 0.0056, 1, 0.53, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " '''hokuyo coord frame to pixel (x,y) - floats\n x,y - NX1 matrices (N points)\n max_dist - dist which will be drawn at row 0\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Return_L479_C4", "label": "return", "type": "return", "loc": [479, 479], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L474_C0", "vector": [13, 1, 0.6718, 0.0014, 1, 0.53, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return org_x-(400./max_dist)*y, org_y-(400./max_dist)*x"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L481_C0", "label": "draw_points", "type": "function", "loc": [481, 488], "level": 0, "parent": null, "vector": [2, 0, 0.6795, 0.0112, 0, 0.66, 0.7857, 154, 0, 6, 0, 0, 0, 0, 6], "semantic": {"name": "draw_points", "arg_names": ["srf", "x", "y", "color", "max_dist", "step"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def draw_points(srf,x,y,color,max_dist,step=1):\n ''' step - set > 1 if you don't want to draw all the points.\n '''\n if len(x.A1) == 0:\n return\n x_pixel, y_pixel = coord(x.T,y.T,max_dist)\n for i in range(0,x_pixel.shape[0],step):\n pygame.draw.circle(srf, color, (int(x_pixel[i,0]+0.5), int(y_pixel[i,0]+0.5)), 2, 0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L482_C4", "label": "expression", "type": "expression", "loc": [482, 483], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L481_C0", "vector": [8, 1, 0.6767, 0.0028, 1, 0.47, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' step - set > 1 if you don't want to draw all the points.\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L484_C4", "label": "if", "type": "if", "loc": [484, 485], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L481_C0", "vector": [4, 1, 0.6795, 0.0028, 1, 0.47, 0.3333, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(x.A1) == 0:\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Return_L485_C8", "label": "return", "type": "return", "loc": [485, 485], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L484_C4", "vector": [13, 2, 0.6802, 0.0014, 2, 0.31, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L486_C4", "label": "x_pixel, y_pixel = coord()", "type": "assigned_variable", "loc": [486, 486], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L481_C0", "vector": [14, 1, 0.6816, 0.0014, 1, 0.47, 0.6667, 452, 3, 3, 0, 0, 84, 10, 1], "semantic": {"name": "x_pixel, y_pixel", "arg_names": [], "import_names": [], "rhs_call_name": "coord", "annotation": ""}, "snippet": " x_pixel, y_pixel = coord(x.T,y.T,max_dist)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L487_C4", "label": "for i", "type": "for", "loc": [487, 488], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L481_C0", "vector": [6, 1, 0.6837, 0.0028, 1, 0.47, 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(0,x_pixel.shape[0],step):\n pygame.draw.circle(srf, color, (int(x_pixel[i,0]+0.5), int(y_pixel[i,0]+0.5)), 2, 0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L488_C8", "label": "circle()", "type": "expression", "loc": [488, 488], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L487_C4", "vector": [8, 2, 0.6844, 0.0014, 2, 0.69, 0.0, 341, 3, 5, 0, 0, 0, 0, 3], "semantic": {"name": "circle", "arg_names": [], "import_names": [], "rhs_call_name": "circle", "annotation": ""}, "snippet": " pygame.draw.circle(srf, color, (int(x_pixel[i,0]+0.5), int(y_pixel[i,0]+0.5)), 2, 0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L490_C0", "label": "draw_hokuyo_scan", "type": "function", "loc": [490, 497], "level": 0, "parent": null, "vector": [2, 0, 0.6921, 0.0112, 0, 0.66, 0.8095, 897, 0, 7, 0, 0, 0, 0, 2], "semantic": {"name": "draw_hokuyo_scan", "arg_names": ["srf", "scan", "ang1", "ang2", "color", "reject_zero_ten", "step"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def draw_hokuyo_scan(srf, scan, ang1, ang2, color, reject_zero_ten=True,step=1):\n ''' reject_zero_ten - don't show points with 0 or 10. range readings.\n step - set > 1 if you don't want to draw all the points.\n '''\n pts = get_xy_map(scan, ang1, ang2, reject_zero_ten=reject_zero_ten)\n# pts = get_xy_map(scan, reject_zero_ten=reject_zero_ten)\n max_dist = MAX_DIST\n draw_points(srf,pts[0,:],pts[1,:],color,max_dist,step=step)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L491_C4", "label": "expression", "type": "expression", "loc": [491, 493], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L490_C0", "vector": [8, 1, 0.69, 0.0042, 1, 0.98, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' reject_zero_ten - don't show points with 0 or 10. range readings.\n step - set > 1 if you don't want to draw all the points.\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L494_C4", "label": "pts = get_xy_map()", "type": "assigned_variable", "loc": [494, 494], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L490_C0", "vector": [14, 1, 0.6928, 0.0014, 1, 0.98, 0.3333, 195, 3, 4, 0, 0, 476, 10, 1], "semantic": {"name": "pts", "arg_names": [], "import_names": [], "rhs_call_name": "get_xy_map", "annotation": ""}, "snippet": " pts = get_xy_map(scan, ang1, ang2, reject_zero_ten=reject_zero_ten)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L496_C4", "label": "max_dist =", "type": "assigned_variable", "loc": [496, 496], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L490_C0", "vector": [14, 1, 0.6957, 0.0014, 1, 0.98, 0.6667, 822, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "max_dist", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " max_dist = MAX_DIST"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L497_C4", "label": "draw_points()", "type": "expression", "loc": [497, 497], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L490_C0", "vector": [8, 1, 0.6971, 0.0014, 1, 0.98, 1.0, 154, 3, 6, 0, 0, 0, 0, 1], "semantic": {"name": "draw_points", "arg_names": [], "import_names": [], "rhs_call_name": "draw_points", "annotation": ""}, "snippet": " draw_points(srf,pts[0,:],pts[1,:],color,max_dist,step=step)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L500_C0", "label": "test_connected_comps", "type": "function", "loc": [500, 508], "level": 0, "parent": null, "vector": [2, 0, 0.7069, 0.0126, 0, 0.66, 0.8333, 950, 0, 2, 0, 0, 0, 0, 11], "semantic": {"name": "test_connected_comps", "arg_names": ["srf", "scan"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def test_connected_comps(srf, scan):\n #colors_list = [(200,0,0), (0,255,0), (100,100,0), (100,0,100), (0,100,100)]\n n_colors = len(color_list)\n cc_list = connected_components(get_xy_map(scan,math.radians(-60),math.radians(60)),0.03)\n# draw the connected components as lines\n for i,(p,q,p_idx,q_idx) in enumerate(cc_list):\n c1,c2 = p.A1.tolist(),q.A1.tolist()\n c1,c2 = coord(c1[0],c1[1], max_dist=MAX_DIST), coord(c2[0],c2[1], max_dist=MAX_DIST)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L502_C4", "label": "n_colors = len()", "type": "assigned_variable", "loc": [502, 502], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L500_C0", "vector": [14, 1, 0.7041, 0.0014, 1, 0.03, 0.0, 109, 3, 1, 0, 0, 890, 10, 1], "semantic": {"name": "n_colors", "arg_names": [], "import_names": [], "rhs_call_name": "len", "annotation": ""}, "snippet": " n_colors = len(color_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L503_C4", "label": "cc_list = connected_components()", "type": "assigned_variable", "loc": [503, 503], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L500_C0", "vector": [14, 1, 0.7055, 0.0014, 1, 0.03, 0.5, 542, 3, 2, 0, 0, 659, 10, 4], "semantic": {"name": "cc_list", "arg_names": [], "import_names": [], "rhs_call_name": "connected_components", "annotation": ""}, "snippet": " cc_list = connected_components(get_xy_map(scan,math.radians(-60),math.radians(60)),0.03)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L505_C4", "label": "for i", "type": "for", "loc": [505, 508], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L500_C0", "vector": [6, 1, 0.7104, 0.0056, 1, 0.03, 1.0, 826, 3, 0, 0, 0, 0, 0, 6], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i,(p,q,p_idx,q_idx) in enumerate(cc_list):\n c1,c2 = p.A1.tolist(),q.A1.tolist()\n c1,c2 = coord(c1[0],c1[1], max_dist=MAX_DIST), coord(c2[0],c2[1], max_dist=MAX_DIST)\n pygame.draw.line(srf,color_list[i%n_colors],c1,c2,2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L506_C8", "label": "c1, c2 =", "type": "assigned_variable", "loc": [506, 506], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L505_C4", "vector": [14, 2, 0.7097, 0.0014, 2, 0.31, 0.0, 680, 0, 0, 0, 0, 0, 8, 2], "semantic": {"name": "c1, c2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " c1,c2 = p.A1.tolist(),q.A1.tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L507_C8", "label": "c1, c2 =", "type": "assigned_variable", "loc": [507, 507], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L505_C4", "vector": [14, 2, 0.7111, 0.0014, 2, 0.31, 0.5, 680, 0, 0, 0, 0, 0, 8, 2], "semantic": {"name": "c1, c2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " c1,c2 = coord(c1[0],c1[1], max_dist=MAX_DIST), coord(c2[0],c2[1], max_dist=MAX_DIST)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L508_C8", "label": "line()", "type": "expression", "loc": [508, 508], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L505_C4", "vector": [8, 2, 0.7125, 0.0014, 2, 0.31, 1.0, 373, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "line", "arg_names": [], "import_names": [], "rhs_call_name": "line", "annotation": ""}, "snippet": " pygame.draw.line(srf,color_list[i%n_colors],c1,c2,2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L510_C0", "label": "test_find_objects", "type": "function", "loc": [510, 521], "level": 0, "parent": null, "vector": [2, 0, 0.723, 0.0168, 0, 0.66, 0.8571, 466, 0, 2, 0, 0, 0, 0, 11], "semantic": {"name": "test_find_objects", "arg_names": ["srf", "scan"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def test_find_objects(srf, scan):\n obj_list = find_objects(scan, max_dist=0.6, max_size=0.3, min_size=0.01,\n min_angle=math.radians(-60), max_angle=math.radians(60),\n connect_dist_thresh=0.02)\n print('number of objects:', len(obj_list))\n #colors_list = [(200,0,0), (0,255,0), (100,100,0), (100,0,100), (0,100,100)]\n for i,(p,q,c) in enumerate(obj_list):\n if i>4:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L511_C4", "label": "obj_list = find_objects()", "type": "assigned_variable", "loc": [511, 513], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L510_C0", "vector": [14, 1, 0.7181, 0.0042, 1, 0.98, 0.0, 342, 3, 7, 0, 0, 936, 10, 3], "semantic": {"name": "obj_list", "arg_names": [], "import_names": [], "rhs_call_name": "find_objects", "annotation": ""}, "snippet": " obj_list = find_objects(scan, max_dist=0.6, max_size=0.3, min_size=0.01,\n min_angle=math.radians(-60), max_angle=math.radians(60),\n connect_dist_thresh=0.02)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L514_C4", "label": "print()", "type": "expression", "loc": [514, 514], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L510_C0", "vector": [8, 1, 0.7209, 0.0014, 1, 0.98, 0.5, 535, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('number of objects:', len(obj_list))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L516_C4", "label": "for i", "type": "for", "loc": [516, 521], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L510_C0", "vector": [6, 1, 0.7272, 0.0084, 1, 0.98, 1.0, 826, 3, 0, 0, 0, 0, 0, 6], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i,(p,q,c) in enumerate(obj_list):\n if i>4:\n break\n c1,c2 = p.A1.tolist(),q.A1.tolist()\n c1,c2 = coord(c1[0],c1[1], max_dist=MAX_DIST), coord(c2[0],c2[1], max_dist=MAX_DIST)\n pygame.draw.line(srf,color_list[i],c1,c2,2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L517_C8", "label": "if", "type": "if", "loc": [517, 518], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L516_C4", "vector": [4, 2, 0.7258, 0.0028, 2, 0.38, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if i>4:\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L519_C8", "label": "c1, c2 =", "type": "assigned_variable", "loc": [519, 519], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L516_C4", "vector": [14, 2, 0.7279, 0.0014, 2, 0.38, 0.3333, 680, 0, 0, 0, 0, 0, 8, 2], "semantic": {"name": "c1, c2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " c1,c2 = p.A1.tolist(),q.A1.tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L520_C8", "label": "c1, c2 =", "type": "assigned_variable", "loc": [520, 520], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L516_C4", "vector": [14, 2, 0.7293, 0.0014, 2, 0.38, 0.6667, 680, 0, 0, 0, 0, 0, 8, 2], "semantic": {"name": "c1, c2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " c1,c2 = coord(c1[0],c1[1], max_dist=MAX_DIST), coord(c2[0],c2[1], max_dist=MAX_DIST)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L521_C8", "label": "line()", "type": "expression", "loc": [521, 521], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L516_C4", "vector": [8, 2, 0.7307, 0.0014, 2, 0.38, 1.0, 373, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "line", "arg_names": [], "import_names": [], "rhs_call_name": "line", "annotation": ""}, "snippet": " pygame.draw.line(srf,color_list[i],c1,c2,2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L523_C0", "label": "test_find_closest_object_point", "type": "function", "loc": [523, 532], "level": 0, "parent": null, "vector": [2, 0, 0.7398, 0.014, 0, 0.66, 0.881, 996, 0, 2, 0, 0, 0, 0, 6], "semantic": {"name": "test_find_closest_object_point", "arg_names": ["srf", "scan"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def test_find_closest_object_point(srf, scan):\n pt_interest = np.matrix([0.,0.]).T\n# pt_interest = np.matrix([0.3,-0.04]).T\n p = find_closest_object_point(scan, pt_interest)\n if p == None:\n return\n c1,c2 = coord(p[0,0],p[1,0], max_dist=MAX_DIST)\n pygame.draw.circle(srf, (0,200,0), (c1,c2), 3, 0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L524_C4", "label": "pt_interest =", "type": "assigned_variable", "loc": [524, 524], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L523_C0", "vector": [14, 1, 0.7349, 0.0014, 1, 0.19, 0.0, 954, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "pt_interest", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pt_interest = np.matrix([0.,0.]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L526_C4", "label": "p = find_closest_object_point()", "type": "assigned_variable", "loc": [526, 526], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L523_C0", "vector": [14, 1, 0.7377, 0.0014, 1, 0.19, 0.1667, 491, 3, 2, 0, 0, 567, 10, 1], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "find_closest_object_point", "annotation": ""}, "snippet": " p = find_closest_object_point(scan, pt_interest)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L527_C4", "label": "if", "type": "if", "loc": [527, 528], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L523_C0", "vector": [4, 1, 0.7398, 0.0028, 1, 0.19, 0.3333, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if p == None:\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Return_L528_C8", "label": "return", "type": "return", "loc": [528, 528], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L527_C4", "vector": [13, 2, 0.7405, 0.0014, 2, 0.52, 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_99581:Assign_L529_C4", "label": "c1, c2 = coord()", "type": "assigned_variable", "loc": [529, 529], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L523_C0", "vector": [14, 1, 0.7419, 0.0014, 1, 0.19, 0.5, 680, 3, 3, 0, 0, 84, 10, 1], "semantic": {"name": "c1, c2", "arg_names": [], "import_names": [], "rhs_call_name": "coord", "annotation": ""}, "snippet": " c1,c2 = coord(p[0,0],p[1,0], max_dist=MAX_DIST)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L530_C4", "label": "circle()", "type": "expression", "loc": [530, 530], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L523_C0", "vector": [8, 1, 0.7433, 0.0014, 1, 0.19, 0.6667, 341, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "circle", "arg_names": [], "import_names": [], "rhs_call_name": "circle", "annotation": ""}, "snippet": " pygame.draw.circle(srf, (0,200,0), (c1,c2), 3, 0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L531_C4", "label": "c1, c2 = coord()", "type": "assigned_variable", "loc": [531, 531], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L523_C0", "vector": [14, 1, 0.7447, 0.0014, 1, 0.19, 0.8333, 680, 3, 3, 0, 0, 84, 10, 1], "semantic": {"name": "c1, c2", "arg_names": [], "import_names": [], "rhs_call_name": "coord", "annotation": ""}, "snippet": " c1,c2 = coord(pt_interest[0,0],pt_interest[1,0], max_dist=MAX_DIST)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L532_C4", "label": "circle()", "type": "expression", "loc": [532, 532], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L523_C0", "vector": [8, 1, 0.7461, 0.0014, 1, 0.19, 1.0, 341, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "circle", "arg_names": [], "import_names": [], "rhs_call_name": "circle", "annotation": ""}, "snippet": " pygame.draw.circle(srf, (200,200,0), (c1,c2), 3, 0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L534_C0", "label": "tune_graze_effect_init", "type": "function", "loc": [534, 536], "level": 0, "parent": null, "vector": [2, 0, 0.7504, 0.0042, 0, 0.66, 0.9048, 894, 0, 0, 1, 0, 0, 0, 1], "semantic": {"name": "tune_graze_effect_init", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def tune_graze_effect_init():\n sl = pu.Slider((340, 20), 10)\n return sl"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L535_C4", "label": "sl = Slider()", "type": "assigned_variable", "loc": [535, 535], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L534_C0", "vector": [14, 1, 0.7504, 0.0014, 1, 0.15, 0.0, 555, 3, 2, 0, 0, 203, 10, 1], "semantic": {"name": "sl", "arg_names": [], "import_names": [], "rhs_call_name": "Slider", "annotation": ""}, "snippet": " sl = pu.Slider((340, 20), 10)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Return_L536_C4", "label": "return", "type": "return", "loc": [536, 536], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L534_C0", "vector": [13, 1, 0.7518, 0.0014, 1, 0.15, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return sl"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L538_C0", "label": "tune_graze_effect_update", "type": "function", "loc": [538, 552], "level": 0, "parent": null, "vector": [2, 0, 0.7644, 0.021, 0, 0.66, 0.9286, 873, 0, 3, 1, 0, 0, 0, 10], "semantic": {"name": "tune_graze_effect_update", "arg_names": ["sl", "srf", "scan"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def tune_graze_effect_update(sl, srf, scan):\n sl.update()\n val = sl.value/255.\n angle = 160+val*20\n\n remove_graze_effect_scan(scan,graze_angle_threshold=math.radians(angle))\n draw_hokuyo_scan(srf,scan,math.radians(-90), math.radians(90),color=(200,0,0),reject_zero_ten=False)\n points_removed = np.where(np.matrix(scan.ranges)>10.)[0].shape[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L539_C4", "label": "update()", "type": "expression", "loc": [539, 539], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L538_C0", "vector": [8, 1, 0.756, 0.0014, 1, 0.5, 0.0, 637, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "update", "arg_names": [], "import_names": [], "rhs_call_name": "update", "annotation": ""}, "snippet": " sl.update()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L540_C4", "label": "val =", "type": "assigned_variable", "loc": [540, 540], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L538_C0", "vector": [14, 1, 0.7574, 0.0014, 1, 0.5, 0.125, 618, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "val", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " val = sl.value/255."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L541_C4", "label": "angle =", "type": "assigned_variable", "loc": [541, 541], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L538_C0", "vector": [14, 1, 0.7588, 0.0014, 1, 0.5, 0.25, 418, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "angle", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " angle = 160+val*20"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L543_C4", "label": "remove_graze_effect_scan()", "type": "expression", "loc": [543, 543], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L538_C0", "vector": [8, 1, 0.7616, 0.0014, 1, 0.5, 0.375, 447, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "remove_graze_effect_scan", "arg_names": [], "import_names": [], "rhs_call_name": "remove_graze_effect_scan", "annotation": ""}, "snippet": " remove_graze_effect_scan(scan,graze_angle_threshold=math.radians(angle))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L544_C4", "label": "draw_hokuyo_scan()", "type": "expression", "loc": [544, 544], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L538_C0", "vector": [8, 1, 0.763, 0.0014, 1, 0.5, 0.5, 897, 3, 6, 0, 0, 0, 0, 3], "semantic": {"name": "draw_hokuyo_scan", "arg_names": [], "import_names": [], "rhs_call_name": "draw_hokuyo_scan", "annotation": ""}, "snippet": " draw_hokuyo_scan(srf,scan,math.radians(-90), math.radians(90),color=(200,0,0),reject_zero_ten=False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L545_C4", "label": "points_removed =", "type": "assigned_variable", "loc": [545, 545], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L538_C0", "vector": [14, 1, 0.7644, 0.0014, 1, 0.5, 0.625, 609, 6, 0, 0, 0, 0, 0, 2], "semantic": {"name": "points_removed", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " points_removed = np.where(np.matrix(scan.ranges)>10.)[0].shape[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L547_C4", "label": "set_text()", "type": "expression", "loc": [547, 547], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L538_C0", "vector": [8, 1, 0.7672, 0.0014, 1, 0.5, 0.75, 592, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_text", "arg_names": [], "import_names": [], "rhs_call_name": "set_text", "annotation": ""}, "snippet": " sl.set_text('angle: %.2f, points_removed: %d'%(angle, points_removed))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L548_C4", "label": "render()", "type": "expression", "loc": [548, 548], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L538_C0", "vector": [8, 1, 0.7686, 0.0014, 1, 0.5, 0.875, 24, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "render", "arg_names": [], "import_names": [], "rhs_call_name": "render", "annotation": ""}, "snippet": " sl.render(srf)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L549_C4", "label": "if", "type": "if", "loc": [549, 552], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L538_C0", "vector": [4, 1, 0.7721, 0.0056, 1, 0.5, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if sl.clicked:\n return True\n else:\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Return_L550_C8", "label": "return", "type": "return", "loc": [550, 550], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L549_C4", "vector": [13, 2, 0.7714, 0.0014, 2, 0.4, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Return_L552_C8", "label": "return", "type": "return", "loc": [552, 552], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L549_C4", "vector": [13, 2, 0.7742, 0.0014, 2, 0.4, 1.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L554_C0", "label": "test_find_handle_init", "type": "function", "loc": [554, 561], "level": 0, "parent": null, "vector": [2, 0, 0.7819, 0.0112, 0, 0.66, 0.9524, 71, 0, 0, 0, 0, 0, 0, 7], "semantic": {"name": "test_find_handle_init", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def test_find_handle_init():\n fr = np.matrix([1.28184669,0.05562259]).T\n bl = np.matrix([1.19585711,-0.06184923]).T\n max_dist = MAX_DIST\n x_fr, y_fr = coord(fr[0,0],fr[1,0],max_dist)\n x_bl, y_bl = coord(bl[0,0],bl[1,0],max_dist)\n pygame.draw.rect(srf,(200,0,200),pygame.Rect(x_bl,y_bl,x_fr-x_bl,y_fr-y_bl),1)\n cv_handle_template = create_handle_template(dict['scan'],dict['bk_lt'],dict['fr_rt'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L555_C4", "label": "fr =", "type": "assigned_variable", "loc": [555, 555], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L554_C0", "vector": [14, 1, 0.7784, 0.0014, 1, 0.43, 0.0, 6, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "fr", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " fr = np.matrix([1.28184669,0.05562259]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L556_C4", "label": "bl =", "type": "assigned_variable", "loc": [556, 556], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L554_C0", "vector": [14, 1, 0.7798, 0.0014, 1, 0.43, 0.1667, 560, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "bl", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " bl = np.matrix([1.19585711,-0.06184923]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L557_C4", "label": "max_dist =", "type": "assigned_variable", "loc": [557, 557], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L554_C0", "vector": [14, 1, 0.7812, 0.0014, 1, 0.43, 0.3333, 822, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "max_dist", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " max_dist = MAX_DIST"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L558_C4", "label": "x_fr, y_fr = coord()", "type": "assigned_variable", "loc": [558, 558], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L554_C0", "vector": [14, 1, 0.7826, 0.0014, 1, 0.43, 0.5, 993, 3, 3, 0, 0, 84, 10, 1], "semantic": {"name": "x_fr, y_fr", "arg_names": [], "import_names": [], "rhs_call_name": "coord", "annotation": ""}, "snippet": " x_fr, y_fr = coord(fr[0,0],fr[1,0],max_dist)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L559_C4", "label": "x_bl, y_bl = coord()", "type": "assigned_variable", "loc": [559, 559], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L554_C0", "vector": [14, 1, 0.784, 0.0014, 1, 0.43, 0.6667, 431, 3, 3, 0, 0, 84, 10, 1], "semantic": {"name": "x_bl, y_bl", "arg_names": [], "import_names": [], "rhs_call_name": "coord", "annotation": ""}, "snippet": " x_bl, y_bl = coord(bl[0,0],bl[1,0],max_dist)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L560_C4", "label": "rect()", "type": "expression", "loc": [560, 560], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L554_C0", "vector": [8, 1, 0.7854, 0.0014, 1, 0.43, 0.8333, 902, 3, 4, 0, 0, 0, 0, 2], "semantic": {"name": "rect", "arg_names": [], "import_names": [], "rhs_call_name": "rect", "annotation": ""}, "snippet": " pygame.draw.rect(srf,(200,0,200),pygame.Rect(x_bl,y_bl,x_fr-x_bl,y_fr-y_bl),1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L561_C4", "label": "cv_handle_template = create_handle_template()", "type": "assigned_variable", "loc": [561, 561], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L554_C0", "vector": [14, 1, 0.7868, 0.0014, 1, 0.43, 1.0, 616, 3, 3, 0, 0, 741, 10, 1], "semantic": {"name": "cv_handle_template", "arg_names": [], "import_names": [], "rhs_call_name": "create_handle_template", "annotation": ""}, "snippet": " cv_handle_template = create_handle_template(dict['scan'],dict['bk_lt'],dict['fr_rt'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L564_C0", "label": "test_find_lines", "type": "function", "loc": [564, 580], "level": 0, "parent": null, "vector": [2, 0, 0.8022, 0.0238, 0, 0.66, 0.9762, 493, 0, 0, 0, 0, 0, 0, 10], "semantic": {"name": "test_find_lines", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def test_find_lines():\n pts = get_xy_map(scan,math.radians(-60),math.radians(60))\n p_start_list,p_end_list = hough_lines(pts)\n if p_start_list == []:\n return\n\n #------- to test door finding ----------\n# p_start,p_end = find_door(p_start_list,p_end_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L565_C4", "label": "pts = get_xy_map()", "type": "assigned_variable", "loc": [565, 565], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L564_C0", "vector": [14, 1, 0.7924, 0.0014, 1, 0.56, 0.0, 195, 3, 3, 0, 0, 476, 10, 3], "semantic": {"name": "pts", "arg_names": [], "import_names": [], "rhs_call_name": "get_xy_map", "annotation": ""}, "snippet": " pts = get_xy_map(scan,math.radians(-60),math.radians(60))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L566_C4", "label": "p_start_list, p_end_list = hough_lines()", "type": "assigned_variable", "loc": [566, 566], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L564_C0", "vector": [14, 1, 0.7938, 0.0014, 1, 0.56, 0.25, 834, 3, 1, 0, 0, 239, 10, 1], "semantic": {"name": "p_start_list, p_end_list", "arg_names": [], "import_names": [], "rhs_call_name": "hough_lines", "annotation": ""}, "snippet": " p_start_list,p_end_list = hough_lines(pts)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L567_C4", "label": "if", "type": "if", "loc": [567, 568], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L564_C0", "vector": [4, 1, 0.7959, 0.0028, 1, 0.56, 0.5, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if p_start_list == []:\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Return_L568_C8", "label": "return", "type": "return", "loc": [568, 568], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L567_C4", "vector": [13, 2, 0.7966, 0.0014, 2, 0.13, 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_99581:Assign_L576_C4", "label": "n_colors = len()", "type": "assigned_variable", "loc": [576, 576], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L564_C0", "vector": [14, 1, 0.8079, 0.0014, 1, 0.56, 0.75, 109, 3, 1, 0, 0, 890, 10, 1], "semantic": {"name": "n_colors", "arg_names": [], "import_names": [], "rhs_call_name": "len", "annotation": ""}, "snippet": " n_colors = len(color_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L578_C4", "label": "for i", "type": "for", "loc": [578, 580], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L564_C0", "vector": [6, 1, 0.8121, 0.0042, 1, 0.56, 1.0, 826, 3, 0, 0, 0, 0, 0, 5], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i,(p1,p2) in enumerate(zip(p_start_list,p_end_list)):\n c1,c2 = coord(p1[0],p1[1], max_dist=MAX_DIST), coord(p2[0],p2[1], max_dist=MAX_DIST)\n pygame.draw.line(srf,color_list[i%n_colors],c1,c2,2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L579_C8", "label": "c1, c2 =", "type": "assigned_variable", "loc": [579, 579], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L578_C4", "vector": [14, 2, 0.8121, 0.0014, 2, 0.93, 0.0, 680, 0, 0, 0, 0, 0, 8, 2], "semantic": {"name": "c1, c2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " c1,c2 = coord(p1[0],p1[1], max_dist=MAX_DIST), coord(p2[0],p2[1], max_dist=MAX_DIST)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L580_C8", "label": "line()", "type": "expression", "loc": [580, 580], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L578_C4", "vector": [8, 2, 0.8135, 0.0014, 2, 0.93, 1.0, 373, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "line", "arg_names": [], "import_names": [], "rhs_call_name": "line", "annotation": ""}, "snippet": " pygame.draw.line(srf,color_list[i%n_colors],c1,c2,2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L583_C0", "label": "if", "type": "if", "loc": [583, 708], "level": 0, "parent": null, "vector": [4, 0, 0.9053, 0.1767, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 42], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n\n p = optparse.OptionParser()\n p.add_option('-t', action='store', type='string', dest='hokuyo_type',\n help='hokuyo_type. urg or utm')\n p.add_option('-a', action='store', type='int', dest='avg',\n help='number of scans to average', default=1)\n p.add_option('-n', action='store', type='int', dest='hokuyo_number',"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L585_C4", "label": "p = OptionParser()", "type": "assigned_variable", "loc": [585, 585], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L583_C0", "vector": [14, 1, 0.8205, 0.0014, 1, 0.97, 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_99581:Expr_L586_C4", "label": "add_option()", "type": "expression", "loc": [586, 587], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L583_C0", "vector": [8, 1, 0.8226, 0.0028, 1, 0.97, 0.037, 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', action='store', type='string', dest='hokuyo_type',\n help='hokuyo_type. urg or utm')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L588_C4", "label": "add_option()", "type": "expression", "loc": [588, 589], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L583_C0", "vector": [8, 1, 0.8254, 0.0028, 1, 0.97, 0.0741, 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', action='store', type='int', dest='avg',\n help='number of scans to average', default=1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L590_C4", "label": "add_option()", "type": "expression", "loc": [590, 591], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L583_C0", "vector": [8, 1, 0.8282, 0.0028, 1, 0.97, 0.1111, 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('-n', action='store', type='int', dest='hokuyo_number',\n help='hokuyo number. 0,1,2 ...')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L592_C4", "label": "add_option()", "type": "expression", "loc": [592, 593], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L583_C0", "vector": [8, 1, 0.831, 0.0028, 1, 0.97, 0.1481, 176, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "add_option", "arg_names": [], "import_names": [], "rhs_call_name": "add_option", "annotation": ""}, "snippet": " p.add_option('-f', action='store_true', dest='flip',\n help='flip the hokuyo scan')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L594_C4", "label": "add_option()", "type": "expression", "loc": [594, 596], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L583_C0", "vector": [8, 1, 0.8345, 0.0042, 1, 0.97, 0.1852, 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('--ang_range', type='float', dest='ang_range',\n help='max angle of the ray to display (degrees)',\n default=360.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L598_C4", "label": "opt, args = parse_args()", "type": "assigned_variable", "loc": [598, 598], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L583_C0", "vector": [14, 1, 0.8387, 0.0014, 1, 0.97, 0.2222, 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_99581:Assign_L599_C4", "label": "hokuyo_type =", "type": "assigned_variable", "loc": [599, 599], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L583_C0", "vector": [14, 1, 0.8401, 0.0014, 1, 0.97, 0.2593, 119, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "hokuyo_type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " hokuyo_type = opt.hokuyo_type"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L600_C4", "label": "hokuyo_number =", "type": "assigned_variable", "loc": [600, 600], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L583_C0", "vector": [14, 1, 0.8415, 0.0014, 1, 0.97, 0.2963, 128, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "hokuyo_number", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " hokuyo_number = opt.hokuyo_number"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L601_C4", "label": "avg_number =", "type": "assigned_variable", "loc": [601, 601], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L583_C0", "vector": [14, 1, 0.8429, 0.0014, 1, 0.97, 0.3333, 556, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "avg_number", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " avg_number = opt.avg"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L602_C4", "label": "flip =", "type": "assigned_variable", "loc": [602, 602], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L583_C0", "vector": [14, 1, 0.8443, 0.0014, 1, 0.97, 0.3704, 677, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "flip", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " flip = opt.flip"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L603_C4", "label": "ang_range =", "type": "assigned_variable", "loc": [603, 603], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L583_C0", "vector": [14, 1, 0.8457, 0.0014, 1, 0.97, 0.4074, 459, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ang_range", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ang_range = opt.ang_range"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L604_C4", "label": "ang_range = radians()", "type": "assigned_variable", "loc": [604, 604], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L583_C0", "vector": [14, 1, 0.8471, 0.0014, 1, 0.97, 0.4444, 459, 3, 1, 0, 0, 383, 10, 1], "semantic": {"name": "ang_range", "arg_names": [], "import_names": [], "rhs_call_name": "radians", "annotation": ""}, "snippet": " ang_range = math.radians(ang_range)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L607_C4", "label": "test_graze_effect_flag =", "type": "assigned_variable", "loc": [607, 607], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L583_C0", "vector": [14, 1, 0.8513, 0.0014, 1, 0.97, 0.4815, 70, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "test_graze_effect_flag", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " test_graze_effect_flag = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L608_C4", "label": "test_find_objects_flag =", "type": "assigned_variable", "loc": [608, 608], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L583_C0", "vector": [14, 1, 0.8527, 0.0014, 1, 0.97, 0.5185, 702, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "test_find_objects_flag", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " test_find_objects_flag = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L609_C4", "label": "test_find_closest_object_point_flag =", "type": "assigned_variable", "loc": [609, 609], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L583_C0", "vector": [14, 1, 0.8541, 0.0014, 1, 0.97, 0.5556, 377, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "test_find_closest_object_point_flag", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " test_find_closest_object_point_flag = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L610_C4", "label": "test_show_change_flag =", "type": "assigned_variable", "loc": [610, 610], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L583_C0", "vector": [14, 1, 0.8555, 0.0014, 1, 0.97, 0.5926, 987, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "test_show_change_flag", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " test_show_change_flag = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L611_C4", "label": "test_find_lines_flag =", "type": "assigned_variable", "loc": [611, 611], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L583_C0", "vector": [14, 1, 0.8569, 0.0014, 1, 0.97, 0.6296, 101, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "test_find_lines_flag", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " test_find_lines_flag = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L617_C4", "label": "srf = set_mode()", "type": "assigned_variable", "loc": [617, 617], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L583_C0", "vector": [14, 1, 0.8654, 0.0014, 1, 0.97, 0.6667, 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((640,480))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L618_C4", "label": "set_caption()", "type": "expression", "loc": [618, 618], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L583_C0", "vector": [8, 1, 0.8668, 0.0014, 1, 0.97, 0.7037, 763, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "set_caption", "arg_names": [], "import_names": [], "rhs_call_name": "set_caption", "annotation": ""}, "snippet": " pygame.display.set_caption(hokuyo_type+' '+str(hokuyo_number))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L620_C4", "label": "fps =", "type": "assigned_variable", "loc": [620, 620], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L583_C0", "vector": [14, 1, 0.8696, 0.0014, 1, 0.97, 0.7407, 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_99581:Assign_L621_C4", "label": "loopFlag =", "type": "assigned_variable", "loc": [621, 621], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L583_C0", "vector": [14, 1, 0.871, 0.0014, 1, 0.97, 0.7778, 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_99581:Assign_L622_C4", "label": "clk = Clock()", "type": "assigned_variable", "loc": [622, 622], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L583_C0", "vector": [14, 1, 0.8724, 0.0014, 1, 0.97, 0.8148, 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_99581:If_L625_C4", "label": "if", "type": "if", "loc": [625, 633], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L583_C0", "vector": [4, 1, 0.8822, 0.0126, 1, 0.97, 0.8519, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if hokuyo_type == 'utm':\n h = hs.Hokuyo('utm',hokuyo_number,start_angle=-ang_range,\n end_angle=ang_range,flip=flip)\n elif hokuyo_type == 'urg':\n h = hs.Hokuyo('urg',hokuyo_number,flip=flip)\n else:\n print('unknown hokuyo type: ', hokuyo_type)\n print('Exiting...')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L626_C8", "label": "h = Hokuyo()", "type": "assigned_variable", "loc": [626, 627], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L625_C4", "vector": [14, 2, 0.8787, 0.0028, 2, 0.31, 0.0, 686, 3, 5, 0, 0, 66, 10, 1], "semantic": {"name": "h", "arg_names": [], "import_names": [], "rhs_call_name": "Hokuyo", "annotation": ""}, "snippet": " h = hs.Hokuyo('utm',hokuyo_number,start_angle=-ang_range,\n end_angle=ang_range,flip=flip)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L628_C4", "label": "if", "type": "if", "loc": [628, 633], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L625_C4", "vector": [4, 2, 0.8843, 0.0084, 2, 0.31, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif hokuyo_type == 'urg':\n h = hs.Hokuyo('urg',hokuyo_number,flip=flip)\n else:\n print('unknown hokuyo type: ', hokuyo_type)\n print('Exiting...')\n sys.exit()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L629_C8", "label": "h = Hokuyo()", "type": "assigned_variable", "loc": [629, 629], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L628_C4", "vector": [14, 3, 0.8822, 0.0014, 3, 0.51, 0.0, 686, 3, 3, 0, 0, 66, 10, 1], "semantic": {"name": "h", "arg_names": [], "import_names": [], "rhs_call_name": "Hokuyo", "annotation": ""}, "snippet": " h = hs.Hokuyo('urg',hokuyo_number,flip=flip)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L631_C8", "label": "print()", "type": "expression", "loc": [631, 631], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L628_C4", "vector": [8, 3, 0.885, 0.0014, 3, 0.51, 0.3333, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('unknown hokuyo type: ', hokuyo_type)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L632_C8", "label": "print()", "type": "expression", "loc": [632, 632], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L628_C4", "vector": [8, 3, 0.8864, 0.0014, 3, 0.51, 0.6667, 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_99581:Expr_L633_C8", "label": "exit()", "type": "expression", "loc": [633, 633], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L628_C4", "vector": [8, 3, 0.8878, 0.0014, 3, 0.51, 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_99581:If_L639_C4", "label": "if", "type": "if", "loc": [639, 640], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L583_C0", "vector": [4, 1, 0.8969, 0.0028, 1, 0.97, 0.8889, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if test_graze_effect_flag:\n sl = tune_graze_effect_init()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L640_C8", "label": "sl = tune_graze_effect_init()", "type": "assigned_variable", "loc": [640, 640], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L639_C4", "vector": [14, 2, 0.8976, 0.0014, 2, 0.05, 0.0, 555, 3, 0, 0, 0, 894, 10, 1], "semantic": {"name": "sl", "arg_names": [], "import_names": [], "rhs_call_name": "tune_graze_effect_init", "annotation": ""}, "snippet": " sl = tune_graze_effect_init()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L643_C4", "label": "if", "type": "if", "loc": [643, 645], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L583_C0", "vector": [4, 1, 0.9032, 0.0042, 1, 0.97, 0.9259, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if test_show_change_flag:\n scan_prev = h.get_scan(avoid_duplicate=True, avg=avg_number, remove_graze=False)\n n_ch_pts_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L644_C8", "label": "scan_prev = get_scan()", "type": "assigned_variable", "loc": [644, 644], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L643_C4", "vector": [14, 2, 0.9032, 0.0014, 2, 0.09, 0.0, 807, 3, 3, 0, 0, 630, 10, 1], "semantic": {"name": "scan_prev", "arg_names": [], "import_names": [], "rhs_call_name": "get_scan", "annotation": ""}, "snippet": " scan_prev = h.get_scan(avoid_duplicate=True, avg=avg_number, remove_graze=False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L645_C8", "label": "n_ch_pts_list =", "type": "assigned_variable", "loc": [645, 645], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L643_C4", "vector": [14, 2, 0.9046, 0.0014, 2, 0.09, 1.0, 247, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "n_ch_pts_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " n_ch_pts_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:While_L646_C4", "label": "while", "type": "while", "loc": [646, 706], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L583_C0", "vector": [5, 1, 0.9481, 0.0856, 1, 0.97, 0.963, 0, 2, 0, 0, 0, 0, 0, 21], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while loopFlag:\n\n widget_clicked = False\n\n # Clear the screen\n srf.fill((255,255,255))\n\n # Draw the urg"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L648_C8", "label": "widget_clicked =", "type": "assigned_variable", "loc": [648, 648], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:While_L646_C4", "vector": [14, 2, 0.9088, 0.0014, 2, 0.92, 0.0, 640, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "widget_clicked", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " widget_clicked = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L651_C8", "label": "fill()", "type": "expression", "loc": [651, 651], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:While_L646_C4", "vector": [8, 2, 0.913, 0.0014, 2, 0.92, 0.0833, 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_99581:Expr_L654_C8", "label": "circle()", "type": "expression", "loc": [654, 654], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:While_L646_C4", "vector": [8, 2, 0.9173, 0.0014, 2, 0.92, 0.1667, 341, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "circle", "arg_names": [], "import_names": [], "rhs_call_name": "circle", "annotation": ""}, "snippet": " pygame.draw.circle(srf, (200,0,0), (org_x,org_y), 10, 0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L657_C8", "label": "if", "type": "if", "loc": [657, 661], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:While_L646_C4", "vector": [4, 2, 0.9243, 0.007, 2, 0.92, 0.25, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if test_graze_effect_flag or test_show_change_flag:\n # here we don't want any filtering on the scan.\n scan = h.get_scan(avoid_duplicate=True, avg=avg_number, remove_graze=False)\n else:\n scan = h.get_scan(avoid_duplicate=True, avg=avg_number, remove_graze=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L659_C12", "label": "scan = get_scan()", "type": "assigned_variable", "loc": [659, 659], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L657_C8", "vector": [14, 3, 0.9243, 0.0014, 3, 0.62, 0.0, 202, 3, 3, 0, 0, 630, 10, 1], "semantic": {"name": "scan", "arg_names": [], "import_names": [], "rhs_call_name": "get_scan", "annotation": ""}, "snippet": " scan = h.get_scan(avoid_duplicate=True, avg=avg_number, remove_graze=False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L661_C12", "label": "scan = get_scan()", "type": "assigned_variable", "loc": [661, 661], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L657_C8", "vector": [14, 3, 0.9271, 0.0014, 3, 0.62, 1.0, 202, 3, 3, 0, 0, 630, 10, 1], "semantic": {"name": "scan", "arg_names": [], "import_names": [], "rhs_call_name": "get_scan", "annotation": ""}, "snippet": " scan = h.get_scan(avoid_duplicate=True, avg=avg_number, remove_graze=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L663_C8", "label": "if", "type": "if", "loc": [663, 673], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:While_L646_C4", "vector": [4, 2, 0.9369, 0.0154, 2, 0.92, 0.3333, 0, 0, 0, 0, 0, 0, 0, 9], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if test_show_change_flag == False:\n #draw_hokuyo_scan(srf,scan,math.radians(-70), math.radians(70),color=(0,0,200))\n #draw_hokuyo_scan(srf,scan,math.radians(-90), math.radians(90),color=(0,0,200))\n draw_hokuyo_scan(srf,scan,math.radians(-135),math.radians(135),color=(0,0,200))\n else:\n diff_scan = subtract_scans(scan,scan_prev)\n scan_prev = scan\n pts = get_xy_map(diff_scan,math.radians(-40), math.radians(40),reject_zero_ten=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L666_C12", "label": "draw_hokuyo_scan()", "type": "expression", "loc": [666, 666], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L663_C8", "vector": [8, 3, 0.9341, 0.0014, 3, 0.1, 0.0, 897, 3, 5, 0, 0, 0, 0, 3], "semantic": {"name": "draw_hokuyo_scan", "arg_names": [], "import_names": [], "rhs_call_name": "draw_hokuyo_scan", "annotation": ""}, "snippet": " draw_hokuyo_scan(srf,scan,math.radians(-135),math.radians(135),color=(0,0,200))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L668_C12", "label": "diff_scan = subtract_scans()", "type": "assigned_variable", "loc": [668, 668], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L663_C8", "vector": [14, 3, 0.9369, 0.0014, 3, 0.1, 0.1667, 671, 3, 2, 0, 0, 993, 10, 1], "semantic": {"name": "diff_scan", "arg_names": [], "import_names": [], "rhs_call_name": "subtract_scans", "annotation": ""}, "snippet": " diff_scan = subtract_scans(scan,scan_prev)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L669_C12", "label": "scan_prev =", "type": "assigned_variable", "loc": [669, 669], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L663_C8", "vector": [14, 3, 0.9383, 0.0014, 3, 0.1, 0.3333, 807, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "scan_prev", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " scan_prev = scan"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L670_C12", "label": "pts = get_xy_map()", "type": "assigned_variable", "loc": [670, 670], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L663_C8", "vector": [14, 3, 0.9397, 0.0014, 3, 0.1, 0.5, 195, 3, 4, 0, 0, 476, 10, 3], "semantic": {"name": "pts", "arg_names": [], "import_names": [], "rhs_call_name": "get_xy_map", "annotation": ""}, "snippet": " pts = get_xy_map(diff_scan,math.radians(-40), math.radians(40),reject_zero_ten=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L671_C12", "label": "append()", "type": "expression", "loc": [671, 671], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L663_C8", "vector": [8, 3, 0.9411, 0.0014, 3, 0.1, 0.6667, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " n_ch_pts_list.append(pts.shape[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L672_C12", "label": "max_dist =", "type": "assigned_variable", "loc": [672, 672], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L663_C8", "vector": [14, 3, 0.9425, 0.0014, 3, 0.1, 0.8333, 822, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "max_dist", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " max_dist = MAX_DIST"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L673_C12", "label": "draw_points()", "type": "expression", "loc": [673, 673], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L663_C8", "vector": [8, 3, 0.9439, 0.0014, 3, 0.1, 1.0, 154, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "draw_points", "arg_names": [], "import_names": [], "rhs_call_name": "draw_points", "annotation": ""}, "snippet": " draw_points(srf,pts[0,:],pts[1,:],color=(0,200,0),max_dist=max_dist)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L676_C8", "label": "if", "type": "if", "loc": [676, 677], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:While_L646_C4", "vector": [4, 2, 0.9488, 0.0028, 2, 0.92, 0.4167, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if test_find_objects_flag:\n test_find_objects(srf, scan)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L677_C12", "label": "test_find_objects()", "type": "expression", "loc": [677, 677], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L676_C8", "vector": [8, 3, 0.9495, 0.0014, 3, 0.09, 0.0, 466, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "test_find_objects", "arg_names": [], "import_names": [], "rhs_call_name": "test_find_objects", "annotation": ""}, "snippet": " test_find_objects(srf, scan)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L678_C8", "label": "if", "type": "if", "loc": [678, 679], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:While_L646_C4", "vector": [4, 2, 0.9516, 0.0028, 2, 0.92, 0.5, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if test_find_closest_object_point_flag:\n test_find_closest_object_point(srf, scan)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L679_C12", "label": "test_find_closest_object_point()", "type": "expression", "loc": [679, 679], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L678_C8", "vector": [8, 3, 0.9523, 0.0014, 3, 0.05, 0.0, 996, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "test_find_closest_object_point", "arg_names": [], "import_names": [], "rhs_call_name": "test_find_closest_object_point", "annotation": ""}, "snippet": " test_find_closest_object_point(srf, scan)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L680_C8", "label": "if", "type": "if", "loc": [680, 681], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:While_L646_C4", "vector": [4, 2, 0.9544, 0.0028, 2, 0.92, 0.5833, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if test_graze_effect_flag:\n widget_clicked |= tune_graze_effect_update(sl,srf, scan)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L682_C8", "label": "if", "type": "if", "loc": [682, 683], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:While_L646_C4", "vector": [4, 2, 0.9572, 0.0028, 2, 0.92, 0.6667, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if test_find_lines_flag:\n test_find_lines()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L683_C12", "label": "test_find_lines()", "type": "expression", "loc": [683, 683], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L682_C8", "vector": [8, 3, 0.9579, 0.0014, 3, 0.26, 0.0, 493, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "test_find_lines", "arg_names": [], "import_names": [], "rhs_call_name": "test_find_lines", "annotation": ""}, "snippet": " test_find_lines()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L685_C8", "label": "flip()", "type": "expression", "loc": [685, 685], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:While_L646_C4", "vector": [8, 2, 0.9607, 0.0014, 2, 0.92, 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_99581:Assign_L687_C8", "label": "events = get()", "type": "assigned_variable", "loc": [687, 687], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:While_L646_C4", "vector": [14, 2, 0.9635, 0.0014, 2, 0.92, 0.8333, 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_99581:For_L688_C8", "label": "for e", "type": "for", "loc": [688, 703], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:While_L646_C4", "vector": [6, 2, 0.9755, 0.0224, 2, 0.92, 0.9167, 175, 2, 0, 0, 0, 0, 0, 1], "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 widget_clicked == False:\n if e.type==pygame.locals.MOUSEMOTION:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L689_C12", "label": "if", "type": "if", "loc": [689, 690], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L688_C8", "vector": [4, 3, 0.967, 0.0028, 3, 0.14, 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_99581:Assign_L690_C16", "label": "loopFlag =", "type": "assigned_variable", "loc": [690, 690], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L689_C12", "vector": [14, 4, 0.9677, 0.0014, 4, 0.44, 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_99581:If_L691_C12", "label": "if", "type": "if", "loc": [691, 693], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L688_C8", "vector": [4, 3, 0.9705, 0.0042, 3, 0.14, 0.5, 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_99581:If_L692_C16", "label": "if", "type": "if", "loc": [692, 693], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L691_C12", "vector": [4, 4, 0.9712, 0.0028, 4, 0.68, 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_99581:Assign_L693_C20", "label": "loopFlag =", "type": "assigned_variable", "loc": [693, 693], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L692_C16", "vector": [14, 5, 0.9719, 0.0014, 5, 0.92, 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_99581:If_L694_C12", "label": "if", "type": "if", "loc": [694, 703], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L688_C8", "vector": [4, 3, 0.9797, 0.014, 3, 0.14, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if widget_clicked == False:\n if e.type==pygame.locals.MOUSEMOTION:\n if e.buttons[0] == 1:\n # left button\n org_x += e.rel[0]\n org_y += e.rel[1]\n if e.buttons[2] == 1:\n # right button"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L695_C16", "label": "if", "type": "if", "loc": [695, 703], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L694_C12", "vector": [4, 4, 0.9804, 0.0126, 4, 0.81, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if e.type==pygame.locals.MOUSEMOTION:\n if e.buttons[0] == 1:\n # left button\n org_x += e.rel[0]\n org_y += e.rel[1]\n if e.buttons[2] == 1:\n # right button\n MAX_DIST *= (1+e.rel[1]*0.01)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L696_C20", "label": "if", "type": "if", "loc": [696, 699], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L695_C16", "vector": [4, 5, 0.9783, 0.0056, 5, 0.03, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if e.buttons[0] == 1:\n # left button\n org_x += e.rel[0]\n org_y += e.rel[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L700_C20", "label": "if", "type": "if", "loc": [700, 703], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L695_C16", "vector": [4, 5, 0.9839, 0.0056, 5, 0.03, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if e.buttons[2] == 1:\n # right button\n MAX_DIST *= (1+e.rel[1]*0.01)\n MAX_DIST = max(MAX_DIST,0.1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L703_C24", "label": "MAX_DIST = max()", "type": "assigned_variable", "loc": [703, 703], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L700_C20", "vector": [14, 6, 0.986, 0.0014, 6, 0.42, 0.0, 507, 3, 2, 0, 0, 442, 10, 1], "semantic": {"name": "MAX_DIST", "arg_names": [], "import_names": [], "rhs_call_name": "max", "annotation": ""}, "snippet": " MAX_DIST = max(MAX_DIST,0.1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L706_C8", "label": "tick()", "type": "expression", "loc": [706, 706], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:While_L646_C4", "vector": [8, 2, 0.9902, 0.0014, 2, 0.92, 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_99581:If_L707_C4", "label": "if", "type": "if", "loc": [707, 708], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L583_C0", "vector": [4, 1, 0.9923, 0.0028, 1, 0.97, 1.0, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if test_show_change_flag:\n ut.save_pickle(n_ch_pts_list,ut.formatted_time()+'_ch_pts_list.pkl')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L708_C8", "label": "save_pickle()", "type": "expression", "loc": [708, 708], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L707_C4", "vector": [8, 2, 0.993, 0.0014, 2, 0.97, 0.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(n_ch_pts_list,ut.formatted_time()+'_ch_pts_list.pkl')"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L70_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L71_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L70_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Return_L73_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L75_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L76_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L75_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Return_L78_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L80_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L81_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L80_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L88_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L80_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L89_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L80_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L91_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L91_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L100_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L80_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L109_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L80_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L112_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L80_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L113_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L80_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L115_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L115_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L116_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L80_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L118_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L80_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L120_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L80_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L121_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L80_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L123_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L123_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L124_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L123_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L125_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L123_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Return_L126_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L123_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Return_L128_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L131_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L132_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L131_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L138_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L131_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L139_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L131_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L140_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L131_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L141_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L131_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L142_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L131_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L143_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L131_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L145_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L131_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L146_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L131_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L148_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L131_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L149_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L131_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L150_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L150_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L151_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L150_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L152_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L131_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Return_L154_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L156_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L158_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L156_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L170_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L156_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L171_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L156_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L172_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L156_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L173_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L156_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L174_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L174_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L175_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L174_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L176_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L174_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L177_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L174_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L178_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L174_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L180_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L174_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L182_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L174_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L184_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L174_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L185_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L156_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L187_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L187_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Return_L188_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L187_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Return_L190_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L192_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L194_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L192_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L198_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L192_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L201_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L201_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Return_L202_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L192_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L204_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L192_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L205_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L205_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L206_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L192_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L208_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L192_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Return_L209_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L211_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L212_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L211_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L216_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L211_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L217_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L211_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L218_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L211_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L219_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L211_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L220_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L211_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L221_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L211_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L222_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L211_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L224_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L211_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L225_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L211_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L226_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L211_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L227_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L211_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L229_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L211_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L230_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L232_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L233_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L232_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L235_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L237_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L238_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L238_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L239_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L238_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L240_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L238_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L241_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L238_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L242_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L237_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L244_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L237_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L245_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L237_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L249_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L237_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L252_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L237_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L253_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L237_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Return_L254_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L256_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L257_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L256_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L261_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L261_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Return_L262_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L256_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L264_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L256_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L265_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L256_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L266_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L256_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L267_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L256_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L269_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L256_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L276_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L276_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Return_L277_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L256_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L278_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L256_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L279_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L256_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L281_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L281_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L282_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L281_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L283_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L281_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L284_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L281_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L285_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L281_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Return_L286_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L281_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L288_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L281_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L289_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L281_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L290_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L281_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L291_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L281_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L292_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L281_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L293_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L281_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L294_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L281_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L295_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L281_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L296_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L281_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L297_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L281_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L303_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L281_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L304_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L304_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Return_L305_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L281_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L307_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L281_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L308_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L281_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L311_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L281_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L312_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L281_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L313_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L281_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L314_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L281_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L315_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L281_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L316_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L281_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L317_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L281_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L318_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L281_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L320_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L281_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Return_L321_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L323_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L324_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L323_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L328_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L323_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L329_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L323_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L330_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L323_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L331_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L323_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L332_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L323_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L334_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L323_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L335_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L323_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L336_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L323_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L337_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L323_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L339_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L339_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L340_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L339_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L342_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L339_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L343_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L339_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L344_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L339_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L345_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L339_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L346_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L339_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L347_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L323_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Return_L349_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L351_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L352_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L351_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L353_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L351_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Return_L354_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L356_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L357_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L356_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L362_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L356_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L363_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L356_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L365_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L356_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L371_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L356_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L372_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L356_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L373_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L356_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L374_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L356_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L375_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L356_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L376_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L356_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L377_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L356_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L378_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L356_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L382_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L356_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L384_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L384_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Return_L385_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L356_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L386_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L356_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L387_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L356_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L389_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L389_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L390_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L389_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L391_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L356_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L393_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L356_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L394_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L394_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L395_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L394_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L396_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L394_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L397_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L394_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L398_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L356_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L400_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L400_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L401_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L400_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L402_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L356_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L404_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L356_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L405_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L356_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L407_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L356_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L408_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L356_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L409_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L356_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L411_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L356_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L412_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L356_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L414_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L414_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L415_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L414_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L416_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L416_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L417_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L414_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L418_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L418_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L419_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L414_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L421_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L414_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L422_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L414_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L423_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L414_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L424_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L414_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L425_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L414_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L426_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L414_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L427_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L414_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L428_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L414_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L429_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L414_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L430_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L414_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L432_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L414_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L435_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L414_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L436_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L414_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L439_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L414_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L440_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L440_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L441_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L440_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L442_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L356_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L444_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L444_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Return_L445_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L356_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L447_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L356_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L448_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L356_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L450_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L356_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L452_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L452_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L453_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L452_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L454_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L454_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L455_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L454_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L456_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L454_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L457_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L452_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L459_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L356_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Return_L462_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L466_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L467_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L466_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Return_L471_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L474_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L475_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L474_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Return_L479_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L481_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L482_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L481_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L484_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L484_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Return_L485_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L481_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L486_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L481_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L487_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L487_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L488_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L490_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L491_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L490_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L494_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L490_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L496_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L490_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L497_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L500_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L502_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L500_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L503_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L500_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L505_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L505_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L506_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L505_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L507_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L505_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L508_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L510_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L511_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L510_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L514_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L510_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L516_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L516_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L517_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L516_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L519_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L516_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L520_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L516_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L521_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L523_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L524_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L523_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L526_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L523_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L527_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L527_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Return_L528_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L523_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L529_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L523_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L530_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L523_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L531_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L523_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L532_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L534_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L535_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L534_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Return_L536_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L538_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L539_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L538_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L540_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L538_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L541_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L538_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L543_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L538_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L544_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L538_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L545_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L538_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L547_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L538_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L548_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L538_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L549_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L549_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Return_L550_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L549_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Return_L552_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L554_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L555_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L554_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L556_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L554_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L557_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L554_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L558_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L554_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L559_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L554_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L560_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L554_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L561_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L564_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L565_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L564_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L566_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L564_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L567_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L567_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Return_L568_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L564_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L576_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:FunctionDef_L564_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L578_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L578_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L579_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L578_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L580_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L583_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L585_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L583_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L586_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L583_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L588_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L583_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L590_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L583_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L592_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L583_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L594_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L583_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L598_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L583_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L599_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L583_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L600_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L583_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L601_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L583_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L602_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L583_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L603_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L583_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L604_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L583_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L607_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L583_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L608_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L583_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L609_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L583_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L610_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L583_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L611_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L583_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L617_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L583_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L618_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L583_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L620_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L583_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L621_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L583_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L622_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L583_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L625_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L625_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L626_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L625_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L628_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L628_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L629_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L628_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L631_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L628_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L632_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L628_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L633_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L583_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L639_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L639_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L640_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L583_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L643_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L643_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L644_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L643_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L645_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L583_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:While_L646_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:While_L646_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L648_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:While_L646_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L651_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:While_L646_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L654_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:While_L646_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L657_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L657_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L659_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L657_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L661_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:While_L646_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L663_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L663_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L666_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L663_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L668_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L663_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L669_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L663_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L670_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L663_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L671_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L663_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L672_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L663_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L673_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:While_L646_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L676_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L676_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L677_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:While_L646_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L678_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L678_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L679_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:While_L646_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L680_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:While_L646_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L682_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L682_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L683_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:While_L646_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L685_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:While_L646_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L687_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:While_L646_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L688_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L688_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L689_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L689_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L690_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L688_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L691_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L691_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L692_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L692_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L693_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:For_L688_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L694_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L694_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L695_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L695_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L696_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L695_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L700_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L700_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Assign_L703_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:While_L646_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L706_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L583_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L707_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99581:If_L707_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99581:Expr_L708_C8"}]
# # Copyright (c) 2009, Georgia Tech Research Corporation # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # * Neither the name of the Georgia Tech Research Corporation nor the # names of its contributors may be used to endorse or promote products # derived from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY GEORGIA TECH RESEARCH CORPORATION ''AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL GEORGIA TECH BE LIABLE FOR ANY DIRECT, INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # \author Advait Jain (Healthcare Robotics Lab, Georgia Tech.) import math, numpy as np import sys, time NAME = 'utm_python_listener' import roslib; roslib.load_manifest('hrl_hokuyo') import rospy from sensor_msgs.msg import LaserScan from threading import RLock import hokuyo_processing as hp import copy import numpy as np class HokuyoScan(): ''' This class has the data of a laser scan. ''' def __init__(self,hokuyo_type,angular_res,max_range,min_range,start_angle,end_angle): ''' hokuyo_type - 'urg', 'utm' angular_res - angle (radians) between consecutive points in the scan. min_range, max_range - in meters ranges,angles,intensities - 1xn_points numpy matrix. ''' self.hokuyo_type = hokuyo_type self.angular_res = angular_res self.max_range = max_range self.min_range = min_range self.start_angle = start_angle self.end_angle = end_angle self.n_points = int((end_angle-start_angle)/angular_res)+1 self.ranges = None self.intensities = None self.angles = [] for i in xrange(self.n_points): self.angles.append(hp.index_to_angle(self,i)) self.angles = np.matrix(self.angles) class Urg(): ''' get a scan from urg using player. ''' def __init__(self, urg_number,start_angle=None,end_angle=None, host='localhost', port=6665): ''' host, port - hostname and port of the player server ''' import player_functions as pf import playerc as pl self.player_client = pf.player_connect(host,port) self.laser = pl.playerc_laser(self.player_client, urg_number) if self.laser.subscribe(pl.PLAYERC_OPEN_MODE) != 0: raise RuntimeError("hokuyo_scan.Urg.__init__: Unable to connect to urg!\n") for i in range(10): self.player_client.read() start_angle_fullscan = -math.radians(654./2*0.36) end_angle_fullscan = math.radians(654./2*0.36) if start_angle == None or start_angle<start_angle_fullscan: start_angle_subscan = start_angle_fullscan else: start_angle_subscan = start_angle if end_angle == None or end_angle>end_angle_fullscan: end_angle_subscan = end_angle_fullscan else: end_angle_subscan = end_angle ang_res = math.radians(0.36) self.start_index_fullscan=(start_angle_subscan-start_angle_fullscan)/ang_res self.end_index_fullscan=(end_angle_subscan-start_angle_fullscan)/ang_res self.hokuyo_scan = HokuyoScan(hokuyo_type = 'urg', angular_res = math.radians(0.36), max_range = 4.0, min_range = 0.2, start_angle=start_angle_subscan, end_angle=end_angle_subscan) def get_scan(self, avoid_duplicate=False): ''' avoid_duplicate - avoids duplicates caused by querying player faster than it can get new scans. ''' curr_ranges = self.hokuyo_scan.ranges for i in range(10): # I get a new scan by the time i=4 if self.player_client.read() == None: raise RuntimeError('hokuyo_scan.Urg.get_scan: player_client.read() returned None.\n') sub_ranges = np.matrix(self.laser.ranges[self.start_index_fullscan:self.end_index_fullscan+1]) if avoid_duplicate == False or np.any(curr_ranges != sub_ranges): # got a fresh scan from player. break self.hokuyo_scan.ranges = sub_ranges return copy.copy(self.hokuyo_scan) class Utm(): ''' get a scan from a UTM using ROS ''' def __init__(self, utm_number,start_angle=None,end_angle=None,ros_init_node=True): hokuyo_node_name = '/utm%d'%utm_number # max_ang = rospy.get_param(hokuyo_node_name+'/max_ang') # min_ang = rospy.get_param(hokuyo_node_name+'/min_ang') # start_angle_fullscan = min_ang # end_angle_fullscan = max_ang # print 'max_angle:', math.degrees(max_ang) # print 'min_angle:', math.degrees(min_ang) max_ang_degrees = rospy.get_param(hokuyo_node_name+'/max_ang_degrees') min_ang_degrees = rospy.get_param(hokuyo_node_name+'/min_ang_degrees') start_angle_fullscan = math.radians(min_ang_degrees) end_angle_fullscan = math.radians(max_ang_degrees) # This is actually determined by the ROS node params and not the UTM. # start_angle_fullscan = -math.radians(1080./2*0.25) #270deg # end_angle_fullscan = math.radians(1080./2*0.25) # start_angle_fullscan = -math.radians(720./2*0.25) #180deg # end_angle_fullscan = math.radians(720./2*0.25) # start_angle_fullscan = -math.radians(559./2*0.25) #140deg # end_angle_fullscan = math.radians(559./2*0.25) if start_angle == None or start_angle<start_angle_fullscan: start_angle_subscan = start_angle_fullscan else: start_angle_subscan = start_angle if end_angle == None or end_angle>end_angle_fullscan: end_angle_subscan = end_angle_fullscan else: end_angle_subscan = end_angle ang_res = math.radians(0.25) self.start_index_fullscan=int(round((start_angle_subscan-start_angle_fullscan)/ang_res)) self.end_index_fullscan=int(round((end_angle_subscan-start_angle_fullscan)/ang_res)) self.hokuyo_scan = HokuyoScan(hokuyo_type = 'utm', angular_res = math.radians(0.25), max_range = 10.0, min_range = 0.1, start_angle=start_angle_subscan, end_angle=end_angle_subscan) self.lock = RLock() self.lock_init = RLock() self.connected_to_ros = False self.ranges,self.intensities = None,None if ros_init_node: try: print 'Utm: init ros node.' rospy.init_node(NAME, anonymous=True) except rospy.ROSException, e: print 'Utm: rospy already initialized. Got message', e pass rospy.Subscriber("utm%d_scan"%(utm_number), LaserScan, self.callback, queue_size = 1) def callback(self, scan): self.lock.acquire() self.connected_to_ros = True self.ranges = np.matrix(scan.ranges[self.start_index_fullscan:self.end_index_fullscan+1]) self.intensities = np.matrix(scan.intensities[self.start_index_fullscan:self.end_index_fullscan+1]) self.lock.release() def get_scan(self, avoid_duplicate=False): while self.connected_to_ros == False: pass while not rospy.is_shutdown(): self.lock.acquire() if avoid_duplicate == False or np.any(self.hokuyo_scan.ranges!=self.ranges): # got a fresh scan from ROS self.hokuyo_scan.ranges = copy.copy(self.ranges) self.hokuyo_scan.intensities = copy.copy(self.intensities) self.lock.release() break self.lock.release() time.sleep(0.001) return copy.copy(self.hokuyo_scan) class Hokuyo(): ''' common class for getting scans from both urg and utm. ''' def __init__(self, hokuyo_type, hokuyo_number, start_angle=None, end_angle=None, flip=False, ros_init_node=True): ''' hokuyo_type - 'urg', 'utm' - 'utm' requires ros revision 2536 ros-kg revision 5612 hokuyo_number - 0,1,2 ... start_angle, end_angle - unoccluded part of the scan. (radians) flip - whether to flip the scans (hokuyo upside-down) ''' self.hokuyo_type = hokuyo_type self.flip = flip if hokuyo_type == 'urg': self.hokuyo = Urg(hokuyo_number,start_angle,end_angle) elif hokuyo_type == 'utm': self.hokuyo = Utm(hokuyo_number,start_angle,end_angle,ros_init_node=ros_init_node) else: raise RuntimeError('hokuyo_scan.Hokuyo.__init__: Unknown hokuyo type: %s\n'%(hokuyo_type)) def get_scan(self, avoid_duplicate=False, avg=1, remove_graze=True): ''' avoid_duplicate - prevent duplicate scans which will happen if get_scan is called at a rate faster than the scanning rate of the hokuyo. avoid_duplicate == True, get_scan will block till new scan is received. (~.2s for urg and 0.05s for utm) ''' l = [] l2 = [] for i in range(avg): hscan = self.hokuyo.get_scan(avoid_duplicate) l.append(hscan.ranges) l2.append(hscan.intensities) ranges_mat = np.row_stack(l) ranges_mat[np.where(ranges_mat==0)] = -1000. # make zero pointvery negative ranges_avg = (ranges_mat.sum(0)/avg) if self.flip: ranges_avg = np.fliplr(ranges_avg) hscan.ranges = ranges_avg intensities_mat = np.row_stack(l2) if self.hokuyo_type == 'utm': hscan.intensities = (intensities_mat.sum(0)/avg) if remove_graze: if self.hokuyo_type=='utm': hp.remove_graze_effect_scan(hscan) else: print 'hokuyo_scan.Hokuyo.get_scan: hokuyo type is urg, but remove_graze is True' return hscan if __name__ == '__main__': import pylab as pl # h = Hokuyo('urg', 0) h = Hokuyo('utm', 0, flip=True) print 'getting first scan' scan1 = h.get_scan(avoid_duplicate=True) # hp.get_xy_map(scan1) t_list = [] for i in range(200): t0 = time.time() scan2 = h.get_scan(avoid_duplicate=True,avg=1,remove_graze=False) # scan = h.get_scan(avoid_duplicate=False) t1 = time.time() print t1-t0, scan1==scan2 t_list.append(t1-t0) scan1=scan2 print scan1.ranges.shape print scan1.angles.shape # t_mat = np.matrix(t_list) # print '#################################################' # print 'mean time between scans:', t_mat.mean() # print 'standard deviation:', np.std(t_mat) pl.plot(t_list) pl.show()
ajibawa-2023/Python-Code-Large/train/row_99582
113
182
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99582:Import_L1_C0", "label": "math import math, np", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0055, 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_99582:Import_L2_C0", "label": "sys import sys, time", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.011, 0.0055, 0, 0.66, 0.0769, 509, 0, 2, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys", "time"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys, time"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99582:Import_L4_C0", "label": "roslib import roslib", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.022, 0.0055, 0, 0.66, 0.1538, 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_hokuyo')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99582:Expr_L4_C15", "label": "load_manifest()", "type": "expression", "loc": [4, 4], "level": 0, "parent": null, "vector": [8, 0, 0.022, 0.0055, 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": "import roslib; roslib.load_manifest('hrl_hokuyo')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99582:Import_L5_C0", "label": "rospy import rospy", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0275, 0.0055, 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_99582:ImportFrom_L6_C0", "label": "from sensor_msgs.msg import LaserScan", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.033, 0.0055, 0, 0.66, 0.3846, 531, 0, 1, 0, 0, 531, 0, 0], "semantic": {"name": "sensor_msgs.msg", "arg_names": [], "import_names": ["LaserScan"], "rhs_call_name": "", "annotation": ""}, "snippet": "from sensor_msgs.msg import LaserScan"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99582:ImportFrom_L7_C0", "label": "from threading import RLock", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.0385, 0.0055, 0, 0.66, 0.4615, 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_99582:Import_L9_C0", "label": "hokuyo_processing import hp", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.0495, 0.0055, 0, 0.66, 0.5385, 410, 0, 1, 0, 0, 410, 0, 0], "semantic": {"name": "hokuyo_processing", "arg_names": [], "import_names": ["hp"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hokuyo_processing as hp"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99582:Import_L10_C0", "label": "copy import copy", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.0549, 0.0055, 0, 0.66, 0.6154, 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_99582:Import_L12_C0", "label": "numpy import np", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.0659, 0.0055, 0, 0.66, 0.6923, 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_99582:ClassDef_L14_C0", "label": "HokuyoScan", "type": "class", "loc": [14, 37], "level": 0, "parent": null, "vector": [3, 0, 0.1401, 0.1319, 0, 0.66, 0.7692, 976, 0, 1, 0, 0, 0, 0, 5], "semantic": {"name": "HokuyoScan", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class HokuyoScan():\n ''' This class has the data of a laser scan.\n '''\n def __init__(self,hokuyo_type,angular_res,max_range,min_range,start_angle,end_angle):\n ''' hokuyo_type - 'urg', 'utm'\n angular_res - angle (radians) between consecutive points in the scan.\n min_range, max_range - in meters\n ranges,angles,intensities - 1xn_points numpy matrix."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99582:Expr_L15_C4", "label": "expression", "type": "expression", "loc": [15, 16], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99582:ClassDef_L14_C0", "vector": [8, 1, 0.0852, 0.011, 1, 0.72, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' This class has the data of a laser scan.\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L17_C4", "label": "__init__", "type": "function", "loc": [17, 37], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99582:ClassDef_L14_C0", "vector": [2, 1, 0.1484, 0.1154, 1, 0.72, 1.0, 555, 0, 7, 0, 0, 0, 0, 5], "semantic": {"name": "__init__", "arg_names": ["self", "hokuyo_type", "angular_res", "max_range", "min_range", "start_angle", "end_angle"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self,hokuyo_type,angular_res,max_range,min_range,start_angle,end_angle):\n ''' hokuyo_type - 'urg', 'utm'\n angular_res - angle (radians) between consecutive points in the scan.\n min_range, max_range - in meters\n ranges,angles,intensities - 1xn_points numpy matrix.\n '''\n self.hokuyo_type = hokuyo_type\n self.angular_res = angular_res"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99582:Expr_L18_C8", "label": "expression", "type": "expression", "loc": [18, 22], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L17_C4", "vector": [8, 2, 0.1099, 0.0275, 2, 0.21, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' hokuyo_type - 'urg', 'utm'\n angular_res - angle (radians) between consecutive points in the scan.\n min_range, max_range - in meters\n ranges,angles,intensities - 1xn_points numpy matrix.\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99582:Assign_L23_C8", "label": "self.hokuyo_type =", "type": "assigned_variable", "loc": [23, 23], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L17_C4", "vector": [14, 2, 0.1264, 0.0055, 2, 0.21, 0.0833, 377, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.hokuyo_type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.hokuyo_type = hokuyo_type"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99582:Assign_L24_C8", "label": "self.angular_res =", "type": "assigned_variable", "loc": [24, 24], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L17_C4", "vector": [14, 2, 0.1319, 0.0055, 2, 0.21, 0.1667, 833, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.angular_res", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.angular_res = angular_res"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99582:Assign_L25_C8", "label": "self.max_range =", "type": "assigned_variable", "loc": [25, 25], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L17_C4", "vector": [14, 2, 0.1374, 0.0055, 2, 0.21, 0.25, 293, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.max_range", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.max_range = max_range"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99582:Assign_L26_C8", "label": "self.min_range =", "type": "assigned_variable", "loc": [26, 26], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L17_C4", "vector": [14, 2, 0.1429, 0.0055, 2, 0.21, 0.3333, 638, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.min_range", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.min_range = min_range"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99582:Assign_L27_C8", "label": "self.start_angle =", "type": "assigned_variable", "loc": [27, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L17_C4", "vector": [14, 2, 0.1484, 0.0055, 2, 0.21, 0.4167, 162, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.start_angle", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.start_angle = start_angle"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99582:Assign_L28_C8", "label": "self.end_angle =", "type": "assigned_variable", "loc": [28, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L17_C4", "vector": [14, 2, 0.1538, 0.0055, 2, 0.21, 0.5, 633, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.end_angle", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.end_angle = end_angle"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99582:Assign_L29_C8", "label": "self.n_points =", "type": "assigned_variable", "loc": [29, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L17_C4", "vector": [14, 2, 0.1593, 0.0055, 2, 0.21, 0.5833, 108, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.n_points", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.n_points = int((end_angle-start_angle)/angular_res)+1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99582:Assign_L31_C8", "label": "self.ranges =", "type": "assigned_variable", "loc": [31, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L17_C4", "vector": [14, 2, 0.1703, 0.0055, 2, 0.21, 0.6667, 27, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.ranges", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.ranges = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99582:Assign_L32_C8", "label": "self.intensities =", "type": "assigned_variable", "loc": [32, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L17_C4", "vector": [14, 2, 0.1758, 0.0055, 2, 0.21, 0.75, 905, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.intensities", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.intensities = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99582:Assign_L33_C8", "label": "self.angles =", "type": "assigned_variable", "loc": [33, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L17_C4", "vector": [14, 2, 0.1813, 0.0055, 2, 0.21, 0.8333, 789, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.angles", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.angles = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99582:For_L35_C8", "label": "for i", "type": "for", "loc": [35, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L17_C4", "vector": [6, 2, 0.1951, 0.011, 2, 0.21, 0.9167, 826, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in xrange(self.n_points):\n self.angles.append(hp.index_to_angle(self,i))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99582:Expr_L36_C12", "label": "append()", "type": "expression", "loc": [36, 36], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99582:For_L35_C8", "vector": [8, 3, 0.1978, 0.0055, 3, 0.89, 0.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.angles.append(hp.index_to_angle(self,i))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99582:Assign_L37_C8", "label": "self.angles = matrix()", "type": "assigned_variable", "loc": [37, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L17_C4", "vector": [14, 2, 0.2033, 0.0055, 2, 0.21, 1.0, 789, 3, 1, 0, 0, 162, 10, 1], "semantic": {"name": "self.angles", "arg_names": [], "import_names": [], "rhs_call_name": "matrix", "annotation": ""}, "snippet": " self.angles = np.matrix(self.angles)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99582:ClassDef_L40_C0", "label": "Urg", "type": "class", "loc": [40, 91], "level": 0, "parent": null, "vector": [3, 0, 0.3599, 0.2857, 0, 0.66, 0.8462, 405, 0, 2, 0, 0, 0, 0, 17], "semantic": {"name": "Urg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Urg():\n ''' get a scan from urg using player.\n '''\n def __init__(self, urg_number,start_angle=None,end_angle=None, host='localhost', port=6665):\n ''' host, port - hostname and port of the player server\n '''\n import player_functions as pf\n import playerc as pl"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99582:Expr_L41_C4", "label": "expression", "type": "expression", "loc": [41, 42], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99582:ClassDef_L40_C0", "vector": [8, 1, 0.228, 0.011, 1, 0.73, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' get a scan from urg using player.\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L43_C4", "label": "__init__", "type": "function", "loc": [43, 76], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99582:ClassDef_L40_C0", "vector": [2, 1, 0.3269, 0.1868, 1, 0.73, 0.5, 555, 0, 6, 0, 0, 0, 0, 11], "semantic": {"name": "__init__", "arg_names": ["self", "urg_number", "start_angle", "end_angle", "host", "port"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, urg_number,start_angle=None,end_angle=None, host='localhost', port=6665):\n ''' host, port - hostname and port of the player server\n '''\n import player_functions as pf\n import playerc as pl\n\n self.player_client = pf.player_connect(host,port)\n self.laser = pl.playerc_laser(self.player_client, urg_number)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99582:Expr_L44_C8", "label": "expression", "type": "expression", "loc": [44, 45], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L43_C4", "vector": [8, 2, 0.2445, 0.011, 2, 0.12, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' host, port - hostname and port of the player server\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99582:Import_L46_C8", "label": "player_functions import pf", "type": "import", "loc": [46, 46], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L43_C4", "vector": [1, 2, 0.2527, 0.0055, 2, 0.12, 0.0714, 358, 0, 1, 0, 0, 358, 0, 0], "semantic": {"name": "player_functions", "arg_names": [], "import_names": ["pf"], "rhs_call_name": "", "annotation": ""}, "snippet": " import player_functions as pf"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99582:Import_L47_C8", "label": "playerc import pl", "type": "import", "loc": [47, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L43_C4", "vector": [1, 2, 0.2582, 0.0055, 2, 0.12, 0.1429, 579, 0, 1, 0, 0, 579, 0, 0], "semantic": {"name": "playerc", "arg_names": [], "import_names": ["pl"], "rhs_call_name": "", "annotation": ""}, "snippet": " import playerc as pl"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99582:Assign_L49_C8", "label": "self.player_client = player_connect()", "type": "assigned_variable", "loc": [49, 49], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L43_C4", "vector": [14, 2, 0.2692, 0.0055, 2, 0.12, 0.2143, 891, 3, 2, 0, 0, 19, 10, 1], "semantic": {"name": "self.player_client", "arg_names": [], "import_names": [], "rhs_call_name": "player_connect", "annotation": ""}, "snippet": " self.player_client = pf.player_connect(host,port)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99582:Assign_L50_C8", "label": "self.laser = playerc_laser()", "type": "assigned_variable", "loc": [50, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L43_C4", "vector": [14, 2, 0.2747, 0.0055, 2, 0.12, 0.2857, 622, 3, 2, 0, 0, 452, 10, 1], "semantic": {"name": "self.laser", "arg_names": [], "import_names": [], "rhs_call_name": "playerc_laser", "annotation": ""}, "snippet": " self.laser = pl.playerc_laser(self.player_client, urg_number)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99582:If_L51_C8", "label": "if", "type": "if", "loc": [51, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L43_C4", "vector": [4, 2, 0.283, 0.011, 2, 0.12, 0.3571, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.laser.subscribe(pl.PLAYERC_OPEN_MODE) != 0:\n raise RuntimeError(\"hokuyo_scan.Urg.__init__: Unable to connect to urg!\\n\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99582:For_L54_C8", "label": "for i", "type": "for", "loc": [54, 55], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L43_C4", "vector": [6, 2, 0.2995, 0.011, 2, 0.12, 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(10):\n self.player_client.read()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99582:Expr_L55_C12", "label": "read()", "type": "expression", "loc": [55, 55], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99582:For_L54_C8", "vector": [8, 3, 0.3022, 0.0055, 3, 0.27, 0.0, 453, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "read", "arg_names": [], "import_names": [], "rhs_call_name": "read", "annotation": ""}, "snippet": " self.player_client.read()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99582:Assign_L57_C8", "label": "start_angle_fullscan =", "type": "assigned_variable", "loc": [57, 57], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L43_C4", "vector": [14, 2, 0.3132, 0.0055, 2, 0.12, 0.5, 94, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "start_angle_fullscan", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " start_angle_fullscan = -math.radians(654./2*0.36)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99582:Assign_L58_C8", "label": "end_angle_fullscan = radians()", "type": "assigned_variable", "loc": [58, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L43_C4", "vector": [14, 2, 0.3187, 0.0055, 2, 0.12, 0.5714, 632, 3, 1, 0, 0, 383, 10, 1], "semantic": {"name": "end_angle_fullscan", "arg_names": [], "import_names": [], "rhs_call_name": "radians", "annotation": ""}, "snippet": " end_angle_fullscan = math.radians(654./2*0.36)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99582:If_L59_C8", "label": "if", "type": "if", "loc": [59, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L43_C4", "vector": [4, 2, 0.3324, 0.022, 2, 0.12, 0.6429, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if start_angle == None or start_angle<start_angle_fullscan:\n start_angle_subscan = start_angle_fullscan\n else:\n start_angle_subscan = start_angle"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99582:Assign_L60_C12", "label": "start_angle_subscan =", "type": "assigned_variable", "loc": [60, 60], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99582:If_L59_C8", "vector": [14, 3, 0.3297, 0.0055, 3, 0.66, 0.0, 717, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "start_angle_subscan", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " start_angle_subscan = start_angle_fullscan"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99582:Assign_L62_C12", "label": "start_angle_subscan =", "type": "assigned_variable", "loc": [62, 62], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99582:If_L59_C8", "vector": [14, 3, 0.3407, 0.0055, 3, 0.66, 1.0, 717, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "start_angle_subscan", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " start_angle_subscan = start_angle"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99582:If_L64_C8", "label": "if", "type": "if", "loc": [64, 67], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L43_C4", "vector": [4, 2, 0.3599, 0.022, 2, 0.12, 0.7143, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if end_angle == None or end_angle>end_angle_fullscan:\n end_angle_subscan = end_angle_fullscan\n else:\n end_angle_subscan = end_angle"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99582:Assign_L65_C12", "label": "end_angle_subscan =", "type": "assigned_variable", "loc": [65, 65], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99582:If_L64_C8", "vector": [14, 3, 0.3571, 0.0055, 3, 0.11, 0.0, 221, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "end_angle_subscan", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " end_angle_subscan = end_angle_fullscan"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99582:Assign_L67_C12", "label": "end_angle_subscan =", "type": "assigned_variable", "loc": [67, 67], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99582:If_L64_C8", "vector": [14, 3, 0.3681, 0.0055, 3, 0.11, 1.0, 221, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "end_angle_subscan", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " end_angle_subscan = end_angle"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99582:Assign_L69_C8", "label": "ang_res = radians()", "type": "assigned_variable", "loc": [69, 69], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L43_C4", "vector": [14, 2, 0.3791, 0.0055, 2, 0.12, 0.7857, 430, 3, 1, 0, 0, 383, 10, 1], "semantic": {"name": "ang_res", "arg_names": [], "import_names": [], "rhs_call_name": "radians", "annotation": ""}, "snippet": " ang_res = math.radians(0.36)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99582:Assign_L70_C8", "label": "self.start_index_fullscan =", "type": "assigned_variable", "loc": [70, 70], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L43_C4", "vector": [14, 2, 0.3846, 0.0055, 2, 0.12, 0.8571, 424, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.start_index_fullscan", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.start_index_fullscan=(start_angle_subscan-start_angle_fullscan)/ang_res"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99582:Assign_L71_C8", "label": "self.end_index_fullscan =", "type": "assigned_variable", "loc": [71, 71], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L43_C4", "vector": [14, 2, 0.3901, 0.0055, 2, 0.12, 0.9286, 112, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.end_index_fullscan", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.end_index_fullscan=(end_angle_subscan-start_angle_fullscan)/ang_res"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99582:Assign_L73_C8", "label": "self.hokuyo_scan = HokuyoScan()", "type": "assigned_variable", "loc": [73, 76], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L43_C4", "vector": [14, 2, 0.4093, 0.022, 2, 0.12, 1.0, 416, 3, 6, 0, 0, 976, 10, 2], "semantic": {"name": "self.hokuyo_scan", "arg_names": [], "import_names": [], "rhs_call_name": "HokuyoScan", "annotation": ""}, "snippet": " self.hokuyo_scan = HokuyoScan(hokuyo_type = 'urg', angular_res = math.radians(0.36),\n max_range = 4.0, min_range = 0.2,\n start_angle=start_angle_subscan,\n end_angle=end_angle_subscan)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L78_C4", "label": "get_scan", "type": "function", "loc": [78, 91], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99582:ClassDef_L40_C0", "vector": [2, 1, 0.4643, 0.0769, 1, 0.73, 1.0, 630, 0, 2, 1, 0, 0, 0, 6], "semantic": {"name": "get_scan", "arg_names": ["self", "avoid_duplicate"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_scan(self, avoid_duplicate=False):\n ''' avoid_duplicate - avoids duplicates caused by querying player faster than it\n can get new scans.\n '''\n curr_ranges = self.hokuyo_scan.ranges\n for i in range(10): # I get a new scan by the time i=4\n if self.player_client.read() == None:\n raise RuntimeError('hokuyo_scan.Urg.get_scan: player_client.read() returned None.\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99582:Expr_L79_C8", "label": "expression", "type": "expression", "loc": [79, 81], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L78_C4", "vector": [8, 2, 0.4396, 0.0165, 2, 0.9, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' avoid_duplicate - avoids duplicates caused by querying player faster than it\n can get new scans.\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99582:Assign_L82_C8", "label": "curr_ranges =", "type": "assigned_variable", "loc": [82, 82], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L78_C4", "vector": [14, 2, 0.4505, 0.0055, 2, 0.9, 0.25, 423, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "curr_ranges", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " curr_ranges = self.hokuyo_scan.ranges"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99582:For_L83_C8", "label": "for i", "type": "for", "loc": [83, 89], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L78_C4", "vector": [6, 2, 0.4725, 0.0385, 2, 0.9, 0.5, 826, 3, 0, 0, 0, 0, 0, 5], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(10): # I get a new scan by the time i=4\n if self.player_client.read() == None:\n raise RuntimeError('hokuyo_scan.Urg.get_scan: player_client.read() returned None.\\n')\n sub_ranges = np.matrix(self.laser.ranges[self.start_index_fullscan:self.end_index_fullscan+1])\n if avoid_duplicate == False or np.any(curr_ranges != sub_ranges):\n # got a fresh scan from player.\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99582:If_L84_C12", "label": "if", "type": "if", "loc": [84, 85], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99582:For_L83_C8", "vector": [4, 3, 0.4643, 0.011, 3, 0.9, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.player_client.read() == None:\n raise RuntimeError('hokuyo_scan.Urg.get_scan: player_client.read() returned None.\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99582:Assign_L86_C12", "label": "sub_ranges = matrix()", "type": "assigned_variable", "loc": [86, 86], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99582:For_L83_C8", "vector": [14, 3, 0.4725, 0.0055, 3, 0.9, 0.5, 653, 3, 1, 0, 0, 162, 10, 1], "semantic": {"name": "sub_ranges", "arg_names": [], "import_names": [], "rhs_call_name": "matrix", "annotation": ""}, "snippet": " sub_ranges = np.matrix(self.laser.ranges[self.start_index_fullscan:self.end_index_fullscan+1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99582:If_L87_C12", "label": "if", "type": "if", "loc": [87, 89], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99582:For_L83_C8", "vector": [4, 3, 0.4835, 0.0165, 3, 0.9, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if avoid_duplicate == False or np.any(curr_ranges != sub_ranges):\n # got a fresh scan from player.\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99582:Assign_L90_C8", "label": "self.hokuyo_scan.ranges =", "type": "assigned_variable", "loc": [90, 90], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L78_C4", "vector": [14, 2, 0.4945, 0.0055, 2, 0.9, 0.75, 875, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.hokuyo_scan.ranges", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.hokuyo_scan.ranges = sub_ranges"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99582:Return_L91_C8", "label": "return", "type": "return", "loc": [91, 91], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L78_C4", "vector": [13, 2, 0.5, 0.0055, 2, 0.9, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return copy.copy(self.hokuyo_scan)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99582:ClassDef_L94_C0", "label": "Utm", "type": "class", "loc": [94, 121], "level": 0, "parent": null, "vector": [3, 0, 0.5907, 0.1538, 0, 0.66, 0.9231, 401, 0, 3, 0, 0, 0, 0, 13], "semantic": {"name": "Utm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Utm():\n ''' get a scan from a UTM using ROS\n '''\n def __init__(self, utm_number,start_angle=None,end_angle=None,ros_init_node=True):\n\n hokuyo_node_name = '/utm%d'%utm_number\n def callback(self, scan):\n self.lock.acquire()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99582:Expr_L95_C4", "label": "expression", "type": "expression", "loc": [95, 96], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99582:ClassDef_L94_C0", "vector": [8, 1, 0.5247, 0.011, 1, 0.91, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' get a scan from a UTM using ROS\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L97_C4", "label": "__init__", "type": "function", "loc": [97, 99], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99582:ClassDef_L94_C0", "vector": [2, 1, 0.5385, 0.0165, 1, 0.91, 0.3333, 555, 0, 5, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "utm_number", "start_angle", "end_angle", "ros_init_node"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, utm_number,start_angle=None,end_angle=None,ros_init_node=True):\n\n hokuyo_node_name = '/utm%d'%utm_number"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99582:Assign_L99_C8", "label": "hokuyo_node_name =", "type": "assigned_variable", "loc": [99, 99], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L97_C4", "vector": [14, 2, 0.544, 0.0055, 2, 0.45, 0.0, 393, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "hokuyo_node_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " hokuyo_node_name = '/utm%d'%utm_number"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L100_C4", "label": "callback", "type": "function", "loc": [100, 105], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99582:ClassDef_L94_C0", "vector": [2, 1, 0.5632, 0.033, 1, 0.91, 0.6667, 342, 0, 2, 0, 0, 0, 0, 4], "semantic": {"name": "callback", "arg_names": ["self", "scan"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def callback(self, scan):\n self.lock.acquire()\n self.connected_to_ros = True\n self.ranges = np.matrix(scan.ranges[self.start_index_fullscan:self.end_index_fullscan+1])\n self.intensities = np.matrix(scan.intensities[self.start_index_fullscan:self.end_index_fullscan+1])\n self.lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99582:Expr_L101_C8", "label": "acquire()", "type": "expression", "loc": [101, 101], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L100_C4", "vector": [8, 2, 0.5549, 0.0055, 2, 0.04, 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_99582:Assign_L102_C8", "label": "self.connected_to_ros =", "type": "assigned_variable", "loc": [102, 102], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L100_C4", "vector": [14, 2, 0.5604, 0.0055, 2, 0.04, 0.25, 726, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.connected_to_ros", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.connected_to_ros = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99582:Assign_L103_C8", "label": "self.ranges = matrix()", "type": "assigned_variable", "loc": [103, 103], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L100_C4", "vector": [14, 2, 0.5659, 0.0055, 2, 0.04, 0.5, 27, 3, 1, 0, 0, 162, 10, 1], "semantic": {"name": "self.ranges", "arg_names": [], "import_names": [], "rhs_call_name": "matrix", "annotation": ""}, "snippet": " self.ranges = np.matrix(scan.ranges[self.start_index_fullscan:self.end_index_fullscan+1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99582:Assign_L104_C8", "label": "self.intensities = matrix()", "type": "assigned_variable", "loc": [104, 104], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L100_C4", "vector": [14, 2, 0.5714, 0.0055, 2, 0.04, 0.75, 905, 3, 1, 0, 0, 162, 10, 1], "semantic": {"name": "self.intensities", "arg_names": [], "import_names": [], "rhs_call_name": "matrix", "annotation": ""}, "snippet": " self.intensities = np.matrix(scan.intensities[self.start_index_fullscan:self.end_index_fullscan+1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99582:Expr_L105_C8", "label": "release()", "type": "expression", "loc": [105, 105], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L100_C4", "vector": [8, 2, 0.5769, 0.0055, 2, 0.04, 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_99582:FunctionDef_L107_C4", "label": "get_scan", "type": "function", "loc": [107, 121], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99582:ClassDef_L94_C0", "vector": [2, 1, 0.6264, 0.0824, 1, 0.91, 1.0, 630, 0, 2, 1, 0, 0, 0, 9], "semantic": {"name": "get_scan", "arg_names": ["self", "avoid_duplicate"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_scan(self, avoid_duplicate=False):\n while self.connected_to_ros == False:\n pass\n while not rospy.is_shutdown():\n self.lock.acquire()\n if avoid_duplicate == False or np.any(self.hokuyo_scan.ranges!=self.ranges):\n # got a fresh scan from ROS\n self.hokuyo_scan.ranges = copy.copy(self.ranges)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99582:While_L108_C8", "label": "while", "type": "while", "loc": [108, 109], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L107_C4", "vector": [5, 2, 0.5962, 0.011, 2, 0.39, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while self.connected_to_ros == False:\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99582:While_L110_C8", "label": "while", "type": "while", "loc": [110, 119], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L107_C4", "vector": [5, 2, 0.6291, 0.0549, 2, 0.39, 0.5, 0, 0, 0, 0, 0, 0, 0, 8], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while not rospy.is_shutdown():\n self.lock.acquire()\n if avoid_duplicate == False or np.any(self.hokuyo_scan.ranges!=self.ranges):\n # got a fresh scan from ROS\n self.hokuyo_scan.ranges = copy.copy(self.ranges)\n self.hokuyo_scan.intensities = copy.copy(self.intensities)\n self.lock.release()\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99582:Expr_L111_C12", "label": "acquire()", "type": "expression", "loc": [111, 111], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99582:While_L110_C8", "vector": [8, 3, 0.6099, 0.0055, 3, 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.lock.acquire()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99582:If_L112_C12", "label": "if", "type": "if", "loc": [112, 117], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99582:While_L110_C8", "vector": [4, 3, 0.6291, 0.033, 3, 0.92, 0.3333, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if avoid_duplicate == False or np.any(self.hokuyo_scan.ranges!=self.ranges):\n # got a fresh scan from ROS\n self.hokuyo_scan.ranges = copy.copy(self.ranges)\n self.hokuyo_scan.intensities = copy.copy(self.intensities)\n self.lock.release()\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99582:Assign_L114_C16", "label": "self.hokuyo_scan.ranges = copy()", "type": "assigned_variable", "loc": [114, 114], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99582:If_L112_C12", "vector": [14, 4, 0.6264, 0.0055, 4, 0.84, 0.0, 875, 3, 1, 0, 0, 739, 10, 1], "semantic": {"name": "self.hokuyo_scan.ranges", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " self.hokuyo_scan.ranges = copy.copy(self.ranges)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99582:Assign_L115_C16", "label": "self.hokuyo_scan.intensities = copy()", "type": "assigned_variable", "loc": [115, 115], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99582:If_L112_C12", "vector": [14, 4, 0.6319, 0.0055, 4, 0.84, 0.5, 80, 3, 1, 0, 0, 739, 10, 1], "semantic": {"name": "self.hokuyo_scan.intensities", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " self.hokuyo_scan.intensities = copy.copy(self.intensities)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99582:Expr_L116_C16", "label": "release()", "type": "expression", "loc": [116, 116], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99582:If_L112_C12", "vector": [8, 4, 0.6374, 0.0055, 4, 0.84, 1.0, 784, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "release", "arg_names": [], "import_names": [], "rhs_call_name": "release", "annotation": ""}, "snippet": " self.lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99582:Expr_L118_C12", "label": "release()", "type": "expression", "loc": [118, 118], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99582:While_L110_C8", "vector": [8, 3, 0.6484, 0.0055, 3, 0.92, 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_99582:Expr_L119_C12", "label": "sleep()", "type": "expression", "loc": [119, 119], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99582:While_L110_C8", "vector": [8, 3, 0.6538, 0.0055, 3, 0.92, 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.001)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99582:Return_L121_C8", "label": "return", "type": "return", "loc": [121, 121], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L107_C4", "vector": [13, 2, 0.6648, 0.0055, 2, 0.39, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return copy.copy(self.hokuyo_scan)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99582:ClassDef_L124_C0", "label": "Hokuyo", "type": "class", "loc": [124, 181], "level": 0, "parent": null, "vector": [3, 0, 0.8379, 0.3187, 0, 0.66, 1.0, 66, 0, 2, 0, 0, 0, 0, 15], "semantic": {"name": "Hokuyo", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Hokuyo():\n ''' common class for getting scans from both urg and utm.\n '''\n\n def __init__(self, hokuyo_type, hokuyo_number, start_angle=None,\n end_angle=None, flip=False, ros_init_node=True):\n ''' hokuyo_type - 'urg', 'utm'\n - 'utm' requires ros revision 2536"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99582:Expr_L125_C4", "label": "expression", "type": "expression", "loc": [125, 126], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99582:ClassDef_L124_C0", "vector": [8, 1, 0.6896, 0.011, 1, 0.53, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' common class for getting scans from both urg and utm.\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L128_C4", "label": "__init__", "type": "function", "loc": [128, 145], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99582:ClassDef_L124_C0", "vector": [2, 1, 0.75, 0.0989, 1, 0.53, 0.3333, 555, 0, 7, 0, 0, 0, 0, 3], "semantic": {"name": "__init__", "arg_names": ["self", "hokuyo_type", "hokuyo_number", "start_angle", "end_angle", "flip", "ros_init_node"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, hokuyo_type, hokuyo_number, start_angle=None,\n end_angle=None, flip=False, ros_init_node=True):\n ''' hokuyo_type - 'urg', 'utm'\n - 'utm' requires ros revision 2536\n ros-kg revision 5612\n hokuyo_number - 0,1,2 ...\n start_angle, end_angle - unoccluded part of the scan. (radians)\n flip - whether to flip the scans (hokuyo upside-down)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99582:Expr_L130_C8", "label": "expression", "type": "expression", "loc": [130, 136], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L128_C4", "vector": [8, 2, 0.7308, 0.0385, 2, 0.19, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' hokuyo_type - 'urg', 'utm'\n - 'utm' requires ros revision 2536\n ros-kg revision 5612\n hokuyo_number - 0,1,2 ...\n start_angle, end_angle - unoccluded part of the scan. (radians)\n flip - whether to flip the scans (hokuyo upside-down)\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99582:Assign_L137_C8", "label": "self.hokuyo_type =", "type": "assigned_variable", "loc": [137, 137], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L128_C4", "vector": [14, 2, 0.7527, 0.0055, 2, 0.19, 0.3333, 377, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.hokuyo_type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.hokuyo_type = hokuyo_type"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99582:Assign_L138_C8", "label": "self.flip =", "type": "assigned_variable", "loc": [138, 138], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L128_C4", "vector": [14, 2, 0.7582, 0.0055, 2, 0.19, 0.6667, 654, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.flip", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.flip = flip"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99582:If_L140_C8", "label": "if", "type": "if", "loc": [140, 145], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L128_C4", "vector": [4, 2, 0.783, 0.033, 2, 0.19, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if hokuyo_type == 'urg':\n self.hokuyo = Urg(hokuyo_number,start_angle,end_angle)\n elif hokuyo_type == 'utm':\n self.hokuyo = Utm(hokuyo_number,start_angle,end_angle,ros_init_node=ros_init_node)\n else:\n raise RuntimeError('hokuyo_scan.Hokuyo.__init__: Unknown hokuyo type: %s\\n'%(hokuyo_type))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99582:Assign_L141_C12", "label": "self.hokuyo = Urg()", "type": "assigned_variable", "loc": [141, 141], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99582:If_L140_C8", "vector": [14, 3, 0.7747, 0.0055, 3, 0.68, 0.0, 640, 3, 3, 0, 0, 405, 10, 1], "semantic": {"name": "self.hokuyo", "arg_names": [], "import_names": [], "rhs_call_name": "Urg", "annotation": ""}, "snippet": " self.hokuyo = Urg(hokuyo_number,start_angle,end_angle)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99582:If_L142_C8", "label": "if", "type": "if", "loc": [142, 145], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99582:If_L140_C8", "vector": [4, 3, 0.7885, 0.022, 3, 0.68, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif hokuyo_type == 'utm':\n self.hokuyo = Utm(hokuyo_number,start_angle,end_angle,ros_init_node=ros_init_node)\n else:\n raise RuntimeError('hokuyo_scan.Hokuyo.__init__: Unknown hokuyo type: %s\\n'%(hokuyo_type))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99582:Assign_L143_C12", "label": "self.hokuyo = Utm()", "type": "assigned_variable", "loc": [143, 143], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99582:If_L142_C8", "vector": [14, 4, 0.7857, 0.0055, 4, 0.04, 0.0, 640, 3, 4, 0, 0, 401, 10, 1], "semantic": {"name": "self.hokuyo", "arg_names": [], "import_names": [], "rhs_call_name": "Utm", "annotation": ""}, "snippet": " self.hokuyo = Utm(hokuyo_number,start_angle,end_angle,ros_init_node=ros_init_node)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L147_C4", "label": "get_scan", "type": "function", "loc": [147, 177], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99582:ClassDef_L124_C0", "vector": [2, 1, 0.8901, 0.1703, 1, 0.53, 0.6667, 630, 0, 4, 1, 0, 0, 0, 12], "semantic": {"name": "get_scan", "arg_names": ["self", "avoid_duplicate", "avg", "remove_graze"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_scan(self, avoid_duplicate=False, avg=1, remove_graze=True):\n ''' avoid_duplicate - prevent duplicate scans which will happen if get_scan is\n called at a rate faster than the scanning rate of the hokuyo.\n avoid_duplicate == True, get_scan will block till new scan is received.\n (~.2s for urg and 0.05s for utm)\n '''\n l = []\n l2 = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99582:Expr_L148_C8", "label": "expression", "type": "expression", "loc": [148, 152], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L147_C4", "vector": [8, 2, 0.8242, 0.0275, 2, 0.62, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' avoid_duplicate - prevent duplicate scans which will happen if get_scan is\n called at a rate faster than the scanning rate of the hokuyo.\n avoid_duplicate == True, get_scan will block till new scan is received.\n (~.2s for urg and 0.05s for utm)\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99582:Assign_L153_C8", "label": "l =", "type": "assigned_variable", "loc": [153, 153], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L147_C4", "vector": [14, 2, 0.8407, 0.0055, 2, 0.62, 0.0833, 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_99582:Assign_L154_C8", "label": "l2 =", "type": "assigned_variable", "loc": [154, 154], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L147_C4", "vector": [14, 2, 0.8462, 0.0055, 2, 0.62, 0.1667, 40, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "l2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " l2 = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99582:For_L155_C8", "label": "for i", "type": "for", "loc": [155, 158], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L147_C4", "vector": [6, 2, 0.8599, 0.022, 2, 0.62, 0.25, 826, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(avg):\n hscan = self.hokuyo.get_scan(avoid_duplicate)\n l.append(hscan.ranges)\n l2.append(hscan.intensities)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99582:Assign_L156_C12", "label": "hscan = get_scan()", "type": "assigned_variable", "loc": [156, 156], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99582:For_L155_C8", "vector": [14, 3, 0.8571, 0.0055, 3, 0.54, 0.0, 160, 3, 1, 0, 0, 630, 10, 1], "semantic": {"name": "hscan", "arg_names": [], "import_names": [], "rhs_call_name": "get_scan", "annotation": ""}, "snippet": " hscan = self.hokuyo.get_scan(avoid_duplicate)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99582:Expr_L157_C12", "label": "append()", "type": "expression", "loc": [157, 157], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99582:For_L155_C8", "vector": [8, 3, 0.8626, 0.0055, 3, 0.54, 0.5, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " l.append(hscan.ranges)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99582:Expr_L158_C12", "label": "append()", "type": "expression", "loc": [158, 158], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99582:For_L155_C8", "vector": [8, 3, 0.8681, 0.0055, 3, 0.54, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " l2.append(hscan.intensities)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99582:Assign_L160_C8", "label": "ranges_mat = row_stack()", "type": "assigned_variable", "loc": [160, 160], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L147_C4", "vector": [14, 2, 0.8791, 0.0055, 2, 0.62, 0.3333, 900, 3, 1, 0, 0, 612, 10, 1], "semantic": {"name": "ranges_mat", "arg_names": [], "import_names": [], "rhs_call_name": "row_stack", "annotation": ""}, "snippet": " ranges_mat = np.row_stack(l)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99582:Assign_L161_C8", "label": "assign", "type": "assigned_variable", "loc": [161, 161], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L147_C4", "vector": [14, 2, 0.8846, 0.0055, 2, 0.62, 0.4167, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ranges_mat[np.where(ranges_mat==0)] = -1000. # make zero pointvery negative"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99582:Assign_L162_C8", "label": "ranges_avg =", "type": "assigned_variable", "loc": [162, 162], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L147_C4", "vector": [14, 2, 0.8901, 0.0055, 2, 0.62, 0.5, 916, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "ranges_avg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ranges_avg = (ranges_mat.sum(0)/avg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99582:If_L163_C8", "label": "if", "type": "if", "loc": [163, 164], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L147_C4", "vector": [4, 2, 0.8984, 0.011, 2, 0.62, 0.5833, 0, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.flip:\n ranges_avg = np.fliplr(ranges_avg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99582:Assign_L164_C12", "label": "ranges_avg = fliplr()", "type": "assigned_variable", "loc": [164, 164], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99582:If_L163_C8", "vector": [14, 3, 0.9011, 0.0055, 3, 0.26, 0.0, 916, 3, 1, 0, 0, 892, 10, 1], "semantic": {"name": "ranges_avg", "arg_names": [], "import_names": [], "rhs_call_name": "fliplr", "annotation": ""}, "snippet": " ranges_avg = np.fliplr(ranges_avg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99582:Assign_L165_C8", "label": "hscan.ranges =", "type": "assigned_variable", "loc": [165, 165], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L147_C4", "vector": [14, 2, 0.9066, 0.0055, 2, 0.62, 0.6667, 697, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "hscan.ranges", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " hscan.ranges = ranges_avg"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99582:Assign_L167_C8", "label": "intensities_mat = row_stack()", "type": "assigned_variable", "loc": [167, 167], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L147_C4", "vector": [14, 2, 0.9176, 0.0055, 2, 0.62, 0.75, 904, 3, 1, 0, 0, 612, 10, 1], "semantic": {"name": "intensities_mat", "arg_names": [], "import_names": [], "rhs_call_name": "row_stack", "annotation": ""}, "snippet": " intensities_mat = np.row_stack(l2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99582:If_L168_C8", "label": "if", "type": "if", "loc": [168, 169], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L147_C4", "vector": [4, 2, 0.9258, 0.011, 2, 0.62, 0.8333, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.hokuyo_type == 'utm':\n hscan.intensities = (intensities_mat.sum(0)/avg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99582:Assign_L169_C12", "label": "hscan.intensities =", "type": "assigned_variable", "loc": [169, 169], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99582:If_L168_C8", "vector": [14, 3, 0.9286, 0.0055, 3, 0.13, 0.0, 395, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "hscan.intensities", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " hscan.intensities = (intensities_mat.sum(0)/avg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99582:If_L171_C8", "label": "if", "type": "if", "loc": [171, 175], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L147_C4", "vector": [4, 2, 0.9505, 0.0275, 2, 0.62, 0.9167, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if remove_graze:\n if self.hokuyo_type=='utm':\n hp.remove_graze_effect_scan(hscan)\n else:\n print('hokuyo_scan.Hokuyo.get_scan: hokuyo type is urg, but remove_graze is True')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99582:If_L172_C12", "label": "if", "type": "if", "loc": [172, 175], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99582:If_L171_C8", "vector": [4, 3, 0.9533, 0.022, 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.hokuyo_type=='utm':\n hp.remove_graze_effect_scan(hscan)\n else:\n print('hokuyo_scan.Hokuyo.get_scan: hokuyo type is urg, but remove_graze is True')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99582:Expr_L173_C16", "label": "remove_graze_effect_scan()", "type": "expression", "loc": [173, 173], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99582:If_L172_C12", "vector": [8, 4, 0.9505, 0.0055, 4, 0.42, 0.0, 447, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "remove_graze_effect_scan", "arg_names": [], "import_names": [], "rhs_call_name": "remove_graze_effect_scan", "annotation": ""}, "snippet": " hp.remove_graze_effect_scan(hscan)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99582:Expr_L175_C16", "label": "print()", "type": "expression", "loc": [175, 175], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99582:If_L172_C12", "vector": [8, 4, 0.9615, 0.0055, 4, 0.42, 1.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('hokuyo_scan.Hokuyo.get_scan: hokuyo type is urg, but remove_graze is True')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99582:Return_L177_C8", "label": "return", "type": "return", "loc": [177, 177], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L147_C4", "vector": [13, 2, 0.9725, 0.0055, 2, 0.62, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return hscan"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99582:Import_L181_C4", "label": "pylab import pl", "type": "import", "loc": [181, 181], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99582:ClassDef_L124_C0", "vector": [1, 1, 0.9945, 0.0055, 1, 0.53, 1.0, 735, 0, 1, 0, 0, 735, 0, 0], "semantic": {"name": "pylab", "arg_names": [], "import_names": ["pl"], "rhs_call_name": "", "annotation": ""}, "snippet": " import pylab as pl"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99582:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99582:Expr_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99582:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L17_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99582:Expr_L18_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L17_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99582:Assign_L23_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L17_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99582:Assign_L24_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L17_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99582:Assign_L25_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L17_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99582:Assign_L26_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L17_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99582:Assign_L27_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L17_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99582:Assign_L28_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L17_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99582:Assign_L29_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L17_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99582:Assign_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L17_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99582:Assign_L32_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L17_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99582:Assign_L33_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L17_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99582:For_L35_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99582:For_L35_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99582:Expr_L36_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L17_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99582:Assign_L37_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99582:ClassDef_L40_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99582:Expr_L41_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99582:ClassDef_L40_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L43_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L43_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99582:Expr_L44_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L43_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99582:Import_L46_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L43_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99582:Import_L47_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L43_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99582:Assign_L49_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L43_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99582:Assign_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L43_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99582:If_L51_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L43_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99582:For_L54_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99582:For_L54_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99582:Expr_L55_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L43_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99582:Assign_L57_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L43_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99582:Assign_L58_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L43_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99582:If_L59_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99582:If_L59_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99582:Assign_L60_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99582:If_L59_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99582:Assign_L62_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L43_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99582:If_L64_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99582:If_L64_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99582:Assign_L65_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99582:If_L64_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99582:Assign_L67_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L43_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99582:Assign_L69_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L43_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99582:Assign_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L43_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99582:Assign_L71_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L43_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99582:Assign_L73_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99582:ClassDef_L40_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L78_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99582:Expr_L79_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99582:Assign_L82_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99582:For_L83_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99582:For_L83_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99582:If_L84_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99582:For_L83_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99582:Assign_L86_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99582:For_L83_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99582:If_L87_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99582:Assign_L90_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99582:Return_L91_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99582:ClassDef_L94_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99582:Expr_L95_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99582:ClassDef_L94_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L97_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99582:Assign_L99_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99582:ClassDef_L94_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L100_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L100_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99582:Expr_L101_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L100_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99582:Assign_L102_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L100_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99582:Assign_L103_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L100_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99582:Assign_L104_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L100_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99582:Expr_L105_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99582:ClassDef_L94_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L107_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99582:While_L108_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99582:While_L110_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99582:While_L110_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99582:Expr_L111_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99582:While_L110_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99582:If_L112_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99582:If_L112_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99582:Assign_L114_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99582:If_L112_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99582:Assign_L115_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99582:If_L112_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99582:Expr_L116_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99582:While_L110_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99582:Expr_L118_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99582:While_L110_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99582:Expr_L119_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99582:Return_L121_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99582:ClassDef_L124_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99582:Expr_L125_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99582:ClassDef_L124_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L128_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L128_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99582:Expr_L130_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L128_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99582:Assign_L137_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L128_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99582:Assign_L138_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L128_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99582:If_L140_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99582:If_L140_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99582:Assign_L141_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99582:If_L140_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99582:If_L142_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99582:If_L142_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99582:Assign_L143_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99582:ClassDef_L124_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L147_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99582:Expr_L148_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99582:Assign_L153_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99582:Assign_L154_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99582:For_L155_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99582:For_L155_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99582:Assign_L156_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99582:For_L155_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99582:Expr_L157_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99582:For_L155_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99582:Expr_L158_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99582:Assign_L160_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99582:Assign_L161_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99582:Assign_L162_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99582:If_L163_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99582:If_L163_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99582:Assign_L164_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99582:Assign_L165_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99582:Assign_L167_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99582:If_L168_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99582:If_L168_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99582:Assign_L169_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99582:If_L171_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99582:If_L171_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99582:If_L172_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99582:If_L172_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99582:Expr_L173_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99582:If_L172_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99582:Expr_L175_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99582:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99582:Return_L177_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99582:ClassDef_L124_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99582:Import_L181_C4"}]
import math # home position in encoder ticks for the servo. servo_param = { # 1: { # Default for new servo. Please issue 'new_servo.write_id(new_id)' and setup your own home position! # 'home_encoder': 351 # }, 2: { # Tilting Hokuyo on El-E 'home_encoder': 446 }, 3: { # RFID Antenna Left Tilt 'home_encoder': 377 }, 4: { # RFID Antenna Right Tilt 'home_encoder': 330 }, 5: { # Tilting kinect on Cody 'home_encoder': 447, 'max_ang': math.radians(55.), 'min_ang': math.radians(-80.) }, 6: { # EL-E stereohead Pan 'home_encoder': 500, 'max_ang': math.radians(90.), 'min_ang': math.radians(-90.) }, 7: { # EL-E safetyscreen tilt. 'home_encoder': 373 }, 11: { # RFID Left Pan 'home_encoder': 430, 'max_ang': math.radians( 141.0 ), 'min_ang': math.radians( -31.0 ) }, 12: { # RFID Left Tilt 'home_encoder': 507, 'max_ang': math.radians( 46.0 ), 'min_ang': math.radians( -36.0 ) }, 13: { # RFID Right Pan 'home_encoder': 583, 'max_ang': math.radians( 31.0 ), 'min_ang': math.radians( -141.0 ) }, 14: { # RFID Right Tilt 'home_encoder': 504, 'max_ang': math.radians( 46.0 ), 'min_ang': math.radians( -36.0 ) }, 15: { # Ear Flap on RFID El-E Right 'home_encoder': 498 }, 16: { # Pan Antenna on RFID El-E Left 'home_encoder': 365 }, 17: { # Tilt Antenna on RFID El-E Left 'home_encoder': 504 }, 18: { # EL-E stereohead Tilt 'home_encoder': 495, 'max_ang': math.radians(60.), 'min_ang': math.radians(-20.) }, 19: { # Desktop System UTM 'home_encoder': 633, 'flipped': True }, 20: { # Desktop System Tilt 'home_encoder': 381 }, 21: { # Desktop System Pan 'home_encoder': 589 }, 22: { # Desktop System Roll 'home_encoder': 454 }, 23: { # Dinah Top 'home_encoder': 379 }, 24: { # Dinah Bottom 'home_encoder': 365 }, 25: { # Meka top Pan 'home_encoder': 500 }, 26: { # Meka top Tilt 'home_encoder': 400 }, 27: { # PR2 RFID Right Pan 'home_encoder': 512 }, 28: { # PR2 RFID Right Tilt 'home_encoder': 506 }, 29: { # PR2 RFID Left Pan 'home_encoder': 544 }, 30: { # PR2 RFID Left Tilt 'home_encoder': 500 }, 31: { # Playpen open/close 'home_encoder': 381 }, 32: { # Conveyor for playpen 'home_encoder': 1 } }
ajibawa-2023/Python-Code-Large/train/row_99585
2
109
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99585:Import_L1_C0", "label": "math import math", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0092, 0.0092, 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_99585:Assign_L5_C0", "label": "servo_param =", "type": "assigned_variable", "loc": [5, 108], "level": 0, "parent": null, "vector": [14, 0, 0.5183, 0.9541, 0, 0.66, 1.0, 241, 0, 0, 0, 0, 0, 6, 14], "semantic": {"name": "servo_param", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "servo_param = {\n# 1: { # Default for new servo. Please issue 'new_servo.write_id(new_id)' and setup your own home position!\n# 'home_encoder': 351\n# }, \n 2: { # Tilting Hokuyo on El-E\n 'home_encoder': 446\n }, \n 3: { # RFID Antenna Left Tilt"}]
[]
__all__ = [ 'robotis_servo', 'lib_robotis', 'ros_robotis', 'servo_config' ]
ajibawa-2023/Python-Code-Large/train/row_99586
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_99586:Assign_L1_C0", "label": "__all__ =", "type": "assigned_variable", "loc": [1, 6], "level": 0, "parent": null, "vector": [14, 0, 0.5833, 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'robotis_servo',\n'lib_robotis',\n'ros_robotis',\n'servo_config'\n]"}]
[]
#!/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. # ## Controlling Robotis Dynamixel RX-28 & RX-64 servos from python ## using the USB2Dynamixel adaptor. ## Authors: Travis Deyle & Advait Jain (Healthcare Robotics Lab, Georgia Tech.) # ROS imports import roslib 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 robotis.lib_robotis as rs import time import math from threading import Thread 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 ): ang = request.angle angvel = request.angvel blocking = bool( request.blocking ) self.servo.move_angle( ang, angvel, blocking ) 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 = rs.USB2Dynamixel_Device( self.dev_name ) self.servos = [ rs.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 and not rospy.is_shutdown(): [ s.update_server() for s in self.ros_servers ] time.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") class ROS_Robotis_Client(): # Provides access to the ROS services in the server. def __init__(self, name = '' ): self.name = name rospy.wait_for_service('/robotis/servo_' + name + '_readangle') rospy.wait_for_service('/robotis/servo_' + name + '_ismoving') rospy.wait_for_service('/robotis/servo_' + name + '_moveangle') self.__service_ang = rospy.ServiceProxy('/robotis/servo_' + name + '_readangle', None_Float) self.__service_ismove = rospy.ServiceProxy('/robotis/servo_' + name + '_ismoving', None_Int32) self.__service_moveang = rospy.ServiceProxy('/robotis/servo_' + name + '_moveangle', MoveAng) def read_angle( self ): resp = self.__service_ang() ang = resp.value return ang def is_moving( self ): resp = self.__service_ismove() return bool( resp.value ) def move_angle( self, ang, angvel = math.radians(50), blocking = True ): self.__service_moveang( ang, angvel, int(blocking) ) if __name__ == '__main__': print 'Sample Server: ' # Important note: You cannot (!) use the same device (dyn) in another # process. The device is only "thread-safe" within the same # process (i.e. between servos (and callbacks) instantiated # within that process) # NOTE: If you are going to be polling the servers as in the snippet # below, I recommen using a poller! See "SAMPLE POLLER" below. dev_name = '/dev/robot/servo_left' ids = [11, 12] names = ['pan', 'tilt'] dyn = rs.USB2Dynamixel_Device( dev_name ) servos = [ rs.Robotis_Servo( dyn, i ) for i in ids ] ros_servers = [ ROS_Robotis_Server( s, n ) for s,n in zip( servos, names ) ] try: while not rospy.is_shutdown(): [ s.update_server() for s in ros_servers ] time.sleep(0.001) except: pass for n in names: print 'ROS_Robotis_Servo: Shutting Down /robotis/servo_'+n ## SAMPLE POLLER # The above example just constantly polls all the servos, while also # making the services available. This generally useful code is # encapsulated in a more general poller class (which also has nicer # shutdown / restart properties). Thus, the above example is best used as: # ROS_Robotis_Poller( '/dev/robot/servo_left', [11,12], ['pan', 'tilt'] ) ## SAMPLE CLIENTS: # tilt = ROS_Robotis_Client( 'tilt' ) # tilt.move_angle( math.radians( 0 ), math.radians(10), blocking=False) # while tilt.is_moving(): # print 'Tilt is moving' # pan = ROS_Robotis_Client( 'pan' ) # pan.move_angle( math.radians( 0 ), math.radians(10), blocking=False) # while pan.is_moving(): # print 'pan is moving'
ajibawa-2023/Python-Code-Large/train/row_99587
98
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_99587:Import_L36_C0", "label": "roslib import roslib", "type": "import", "loc": [36, 36], "level": 0, "parent": null, "vector": [1, 0, 0.1629, 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_99587:Expr_L37_C0", "label": "load_manifest()", "type": "expression", "loc": [37, 37], "level": 0, "parent": null, "vector": [8, 0, 0.1674, 0.0045, 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('robotis')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99587:Import_L38_C0", "label": "rospy import rospy", "type": "import", "loc": [38, 38], "level": 0, "parent": null, "vector": [1, 0, 0.1719, 0.0045, 0, 0.66, 0.1176, 164, 0, 1, 0, 0, 164, 0, 0], "semantic": {"name": "rospy", "arg_names": [], "import_names": ["rospy"], "rhs_call_name": "", "annotation": ""}, "snippet": "import rospy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99587:ImportFrom_L40_C0", "label": "from std_msgs.msg import Float64", "type": "import", "loc": [40, 40], "level": 0, "parent": null, "vector": [1, 0, 0.181, 0.0045, 0, 0.66, 0.1765, 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_99587:ImportFrom_L41_C0", "label": "from robotis.srv import None_Float", "type": "import", "loc": [41, 41], "level": 0, "parent": null, "vector": [1, 0, 0.1855, 0.0045, 0, 0.66, 0.2353, 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_99587:ImportFrom_L42_C0", "label": "from robotis.srv import None_FloatResponse", "type": "import", "loc": [42, 42], "level": 0, "parent": null, "vector": [1, 0, 0.19, 0.0045, 0, 0.66, 0.2941, 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_99587:ImportFrom_L43_C0", "label": "from robotis.srv import MoveAng", "type": "import", "loc": [43, 43], "level": 0, "parent": null, "vector": [1, 0, 0.1946, 0.0045, 0, 0.66, 0.3529, 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_99587:ImportFrom_L44_C0", "label": "from robotis.srv import MoveAngResponse", "type": "import", "loc": [44, 44], "level": 0, "parent": null, "vector": [1, 0, 0.1991, 0.0045, 0, 0.66, 0.4118, 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_99587:ImportFrom_L45_C0", "label": "from robotis.srv import None_Int32", "type": "import", "loc": [45, 45], "level": 0, "parent": null, "vector": [1, 0, 0.2036, 0.0045, 0, 0.66, 0.4706, 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_99587:ImportFrom_L46_C0", "label": "from robotis.srv import None_Int32Response", "type": "import", "loc": [46, 46], "level": 0, "parent": null, "vector": [1, 0, 0.2081, 0.0045, 0, 0.66, 0.5294, 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_99587:Import_L48_C0", "label": "robotis.lib_robotis import rs", "type": "import", "loc": [48, 48], "level": 0, "parent": null, "vector": [1, 0, 0.2172, 0.0045, 0, 0.66, 0.5882, 324, 0, 1, 0, 0, 324, 0, 0], "semantic": {"name": "robotis.lib_robotis", "arg_names": [], "import_names": ["rs"], "rhs_call_name": "", "annotation": ""}, "snippet": "import robotis.lib_robotis as rs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99587:Import_L49_C0", "label": "time import time", "type": "import", "loc": [49, 49], "level": 0, "parent": null, "vector": [1, 0, 0.2217, 0.0045, 0, 0.66, 0.6471, 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_99587:Import_L50_C0", "label": "math import math", "type": "import", "loc": [50, 50], "level": 0, "parent": null, "vector": [1, 0, 0.2262, 0.0045, 0, 0.66, 0.7059, 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_99587:ImportFrom_L51_C0", "label": "from threading import Thread", "type": "import", "loc": [51, 51], "level": 0, "parent": null, "vector": [1, 0, 0.2308, 0.0045, 0, 0.66, 0.7647, 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_99587:ClassDef_L54_C0", "label": "ROS_Robotis_Server", "type": "class", "loc": [54, 100], "level": 0, "parent": null, "vector": [3, 0, 0.3484, 0.2127, 0, 0.66, 0.8235, 693, 0, 5, 0, 0, 0, 0, 18], "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_99587:FunctionDef_L56_C4", "label": "__init__", "type": "function", "loc": [56, 80], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99587:ClassDef_L54_C0", "vector": [2, 1, 0.3077, 0.1131, 1, 0.17, 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_99587:If_L57_C8", "label": "if", "type": "if", "loc": [57, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L56_C4", "vector": [4, 2, 0.2602, 0.009, 2, 0.76, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if servo == None:\n raise RuntimeError( 'ROS_Robotis_Servo: No servo specified for server.\\n' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99587:Assign_L60_C8", "label": "self.servo =", "type": "assigned_variable", "loc": [60, 60], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L56_C4", "vector": [14, 2, 0.2715, 0.0045, 2, 0.76, 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_99587:Assign_L61_C8", "label": "self.name =", "type": "assigned_variable", "loc": [61, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L56_C4", "vector": [14, 2, 0.276, 0.0045, 2, 0.76, 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_99587:Try_L63_C8", "label": "try", "type": "try", "loc": [63, 66], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L56_C4", "vector": [7, 2, 0.2919, 0.0181, 2, 0.76, 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_99587:Expr_L64_C12", "label": "init_node()", "type": "expression", "loc": [64, 64], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99587:Try_L63_C8", "vector": [8, 3, 0.2896, 0.0045, 3, 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( 'robotis_servo_' + self.name )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99587:Expr_L70_C8", "label": "logout()", "type": "expression", "loc": [70, 70], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L56_C4", "vector": [8, 2, 0.3167, 0.0045, 2, 0.76, 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_99587:Assign_L71_C8", "label": "self.channel = Publisher()", "type": "assigned_variable", "loc": [71, 71], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L56_C4", "vector": [14, 2, 0.3213, 0.0045, 2, 0.76, 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_99587:Assign_L73_C8", "label": "self.__service_ang = Service()", "type": "assigned_variable", "loc": [73, 74], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L56_C4", "vector": [14, 2, 0.3326, 0.009, 2, 0.76, 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_99587:Assign_L76_C8", "label": "self.__service_ismove = Service()", "type": "assigned_variable", "loc": [76, 77], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L56_C4", "vector": [14, 2, 0.3462, 0.009, 2, 0.76, 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_99587:Assign_L79_C8", "label": "self.__service_moveang = Service()", "type": "assigned_variable", "loc": [79, 80], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L56_C4", "vector": [14, 2, 0.3597, 0.009, 2, 0.76, 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_99587:FunctionDef_L82_C4", "label": "__cb_readangle", "type": "function", "loc": [82, 84], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99587:ClassDef_L54_C0", "vector": [2, 1, 0.3756, 0.0136, 1, 0.17, 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_99587:Assign_L83_C8", "label": "ang = update_server()", "type": "assigned_variable", "loc": [83, 83], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L82_C4", "vector": [14, 2, 0.3756, 0.0045, 2, 0.39, 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_99587:Return_L84_C8", "label": "return", "type": "return", "loc": [84, 84], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L82_C4", "vector": [13, 2, 0.3801, 0.0045, 2, 0.39, 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_99587:FunctionDef_L86_C4", "label": "__cb_ismoving", "type": "function", "loc": [86, 88], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99587:ClassDef_L54_C0", "vector": [2, 1, 0.3937, 0.0136, 1, 0.17, 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_99587:Assign_L87_C8", "label": "status = is_moving()", "type": "assigned_variable", "loc": [87, 87], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L86_C4", "vector": [14, 2, 0.3937, 0.0045, 2, 0.34, 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_99587:Return_L88_C8", "label": "return", "type": "return", "loc": [88, 88], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L86_C4", "vector": [13, 2, 0.3982, 0.0045, 2, 0.34, 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_99587:FunctionDef_L90_C4", "label": "__cb_moveangle", "type": "function", "loc": [90, 95], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99587:ClassDef_L54_C0", "vector": [2, 1, 0.4186, 0.0271, 1, 0.17, 0.75, 718, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "__cb_moveangle", "arg_names": ["self", "request"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __cb_moveangle( self, request ):\n ang = request.angle\n angvel = request.angvel\n blocking = bool( request.blocking )\n self.servo.move_angle( ang, angvel, blocking )\n return MoveAngResponse()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99587:Assign_L91_C8", "label": "ang =", "type": "assigned_variable", "loc": [91, 91], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L90_C4", "vector": [14, 2, 0.4118, 0.0045, 2, 0.24, 0.0, 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_99587:Assign_L92_C8", "label": "angvel =", "type": "assigned_variable", "loc": [92, 92], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L90_C4", "vector": [14, 2, 0.4163, 0.0045, 2, 0.24, 0.25, 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_99587:Assign_L93_C8", "label": "blocking = bool()", "type": "assigned_variable", "loc": [93, 93], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L90_C4", "vector": [14, 2, 0.4208, 0.0045, 2, 0.24, 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_99587:Expr_L94_C8", "label": "move_angle()", "type": "expression", "loc": [94, 94], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L90_C4", "vector": [8, 2, 0.4253, 0.0045, 2, 0.24, 0.75, 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_99587:Return_L95_C8", "label": "return", "type": "return", "loc": [95, 95], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L90_C4", "vector": [13, 2, 0.4299, 0.0045, 2, 0.24, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return MoveAngResponse()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L97_C4", "label": "update_server", "type": "function", "loc": [97, 100], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99587:ClassDef_L54_C0", "vector": [2, 1, 0.4457, 0.0181, 1, 0.17, 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_99587:Assign_L98_C8", "label": "ang = read_angle()", "type": "assigned_variable", "loc": [98, 98], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L97_C4", "vector": [14, 2, 0.4434, 0.0045, 2, 0.34, 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_99587:Expr_L99_C8", "label": "publish()", "type": "expression", "loc": [99, 99], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L97_C4", "vector": [8, 2, 0.448, 0.0045, 2, 0.34, 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_99587:Return_L100_C8", "label": "return", "type": "return", "loc": [100, 100], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L97_C4", "vector": [13, 2, 0.4525, 0.0045, 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 ang"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99587:ClassDef_L103_C0", "label": "ROS_Robotis_Poller", "type": "class", "loc": [103, 136], "level": 0, "parent": null, "vector": [3, 0, 0.5407, 0.1538, 0, 0.66, 0.8824, 343, 0, 3, 0, 0, 134, 0, 15], "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_99587:FunctionDef_L105_C4", "label": "__init__", "type": "function", "loc": [105, 122], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99587:ClassDef_L103_C0", "vector": [2, 1, 0.5136, 0.0814, 1, 0.0, 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_99587:Expr_L106_C8", "label": "__init__()", "type": "expression", "loc": [106, 106], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L105_C4", "vector": [8, 2, 0.4796, 0.0045, 2, 0.83, 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_99587:Assign_L108_C8", "label": "self.should_run =", "type": "assigned_variable", "loc": [108, 108], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L105_C4", "vector": [14, 2, 0.4887, 0.0045, 2, 0.83, 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_99587:Assign_L109_C8", "label": "self.dev_name =", "type": "assigned_variable", "loc": [109, 109], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L105_C4", "vector": [14, 2, 0.4932, 0.0045, 2, 0.83, 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_99587:Assign_L110_C8", "label": "self.ids =", "type": "assigned_variable", "loc": [110, 110], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L105_C4", "vector": [14, 2, 0.4977, 0.0045, 2, 0.83, 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_99587:Assign_L111_C8", "label": "self.names =", "type": "assigned_variable", "loc": [111, 111], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L105_C4", "vector": [14, 2, 0.5023, 0.0045, 2, 0.83, 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_99587:For_L113_C8", "label": "for n", "type": "for", "loc": [113, 114], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L105_C4", "vector": [6, 2, 0.5136, 0.009, 2, 0.83, 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_99587:Expr_L114_C12", "label": "logout()", "type": "expression", "loc": [114, 114], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99587:For_L113_C8", "vector": [8, 3, 0.5158, 0.0045, 3, 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( 'ROS_Robotis_Servo: Starting Up /robotis/servo_' + n + ' on ' + self.dev_name )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99587:Assign_L116_C8", "label": "self.dyn = USB2Dynamixel_Device()", "type": "assigned_variable", "loc": [116, 116], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L105_C4", "vector": [14, 2, 0.5249, 0.0045, 2, 0.83, 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 = rs.USB2Dynamixel_Device( self.dev_name )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99587:Assign_L117_C8", "label": "self.servos =", "type": "assigned_variable", "loc": [117, 117], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L105_C4", "vector": [14, 2, 0.5294, 0.0045, 2, 0.83, 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 = [ rs.Robotis_Servo( self.dyn, i ) for i in self.ids ]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99587:Assign_L118_C8", "label": "self.ros_servers =", "type": "assigned_variable", "loc": [118, 118], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L105_C4", "vector": [14, 2, 0.5339, 0.0045, 2, 0.83, 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_99587:Expr_L120_C8", "label": "logout()", "type": "expression", "loc": [120, 120], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L105_C4", "vector": [8, 2, 0.543, 0.0045, 2, 0.83, 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_99587:Expr_L122_C8", "label": "start()", "type": "expression", "loc": [122, 122], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L105_C4", "vector": [8, 2, 0.552, 0.0045, 2, 0.83, 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_99587:FunctionDef_L124_C4", "label": "run", "type": "function", "loc": [124, 130], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99587:ClassDef_L103_C0", "vector": [2, 1, 0.5747, 0.0317, 1, 0.0, 0.5, 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 while self.should_run and not rospy.is_shutdown():\n [ s.update_server() for s in self.ros_servers ]\n time.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_99587:While_L125_C8", "label": "while", "type": "while", "loc": [125, 127], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L124_C4", "vector": [5, 2, 0.5701, 0.0136, 2, 0.75, 0.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 [ s.update_server() for s in self.ros_servers ]\n time.sleep(0.001)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99587:Expr_L126_C12", "label": "expression", "type": "expression", "loc": [126, 126], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99587:While_L125_C8", "vector": [8, 3, 0.5701, 0.0045, 3, 0.93, 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_99587:Expr_L127_C12", "label": "sleep()", "type": "expression", "loc": [127, 127], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99587:While_L125_C8", "vector": [8, 3, 0.5747, 0.0045, 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": " time.sleep(0.001)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99587:For_L129_C8", "label": "for n", "type": "for", "loc": [129, 130], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L124_C4", "vector": [6, 2, 0.586, 0.009, 2, 0.75, 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_99587:Expr_L130_C12", "label": "logout()", "type": "expression", "loc": [130, 130], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99587:For_L129_C8", "vector": [8, 3, 0.5882, 0.0045, 3, 0.69, 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_99587:FunctionDef_L132_C4", "label": "stop", "type": "function", "loc": [132, 136], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99587:ClassDef_L103_C0", "vector": [2, 1, 0.6063, 0.0226, 1, 0.0, 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_99587:Assign_L133_C8", "label": "self.should_run =", "type": "assigned_variable", "loc": [133, 133], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L132_C4", "vector": [14, 2, 0.6018, 0.0045, 2, 0.62, 0.0, 736, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.should_run", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.should_run = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99587:Expr_L134_C8", "label": "join()", "type": "expression", "loc": [134, 134], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L132_C4", "vector": [8, 2, 0.6063, 0.0045, 2, 0.62, 0.5, 933, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "join", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " self.join(3)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99587:If_L135_C8", "label": "if", "type": "if", "loc": [135, 136], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L132_C4", "vector": [4, 2, 0.6131, 0.009, 2, 0.62, 1.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (self.isAlive()):\n raise RuntimeError(\"ROS_Robotis_Servo: unable to stop thread\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99587:ClassDef_L140_C0", "label": "ROS_Robotis_Client", "type": "class", "loc": [140, 168], "level": 0, "parent": null, "vector": [3, 0, 0.6968, 0.1312, 0, 0.66, 0.9412, 769, 0, 4, 0, 0, 0, 0, 12], "semantic": {"name": "ROS_Robotis_Client", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ROS_Robotis_Client():\n # Provides access to the ROS services in the server.\n def __init__(self, name = '' ):\n self.name = name\n\n rospy.wait_for_service('/robotis/servo_' + name + '_readangle')\n rospy.wait_for_service('/robotis/servo_' + name + '_ismoving')\n rospy.wait_for_service('/robotis/servo_' + name + '_moveangle')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L142_C4", "label": "__init__", "type": "function", "loc": [142, 156], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99587:ClassDef_L140_C0", "vector": [2, 1, 0.6742, 0.0679, 1, 0.71, 0.0, 555, 0, 2, 0, 0, 0, 0, 6], "semantic": {"name": "__init__", "arg_names": ["self", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, name = '' ):\n self.name = name\n\n rospy.wait_for_service('/robotis/servo_' + name + '_readangle')\n rospy.wait_for_service('/robotis/servo_' + name + '_ismoving')\n rospy.wait_for_service('/robotis/servo_' + name + '_moveangle')\n\n self.__service_ang = rospy.ServiceProxy('/robotis/servo_' + name + '_readangle',"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99587:Assign_L143_C8", "label": "self.name =", "type": "assigned_variable", "loc": [143, 143], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L142_C4", "vector": [14, 2, 0.6471, 0.0045, 2, 0.23, 0.0, 689, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.name = name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99587:Expr_L145_C8", "label": "wait_for_service()", "type": "expression", "loc": [145, 145], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L142_C4", "vector": [8, 2, 0.6561, 0.0045, 2, 0.23, 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('/robotis/servo_' + name + '_readangle')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99587:Expr_L146_C8", "label": "wait_for_service()", "type": "expression", "loc": [146, 146], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L142_C4", "vector": [8, 2, 0.6606, 0.0045, 2, 0.23, 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('/robotis/servo_' + name + '_ismoving')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99587:Expr_L147_C8", "label": "wait_for_service()", "type": "expression", "loc": [147, 147], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L142_C4", "vector": [8, 2, 0.6652, 0.0045, 2, 0.23, 0.5, 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('/robotis/servo_' + name + '_moveangle')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99587:Assign_L149_C8", "label": "self.__service_ang = ServiceProxy()", "type": "assigned_variable", "loc": [149, 150], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L142_C4", "vector": [14, 2, 0.6765, 0.009, 2, 0.23, 0.6667, 182, 3, 2, 0, 0, 915, 10, 1], "semantic": {"name": "self.__service_ang", "arg_names": [], "import_names": [], "rhs_call_name": "ServiceProxy", "annotation": ""}, "snippet": " self.__service_ang = rospy.ServiceProxy('/robotis/servo_' + name + '_readangle',\n None_Float)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99587:Assign_L152_C8", "label": "self.__service_ismove = ServiceProxy()", "type": "assigned_variable", "loc": [152, 153], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L142_C4", "vector": [14, 2, 0.69, 0.009, 2, 0.23, 0.8333, 913, 3, 2, 0, 0, 915, 10, 1], "semantic": {"name": "self.__service_ismove", "arg_names": [], "import_names": [], "rhs_call_name": "ServiceProxy", "annotation": ""}, "snippet": " self.__service_ismove = rospy.ServiceProxy('/robotis/servo_' + name + '_ismoving',\n None_Int32)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99587:Assign_L155_C8", "label": "self.__service_moveang = ServiceProxy()", "type": "assigned_variable", "loc": [155, 156], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L142_C4", "vector": [14, 2, 0.7036, 0.009, 2, 0.23, 1.0, 463, 3, 2, 0, 0, 915, 10, 1], "semantic": {"name": "self.__service_moveang", "arg_names": [], "import_names": [], "rhs_call_name": "ServiceProxy", "annotation": ""}, "snippet": " self.__service_moveang = rospy.ServiceProxy('/robotis/servo_' + name + '_moveangle',\n MoveAng)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L158_C4", "label": "read_angle", "type": "function", "loc": [158, 161], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99587:ClassDef_L140_C0", "vector": [2, 1, 0.7217, 0.0181, 1, 0.71, 0.3333, 27, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "read_angle", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def read_angle( self ):\n resp = self.__service_ang()\n ang = resp.value\n return ang"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99587:Assign_L159_C8", "label": "resp = __service_ang()", "type": "assigned_variable", "loc": [159, 159], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L158_C4", "vector": [14, 2, 0.7195, 0.0045, 2, 0.8, 0.0, 48, 3, 0, 0, 0, 365, 10, 1], "semantic": {"name": "resp", "arg_names": [], "import_names": [], "rhs_call_name": "__service_ang", "annotation": ""}, "snippet": " resp = self.__service_ang()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99587:Assign_L160_C8", "label": "ang =", "type": "assigned_variable", "loc": [160, 160], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L158_C4", "vector": [14, 2, 0.724, 0.0045, 2, 0.8, 0.5, 762, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ang", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ang = resp.value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99587:Return_L161_C8", "label": "return", "type": "return", "loc": [161, 161], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L158_C4", "vector": [13, 2, 0.7285, 0.0045, 2, 0.8, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ang"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L163_C4", "label": "is_moving", "type": "function", "loc": [163, 165], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99587:ClassDef_L140_C0", "vector": [2, 1, 0.7421, 0.0136, 1, 0.71, 0.6667, 896, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "is_moving", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def is_moving( self ):\n resp = self.__service_ismove()\n return bool( resp.value )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99587:Assign_L164_C8", "label": "resp = __service_ismove()", "type": "assigned_variable", "loc": [164, 164], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L163_C4", "vector": [14, 2, 0.7421, 0.0045, 2, 0.45, 0.0, 48, 3, 0, 0, 0, 810, 10, 1], "semantic": {"name": "resp", "arg_names": [], "import_names": [], "rhs_call_name": "__service_ismove", "annotation": ""}, "snippet": " resp = self.__service_ismove()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99587:Return_L165_C8", "label": "return", "type": "return", "loc": [165, 165], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L163_C4", "vector": [13, 2, 0.7466, 0.0045, 2, 0.45, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return bool( resp.value )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L167_C4", "label": "move_angle", "type": "function", "loc": [167, 168], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99587:ClassDef_L140_C0", "vector": [2, 1, 0.7579, 0.009, 1, 0.71, 1.0, 293, 0, 4, 0, 0, 0, 0, 3], "semantic": {"name": "move_angle", "arg_names": ["self", "ang", "angvel", "blocking"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def move_angle( self, ang, angvel = math.radians(50), blocking = True ):\n self.__service_moveang( ang, angvel, int(blocking) )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99587:Expr_L168_C8", "label": "__service_moveang()", "type": "expression", "loc": [168, 168], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L167_C4", "vector": [8, 2, 0.7602, 0.0045, 2, 0.64, 0.0, 768, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "__service_moveang", "arg_names": [], "import_names": [], "rhs_call_name": "__service_moveang", "annotation": ""}, "snippet": " self.__service_moveang( ang, angvel, int(blocking) )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99587:If_L170_C0", "label": "if", "type": "if", "loc": [170, 198], "level": 0, "parent": null, "vector": [4, 0, 0.8326, 0.1312, 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 print('Sample Server: ')\n\n # Important note: You cannot (!) use the same device (dyn) in another\n # process. The device is only \"thread-safe\" within the same\n # process (i.e. between servos (and callbacks) instantiated\n # within that process) \n "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99587:Expr_L171_C4", "label": "print()", "type": "expression", "loc": [171, 171], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99587:If_L170_C0", "vector": [8, 1, 0.7738, 0.0045, 1, 0.76, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Sample Server: ')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99587:Assign_L181_C4", "label": "dev_name =", "type": "assigned_variable", "loc": [181, 181], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99587:If_L170_C0", "vector": [14, 1, 0.819, 0.0045, 1, 0.76, 0.125, 984, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "dev_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " dev_name = '/dev/robot/servo_left'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99587:Assign_L182_C4", "label": "ids =", "type": "assigned_variable", "loc": [182, 182], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99587:If_L170_C0", "vector": [14, 1, 0.8235, 0.0045, 1, 0.76, 0.25, 202, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "ids", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ids = [11, 12]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99587:Assign_L183_C4", "label": "names =", "type": "assigned_variable", "loc": [183, 183], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99587:If_L170_C0", "vector": [14, 1, 0.8281, 0.0045, 1, 0.76, 0.375, 382, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "names", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " names = ['pan', 'tilt']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99587:Assign_L185_C4", "label": "dyn = USB2Dynamixel_Device()", "type": "assigned_variable", "loc": [185, 185], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99587:If_L170_C0", "vector": [14, 1, 0.8371, 0.0045, 1, 0.76, 0.5, 350, 3, 1, 0, 0, 935, 10, 1], "semantic": {"name": "dyn", "arg_names": [], "import_names": [], "rhs_call_name": "USB2Dynamixel_Device", "annotation": ""}, "snippet": " dyn = rs.USB2Dynamixel_Device( dev_name )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99587:Assign_L187_C4", "label": "servos =", "type": "assigned_variable", "loc": [187, 187], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99587:If_L170_C0", "vector": [14, 1, 0.8462, 0.0045, 1, 0.76, 0.625, 130, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "servos", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " servos = [ rs.Robotis_Servo( dyn, i ) for i in ids ]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99587:Assign_L188_C4", "label": "ros_servers =", "type": "assigned_variable", "loc": [188, 188], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99587:If_L170_C0", "vector": [14, 1, 0.8507, 0.0045, 1, 0.76, 0.75, 394, 5, 0, 0, 0, 0, 0, 2], "semantic": {"name": "ros_servers", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ros_servers = [ ROS_Robotis_Server( s, n ) for s,n in zip( servos, names ) ]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99587:Try_L190_C4", "label": "try", "type": "try", "loc": [190, 195], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99587:If_L170_C0", "vector": [7, 1, 0.871, 0.0271, 1, 0.76, 0.875, 0, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n while not rospy.is_shutdown():\n [ s.update_server() for s in ros_servers ]\n time.sleep(0.001)\n except:\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99587:While_L191_C8", "label": "while", "type": "while", "loc": [191, 193], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99587:Try_L190_C4", "vector": [5, 2, 0.8688, 0.0136, 2, 0.47, 0.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while not rospy.is_shutdown():\n [ s.update_server() for s in ros_servers ]\n time.sleep(0.001)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99587:Expr_L192_C12", "label": "expression", "type": "expression", "loc": [192, 192], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99587:While_L191_C8", "vector": [8, 3, 0.8688, 0.0045, 3, 0.83, 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 ros_servers ]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99587:Expr_L193_C12", "label": "sleep()", "type": "expression", "loc": [193, 193], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99587:While_L191_C8", "vector": [8, 3, 0.8733, 0.0045, 3, 0.83, 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.001)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99587:For_L197_C4", "label": "for n", "type": "for", "loc": [197, 198], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99587:If_L170_C0", "vector": [6, 1, 0.8937, 0.009, 1, 0.76, 1.0, 773, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "n", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for n in names:\n print('ROS_Robotis_Servo: Shutting Down /robotis/servo_'+n)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99587:Expr_L198_C8", "label": "print()", "type": "expression", "loc": [198, 198], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99587:For_L197_C4", "vector": [8, 2, 0.8959, 0.0045, 2, 0.11, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('ROS_Robotis_Servo: Shutting Down /robotis/servo_'+n)"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99587:ClassDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L56_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99587:If_L57_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99587:Assign_L60_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99587:Assign_L61_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99587:Try_L63_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99587:Try_L63_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99587:Expr_L64_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99587:Expr_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99587:Assign_L71_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99587:Assign_L73_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99587:Assign_L76_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99587:Assign_L79_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99587:ClassDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L82_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99587:Assign_L83_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99587:Return_L84_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99587:ClassDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L86_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L86_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99587:Assign_L87_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L86_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99587:Return_L88_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99587:ClassDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L90_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L90_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99587:Assign_L91_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L90_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99587:Assign_L92_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L90_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99587:Assign_L93_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L90_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99587:Expr_L94_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L90_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99587:Return_L95_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99587:ClassDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L97_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99587:Assign_L98_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99587:Expr_L99_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99587:Return_L100_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99587:ClassDef_L103_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L105_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L105_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99587:Expr_L106_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L105_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99587:Assign_L108_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L105_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99587:Assign_L109_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L105_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99587:Assign_L110_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L105_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99587:Assign_L111_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L105_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99587:For_L113_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99587:For_L113_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99587:Expr_L114_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L105_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99587:Assign_L116_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L105_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99587:Assign_L117_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L105_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99587:Assign_L118_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L105_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99587:Expr_L120_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L105_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99587:Expr_L122_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99587:ClassDef_L103_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L124_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L124_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99587:While_L125_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99587:While_L125_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99587:Expr_L126_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99587:While_L125_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99587:Expr_L127_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L124_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99587:For_L129_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99587:For_L129_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99587:Expr_L130_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99587:ClassDef_L103_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L132_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L132_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99587:Assign_L133_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L132_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99587:Expr_L134_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L132_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99587:If_L135_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99587:ClassDef_L140_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L142_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L142_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99587:Assign_L143_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L142_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99587:Expr_L145_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L142_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99587:Expr_L146_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L142_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99587:Expr_L147_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L142_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99587:Assign_L149_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L142_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99587:Assign_L152_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L142_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99587:Assign_L155_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99587:ClassDef_L140_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L158_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L158_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99587:Assign_L159_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L158_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99587:Assign_L160_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L158_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99587:Return_L161_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99587:ClassDef_L140_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L163_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L163_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99587:Assign_L164_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L163_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99587:Return_L165_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99587:ClassDef_L140_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L167_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99587:FunctionDef_L167_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99587:Expr_L168_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99587:If_L170_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99587:Expr_L171_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99587:If_L170_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99587:Assign_L181_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99587:If_L170_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99587:Assign_L182_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99587:If_L170_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99587:Assign_L183_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99587:If_L170_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99587:Assign_L185_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99587:If_L170_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99587:Assign_L187_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99587:If_L170_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99587:Assign_L188_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99587:If_L170_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99587:Try_L190_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99587:Try_L190_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99587:While_L191_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99587:While_L191_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99587:Expr_L192_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99587:While_L191_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99587:Expr_L193_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99587:If_L170_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99587:For_L197_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99587:For_L197_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99587:Expr_L198_C8"}]
# # Copyright (c) 2009, Georgia Tech Research Corporation # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # * Neither the name of the Georgia Tech Research Corporation nor the # names of its contributors may be used to endorse or promote products # derived from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY GEORGIA TECH RESEARCH CORPORATION ''AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL GEORGIA TECH BE LIABLE FOR ANY DIRECT, INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # \author Advait Jain (Healthcare Robotics Lab, Georgia Tech.) import roslib; roslib.load_manifest('pan_tilt_robotis') import time import sys, optparse import numpy as np, math import hrl_lib.util as ut import robotis.robotis_servo as rs class PanTilt(): ## Assumes that both pan and tilt servos are controlled using the # same usb2dynamixel adaptor. # @param dev_name - name of serial device of the servo controller (e.g. '/dev/robot/servo0') # @param pan_id - servo id for the pan Robotis servo. # @param pan_id - servo id for the tilt Robotis servo. # @param baudrate - for the servo controller (usb2dynamixel) # @param pan_speed - max pan speed (radians/sec) # @param tilt_speed - max tilt speed (radians/sec) def __init__(self, dev_name, pan_id, tilt_id, baudrate=57600, pan_speed = math.radians(180), tilt_speed = math.radians(180)): self.pan_servo = rs.robotis_servo(dev_name,pan_id,baudrate, max_speed = pan_speed) self.tilt_servo = rs.robotis_servo(dev_name,tilt_id,baudrate, max_speed = tilt_speed) self.max_pan = self.pan_servo.max_ang self.min_pan = self.pan_servo.min_ang self.max_tilt = self.tilt_servo.max_ang self.min_tilt = self.tilt_servo.min_ang ## return (pan,tilt) angles in RADIANS. def get_pan_tilt(self): pan = self.pan_servo.read_angle() tilt = self.tilt_servo.read_angle() return pan, -tilt ## set (pan,tilt) angles in RADIANS. # blocks until the pan and tilt angles are attained. # @param pan - pan angle (RADIANS) # @param tilt - tilt angle (RADIANS) def set_pan_tilt(self, pan, tilt, speed=math.radians(180)): self.pan_servo.move_angle(pan, angvel=speed, blocking=False) self.tilt_servo.move_angle(tilt, angvel=speed, blocking=True) self.pan_servo.move_angle(pan, angvel=speed, blocking=True) ## new pan,tilt = current pan,tilt + pan_d,tilt_d # blocks until the pan and tilt angles are attained. # @param pan - pan angle (RADIANS) # @param tilt - tilt angle (RADIANS) def set_pan_tilt_delta(self,pan_d,tilt_d): p,t = self.get_pan_tilt() self.set_pan_tilt(p+pan_d,t+tilt_d) def set_ptz_angles_rad(self, pan, tilt): print 'pan_tilt.set_ptz_angles_rad: WARNING this function has been deprecated. use set_pan_tilt' self.set_pan_tilt(pan, tilt) def set_ptz_values(self, pan, tilt, blocking=True): print 'pan_tilt.set_ptz_values: WARNING this function has been deprecated. use set_pan_tilt' self.set_pan_tilt(pan, tilt) def get_ptz_angles_rad(self): print 'pan_tilt.get_ptz_angles_rad: WARNING this function has been deprecated. use set_pan_tilt' return self.get_pan_tilt() def get_ptz_values(self): print 'pan_tilt.get_ptz_values: WARNING this function has been deprecated. use set_pan_tilt' p, t = self.get_pan_tilt() #return p, t return math.degrees(p), math.degrees(t) if __name__ == '__main__': p = optparse.OptionParser() p.add_option('-d', action='store', type='string', dest='servo_dev_name', default='/dev/robot/pan_tilt0', help='servo device string. [default= /dev/robot/pan_tilt0]') p.add_option('--pan_id', action='store', type='int', dest='pan_id', help='id of the pan servo',default=None) p.add_option('--tilt_id', action='store', type='int', dest='tilt_id', help='id of the tilt servo',default=None) p.add_option('--pan', action='store', type='float', dest='pan', help='pan angle (degrees).',default=None) p.add_option('--tilt', action='store', type='float', dest='tilt', help='tilt angle (degrees).',default=None) opt, args = p.parse_args() servo_dev_name = opt.servo_dev_name pan_id = opt.pan_id tilt_id = opt.tilt_id pan = opt.pan tilt = opt.tilt if pan_id == None: print 'Please provide a pan_id' print 'Exiting...' sys.exit() if tilt_id == None: print 'Please provide a tilt_id' print 'Exiting...' sys.exit() if pan == None: print 'Please provide a pan (angle)' print 'Exiting...' sys.exit() if tilt == None: print 'Please provide a tilt (angle)' print 'Exiting...' sys.exit() ptu = PanTilt(servo_dev_name,pan_id,tilt_id) ptu.set_pan_tilt(math.radians(pan),math.radians(tilt)) # For EL-E: # python pan_tilt.py -d /dev/robot/servos_pan_tilt_hat --pan_id=6 --tilt_id=18 --pan=0 --tilt=0
ajibawa-2023/Python-Code-Large/train/row_99589
70
156
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99589:Import_L30_C0", "label": "roslib import roslib", "type": "import", "loc": [30, 30], "level": 0, "parent": null, "vector": [1, 0, 0.1923, 0.0064, 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('pan_tilt_robotis')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99589:Expr_L30_C15", "label": "load_manifest()", "type": "expression", "loc": [30, 30], "level": 0, "parent": null, "vector": [8, 0, 0.1923, 0.0064, 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('pan_tilt_robotis')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99589:Import_L32_C0", "label": "time import time", "type": "import", "loc": [32, 32], "level": 0, "parent": null, "vector": [1, 0, 0.2051, 0.0064, 0, 0.66, 0.25, 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_99589:Import_L33_C0", "label": "sys import sys, optparse", "type": "import", "loc": [33, 33], "level": 0, "parent": null, "vector": [1, 0, 0.2115, 0.0064, 0, 0.66, 0.375, 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_99589:Import_L35_C0", "label": "numpy import np, math", "type": "import", "loc": [35, 35], "level": 0, "parent": null, "vector": [1, 0, 0.2244, 0.0064, 0, 0.66, 0.5, 954, 0, 2, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np", "math"], "rhs_call_name": "", "annotation": ""}, "snippet": "import numpy as np, math"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99589:Import_L37_C0", "label": "hrl_lib.util import ut", "type": "import", "loc": [37, 37], "level": 0, "parent": null, "vector": [1, 0, 0.2372, 0.0064, 0, 0.66, 0.625, 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_99589:Import_L38_C0", "label": "robotis.robotis_servo import rs", "type": "import", "loc": [38, 38], "level": 0, "parent": null, "vector": [1, 0, 0.2436, 0.0064, 0, 0.66, 0.75, 891, 0, 1, 0, 0, 891, 0, 0], "semantic": {"name": "robotis.robotis_servo", "arg_names": [], "import_names": ["rs"], "rhs_call_name": "", "annotation": ""}, "snippet": "import robotis.robotis_servo as rs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99589:ClassDef_L41_C0", "label": "PanTilt", "type": "class", "loc": [41, 106], "level": 0, "parent": null, "vector": [3, 0, 0.4712, 0.4231, 0, 0.66, 0.875, 123, 0, 8, 0, 0, 0, 0, 22], "semantic": {"name": "PanTilt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class PanTilt():\n \n ## Assumes that both pan and tilt servos are controlled using the\n # same usb2dynamixel adaptor.\n # @param dev_name - name of serial device of the servo controller (e.g. '/dev/robot/servo0')\n # @param pan_id - servo id for the pan Robotis servo.\n # @param pan_id - servo id for the tilt Robotis servo.\n # @param baudrate - for the servo controller (usb2dynamixel)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99589:FunctionDef_L51_C4", "label": "__init__", "type": "function", "loc": [51, 63], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99589:ClassDef_L41_C0", "vector": [2, 1, 0.3654, 0.0833, 1, 0.84, 0.0, 555, 0, 7, 0, 0, 0, 0, 4], "semantic": {"name": "__init__", "arg_names": ["self", "dev_name", "pan_id", "tilt_id", "baudrate", "pan_speed", "tilt_speed"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, dev_name, pan_id, tilt_id, baudrate=57600,\n pan_speed = math.radians(180),\n tilt_speed = math.radians(180)):\n self.pan_servo = rs.robotis_servo(dev_name,pan_id,baudrate,\n max_speed = pan_speed)\n self.tilt_servo = rs.robotis_servo(dev_name,tilt_id,baudrate,\n max_speed = tilt_speed)\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99589:Assign_L54_C8", "label": "self.pan_servo = robotis_servo()", "type": "assigned_variable", "loc": [54, 55], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99589:FunctionDef_L51_C4", "vector": [14, 2, 0.3494, 0.0128, 2, 0.8, 0.0, 576, 3, 4, 0, 0, 169, 10, 1], "semantic": {"name": "self.pan_servo", "arg_names": [], "import_names": [], "rhs_call_name": "robotis_servo", "annotation": ""}, "snippet": " self.pan_servo = rs.robotis_servo(dev_name,pan_id,baudrate,\n max_speed = pan_speed)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99589:Assign_L56_C8", "label": "self.tilt_servo = robotis_servo()", "type": "assigned_variable", "loc": [56, 57], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99589:FunctionDef_L51_C4", "vector": [14, 2, 0.3622, 0.0128, 2, 0.8, 0.2, 758, 3, 4, 0, 0, 169, 10, 1], "semantic": {"name": "self.tilt_servo", "arg_names": [], "import_names": [], "rhs_call_name": "robotis_servo", "annotation": ""}, "snippet": " self.tilt_servo = rs.robotis_servo(dev_name,tilt_id,baudrate,\n max_speed = tilt_speed)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99589:Assign_L59_C8", "label": "self.max_pan =", "type": "assigned_variable", "loc": [59, 59], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99589:FunctionDef_L51_C4", "vector": [14, 2, 0.3782, 0.0064, 2, 0.8, 0.4, 365, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.max_pan", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.max_pan = self.pan_servo.max_ang"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99589:Assign_L60_C8", "label": "self.min_pan =", "type": "assigned_variable", "loc": [60, 60], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99589:FunctionDef_L51_C4", "vector": [14, 2, 0.3846, 0.0064, 2, 0.8, 0.6, 149, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.min_pan", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.min_pan = self.pan_servo.min_ang"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99589:Assign_L62_C8", "label": "self.max_tilt =", "type": "assigned_variable", "loc": [62, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99589:FunctionDef_L51_C4", "vector": [14, 2, 0.3974, 0.0064, 2, 0.8, 0.8, 969, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.max_tilt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.max_tilt = self.tilt_servo.max_ang"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99589:Assign_L63_C8", "label": "self.min_tilt =", "type": "assigned_variable", "loc": [63, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99589:FunctionDef_L51_C4", "vector": [14, 2, 0.4038, 0.0064, 2, 0.8, 1.0, 904, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.min_tilt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.min_tilt = self.tilt_servo.min_ang"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99589:FunctionDef_L67_C4", "label": "get_pan_tilt", "type": "function", "loc": [67, 70], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99589:ClassDef_L41_C0", "vector": [2, 1, 0.4391, 0.0256, 1, 0.84, 0.1429, 706, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "get_pan_tilt", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_pan_tilt(self):\n pan = self.pan_servo.read_angle()\n tilt = self.tilt_servo.read_angle()\n return pan, -tilt"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99589:Assign_L68_C8", "label": "pan = read_angle()", "type": "assigned_variable", "loc": [68, 68], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99589:FunctionDef_L67_C4", "vector": [14, 2, 0.4359, 0.0064, 2, 0.32, 0.0, 608, 3, 0, 0, 0, 27, 10, 1], "semantic": {"name": "pan", "arg_names": [], "import_names": [], "rhs_call_name": "read_angle", "annotation": ""}, "snippet": " pan = self.pan_servo.read_angle()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99589:Assign_L69_C8", "label": "tilt = read_angle()", "type": "assigned_variable", "loc": [69, 69], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99589:FunctionDef_L67_C4", "vector": [14, 2, 0.4423, 0.0064, 2, 0.32, 0.5, 974, 3, 0, 0, 0, 27, 10, 1], "semantic": {"name": "tilt", "arg_names": [], "import_names": [], "rhs_call_name": "read_angle", "annotation": ""}, "snippet": " tilt = self.tilt_servo.read_angle()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99589:Return_L70_C8", "label": "return", "type": "return", "loc": [70, 70], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99589:FunctionDef_L67_C4", "vector": [13, 2, 0.4487, 0.0064, 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 pan, -tilt"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99589:FunctionDef_L76_C4", "label": "set_pan_tilt", "type": "function", "loc": [76, 79], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99589:ClassDef_L41_C0", "vector": [2, 1, 0.4968, 0.0256, 1, 0.84, 0.2857, 69, 0, 4, 0, 0, 0, 0, 4], "semantic": {"name": "set_pan_tilt", "arg_names": ["self", "pan", "tilt", "speed"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def set_pan_tilt(self, pan, tilt, speed=math.radians(180)):\n self.pan_servo.move_angle(pan, angvel=speed, blocking=False)\n self.tilt_servo.move_angle(tilt, angvel=speed, blocking=True)\n self.pan_servo.move_angle(pan, angvel=speed, blocking=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99589:Expr_L77_C8", "label": "move_angle()", "type": "expression", "loc": [77, 77], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99589:FunctionDef_L76_C4", "vector": [8, 2, 0.4936, 0.0064, 2, 0.6, 0.0, 293, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "move_angle", "arg_names": [], "import_names": [], "rhs_call_name": "move_angle", "annotation": ""}, "snippet": " self.pan_servo.move_angle(pan, angvel=speed, blocking=False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99589:Expr_L78_C8", "label": "move_angle()", "type": "expression", "loc": [78, 78], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99589:FunctionDef_L76_C4", "vector": [8, 2, 0.5, 0.0064, 2, 0.6, 0.5, 293, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "move_angle", "arg_names": [], "import_names": [], "rhs_call_name": "move_angle", "annotation": ""}, "snippet": " self.tilt_servo.move_angle(tilt, angvel=speed, blocking=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99589:Expr_L79_C8", "label": "move_angle()", "type": "expression", "loc": [79, 79], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99589:FunctionDef_L76_C4", "vector": [8, 2, 0.5064, 0.0064, 2, 0.6, 1.0, 293, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "move_angle", "arg_names": [], "import_names": [], "rhs_call_name": "move_angle", "annotation": ""}, "snippet": " self.pan_servo.move_angle(pan, angvel=speed, blocking=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99589:FunctionDef_L86_C4", "label": "set_pan_tilt_delta", "type": "function", "loc": [86, 88], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99589:ClassDef_L41_C0", "vector": [2, 1, 0.5577, 0.0192, 1, 0.84, 0.4286, 194, 0, 3, 0, 0, 0, 0, 2], "semantic": {"name": "set_pan_tilt_delta", "arg_names": ["self", "pan_d", "tilt_d"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def set_pan_tilt_delta(self,pan_d,tilt_d):\n p,t = self.get_pan_tilt()\n self.set_pan_tilt(p+pan_d,t+tilt_d)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99589:Assign_L87_C8", "label": "p, t = get_pan_tilt()", "type": "assigned_variable", "loc": [87, 87], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99589:FunctionDef_L86_C4", "vector": [14, 2, 0.5577, 0.0064, 2, 0.51, 0.0, 905, 3, 0, 0, 0, 706, 10, 1], "semantic": {"name": "p, t", "arg_names": [], "import_names": [], "rhs_call_name": "get_pan_tilt", "annotation": ""}, "snippet": " p,t = self.get_pan_tilt()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99589:Expr_L88_C8", "label": "set_pan_tilt()", "type": "expression", "loc": [88, 88], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99589:FunctionDef_L86_C4", "vector": [8, 2, 0.5641, 0.0064, 2, 0.51, 1.0, 69, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "set_pan_tilt", "arg_names": [], "import_names": [], "rhs_call_name": "set_pan_tilt", "annotation": ""}, "snippet": " self.set_pan_tilt(p+pan_d,t+tilt_d)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99589:FunctionDef_L90_C4", "label": "set_ptz_angles_rad", "type": "function", "loc": [90, 92], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99589:ClassDef_L41_C0", "vector": [2, 1, 0.5833, 0.0192, 1, 0.84, 0.5714, 370, 0, 3, 0, 0, 0, 0, 2], "semantic": {"name": "set_ptz_angles_rad", "arg_names": ["self", "pan", "tilt"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def set_ptz_angles_rad(self, pan, tilt):\n print('pan_tilt.set_ptz_angles_rad: WARNING this function has been deprecated. use set_pan_tilt')\n self.set_pan_tilt(pan, tilt)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99589:Expr_L91_C8", "label": "print()", "type": "expression", "loc": [91, 91], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99589:FunctionDef_L90_C4", "vector": [8, 2, 0.5833, 0.0064, 2, 0.9, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('pan_tilt.set_ptz_angles_rad: WARNING this function has been deprecated. use set_pan_tilt')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99589:Expr_L92_C8", "label": "set_pan_tilt()", "type": "expression", "loc": [92, 92], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99589:FunctionDef_L90_C4", "vector": [8, 2, 0.5897, 0.0064, 2, 0.9, 1.0, 69, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "set_pan_tilt", "arg_names": [], "import_names": [], "rhs_call_name": "set_pan_tilt", "annotation": ""}, "snippet": " self.set_pan_tilt(pan, tilt)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99589:FunctionDef_L94_C4", "label": "set_ptz_values", "type": "function", "loc": [94, 96], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99589:ClassDef_L41_C0", "vector": [2, 1, 0.609, 0.0192, 1, 0.84, 0.7143, 120, 0, 4, 0, 0, 0, 0, 2], "semantic": {"name": "set_ptz_values", "arg_names": ["self", "pan", "tilt", "blocking"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def set_ptz_values(self, pan, tilt, blocking=True):\n print('pan_tilt.set_ptz_values: WARNING this function has been deprecated. use set_pan_tilt')\n self.set_pan_tilt(pan, tilt)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99589:Expr_L95_C8", "label": "print()", "type": "expression", "loc": [95, 95], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99589:FunctionDef_L94_C4", "vector": [8, 2, 0.609, 0.0064, 2, 0.87, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('pan_tilt.set_ptz_values: WARNING this function has been deprecated. use set_pan_tilt')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99589:Expr_L96_C8", "label": "set_pan_tilt()", "type": "expression", "loc": [96, 96], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99589:FunctionDef_L94_C4", "vector": [8, 2, 0.6154, 0.0064, 2, 0.87, 1.0, 69, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "set_pan_tilt", "arg_names": [], "import_names": [], "rhs_call_name": "set_pan_tilt", "annotation": ""}, "snippet": " self.set_pan_tilt(pan, tilt)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99589:FunctionDef_L98_C4", "label": "get_ptz_angles_rad", "type": "function", "loc": [98, 100], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99589:ClassDef_L41_C0", "vector": [2, 1, 0.6346, 0.0192, 1, 0.84, 0.8571, 953, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "get_ptz_angles_rad", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_ptz_angles_rad(self):\n print('pan_tilt.get_ptz_angles_rad: WARNING this function has been deprecated. use set_pan_tilt')\n return self.get_pan_tilt()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99589:Expr_L99_C8", "label": "print()", "type": "expression", "loc": [99, 99], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99589:FunctionDef_L98_C4", "vector": [8, 2, 0.6346, 0.0064, 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('pan_tilt.get_ptz_angles_rad: WARNING this function has been deprecated. use set_pan_tilt')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99589:Return_L100_C8", "label": "return", "type": "return", "loc": [100, 100], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99589:FunctionDef_L98_C4", "vector": [13, 2, 0.641, 0.0064, 2, 0.13, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.get_pan_tilt()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99589:FunctionDef_L102_C4", "label": "get_ptz_values", "type": "function", "loc": [102, 106], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99589:ClassDef_L41_C0", "vector": [2, 1, 0.6667, 0.0321, 1, 0.84, 1.0, 544, 0, 1, 1, 0, 0, 0, 4], "semantic": {"name": "get_ptz_values", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_ptz_values(self):\n print('pan_tilt.get_ptz_values: WARNING this function has been deprecated. use set_pan_tilt')\n p, t = self.get_pan_tilt()\n #return p, t\n return math.degrees(p), math.degrees(t)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99589:Expr_L103_C8", "label": "print()", "type": "expression", "loc": [103, 103], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99589:FunctionDef_L102_C4", "vector": [8, 2, 0.6603, 0.0064, 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('pan_tilt.get_ptz_values: WARNING this function has been deprecated. use set_pan_tilt')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99589:Assign_L104_C8", "label": "p, t = get_pan_tilt()", "type": "assigned_variable", "loc": [104, 104], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99589:FunctionDef_L102_C4", "vector": [14, 2, 0.6667, 0.0064, 2, 0.37, 0.5, 905, 3, 0, 0, 0, 706, 10, 1], "semantic": {"name": "p, t", "arg_names": [], "import_names": [], "rhs_call_name": "get_pan_tilt", "annotation": ""}, "snippet": " p, t = self.get_pan_tilt()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99589:Return_L106_C8", "label": "return", "type": "return", "loc": [106, 106], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99589:FunctionDef_L102_C4", "vector": [13, 2, 0.6795, 0.0064, 2, 0.37, 1.0, 0, 0, 0, 0, 0, 0, 8, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return math.degrees(p), math.degrees(t)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99589:If_L109_C0", "label": "if", "type": "if", "loc": [109, 150], "level": 0, "parent": null, "vector": [4, 0, 0.8301, 0.2692, 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\n p = optparse.OptionParser()\n p.add_option('-d', action='store', type='string', dest='servo_dev_name',\n default='/dev/robot/pan_tilt0', help='servo device string. [default= /dev/robot/pan_tilt0]')\n p.add_option('--pan_id', action='store', type='int', dest='pan_id',\n help='id of the pan servo',default=None)\n p.add_option('--tilt_id', action='store', type='int', dest='tilt_id',"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99589:Assign_L111_C4", "label": "p = OptionParser()", "type": "assigned_variable", "loc": [111, 111], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99589:If_L109_C0", "vector": [14, 1, 0.7115, 0.0064, 1, 0.48, 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_99589:Expr_L112_C4", "label": "add_option()", "type": "expression", "loc": [112, 113], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99589:If_L109_C0", "vector": [8, 1, 0.7212, 0.0128, 1, 0.48, 0.0588, 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='servo_dev_name',\n default='/dev/robot/pan_tilt0', help='servo device string. [default= /dev/robot/pan_tilt0]')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99589:Expr_L114_C4", "label": "add_option()", "type": "expression", "loc": [114, 115], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99589:If_L109_C0", "vector": [8, 1, 0.734, 0.0128, 1, 0.48, 0.1176, 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('--pan_id', action='store', type='int', dest='pan_id',\n help='id of the pan servo',default=None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99589:Expr_L116_C4", "label": "add_option()", "type": "expression", "loc": [116, 117], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99589:If_L109_C0", "vector": [8, 1, 0.7468, 0.0128, 1, 0.48, 0.1765, 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('--tilt_id', action='store', type='int', dest='tilt_id',\n help='id of the tilt servo',default=None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99589:Expr_L118_C4", "label": "add_option()", "type": "expression", "loc": [118, 119], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99589:If_L109_C0", "vector": [8, 1, 0.7596, 0.0128, 1, 0.48, 0.2353, 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('--pan', action='store', type='float', dest='pan',\n help='pan angle (degrees).',default=None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99589:Expr_L120_C4", "label": "add_option()", "type": "expression", "loc": [120, 121], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99589:If_L109_C0", "vector": [8, 1, 0.7724, 0.0128, 1, 0.48, 0.2941, 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('--tilt', action='store', type='float', dest='tilt',\n help='tilt angle (degrees).',default=None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99589:Assign_L123_C4", "label": "opt, args = parse_args()", "type": "assigned_variable", "loc": [123, 123], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99589:If_L109_C0", "vector": [14, 1, 0.7885, 0.0064, 1, 0.48, 0.3529, 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_99589:Assign_L125_C4", "label": "servo_dev_name =", "type": "assigned_variable", "loc": [125, 125], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99589:If_L109_C0", "vector": [14, 1, 0.8013, 0.0064, 1, 0.48, 0.4118, 801, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "servo_dev_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " servo_dev_name = opt.servo_dev_name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99589:Assign_L126_C4", "label": "pan_id =", "type": "assigned_variable", "loc": [126, 126], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99589:If_L109_C0", "vector": [14, 1, 0.8077, 0.0064, 1, 0.48, 0.4706, 548, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pan_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pan_id = opt.pan_id"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99589:Assign_L127_C4", "label": "tilt_id =", "type": "assigned_variable", "loc": [127, 127], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99589:If_L109_C0", "vector": [14, 1, 0.8141, 0.0064, 1, 0.48, 0.5294, 245, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "tilt_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tilt_id = opt.tilt_id"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99589:Assign_L129_C4", "label": "pan =", "type": "assigned_variable", "loc": [129, 129], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99589:If_L109_C0", "vector": [14, 1, 0.8269, 0.0064, 1, 0.48, 0.5882, 608, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pan", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pan = opt.pan"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99589:Assign_L130_C4", "label": "tilt =", "type": "assigned_variable", "loc": [130, 130], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99589:If_L109_C0", "vector": [14, 1, 0.8333, 0.0064, 1, 0.48, 0.6471, 974, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "tilt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tilt = opt.tilt"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99589:If_L132_C4", "label": "if", "type": "if", "loc": [132, 135], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99589:If_L109_C0", "vector": [4, 1, 0.8558, 0.0256, 1, 0.48, 0.7059, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if pan_id == None:\n print('Please provide a pan_id')\n print('Exiting...')\n sys.exit()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99589:Expr_L133_C8", "label": "print()", "type": "expression", "loc": [133, 133], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99589:If_L132_C4", "vector": [8, 2, 0.8526, 0.0064, 2, 0.43, 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 provide a pan_id')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99589:Expr_L134_C8", "label": "print()", "type": "expression", "loc": [134, 134], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99589:If_L132_C4", "vector": [8, 2, 0.859, 0.0064, 2, 0.43, 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_99589:Expr_L135_C8", "label": "exit()", "type": "expression", "loc": [135, 135], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99589:If_L132_C4", "vector": [8, 2, 0.8654, 0.0064, 2, 0.43, 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_99589:If_L136_C4", "label": "if", "type": "if", "loc": [136, 139], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99589:If_L109_C0", "vector": [4, 1, 0.8814, 0.0256, 1, 0.48, 0.7647, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if tilt_id == None:\n print('Please provide a tilt_id')\n print('Exiting...')\n sys.exit()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99589:Expr_L137_C8", "label": "print()", "type": "expression", "loc": [137, 137], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99589:If_L136_C4", "vector": [8, 2, 0.8782, 0.0064, 2, 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('Please provide a tilt_id')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99589:Expr_L138_C8", "label": "print()", "type": "expression", "loc": [138, 138], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99589:If_L136_C4", "vector": [8, 2, 0.8846, 0.0064, 2, 0.46, 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_99589:Expr_L139_C8", "label": "exit()", "type": "expression", "loc": [139, 139], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99589:If_L136_C4", "vector": [8, 2, 0.891, 0.0064, 2, 0.46, 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_99589:If_L140_C4", "label": "if", "type": "if", "loc": [140, 143], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99589:If_L109_C0", "vector": [4, 1, 0.9071, 0.0256, 1, 0.48, 0.8235, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if pan == None:\n print('Please provide a pan (angle)')\n print('Exiting...')\n sys.exit()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99589:Expr_L141_C8", "label": "print()", "type": "expression", "loc": [141, 141], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99589:If_L140_C4", "vector": [8, 2, 0.9038, 0.0064, 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('Please provide a pan (angle)')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99589:Expr_L142_C8", "label": "print()", "type": "expression", "loc": [142, 142], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99589:If_L140_C4", "vector": [8, 2, 0.9103, 0.0064, 2, 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('Exiting...')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99589:Expr_L143_C8", "label": "exit()", "type": "expression", "loc": [143, 143], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99589:If_L140_C4", "vector": [8, 2, 0.9167, 0.0064, 2, 0.09, 1.0, 436, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "exit", "arg_names": [], "import_names": [], "rhs_call_name": "exit", "annotation": ""}, "snippet": " sys.exit()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99589:If_L144_C4", "label": "if", "type": "if", "loc": [144, 147], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99589:If_L109_C0", "vector": [4, 1, 0.9327, 0.0256, 1, 0.48, 0.8824, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if tilt == None:\n print('Please provide a tilt (angle)')\n print('Exiting...')\n sys.exit()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99589:Expr_L145_C8", "label": "print()", "type": "expression", "loc": [145, 145], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99589:If_L144_C4", "vector": [8, 2, 0.9295, 0.0064, 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('Please provide a tilt (angle)')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99589:Expr_L146_C8", "label": "print()", "type": "expression", "loc": [146, 146], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99589:If_L144_C4", "vector": [8, 2, 0.9359, 0.0064, 2, 0.32, 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_99589:Expr_L147_C8", "label": "exit()", "type": "expression", "loc": [147, 147], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99589:If_L144_C4", "vector": [8, 2, 0.9423, 0.0064, 2, 0.32, 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_99589:Assign_L149_C4", "label": "ptu = PanTilt()", "type": "assigned_variable", "loc": [149, 149], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99589:If_L109_C0", "vector": [14, 1, 0.9551, 0.0064, 1, 0.48, 0.9412, 499, 3, 3, 0, 0, 123, 10, 1], "semantic": {"name": "ptu", "arg_names": [], "import_names": [], "rhs_call_name": "PanTilt", "annotation": ""}, "snippet": " ptu = PanTilt(servo_dev_name,pan_id,tilt_id)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99589:Expr_L150_C4", "label": "set_pan_tilt()", "type": "expression", "loc": [150, 150], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99589:If_L109_C0", "vector": [8, 1, 0.9615, 0.0064, 1, 0.48, 1.0, 69, 3, 2, 0, 0, 0, 0, 3], "semantic": {"name": "set_pan_tilt", "arg_names": [], "import_names": [], "rhs_call_name": "set_pan_tilt", "annotation": ""}, "snippet": " ptu.set_pan_tilt(math.radians(pan),math.radians(tilt))"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99589:ClassDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99589:FunctionDef_L51_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99589:FunctionDef_L51_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99589:Assign_L54_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99589:FunctionDef_L51_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99589:Assign_L56_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99589:FunctionDef_L51_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99589:Assign_L59_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99589:FunctionDef_L51_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99589:Assign_L60_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99589:FunctionDef_L51_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99589:Assign_L62_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99589:FunctionDef_L51_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99589:Assign_L63_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99589:ClassDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99589:FunctionDef_L67_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99589:FunctionDef_L67_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99589:Assign_L68_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99589:FunctionDef_L67_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99589:Assign_L69_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99589:FunctionDef_L67_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99589:Return_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99589:ClassDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99589:FunctionDef_L76_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99589:FunctionDef_L76_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99589:Expr_L77_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99589:FunctionDef_L76_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99589:Expr_L78_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99589:FunctionDef_L76_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99589:Expr_L79_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99589:ClassDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99589:FunctionDef_L86_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99589:FunctionDef_L86_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99589:Assign_L87_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99589:FunctionDef_L86_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99589:Expr_L88_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99589:ClassDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99589:FunctionDef_L90_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99589:FunctionDef_L90_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99589:Expr_L91_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99589:FunctionDef_L90_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99589:Expr_L92_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99589:ClassDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99589:FunctionDef_L94_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99589:FunctionDef_L94_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99589:Expr_L95_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99589:FunctionDef_L94_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99589:Expr_L96_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99589:ClassDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99589:FunctionDef_L98_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99589:FunctionDef_L98_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99589:Expr_L99_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99589:FunctionDef_L98_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99589:Return_L100_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99589:ClassDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99589:FunctionDef_L102_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99589:FunctionDef_L102_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99589:Expr_L103_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99589:FunctionDef_L102_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99589:Assign_L104_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99589:FunctionDef_L102_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99589:Return_L106_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99589:If_L109_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99589:Assign_L111_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99589:If_L109_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99589:Expr_L112_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99589:If_L109_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99589:Expr_L114_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99589:If_L109_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99589:Expr_L116_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99589:If_L109_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99589:Expr_L118_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99589:If_L109_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99589:Expr_L120_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99589:If_L109_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99589:Assign_L123_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99589:If_L109_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99589:Assign_L125_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99589:If_L109_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99589:Assign_L126_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99589:If_L109_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99589:Assign_L127_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99589:If_L109_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99589:Assign_L129_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99589:If_L109_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99589:Assign_L130_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99589:If_L109_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99589:If_L132_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99589:If_L132_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99589:Expr_L133_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99589:If_L132_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99589:Expr_L134_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99589:If_L132_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99589:Expr_L135_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99589:If_L109_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99589:If_L136_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99589:If_L136_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99589:Expr_L137_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99589:If_L136_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99589:Expr_L138_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99589:If_L136_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99589:Expr_L139_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99589:If_L109_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99589:If_L140_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99589:If_L140_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99589:Expr_L141_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99589:If_L140_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99589:Expr_L142_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99589:If_L140_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99589:Expr_L143_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99589:If_L109_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99589:If_L144_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99589:If_L144_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99589:Expr_L145_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99589:If_L144_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99589:Expr_L146_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99589:If_L144_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99589:Expr_L147_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99589:If_L109_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99589:Assign_L149_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99589:If_L109_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99589:Expr_L150_C4"}]
import time import sys, os, copy import numpy as np, math import scipy.ndimage as ni class occupancy_grid_3d(): ## # @param resolution - 3x1 matrix. size of each cell (in meters) along # the different directions. def __init__(self, center, size, resolution, data, occupancy_threshold, to_binary = True): self.grid_shape = size/resolution tlb = center + size/2 brf = center + size/2 self.size = size self.grid = np.reshape(data, self.grid_shape) self.grid_shape = np.matrix(self.grid.shape).T self.resolution = resolution self.center = center if to_binary: self.to_binary(occupancy_threshold) ## binarize the grid # @param occupancy_threshold - voxels with occupancy less than this are set to zero. def to_binary(self, occupancy_threshold): filled = (self.grid >= occupancy_threshold) self.grid[np.where(filled==True)] = 1 self.grid[np.where(filled==False)] = 0 ## # @param array - if not None then this will be used instead of self.grid # @return 3xN matrix of 3d coord of the cells which have occupancy = 1 def grid_to_points(self, array=None): if array == None: array = self.grid idxs = np.where(array == 1) x_idx = idxs[0] y_idx = idxs[1] z_idx = idxs[2] x = x_idx * self.resolution[0,0] + self.center[0,0] - self.size[0,0]/2 y = y_idx * self.resolution[1,0] + self.center[1,0] - self.size[1,0]/2 z = z_idx * self.resolution[2,0] + self.center[2,0] - self.size[2,0]/2 return np.matrix(np.row_stack([x,y,z])) ## 27-connected components. # @param threshold - min allowed size of connected component def connected_comonents(self, threshold): connect_structure = np.ones((3,3,3), dtype='int') grid = self.grid labeled_arr, n_labels = ni.label(grid, connect_structure) if n_labels == 0: return labeled_arr, n_labels labels_list = range(1,n_labels+1) count_objects = ni.sum(grid, labeled_arr, labels_list) if n_labels == 1: count_objects = [count_objects] t0 = time.time() new_labels_list = [] for c,l in zip(count_objects, labels_list): if c > threshold: new_labels_list.append(l) else: labeled_arr[np.where(labeled_arr == l)] = 0 # relabel stuff for nl,l in enumerate(new_labels_list): labeled_arr[np.where(labeled_arr == l)] = nl+1 n_labels = len(new_labels_list) t1 = time.time() print 'time:', t1-t0 return labeled_arr, n_labels if __name__ == '__main__': print 'Hello World'
ajibawa-2023/Python-Code-Large/train/row_99590
55
89
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99590:Import_L2_C0", "label": "time import time", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0225, 0.0112, 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_99590:Import_L3_C0", "label": "sys import sys, os, copy", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0337, 0.0112, 0, 0.66, 0.2, 509, 0, 3, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys", "os", "copy"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys, os, copy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99590:Import_L4_C0", "label": "numpy import np, math", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0449, 0.0112, 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_99590:Import_L5_C0", "label": "scipy.ndimage import ni", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0562, 0.0112, 0, 0.66, 0.6, 348, 0, 1, 0, 0, 348, 0, 0], "semantic": {"name": "scipy.ndimage", "arg_names": [], "import_names": ["ni"], "rhs_call_name": "", "annotation": ""}, "snippet": "import scipy.ndimage as ni"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99590:ClassDef_L7_C0", "label": "occupancy_grid_3d", "type": "class", "loc": [7, 82], "level": 0, "parent": null, "vector": [3, 0, 0.5, 0.8539, 0, 0.66, 0.8, 222, 0, 4, 0, 0, 0, 0, 21], "semantic": {"name": "occupancy_grid_3d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class occupancy_grid_3d():\n\n ##\n # @param resolution - 3x1 matrix. size of each cell (in meters) along\n # the different directions.\n def __init__(self, center, size, resolution, data,\n occupancy_threshold, to_binary = True):\n self.grid_shape = size/resolution"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99590:FunctionDef_L12_C4", "label": "__init__", "type": "function", "loc": [12, 25], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99590:ClassDef_L7_C0", "vector": [2, 1, 0.2079, 0.1573, 1, 0.27, 0.0, 555, 0, 7, 0, 0, 0, 0, 3], "semantic": {"name": "__init__", "arg_names": ["self", "center", "size", "resolution", "data", "occupancy_threshold", "to_binary"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, center, size, resolution, data,\n occupancy_threshold, to_binary = True):\n self.grid_shape = size/resolution\n tlb = center + size/2\n brf = center + size/2\n\n self.size = size\n self.grid = np.reshape(data, self.grid_shape)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99590:Assign_L14_C8", "label": "self.grid_shape =", "type": "assigned_variable", "loc": [14, 14], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99590:FunctionDef_L12_C4", "vector": [14, 2, 0.1573, 0.0112, 2, 0.02, 0.0, 573, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.grid_shape", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.grid_shape = size/resolution"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99590:Assign_L15_C8", "label": "tlb =", "type": "assigned_variable", "loc": [15, 15], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99590:FunctionDef_L12_C4", "vector": [14, 2, 0.1685, 0.0112, 2, 0.02, 0.125, 90, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "tlb", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tlb = center + size/2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99590:Assign_L16_C8", "label": "brf =", "type": "assigned_variable", "loc": [16, 16], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99590:FunctionDef_L12_C4", "vector": [14, 2, 0.1798, 0.0112, 2, 0.02, 0.25, 17, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "brf", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " brf = center + size/2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99590:Assign_L18_C8", "label": "self.size =", "type": "assigned_variable", "loc": [18, 18], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99590:FunctionDef_L12_C4", "vector": [14, 2, 0.2022, 0.0112, 2, 0.02, 0.375, 183, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.size", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.size = size"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99590:Assign_L19_C8", "label": "self.grid = reshape()", "type": "assigned_variable", "loc": [19, 19], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99590:FunctionDef_L12_C4", "vector": [14, 2, 0.2135, 0.0112, 2, 0.02, 0.5, 16, 3, 2, 0, 0, 276, 10, 1], "semantic": {"name": "self.grid", "arg_names": [], "import_names": [], "rhs_call_name": "reshape", "annotation": ""}, "snippet": " self.grid = np.reshape(data, self.grid_shape)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99590:Assign_L20_C8", "label": "self.grid_shape =", "type": "assigned_variable", "loc": [20, 20], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99590:FunctionDef_L12_C4", "vector": [14, 2, 0.2247, 0.0112, 2, 0.02, 0.625, 573, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.grid_shape", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.grid_shape = np.matrix(self.grid.shape).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99590:Assign_L21_C8", "label": "self.resolution =", "type": "assigned_variable", "loc": [21, 21], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99590:FunctionDef_L12_C4", "vector": [14, 2, 0.236, 0.0112, 2, 0.02, 0.75, 440, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.resolution", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.resolution = resolution"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99590:Assign_L22_C8", "label": "self.center =", "type": "assigned_variable", "loc": [22, 22], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99590:FunctionDef_L12_C4", "vector": [14, 2, 0.2472, 0.0112, 2, 0.02, 0.875, 46, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.center", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.center = center"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99590:If_L24_C8", "label": "if", "type": "if", "loc": [24, 25], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99590:FunctionDef_L12_C4", "vector": [4, 2, 0.2753, 0.0225, 2, 0.02, 1.0, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if to_binary:\n self.to_binary(occupancy_threshold)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99590:Expr_L25_C12", "label": "to_binary()", "type": "expression", "loc": [25, 25], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99590:If_L24_C8", "vector": [8, 3, 0.2809, 0.0112, 3, 0.6, 0.0, 206, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "to_binary", "arg_names": [], "import_names": [], "rhs_call_name": "to_binary", "annotation": ""}, "snippet": " self.to_binary(occupancy_threshold)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99590:FunctionDef_L29_C4", "label": "to_binary", "type": "function", "loc": [29, 32], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99590:ClassDef_L7_C0", "vector": [2, 1, 0.3427, 0.0449, 1, 0.27, 0.3333, 206, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "to_binary", "arg_names": ["self", "occupancy_threshold"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def to_binary(self, occupancy_threshold):\n filled = (self.grid >= occupancy_threshold)\n self.grid[np.where(filled==True)] = 1\n self.grid[np.where(filled==False)] = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99590:Assign_L30_C8", "label": "filled =", "type": "assigned_variable", "loc": [30, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99590:FunctionDef_L29_C4", "vector": [14, 2, 0.3371, 0.0112, 2, 0.71, 0.0, 984, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "filled", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " filled = (self.grid >= occupancy_threshold)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99590:Assign_L31_C8", "label": "assign", "type": "assigned_variable", "loc": [31, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99590:FunctionDef_L29_C4", "vector": [14, 2, 0.3483, 0.0112, 2, 0.71, 0.5, 0, 1, 0, 0, 0, 0, 1, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.grid[np.where(filled==True)] = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99590:Assign_L32_C8", "label": "assign", "type": "assigned_variable", "loc": [32, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99590:FunctionDef_L29_C4", "vector": [14, 2, 0.3596, 0.0112, 2, 0.71, 1.0, 0, 1, 0, 0, 0, 0, 1, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.grid[np.where(filled==False)] = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99590:FunctionDef_L37_C4", "label": "grid_to_points", "type": "function", "loc": [37, 50], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99590:ClassDef_L7_C0", "vector": [2, 1, 0.4888, 0.1573, 1, 0.27, 0.6667, 558, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "grid_to_points", "arg_names": ["self", "array"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def grid_to_points(self, array=None):\n if array == None:\n array = self.grid\n\n idxs = np.where(array == 1)\n x_idx = idxs[0]\n y_idx = idxs[1]\n z_idx = idxs[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99590:If_L38_C8", "label": "if", "type": "if", "loc": [38, 39], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99590:FunctionDef_L37_C4", "vector": [4, 2, 0.4326, 0.0225, 2, 0.08, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if array == None:\n array = self.grid"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99590:Assign_L39_C12", "label": "array =", "type": "assigned_variable", "loc": [39, 39], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99590:If_L38_C8", "vector": [14, 3, 0.4382, 0.0112, 3, 0.85, 0.0, 80, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "array", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " array = self.grid"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99590:Assign_L41_C8", "label": "idxs = where()", "type": "assigned_variable", "loc": [41, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99590:FunctionDef_L37_C4", "vector": [14, 2, 0.4607, 0.0112, 2, 0.08, 0.125, 677, 3, 1, 0, 0, 169, 10, 1], "semantic": {"name": "idxs", "arg_names": [], "import_names": [], "rhs_call_name": "where", "annotation": ""}, "snippet": " idxs = np.where(array == 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99590:Assign_L42_C8", "label": "x_idx =", "type": "assigned_variable", "loc": [42, 42], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99590:FunctionDef_L37_C4", "vector": [14, 2, 0.4719, 0.0112, 2, 0.08, 0.25, 380, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "x_idx", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " x_idx = idxs[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99590:Assign_L43_C8", "label": "y_idx =", "type": "assigned_variable", "loc": [43, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99590:FunctionDef_L37_C4", "vector": [14, 2, 0.4831, 0.0112, 2, 0.08, 0.375, 821, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "y_idx", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " y_idx = idxs[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99590:Assign_L44_C8", "label": "z_idx =", "type": "assigned_variable", "loc": [44, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99590:FunctionDef_L37_C4", "vector": [14, 2, 0.4944, 0.0112, 2, 0.08, 0.5, 160, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "z_idx", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " z_idx = idxs[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99590:Assign_L46_C8", "label": "x =", "type": "assigned_variable", "loc": [46, 46], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99590:FunctionDef_L37_C4", "vector": [14, 2, 0.5169, 0.0112, 2, 0.08, 0.625, 190, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " x = x_idx * self.resolution[0,0] + self.center[0,0] - self.size[0,0]/2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99590:Assign_L47_C8", "label": "y =", "type": "assigned_variable", "loc": [47, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99590:FunctionDef_L37_C4", "vector": [14, 2, 0.5281, 0.0112, 2, 0.08, 0.75, 304, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " y = y_idx * self.resolution[1,0] + self.center[1,0] - self.size[1,0]/2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99590:Assign_L48_C8", "label": "z =", "type": "assigned_variable", "loc": [48, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99590:FunctionDef_L37_C4", "vector": [14, 2, 0.5393, 0.0112, 2, 0.08, 0.875, 859, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " z = z_idx * self.resolution[2,0] + self.center[2,0] - self.size[2,0]/2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99590:Return_L50_C8", "label": "return", "type": "return", "loc": [50, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99590:FunctionDef_L37_C4", "vector": [13, 2, 0.5618, 0.0112, 2, 0.08, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return np.matrix(np.row_stack([x,y,z]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99590:FunctionDef_L54_C4", "label": "connected_comonents", "type": "function", "loc": [54, 82], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99590:ClassDef_L7_C0", "vector": [2, 1, 0.764, 0.3258, 1, 0.27, 1.0, 553, 0, 2, 1, 0, 0, 0, 13], "semantic": {"name": "connected_comonents", "arg_names": ["self", "threshold"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def connected_comonents(self, threshold):\n connect_structure = np.ones((3,3,3), dtype='int')\n grid = self.grid\n labeled_arr, n_labels = ni.label(grid, connect_structure)\n\n if n_labels == 0:\n return labeled_arr, n_labels\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99590:Assign_L55_C8", "label": "connect_structure = ones()", "type": "assigned_variable", "loc": [55, 55], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99590:FunctionDef_L54_C4", "vector": [14, 2, 0.618, 0.0112, 2, 0.57, 0.0, 297, 3, 2, 0, 0, 530, 10, 1], "semantic": {"name": "connect_structure", "arg_names": [], "import_names": [], "rhs_call_name": "ones", "annotation": ""}, "snippet": " connect_structure = np.ones((3,3,3), dtype='int')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99590:Assign_L56_C8", "label": "grid =", "type": "assigned_variable", "loc": [56, 56], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99590:FunctionDef_L54_C4", "vector": [14, 2, 0.6292, 0.0112, 2, 0.57, 0.0714, 690, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "grid", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " grid = self.grid"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99590:Assign_L57_C8", "label": "labeled_arr, n_labels = label()", "type": "assigned_variable", "loc": [57, 57], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99590:FunctionDef_L54_C4", "vector": [14, 2, 0.6404, 0.0112, 2, 0.57, 0.1429, 952, 3, 2, 0, 0, 811, 10, 1], "semantic": {"name": "labeled_arr, n_labels", "arg_names": [], "import_names": [], "rhs_call_name": "label", "annotation": ""}, "snippet": " labeled_arr, n_labels = ni.label(grid, connect_structure)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99590:If_L59_C8", "label": "if", "type": "if", "loc": [59, 60], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99590:FunctionDef_L54_C4", "vector": [4, 2, 0.6685, 0.0225, 2, 0.57, 0.2143, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if n_labels == 0:\n return labeled_arr, n_labels"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99590:Return_L60_C12", "label": "return", "type": "return", "loc": [60, 60], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99590:If_L59_C8", "vector": [13, 3, 0.6742, 0.0112, 3, 0.95, 0.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return labeled_arr, n_labels"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99590:Assign_L62_C8", "label": "labels_list = range()", "type": "assigned_variable", "loc": [62, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99590:FunctionDef_L54_C4", "vector": [14, 2, 0.6966, 0.0112, 2, 0.57, 0.2857, 325, 3, 2, 0, 0, 816, 10, 1], "semantic": {"name": "labels_list", "arg_names": [], "import_names": [], "rhs_call_name": "range", "annotation": ""}, "snippet": " labels_list = range(1,n_labels+1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99590:Assign_L63_C8", "label": "count_objects = sum()", "type": "assigned_variable", "loc": [63, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99590:FunctionDef_L54_C4", "vector": [14, 2, 0.7079, 0.0112, 2, 0.57, 0.3571, 769, 3, 3, 0, 0, 824, 10, 1], "semantic": {"name": "count_objects", "arg_names": [], "import_names": [], "rhs_call_name": "sum", "annotation": ""}, "snippet": " count_objects = ni.sum(grid, labeled_arr, labels_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99590:If_L64_C8", "label": "if", "type": "if", "loc": [64, 65], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99590:FunctionDef_L54_C4", "vector": [4, 2, 0.7247, 0.0225, 2, 0.57, 0.4286, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if n_labels == 1:\n count_objects = [count_objects]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99590:Assign_L65_C12", "label": "count_objects =", "type": "assigned_variable", "loc": [65, 65], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99590:If_L64_C8", "vector": [14, 3, 0.7303, 0.0112, 3, 0.35, 0.0, 769, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "count_objects", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " count_objects = [count_objects]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99590:Assign_L67_C8", "label": "t0 = time()", "type": "assigned_variable", "loc": [67, 67], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99590:FunctionDef_L54_C4", "vector": [14, 2, 0.7528, 0.0112, 2, 0.57, 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_99590:Assign_L68_C8", "label": "new_labels_list =", "type": "assigned_variable", "loc": [68, 68], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99590:FunctionDef_L54_C4", "vector": [14, 2, 0.764, 0.0112, 2, 0.57, 0.5714, 12, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "new_labels_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " new_labels_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99590:For_L70_C8", "label": "for c, l", "type": "for", "loc": [70, 74], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99590:FunctionDef_L54_C4", "vector": [6, 2, 0.809, 0.0562, 2, 0.57, 0.6429, 723, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "c, l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for c,l in zip(count_objects, labels_list):\n if c > threshold:\n new_labels_list.append(l)\n else:\n labeled_arr[np.where(labeled_arr == l)] = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99590:If_L71_C12", "label": "if", "type": "if", "loc": [71, 74], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99590:For_L70_C8", "vector": [4, 3, 0.8146, 0.0449, 3, 0.59, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if c > threshold:\n new_labels_list.append(l)\n else:\n labeled_arr[np.where(labeled_arr == l)] = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99590:Expr_L72_C16", "label": "append()", "type": "expression", "loc": [72, 72], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99590:If_L71_C12", "vector": [8, 4, 0.809, 0.0112, 4, 0.39, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " new_labels_list.append(l)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99590:Assign_L74_C16", "label": "assign", "type": "assigned_variable", "loc": [74, 74], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99590:If_L71_C12", "vector": [14, 4, 0.8315, 0.0112, 4, 0.39, 1.0, 0, 1, 0, 0, 0, 0, 1, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " labeled_arr[np.where(labeled_arr == l)] = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99590:For_L77_C8", "label": "for nl, l", "type": "for", "loc": [77, 78], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99590:FunctionDef_L54_C4", "vector": [6, 2, 0.8708, 0.0225, 2, 0.57, 0.7143, 313, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "nl, l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for nl,l in enumerate(new_labels_list):\n labeled_arr[np.where(labeled_arr == l)] = nl+1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99590:Assign_L78_C12", "label": "assign", "type": "assigned_variable", "loc": [78, 78], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99590:For_L77_C8", "vector": [14, 3, 0.8764, 0.0112, 3, 0.01, 0.0, 0, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " labeled_arr[np.where(labeled_arr == l)] = nl+1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99590:Assign_L79_C8", "label": "n_labels = len()", "type": "assigned_variable", "loc": [79, 79], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99590:FunctionDef_L54_C4", "vector": [14, 2, 0.8876, 0.0112, 2, 0.57, 0.7857, 797, 3, 1, 0, 0, 890, 10, 1], "semantic": {"name": "n_labels", "arg_names": [], "import_names": [], "rhs_call_name": "len", "annotation": ""}, "snippet": " n_labels = len(new_labels_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99590:Assign_L80_C8", "label": "t1 = time()", "type": "assigned_variable", "loc": [80, 80], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99590:FunctionDef_L54_C4", "vector": [14, 2, 0.8989, 0.0112, 2, 0.57, 0.8571, 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_99590:Expr_L81_C8", "label": "print()", "type": "expression", "loc": [81, 81], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99590:FunctionDef_L54_C4", "vector": [8, 2, 0.9101, 0.0112, 2, 0.57, 0.9286, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('time:', t1-t0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99590:Return_L82_C8", "label": "return", "type": "return", "loc": [82, 82], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99590:FunctionDef_L54_C4", "vector": [13, 2, 0.9213, 0.0112, 2, 0.57, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return labeled_arr, n_labels"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99590:If_L87_C0", "label": "if", "type": "if", "loc": [87, 88], "level": 0, "parent": null, "vector": [4, 0, 0.9831, 0.0225, 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 print('Hello World')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99590:Expr_L88_C4", "label": "print()", "type": "expression", "loc": [88, 88], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99590:If_L87_C0", "vector": [8, 1, 0.9888, 0.0112, 1, 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('Hello World')"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99590:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99590:FunctionDef_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99590:FunctionDef_L12_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99590:Assign_L14_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99590:FunctionDef_L12_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99590:Assign_L15_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99590:FunctionDef_L12_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99590:Assign_L16_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99590:FunctionDef_L12_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99590:Assign_L18_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99590:FunctionDef_L12_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99590:Assign_L19_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99590:FunctionDef_L12_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99590:Assign_L20_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99590:FunctionDef_L12_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99590:Assign_L21_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99590:FunctionDef_L12_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99590:Assign_L22_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99590:FunctionDef_L12_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99590:If_L24_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99590:If_L24_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99590:Expr_L25_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99590:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99590:FunctionDef_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99590:FunctionDef_L29_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99590:Assign_L30_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99590:FunctionDef_L29_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99590:Assign_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99590:FunctionDef_L29_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99590:Assign_L32_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99590:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99590:FunctionDef_L37_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99590:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99590:If_L38_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99590:If_L38_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99590:Assign_L39_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99590:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99590:Assign_L41_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99590:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99590:Assign_L42_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99590:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99590:Assign_L43_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99590:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99590:Assign_L44_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99590:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99590:Assign_L46_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99590:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99590:Assign_L47_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99590:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99590:Assign_L48_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99590:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99590:Return_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99590:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99590:FunctionDef_L54_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99590:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99590:Assign_L55_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99590:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99590:Assign_L56_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99590:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99590:Assign_L57_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99590:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99590:If_L59_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99590:If_L59_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99590:Return_L60_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99590:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99590:Assign_L62_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99590:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99590:Assign_L63_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99590:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99590:If_L64_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99590:If_L64_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99590:Assign_L65_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99590:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99590:Assign_L67_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99590:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99590:Assign_L68_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99590:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99590:For_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99590:For_L70_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99590:If_L71_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99590:If_L71_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99590:Expr_L72_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99590:If_L71_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99590:Assign_L74_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99590:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99590:For_L77_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99590:For_L77_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99590:Assign_L78_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99590:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99590:Assign_L79_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99590:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99590:Assign_L80_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99590:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99590:Expr_L81_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99590:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99590:Return_L82_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99590:If_L87_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99590:Expr_L88_C4"}]
import sys import numpy as np, math import add_cylinder as ac import online_collision_detection as ocd import roslib; roslib.load_manifest('arm_navigation_tutorials') import rospy from mapping_msgs.msg import CollisionObject from visualization_msgs.msg import Marker import hrl_lib.transforms as tr import hrl_lib.viz as hv roslib.load_manifest('hrl_pr2_lib') import hrl_pr2_lib.pr2_arms as pa roslib.load_manifest('force_torque') # hack by Advait import force_torque.FTClient as ftc import tf class object_ft_sensors(): def __init__(self): self.obj1_ftc = ftc.FTClient('force_torque_ft2') self.tf_lstnr = tf.TransformListener() def get_forces(self, bias = True): # later I might be looping over all the different objects, # returning a dictionary of <object_id: force_vector> f = self.obj1_ftc.read(without_bias = not bias) f = f[0:3, :] trans, quat = self.tf_lstnr.lookupTransform('/torso_lift_link', '/ft2', rospy.Time(0)) rot = tr.quaternion_to_matrix(quat) f = rot * f return -f # the negative is intentional (Advait, Nov 24. 2010.) def bias_fts(self): self.obj1_ftc.bias() def get_arrow_text_markers(p, f, frame, m_id, duration): t_now = rospy.Time.now() q = hv.arrow_direction_to_quat(f) arrow_len = np.linalg.norm(f) * 0.04 scale = (arrow_len, 0.2, 0.2) m1 = hv.single_marker(p, q, 'arrow', frame, scale, m_id = m_id, duration = duration) m1.header.stamp = t_now m2 = hv.single_marker(p, q, 'text_view_facing', frame, (0.1, 0.1, 0.1), m_id = m_id+1, duration = duration, color=(1.,0.,0.,1.)) m2.text = '%.1f N'%(np.linalg.norm(f)) m2.header.stamp = t_now return m1, m2 if __name__ == '__main__': rospy.init_node('force_visualize_test') marker_pub = rospy.Publisher('/skin/viz_marker', Marker) fts = object_ft_sensors() fts.bias_fts() pr2_arms = pa.PR2Arms() r_arm, l_arm = 0, 1 arm = r_arm while not rospy.is_shutdown(): f = fts.get_forces() p, r = pr2_arms.end_effector_pos(arm) m1, m2 = get_arrow_text_markers(p, f, 'torso_lift_link', 0, 1.) marker_pub.publish(m1) marker_pub.publish(m2) rospy.sleep(0.1)
ajibawa-2023/Python-Code-Large/train/row_99591
55
89
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99591:Import_L2_C0", "label": "sys import sys", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0225, 0.0112, 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_99591:Import_L3_C0", "label": "numpy import np, math", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0337, 0.0112, 0, 0.66, 0.0556, 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_99591:Import_L5_C0", "label": "add_cylinder import ac", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0562, 0.0112, 0, 0.66, 0.1111, 412, 0, 1, 0, 0, 412, 0, 0], "semantic": {"name": "add_cylinder", "arg_names": [], "import_names": ["ac"], "rhs_call_name": "", "annotation": ""}, "snippet": "import add_cylinder as ac"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99591:Import_L6_C0", "label": "online_collision_detection import ocd", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0674, 0.0112, 0, 0.66, 0.1667, 626, 0, 1, 0, 0, 626, 0, 0], "semantic": {"name": "online_collision_detection", "arg_names": [], "import_names": ["ocd"], "rhs_call_name": "", "annotation": ""}, "snippet": "import online_collision_detection as ocd"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99591:Import_L8_C0", "label": "roslib import roslib", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.0899, 0.0112, 0, 0.66, 0.2222, 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('arm_navigation_tutorials')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99591:Expr_L8_C15", "label": "load_manifest()", "type": "expression", "loc": [8, 8], "level": 0, "parent": null, "vector": [8, 0, 0.0899, 0.0112, 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": "import roslib; roslib.load_manifest('arm_navigation_tutorials')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99591:Import_L9_C0", "label": "rospy import rospy", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.1011, 0.0112, 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_99591:ImportFrom_L10_C0", "label": "from mapping_msgs.msg import CollisionObject", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.1124, 0.0112, 0, 0.66, 0.3889, 483, 0, 1, 0, 0, 483, 0, 0], "semantic": {"name": "mapping_msgs.msg", "arg_names": [], "import_names": ["CollisionObject"], "rhs_call_name": "", "annotation": ""}, "snippet": "from mapping_msgs.msg import CollisionObject"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99591:ImportFrom_L11_C0", "label": "from visualization_msgs.msg import Marker", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.1236, 0.0112, 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_99591:Import_L13_C0", "label": "hrl_lib.transforms import tr", "type": "import", "loc": [13, 13], "level": 0, "parent": null, "vector": [1, 0, 0.1461, 0.0112, 0, 0.66, 0.5, 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_99591:Import_L14_C0", "label": "hrl_lib.viz import hv", "type": "import", "loc": [14, 14], "level": 0, "parent": null, "vector": [1, 0, 0.1573, 0.0112, 0, 0.66, 0.5556, 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_99591:Expr_L16_C0", "label": "load_manifest()", "type": "expression", "loc": [16, 16], "level": 0, "parent": null, "vector": [8, 0, 0.1798, 0.0112, 0, 0.66, 0.6111, 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_99591:Import_L17_C0", "label": "hrl_pr2_lib.pr2_arms import pa", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.191, 0.0112, 0, 0.66, 0.6667, 359, 0, 1, 0, 0, 359, 0, 0], "semantic": {"name": "hrl_pr2_lib.pr2_arms", "arg_names": [], "import_names": ["pa"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_pr2_lib.pr2_arms as pa"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99591:Expr_L19_C0", "label": "load_manifest()", "type": "expression", "loc": [19, 19], "level": 0, "parent": null, "vector": [8, 0, 0.2135, 0.0112, 0, 0.66, 0.7222, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest('force_torque') # hack by Advait"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99591:Import_L20_C0", "label": "force_torque.FTClient import ftc", "type": "import", "loc": [20, 20], "level": 0, "parent": null, "vector": [1, 0, 0.2247, 0.0112, 0, 0.66, 0.7778, 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_99591:Import_L21_C0", "label": "tf import tf", "type": "import", "loc": [21, 21], "level": 0, "parent": null, "vector": [1, 0, 0.236, 0.0112, 0, 0.66, 0.8333, 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_99591:ClassDef_L23_C0", "label": "object_ft_sensors", "type": "class", "loc": [23, 42], "level": 0, "parent": null, "vector": [3, 0, 0.3652, 0.2247, 0, 0.66, 0.8889, 741, 0, 3, 0, 0, 0, 0, 7], "semantic": {"name": "object_ft_sensors", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class object_ft_sensors():\n def __init__(self):\n self.obj1_ftc = ftc.FTClient('force_torque_ft2')\n self.tf_lstnr = tf.TransformListener()\n\n def get_forces(self, bias = True):\n # later I might be looping over all the different objects,\n # returning a dictionary of <object_id: force_vector>"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99591:FunctionDef_L24_C4", "label": "__init__", "type": "function", "loc": [24, 26], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99591:ClassDef_L23_C0", "vector": [2, 1, 0.2809, 0.0337, 1, 0.88, 0.0, 555, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self):\n self.obj1_ftc = ftc.FTClient('force_torque_ft2')\n self.tf_lstnr = tf.TransformListener()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99591:Assign_L25_C8", "label": "self.obj1_ftc = FTClient()", "type": "assigned_variable", "loc": [25, 25], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99591:FunctionDef_L24_C4", "vector": [14, 2, 0.2809, 0.0112, 2, 0.01, 0.0, 172, 3, 1, 0, 0, 78, 10, 1], "semantic": {"name": "self.obj1_ftc", "arg_names": [], "import_names": [], "rhs_call_name": "FTClient", "annotation": ""}, "snippet": " self.obj1_ftc = ftc.FTClient('force_torque_ft2')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99591:Assign_L26_C8", "label": "self.tf_lstnr = TransformListener()", "type": "assigned_variable", "loc": [26, 26], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99591:FunctionDef_L24_C4", "vector": [14, 2, 0.2921, 0.0112, 2, 0.01, 1.0, 699, 3, 0, 0, 0, 108, 10, 1], "semantic": {"name": "self.tf_lstnr", "arg_names": [], "import_names": [], "rhs_call_name": "TransformListener", "annotation": ""}, "snippet": " self.tf_lstnr = tf.TransformListener()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99591:FunctionDef_L28_C4", "label": "get_forces", "type": "function", "loc": [28, 39], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99591:ClassDef_L23_C0", "vector": [2, 1, 0.3764, 0.1348, 1, 0.88, 0.5, 100, 0, 2, 1, 0, 0, 0, 4], "semantic": {"name": "get_forces", "arg_names": ["self", "bias"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_forces(self, bias = True):\n # later I might be looping over all the different objects,\n # returning a dictionary of <object_id: force_vector>\n f = self.obj1_ftc.read(without_bias = not bias)\n f = f[0:3, :]\n\n trans, quat = self.tf_lstnr.lookupTransform('/torso_lift_link',\n '/ft2',"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99591:Assign_L31_C8", "label": "f = read()", "type": "assigned_variable", "loc": [31, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99591:FunctionDef_L28_C4", "vector": [14, 2, 0.3483, 0.0112, 2, 0.71, 0.0, 899, 3, 1, 0, 0, 453, 10, 1], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "read", "annotation": ""}, "snippet": " f = self.obj1_ftc.read(without_bias = not bias)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99591:Assign_L32_C8", "label": "f =", "type": "assigned_variable", "loc": [32, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99591:FunctionDef_L28_C4", "vector": [14, 2, 0.3596, 0.0112, 2, 0.71, 0.2, 899, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " f = f[0:3, :]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99591:Assign_L34_C8", "label": "trans, quat = lookupTransform()", "type": "assigned_variable", "loc": [34, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99591:FunctionDef_L28_C4", "vector": [14, 2, 0.3933, 0.0337, 2, 0.71, 0.4, 441, 3, 3, 0, 0, 926, 10, 2], "semantic": {"name": "trans, quat", "arg_names": [], "import_names": [], "rhs_call_name": "lookupTransform", "annotation": ""}, "snippet": " trans, quat = self.tf_lstnr.lookupTransform('/torso_lift_link',\n '/ft2',\n rospy.Time(0))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99591:Assign_L37_C8", "label": "rot = quaternion_to_matrix()", "type": "assigned_variable", "loc": [37, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99591:FunctionDef_L28_C4", "vector": [14, 2, 0.4157, 0.0112, 2, 0.71, 0.6, 812, 3, 1, 0, 0, 149, 10, 1], "semantic": {"name": "rot", "arg_names": [], "import_names": [], "rhs_call_name": "quaternion_to_matrix", "annotation": ""}, "snippet": " rot = tr.quaternion_to_matrix(quat)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99591:Assign_L38_C8", "label": "f =", "type": "assigned_variable", "loc": [38, 38], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99591:FunctionDef_L28_C4", "vector": [14, 2, 0.427, 0.0112, 2, 0.71, 0.8, 899, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " f = rot * f"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99591:Return_L39_C8", "label": "return", "type": "return", "loc": [39, 39], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99591:FunctionDef_L28_C4", "vector": [13, 2, 0.4382, 0.0112, 2, 0.71, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return -f # the negative is intentional (Advait, Nov 24. 2010.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99591:FunctionDef_L41_C4", "label": "bias_fts", "type": "function", "loc": [41, 42], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99591:ClassDef_L23_C0", "vector": [2, 1, 0.4663, 0.0225, 1, 0.88, 1.0, 594, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "bias_fts", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def bias_fts(self):\n self.obj1_ftc.bias()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99591:Expr_L42_C7", "label": "bias()", "type": "expression", "loc": [42, 42], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99591:FunctionDef_L41_C4", "vector": [8, 2, 0.4719, 0.0112, 2, 0.51, 0.0, 354, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "bias", "arg_names": [], "import_names": [], "rhs_call_name": "bias", "annotation": ""}, "snippet": " self.obj1_ftc.bias()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99591:FunctionDef_L45_C0", "label": "get_arrow_text_markers", "type": "function", "loc": [45, 60], "level": 0, "parent": null, "vector": [2, 0, 0.5899, 0.1798, 0, 0.66, 0.9444, 933, 0, 5, 1, 0, 0, 0, 6], "semantic": {"name": "get_arrow_text_markers", "arg_names": ["p", "f", "frame", "m_id", "duration"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def get_arrow_text_markers(p, f, frame, m_id, duration):\n t_now = rospy.Time.now()\n q = hv.arrow_direction_to_quat(f)\n arrow_len = np.linalg.norm(f) * 0.04\n\n scale = (arrow_len, 0.2, 0.2)\n m1 = hv.single_marker(p, q, 'arrow', frame, scale, m_id = m_id,\n duration = duration)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99591:Assign_L46_C4", "label": "t_now = now()", "type": "assigned_variable", "loc": [46, 46], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99591:FunctionDef_L45_C0", "vector": [14, 1, 0.5169, 0.0112, 1, 0.6, 0.0, 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_99591:Assign_L47_C4", "label": "q = arrow_direction_to_quat()", "type": "assigned_variable", "loc": [47, 47], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99591:FunctionDef_L45_C0", "vector": [14, 1, 0.5281, 0.0112, 1, 0.6, 0.1111, 516, 3, 1, 0, 0, 157, 10, 1], "semantic": {"name": "q", "arg_names": [], "import_names": [], "rhs_call_name": "arrow_direction_to_quat", "annotation": ""}, "snippet": " q = hv.arrow_direction_to_quat(f)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99591:Assign_L48_C4", "label": "arrow_len =", "type": "assigned_variable", "loc": [48, 48], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99591:FunctionDef_L45_C0", "vector": [14, 1, 0.5393, 0.0112, 1, 0.6, 0.2222, 805, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "arrow_len", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " arrow_len = np.linalg.norm(f) * 0.04"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99591:Assign_L50_C4", "label": "scale =", "type": "assigned_variable", "loc": [50, 50], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99591:FunctionDef_L45_C0", "vector": [14, 1, 0.5618, 0.0112, 1, 0.6, 0.3333, 18, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "scale", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " scale = (arrow_len, 0.2, 0.2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99591:Assign_L51_C4", "label": "m1 = single_marker()", "type": "assigned_variable", "loc": [51, 52], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99591:FunctionDef_L45_C0", "vector": [14, 1, 0.5787, 0.0225, 1, 0.6, 0.4444, 814, 3, 7, 0, 0, 614, 10, 1], "semantic": {"name": "m1", "arg_names": [], "import_names": [], "rhs_call_name": "single_marker", "annotation": ""}, "snippet": " m1 = hv.single_marker(p, q, 'arrow', frame, scale, m_id = m_id,\n duration = duration)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99591:Assign_L53_C4", "label": "m1.header.stamp =", "type": "assigned_variable", "loc": [53, 53], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99591:FunctionDef_L45_C0", "vector": [14, 1, 0.5955, 0.0112, 1, 0.6, 0.5556, 601, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "m1.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " m1.header.stamp = t_now"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99591:Assign_L55_C4", "label": "m2 = single_marker()", "type": "assigned_variable", "loc": [55, 57], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99591:FunctionDef_L45_C0", "vector": [14, 1, 0.6292, 0.0337, 1, 0.6, 0.6667, 562, 3, 8, 0, 0, 614, 10, 1], "semantic": {"name": "m2", "arg_names": [], "import_names": [], "rhs_call_name": "single_marker", "annotation": ""}, "snippet": " m2 = hv.single_marker(p, q, 'text_view_facing', frame,\n (0.1, 0.1, 0.1), m_id = m_id+1,\n duration = duration, color=(1.,0.,0.,1.))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99591:Assign_L58_C4", "label": "m2.text =", "type": "assigned_variable", "loc": [58, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99591:FunctionDef_L45_C0", "vector": [14, 1, 0.6517, 0.0112, 1, 0.6, 0.7778, 398, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "m2.text", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " m2.text = '%.1f N'%(np.linalg.norm(f))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99591:Assign_L59_C4", "label": "m2.header.stamp =", "type": "assigned_variable", "loc": [59, 59], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99591:FunctionDef_L45_C0", "vector": [14, 1, 0.6629, 0.0112, 1, 0.6, 0.8889, 563, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "m2.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " m2.header.stamp = t_now"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99591:Return_L60_C4", "label": "return", "type": "return", "loc": [60, 60], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99591:FunctionDef_L45_C0", "vector": [13, 1, 0.6742, 0.0112, 1, 0.6, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return m1, m2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99591:If_L63_C0", "label": "if", "type": "if", "loc": [63, 80], "level": 0, "parent": null, "vector": [4, 0, 0.8034, 0.2022, 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 rospy.init_node('force_visualize_test')\n marker_pub = rospy.Publisher('/skin/viz_marker', Marker)\n\n fts = object_ft_sensors()\n fts.bias_fts()\n\n pr2_arms = pa.PR2Arms()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99591:Expr_L64_C4", "label": "init_node()", "type": "expression", "loc": [64, 64], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99591:If_L63_C0", "vector": [8, 1, 0.7191, 0.0112, 1, 0.41, 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('force_visualize_test')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99591:Assign_L65_C4", "label": "marker_pub = Publisher()", "type": "assigned_variable", "loc": [65, 65], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99591:If_L63_C0", "vector": [14, 1, 0.7303, 0.0112, 1, 0.41, 0.1429, 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('/skin/viz_marker', Marker)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99591:Assign_L67_C4", "label": "fts = object_ft_sensors()", "type": "assigned_variable", "loc": [67, 67], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99591:If_L63_C0", "vector": [14, 1, 0.7528, 0.0112, 1, 0.41, 0.2857, 318, 3, 0, 0, 0, 741, 10, 1], "semantic": {"name": "fts", "arg_names": [], "import_names": [], "rhs_call_name": "object_ft_sensors", "annotation": ""}, "snippet": " fts = object_ft_sensors()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99591:Expr_L68_C4", "label": "bias_fts()", "type": "expression", "loc": [68, 68], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99591:If_L63_C0", "vector": [8, 1, 0.764, 0.0112, 1, 0.41, 0.4286, 594, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "bias_fts", "arg_names": [], "import_names": [], "rhs_call_name": "bias_fts", "annotation": ""}, "snippet": " fts.bias_fts()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99591:Assign_L70_C4", "label": "pr2_arms = PR2Arms()", "type": "assigned_variable", "loc": [70, 70], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99591:If_L63_C0", "vector": [14, 1, 0.7865, 0.0112, 1, 0.41, 0.5714, 369, 3, 0, 0, 0, 694, 10, 1], "semantic": {"name": "pr2_arms", "arg_names": [], "import_names": [], "rhs_call_name": "PR2Arms", "annotation": ""}, "snippet": " pr2_arms = pa.PR2Arms()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99591:Assign_L71_C4", "label": "r_arm, l_arm =", "type": "assigned_variable", "loc": [71, 71], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99591:If_L63_C0", "vector": [14, 1, 0.7978, 0.0112, 1, 0.41, 0.7143, 451, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "r_arm, l_arm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " r_arm, l_arm = 0, 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99591:Assign_L72_C4", "label": "arm =", "type": "assigned_variable", "loc": [72, 72], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99591:If_L63_C0", "vector": [14, 1, 0.809, 0.0112, 1, 0.41, 0.8571, 413, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "arm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " arm = r_arm"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99591:While_L74_C4", "label": "while", "type": "while", "loc": [74, 80], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99591:If_L63_C0", "vector": [5, 1, 0.8652, 0.0787, 1, 0.41, 1.0, 0, 0, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while not rospy.is_shutdown():\n f = fts.get_forces()\n p, r = pr2_arms.end_effector_pos(arm)\n m1, m2 = get_arrow_text_markers(p, f, 'torso_lift_link', 0, 1.)\n marker_pub.publish(m1)\n marker_pub.publish(m2)\n rospy.sleep(0.1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99591:Assign_L75_C8", "label": "f = get_forces()", "type": "assigned_variable", "loc": [75, 75], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99591:While_L74_C4", "vector": [14, 2, 0.8427, 0.0112, 2, 0.98, 0.0, 899, 3, 0, 0, 0, 100, 10, 1], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "get_forces", "annotation": ""}, "snippet": " f = fts.get_forces()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99591:Assign_L76_C8", "label": "p, r = end_effector_pos()", "type": "assigned_variable", "loc": [76, 76], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99591:While_L74_C4", "vector": [14, 2, 0.8539, 0.0112, 2, 0.98, 0.2, 364, 3, 1, 0, 0, 889, 10, 1], "semantic": {"name": "p, r", "arg_names": [], "import_names": [], "rhs_call_name": "end_effector_pos", "annotation": ""}, "snippet": " p, r = pr2_arms.end_effector_pos(arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99591:Assign_L77_C8", "label": "m1, m2 = get_arrow_text_markers()", "type": "assigned_variable", "loc": [77, 77], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99591:While_L74_C4", "vector": [14, 2, 0.8652, 0.0112, 2, 0.98, 0.4, 231, 3, 5, 0, 0, 933, 10, 1], "semantic": {"name": "m1, m2", "arg_names": [], "import_names": [], "rhs_call_name": "get_arrow_text_markers", "annotation": ""}, "snippet": " m1, m2 = get_arrow_text_markers(p, f, 'torso_lift_link', 0, 1.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99591:Expr_L78_C8", "label": "publish()", "type": "expression", "loc": [78, 78], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99591:While_L74_C4", "vector": [8, 2, 0.8764, 0.0112, 2, 0.98, 0.6, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " marker_pub.publish(m1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99591:Expr_L79_C8", "label": "publish()", "type": "expression", "loc": [79, 79], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99591:While_L74_C4", "vector": [8, 2, 0.8876, 0.0112, 2, 0.98, 0.8, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " marker_pub.publish(m2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99591:Expr_L80_C8", "label": "sleep()", "type": "expression", "loc": [80, 80], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99591:While_L74_C4", "vector": [8, 2, 0.8989, 0.0112, 2, 0.98, 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)"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99591:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99591:FunctionDef_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99591:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99591:Assign_L25_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99591:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99591:Assign_L26_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99591:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99591:FunctionDef_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99591:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99591:Assign_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99591:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99591:Assign_L32_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99591:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99591:Assign_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99591:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99591:Assign_L37_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99591:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99591:Assign_L38_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99591:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99591:Return_L39_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99591:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99591:FunctionDef_L41_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99591:FunctionDef_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99591:Expr_L42_C7"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99591:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99591:Assign_L46_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99591:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99591:Assign_L47_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99591:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99591:Assign_L48_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99591:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99591:Assign_L50_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99591:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99591:Assign_L51_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99591:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99591:Assign_L53_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99591:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99591:Assign_L55_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99591:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99591:Assign_L58_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99591:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99591:Assign_L59_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99591:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99591:Return_L60_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99591:If_L63_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99591:Expr_L64_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99591:If_L63_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99591:Assign_L65_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99591:If_L63_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99591:Assign_L67_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99591:If_L63_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99591:Expr_L68_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99591:If_L63_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99591:Assign_L70_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99591:If_L63_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99591:Assign_L71_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99591:If_L63_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99591:Assign_L72_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99591:If_L63_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99591:While_L74_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99591:While_L74_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99591:Assign_L75_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99591:While_L74_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99591:Assign_L76_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99591:While_L74_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99591:Assign_L77_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99591:While_L74_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99591:Expr_L78_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99591:While_L74_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99591:Expr_L79_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99591:While_L74_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99591:Expr_L80_C8"}]
import roslib; roslib.load_manifest('arm_navigation_tutorials') import sys import rospy from planning_environment_msgs.srv import GetStateValidity from planning_environment_msgs.srv import GetStateValidityRequest if __name__ == '__main__': rospy.init_node('get_state_validity_python') srv_nm = 'environment_server_right_arm/get_state_validity' rospy.wait_for_service(srv_nm) get_state_validity = rospy.ServiceProxy(srv_nm, GetStateValidity) req = GetStateValidityRequest() req.robot_state.joint_state.name = ['r_shoulder_pan_joint', 'r_shoulder_lift_joint', 'r_upper_arm_roll_joint', 'r_elbow_flex_joint', 'r_forearm_roll_joint', 'r_wrist_flex_joint', 'r_wrist_roll_joint'] req.robot_state.joint_state.position = [0.] * 7 req.robot_state.joint_state.position[0] = 0.4 req.robot_state.joint_state.position[3] = -0.4 req.robot_state.joint_state.header.stamp = rospy.Time.now() req.check_collisions = True res = get_state_validity.call(req) if res.error_code.val == res.error_code.SUCCESS: rospy.loginfo('Requested state is not in collision') else: rospy.loginfo('Requested state is in collision. Error code: %d'%(res.error_code.val))
ajibawa-2023/Python-Code-Large/train/row_99592
22
40
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99592:Import_L2_C0", "label": "roslib import roslib", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.05, 0.025, 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('arm_navigation_tutorials')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99592:Expr_L2_C15", "label": "load_manifest()", "type": "expression", "loc": [2, 2], "level": 0, "parent": null, "vector": [8, 0, 0.05, 0.025, 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('arm_navigation_tutorials')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99592:Import_L3_C0", "label": "sys import sys", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.075, 0.025, 0, 0.66, 0.3333, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99592:Import_L4_C0", "label": "rospy import rospy", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.1, 0.025, 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_99592:ImportFrom_L6_C0", "label": "from planning_environment_msgs.srv import GetStateValidity", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.15, 0.025, 0, 0.66, 0.6667, 813, 0, 1, 0, 0, 813, 0, 0], "semantic": {"name": "planning_environment_msgs.srv", "arg_names": [], "import_names": ["GetStateValidity"], "rhs_call_name": "", "annotation": ""}, "snippet": "from planning_environment_msgs.srv import GetStateValidity"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99592:ImportFrom_L7_C0", "label": "from planning_environment_msgs.srv import GetStateValidityRequest", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.175, 0.025, 0, 0.66, 0.8333, 813, 0, 1, 0, 0, 813, 0, 0], "semantic": {"name": "planning_environment_msgs.srv", "arg_names": [], "import_names": ["GetStateValidityRequest"], "rhs_call_name": "", "annotation": ""}, "snippet": "from planning_environment_msgs.srv import GetStateValidityRequest"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99592:If_L10_C0", "label": "if", "type": "if", "loc": [10, 37], "level": 0, "parent": null, "vector": [4, 0, 0.5875, 0.7, 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('get_state_validity_python')\n\n srv_nm = 'environment_server_right_arm/get_state_validity'\n rospy.wait_for_service(srv_nm)\n get_state_validity = rospy.ServiceProxy(srv_nm, GetStateValidity)\n\n req = GetStateValidityRequest()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99592:Expr_L11_C4", "label": "init_node()", "type": "expression", "loc": [11, 11], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99592:If_L10_C0", "vector": [8, 1, 0.275, 0.025, 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('get_state_validity_python')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99592:Assign_L13_C4", "label": "srv_nm =", "type": "assigned_variable", "loc": [13, 13], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99592:If_L10_C0", "vector": [14, 1, 0.325, 0.025, 1, 0.97, 0.0833, 560, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "srv_nm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " srv_nm = 'environment_server_right_arm/get_state_validity'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99592:Expr_L14_C4", "label": "wait_for_service()", "type": "expression", "loc": [14, 14], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99592:If_L10_C0", "vector": [8, 1, 0.35, 0.025, 1, 0.97, 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(srv_nm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99592:Assign_L15_C4", "label": "get_state_validity = ServiceProxy()", "type": "assigned_variable", "loc": [15, 15], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99592:If_L10_C0", "vector": [14, 1, 0.375, 0.025, 1, 0.97, 0.25, 583, 3, 2, 0, 0, 915, 10, 1], "semantic": {"name": "get_state_validity", "arg_names": [], "import_names": [], "rhs_call_name": "ServiceProxy", "annotation": ""}, "snippet": " get_state_validity = rospy.ServiceProxy(srv_nm, GetStateValidity)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99592:Assign_L17_C4", "label": "req = GetStateValidityRequest()", "type": "assigned_variable", "loc": [17, 17], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99592:If_L10_C0", "vector": [14, 1, 0.425, 0.025, 1, 0.97, 0.3333, 233, 3, 0, 0, 0, 4, 10, 1], "semantic": {"name": "req", "arg_names": [], "import_names": [], "rhs_call_name": "GetStateValidityRequest", "annotation": ""}, "snippet": " req = GetStateValidityRequest()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99592:Assign_L18_C4", "label": "req.robot_state.joint_state.name =", "type": "assigned_variable", "loc": [18, 24], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99592:If_L10_C0", "vector": [14, 1, 0.525, 0.175, 1, 0.97, 0.4167, 525, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "req.robot_state.joint_state.name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " req.robot_state.joint_state.name = ['r_shoulder_pan_joint',\n 'r_shoulder_lift_joint',\n 'r_upper_arm_roll_joint',\n 'r_elbow_flex_joint',\n 'r_forearm_roll_joint',\n 'r_wrist_flex_joint',\n 'r_wrist_roll_joint']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99592:Assign_L25_C4", "label": "req.robot_state.joint_state.position =", "type": "assigned_variable", "loc": [25, 25], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99592:If_L10_C0", "vector": [14, 1, 0.625, 0.025, 1, 0.97, 0.5, 249, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "req.robot_state.joint_state.position", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " req.robot_state.joint_state.position = [0.] * 7"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99592:Assign_L26_C4", "label": "assign", "type": "assigned_variable", "loc": [26, 26], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99592:If_L10_C0", "vector": [14, 1, 0.65, 0.025, 1, 0.97, 0.5833, 0, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " req.robot_state.joint_state.position[0] = 0.4"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99592:Assign_L27_C4", "label": "assign", "type": "assigned_variable", "loc": [27, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99592:If_L10_C0", "vector": [14, 1, 0.675, 0.025, 1, 0.97, 0.6667, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " req.robot_state.joint_state.position[3] = -0.4"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99592:Assign_L29_C4", "label": "req.robot_state.joint_state.header.stamp = now()", "type": "assigned_variable", "loc": [29, 29], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99592:If_L10_C0", "vector": [14, 1, 0.725, 0.025, 1, 0.97, 0.75, 1, 3, 0, 0, 0, 894, 10, 1], "semantic": {"name": "req.robot_state.joint_state.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "now", "annotation": ""}, "snippet": " req.robot_state.joint_state.header.stamp = rospy.Time.now()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99592:Assign_L30_C4", "label": "req.check_collisions =", "type": "assigned_variable", "loc": [30, 30], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99592:If_L10_C0", "vector": [14, 1, 0.75, 0.025, 1, 0.97, 0.8333, 373, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "req.check_collisions", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " req.check_collisions = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99592:Assign_L32_C4", "label": "res = call()", "type": "assigned_variable", "loc": [32, 32], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99592:If_L10_C0", "vector": [14, 1, 0.8, 0.025, 1, 0.97, 0.9167, 413, 3, 1, 0, 0, 832, 10, 1], "semantic": {"name": "res", "arg_names": [], "import_names": [], "rhs_call_name": "call", "annotation": ""}, "snippet": " res = get_state_validity.call(req)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99592:If_L34_C4", "label": "if", "type": "if", "loc": [34, 37], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99592:If_L10_C0", "vector": [4, 1, 0.8875, 0.1, 1, 0.97, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if res.error_code.val == res.error_code.SUCCESS:\n rospy.loginfo('Requested state is not in collision')\n else:\n rospy.loginfo('Requested state is in collision. Error code: %d'%(res.error_code.val))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99592:Expr_L35_C8", "label": "loginfo()", "type": "expression", "loc": [35, 35], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99592:If_L34_C4", "vector": [8, 2, 0.875, 0.025, 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('Requested state is not in collision')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99592:Expr_L37_C8", "label": "loginfo()", "type": "expression", "loc": [37, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99592:If_L34_C4", "vector": [8, 2, 0.925, 0.025, 2, 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('Requested state is in collision. Error code: %d'%(res.error_code.val))"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99592:If_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99592:Expr_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99592:If_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99592:Assign_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99592:If_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99592:Expr_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99592:If_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99592:Assign_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99592:If_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99592:Assign_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99592:If_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99592:Assign_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99592:If_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99592:Assign_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99592:If_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99592:Assign_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99592:If_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99592:Assign_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99592:If_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99592:Assign_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99592:If_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99592:Assign_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99592:If_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99592:Assign_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99592:If_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99592:If_L34_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99592:If_L34_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99592:Expr_L35_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99592:If_L34_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99592:Expr_L37_C8"}]
import sys import numpy as np, math import add_cylinder as ac import online_collision_detection as ocd import force_visualize_test as fvt import roslib; roslib.load_manifest('arm_navigation_tutorials') import rospy from mapping_msgs.msg import CollisionObject from visualization_msgs.msg import Marker import hrl_lib.viz as hv roslib.load_manifest('hrl_pr2_lib') import hrl_pr2_lib.pr2_arms as pa def contact_info_list_to_dict(cont_info_list): ci = cont_info_list[0] frm = ci.header.frame_id # print 'frame:', frm b1 = ci.contact_body_1 b2 = ci.contact_body_2 contact_dict = {} pts_list = [] for ci in cont_info_list: if frm != ci.header.frame_id: rospy.logerr('initial frame_id: %s and current frame_id: %s'%(frm, ci.header.frame_id)) b1 = ci.contact_body_1 b2 = ci.contact_body_2 two_bodies = b1 + '+' + b2 if two_bodies not in contact_dict: contact_dict[two_bodies] = [] contact_dict[two_bodies].append((ci.position.x, ci.position.y, ci.position.z)) return contact_dict def visualize_contact_dict(cd, marker_pub, fts): color_list = [(1.,0.,0.), (0.,1.,0.), (0.,0.,1.), (1.,1.,0.), (1.,0.,1.), (0.,1.,1.), (0.5,1.,0.), (0.5,0.,1.), (0.,0.5,1.) ] pts_list = [] cs_list = [] marker_list = [] for i, k in enumerate(cd.keys()): pts = np.matrix(cd[k]).T c = color_list[i] cs = np.ones((4, pts.shape[1])) cs[0,:] = c[0] cs[1,:] = c[1] cs[2,:] = c[2] pts_list.append(pts) cs_list.append(cs) print '# of contact points:', pts.shape[1] mn = np.mean(pts, 1) f = fts.get_forces() m1, m2 = fvt.get_arrow_text_markers(mn, f, 'base_footprint', m_id = 2*i+1, duration=0.5) marker_pub.publish(m1) marker_pub.publish(m2) m = hv.list_marker(np.column_stack(pts_list), np.column_stack(cs_list), (0.01, 0.01, 0.01), 'points', 'base_footprint', duration=1.0, m_id=0) t_now = rospy.Time.now() m.header.stamp = t_now marker_pub.publish(m) for m in marker_list: m.header.stamp = rospy.Time.now() marker_pub.publish(m) if __name__ == '__main__': rospy.init_node('pr2_skin_simulate') pub = rospy.Publisher('collision_object', CollisionObject) marker_pub = rospy.Publisher('/skin/viz_marker', Marker) fts = fvt.object_ft_sensors() fts.bias_fts() pr2_arms = pa.PR2Arms() r_arm, l_arm = 0, 1 arm = r_arm raw_input('Touch the object and then hit ENTER.') ee_pos, ee_rot = pr2_arms.end_effector_pos(arm) print 'ee_pos:', ee_pos.flatten() print 'ee_pos.shape:', ee_pos.shape trans, quat = pr2_arms.tf_lstnr.lookupTransform('/base_footprint', '/torso_lift_link', rospy.Time(0)) height = ee_pos[2] + trans[2] ee_pos[2] = -trans[2] ac.add_cylinder('pole', ee_pos, 0.02, height, '/torso_lift_link', pub) rospy.loginfo('Now starting the loop where I get contact locations.') col_det = ocd.online_collision_detector() while not rospy.is_shutdown(): rospy.sleep(0.1) res = col_det.check_validity(pr2_arms, arm) if res.error_code.val == res.error_code.SUCCESS: rospy.loginfo('No contact') else: contact_dict = contact_info_list_to_dict(res.contacts) print 'contact_dict.keys:', contact_dict.keys() visualize_contact_dict(contact_dict, marker_pub, fts)
ajibawa-2023/Python-Code-Large/train/row_99593
84
116
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99593:Import_L2_C0", "label": "sys import sys", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0172, 0.0086, 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_99593:Import_L3_C0", "label": "numpy import np, math", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0259, 0.0086, 0, 0.66, 0.0667, 954, 0, 2, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np", "math"], "rhs_call_name": "", "annotation": ""}, "snippet": "import numpy as np, math"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99593:Import_L5_C0", "label": "add_cylinder import ac", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0431, 0.0086, 0, 0.66, 0.1333, 412, 0, 1, 0, 0, 412, 0, 0], "semantic": {"name": "add_cylinder", "arg_names": [], "import_names": ["ac"], "rhs_call_name": "", "annotation": ""}, "snippet": "import add_cylinder as ac"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99593:Import_L6_C0", "label": "online_collision_detection import ocd", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0517, 0.0086, 0, 0.66, 0.2, 626, 0, 1, 0, 0, 626, 0, 0], "semantic": {"name": "online_collision_detection", "arg_names": [], "import_names": ["ocd"], "rhs_call_name": "", "annotation": ""}, "snippet": "import online_collision_detection as ocd"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99593:Import_L7_C0", "label": "force_visualize_test import fvt", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.0603, 0.0086, 0, 0.66, 0.2667, 365, 0, 1, 0, 0, 365, 0, 0], "semantic": {"name": "force_visualize_test", "arg_names": [], "import_names": ["fvt"], "rhs_call_name": "", "annotation": ""}, "snippet": "import force_visualize_test as fvt"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99593:Import_L9_C0", "label": "roslib import roslib", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.0776, 0.0086, 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('arm_navigation_tutorials')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99593:Expr_L9_C15", "label": "load_manifest()", "type": "expression", "loc": [9, 9], "level": 0, "parent": null, "vector": [8, 0, 0.0776, 0.0086, 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('arm_navigation_tutorials')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99593:Import_L10_C0", "label": "rospy import rospy", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.0862, 0.0086, 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_99593:ImportFrom_L11_C0", "label": "from mapping_msgs.msg import CollisionObject", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.0948, 0.0086, 0, 0.66, 0.5333, 483, 0, 1, 0, 0, 483, 0, 0], "semantic": {"name": "mapping_msgs.msg", "arg_names": [], "import_names": ["CollisionObject"], "rhs_call_name": "", "annotation": ""}, "snippet": "from mapping_msgs.msg import CollisionObject"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99593:ImportFrom_L12_C0", "label": "from visualization_msgs.msg import Marker", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.1034, 0.0086, 0, 0.66, 0.6, 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_99593:Import_L14_C0", "label": "hrl_lib.viz import hv", "type": "import", "loc": [14, 14], "level": 0, "parent": null, "vector": [1, 0, 0.1207, 0.0086, 0, 0.66, 0.6667, 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_99593:Expr_L16_C0", "label": "load_manifest()", "type": "expression", "loc": [16, 16], "level": 0, "parent": null, "vector": [8, 0, 0.1379, 0.0086, 0, 0.66, 0.7333, 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_99593:Import_L17_C0", "label": "hrl_pr2_lib.pr2_arms import pa", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.1466, 0.0086, 0, 0.66, 0.8, 359, 0, 1, 0, 0, 359, 0, 0], "semantic": {"name": "hrl_pr2_lib.pr2_arms", "arg_names": [], "import_names": ["pa"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_pr2_lib.pr2_arms as pa"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99593:FunctionDef_L20_C0", "label": "contact_info_list_to_dict", "type": "function", "loc": [20, 39], "level": 0, "parent": null, "vector": [2, 0, 0.2543, 0.1724, 0, 0.66, 0.8667, 76, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "contact_info_list_to_dict", "arg_names": ["cont_info_list"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def contact_info_list_to_dict(cont_info_list):\n ci = cont_info_list[0]\n frm = ci.header.frame_id\n# print 'frame:', frm\n b1 = ci.contact_body_1\n b2 = ci.contact_body_2\n contact_dict = {}\n pts_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99593:Assign_L21_C4", "label": "ci =", "type": "assigned_variable", "loc": [21, 21], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99593:FunctionDef_L20_C0", "vector": [14, 1, 0.181, 0.0086, 1, 0.52, 0.0, 916, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ci", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ci = cont_info_list[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99593:Assign_L22_C4", "label": "frm =", "type": "assigned_variable", "loc": [22, 22], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99593:FunctionDef_L20_C0", "vector": [14, 1, 0.1897, 0.0086, 1, 0.52, 0.1429, 798, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "frm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " frm = ci.header.frame_id"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99593:Assign_L24_C4", "label": "b1 =", "type": "assigned_variable", "loc": [24, 24], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99593:FunctionDef_L20_C0", "vector": [14, 1, 0.2069, 0.0086, 1, 0.52, 0.2857, 341, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "b1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " b1 = ci.contact_body_1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99593:Assign_L25_C4", "label": "b2 =", "type": "assigned_variable", "loc": [25, 25], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99593:FunctionDef_L20_C0", "vector": [14, 1, 0.2155, 0.0086, 1, 0.52, 0.4286, 670, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "b2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " b2 = ci.contact_body_2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99593:Assign_L26_C4", "label": "contact_dict =", "type": "assigned_variable", "loc": [26, 26], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99593:FunctionDef_L20_C0", "vector": [14, 1, 0.2241, 0.0086, 1, 0.52, 0.5714, 953, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "contact_dict", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " contact_dict = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99593:Assign_L27_C4", "label": "pts_list =", "type": "assigned_variable", "loc": [27, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99593:FunctionDef_L20_C0", "vector": [14, 1, 0.2328, 0.0086, 1, 0.52, 0.7143, 713, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "pts_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pts_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99593:For_L28_C4", "label": "for ci", "type": "for", "loc": [28, 37], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99593:FunctionDef_L20_C0", "vector": [6, 1, 0.2802, 0.0862, 1, 0.52, 0.8571, 916, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "ci", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for ci in cont_info_list:\n if frm != ci.header.frame_id:\n rospy.logerr('initial frame_id: %s and current frame_id: %s'%(frm, ci.header.frame_id))\n\n b1 = ci.contact_body_1\n b2 = ci.contact_body_2\n two_bodies = b1 + '+' + b2\n if two_bodies not in contact_dict:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99593:If_L29_C8", "label": "if", "type": "if", "loc": [29, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99593:For_L28_C4", "vector": [4, 2, 0.2543, 0.0172, 2, 0.0, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if frm != ci.header.frame_id:\n rospy.logerr('initial frame_id: %s and current frame_id: %s'%(frm, ci.header.frame_id))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99593:Expr_L30_C12", "label": "logerr()", "type": "expression", "loc": [30, 30], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99593:If_L29_C8", "vector": [8, 3, 0.2586, 0.0086, 3, 0.98, 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('initial frame_id: %s and current frame_id: %s'%(frm, ci.header.frame_id))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99593:Assign_L32_C8", "label": "b1 =", "type": "assigned_variable", "loc": [32, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99593:For_L28_C4", "vector": [14, 2, 0.2759, 0.0086, 2, 0.0, 0.2, 341, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "b1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " b1 = ci.contact_body_1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99593:Assign_L33_C8", "label": "b2 =", "type": "assigned_variable", "loc": [33, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99593:For_L28_C4", "vector": [14, 2, 0.2845, 0.0086, 2, 0.0, 0.4, 670, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "b2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " b2 = ci.contact_body_2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99593:Assign_L34_C8", "label": "two_bodies =", "type": "assigned_variable", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99593:For_L28_C4", "vector": [14, 2, 0.2931, 0.0086, 2, 0.0, 0.6, 212, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "two_bodies", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " two_bodies = b1 + '+' + b2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99593:If_L35_C8", "label": "if", "type": "if", "loc": [35, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99593:For_L28_C4", "vector": [4, 2, 0.306, 0.0172, 2, 0.0, 0.8, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if two_bodies not in contact_dict:\n contact_dict[two_bodies] = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99593:Assign_L36_C12", "label": "assign", "type": "assigned_variable", "loc": [36, 36], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99593:If_L35_C8", "vector": [14, 3, 0.3103, 0.0086, 3, 0.15, 0.0, 0, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " contact_dict[two_bodies] = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99593:Expr_L37_C8", "label": "append()", "type": "expression", "loc": [37, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99593:For_L28_C4", "vector": [8, 2, 0.319, 0.0086, 2, 0.0, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " contact_dict[two_bodies].append((ci.position.x, ci.position.y, ci.position.z))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99593:Return_L39_C4", "label": "return", "type": "return", "loc": [39, 39], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99593:FunctionDef_L20_C0", "vector": [13, 1, 0.3362, 0.0086, 1, 0.52, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return contact_dict"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99593:FunctionDef_L41_C0", "label": "visualize_contact_dict", "type": "function", "loc": [41, 76], "level": 0, "parent": null, "vector": [2, 0, 0.5043, 0.3103, 0, 0.66, 0.9333, 888, 0, 3, 0, 0, 0, 0, 19], "semantic": {"name": "visualize_contact_dict", "arg_names": ["cd", "marker_pub", "fts"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def visualize_contact_dict(cd, marker_pub, fts):\n color_list = [(1.,0.,0.), (0.,1.,0.), (0.,0.,1.), (1.,1.,0.),\n (1.,0.,1.), (0.,1.,1.), (0.5,1.,0.), (0.5,0.,1.),\n (0.,0.5,1.) ]\n pts_list = []\n cs_list = []\n marker_list = []\n for i, k in enumerate(cd.keys()):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99593:Assign_L42_C4", "label": "color_list =", "type": "assigned_variable", "loc": [42, 44], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99593:FunctionDef_L41_C0", "vector": [14, 1, 0.3707, 0.0259, 1, 0.5, 0.0, 570, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "color_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " color_list = [(1.,0.,0.), (0.,1.,0.), (0.,0.,1.), (1.,1.,0.),\n (1.,0.,1.), (0.,1.,1.), (0.5,1.,0.), (0.5,0.,1.),\n (0.,0.5,1.) ]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99593:Assign_L45_C4", "label": "pts_list =", "type": "assigned_variable", "loc": [45, 45], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99593:FunctionDef_L41_C0", "vector": [14, 1, 0.3879, 0.0086, 1, 0.5, 0.1111, 713, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "pts_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pts_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99593:Assign_L46_C4", "label": "cs_list =", "type": "assigned_variable", "loc": [46, 46], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99593:FunctionDef_L41_C0", "vector": [14, 1, 0.3966, 0.0086, 1, 0.5, 0.2222, 574, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "cs_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cs_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99593:Assign_L47_C4", "label": "marker_list =", "type": "assigned_variable", "loc": [47, 47], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99593:FunctionDef_L41_C0", "vector": [14, 1, 0.4052, 0.0086, 1, 0.5, 0.3333, 305, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "marker_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99593:For_L48_C4", "label": "for i, k", "type": "for", "loc": [48, 64], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99593:FunctionDef_L41_C0", "vector": [6, 1, 0.4828, 0.1466, 1, 0.5, 0.4444, 992, 3, 0, 0, 0, 0, 0, 12], "semantic": {"name": "i, k", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i, k in enumerate(cd.keys()):\n pts = np.matrix(cd[k]).T\n c = color_list[i]\n cs = np.ones((4, pts.shape[1]))\n cs[0,:] = c[0]\n cs[1,:] = c[1]\n cs[2,:] = c[2]\n pts_list.append(pts)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99593:Assign_L49_C8", "label": "pts =", "type": "assigned_variable", "loc": [49, 49], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99593:For_L48_C4", "vector": [14, 2, 0.4224, 0.0086, 2, 0.06, 0.0, 195, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "pts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pts = np.matrix(cd[k]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99593:Assign_L50_C8", "label": "c =", "type": "assigned_variable", "loc": [50, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99593:For_L48_C4", "vector": [14, 2, 0.431, 0.0086, 2, 0.06, 0.0769, 411, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "c", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " c = color_list[i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99593:Assign_L51_C8", "label": "cs = ones()", "type": "assigned_variable", "loc": [51, 51], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99593:For_L48_C4", "vector": [14, 2, 0.4397, 0.0086, 2, 0.06, 0.1538, 256, 3, 1, 0, 0, 530, 10, 1], "semantic": {"name": "cs", "arg_names": [], "import_names": [], "rhs_call_name": "ones", "annotation": ""}, "snippet": " cs = np.ones((4, pts.shape[1]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99593:Assign_L52_C8", "label": "assign", "type": "assigned_variable", "loc": [52, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99593:For_L48_C4", "vector": [14, 2, 0.4483, 0.0086, 2, 0.06, 0.2308, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cs[0,:] = c[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99593:Assign_L53_C8", "label": "assign", "type": "assigned_variable", "loc": [53, 53], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99593:For_L48_C4", "vector": [14, 2, 0.4569, 0.0086, 2, 0.06, 0.3077, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cs[1,:] = c[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99593:Assign_L54_C8", "label": "assign", "type": "assigned_variable", "loc": [54, 54], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99593:For_L48_C4", "vector": [14, 2, 0.4655, 0.0086, 2, 0.06, 0.3846, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cs[2,:] = c[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99593:Expr_L55_C8", "label": "append()", "type": "expression", "loc": [55, 55], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99593:For_L48_C4", "vector": [8, 2, 0.4741, 0.0086, 2, 0.06, 0.4615, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " pts_list.append(pts)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99593:Expr_L56_C8", "label": "append()", "type": "expression", "loc": [56, 56], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99593:For_L48_C4", "vector": [8, 2, 0.4828, 0.0086, 2, 0.06, 0.5385, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " cs_list.append(cs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99593:Expr_L57_C8", "label": "print()", "type": "expression", "loc": [57, 57], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99593:For_L48_C4", "vector": [8, 2, 0.4914, 0.0086, 2, 0.06, 0.6154, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('# of contact points:', pts.shape[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99593:Assign_L58_C8", "label": "mn = mean()", "type": "assigned_variable", "loc": [58, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99593:For_L48_C4", "vector": [14, 2, 0.5, 0.0086, 2, 0.06, 0.6923, 747, 3, 2, 0, 0, 856, 10, 1], "semantic": {"name": "mn", "arg_names": [], "import_names": [], "rhs_call_name": "mean", "annotation": ""}, "snippet": " mn = np.mean(pts, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99593:Assign_L60_C8", "label": "f = get_forces()", "type": "assigned_variable", "loc": [60, 60], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99593:For_L48_C4", "vector": [14, 2, 0.5172, 0.0086, 2, 0.06, 0.7692, 899, 3, 0, 0, 0, 100, 10, 1], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "get_forces", "annotation": ""}, "snippet": " f = fts.get_forces()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99593:Assign_L61_C8", "label": "m1, m2 = get_arrow_text_markers()", "type": "assigned_variable", "loc": [61, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99593:For_L48_C4", "vector": [14, 2, 0.5302, 0.0172, 2, 0.06, 0.8462, 231, 3, 5, 0, 0, 933, 10, 1], "semantic": {"name": "m1, m2", "arg_names": [], "import_names": [], "rhs_call_name": "get_arrow_text_markers", "annotation": ""}, "snippet": " m1, m2 = fvt.get_arrow_text_markers(mn, f, 'base_footprint',\n m_id = 2*i+1, duration=0.5)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99593:Expr_L63_C8", "label": "publish()", "type": "expression", "loc": [63, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99593:For_L48_C4", "vector": [8, 2, 0.5431, 0.0086, 2, 0.06, 0.9231, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " marker_pub.publish(m1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99593:Expr_L64_C8", "label": "publish()", "type": "expression", "loc": [64, 64], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99593:For_L48_C4", "vector": [8, 2, 0.5517, 0.0086, 2, 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(m2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99593:Assign_L66_C4", "label": "m = list_marker()", "type": "assigned_variable", "loc": [66, 69], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99593:FunctionDef_L41_C0", "vector": [14, 1, 0.5819, 0.0345, 1, 0.5, 0.5556, 711, 3, 7, 0, 0, 370, 10, 3], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "list_marker", "annotation": ""}, "snippet": " m = hv.list_marker(np.column_stack(pts_list),\n np.column_stack(cs_list), (0.01, 0.01, 0.01),\n 'points', 'base_footprint', duration=1.0,\n m_id=0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99593:Assign_L70_C4", "label": "t_now = now()", "type": "assigned_variable", "loc": [70, 70], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99593:FunctionDef_L41_C0", "vector": [14, 1, 0.6034, 0.0086, 1, 0.5, 0.6667, 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_99593:Assign_L71_C4", "label": "m.header.stamp =", "type": "assigned_variable", "loc": [71, 71], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99593:FunctionDef_L41_C0", "vector": [14, 1, 0.6121, 0.0086, 1, 0.5, 0.7778, 726, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "m.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " m.header.stamp = t_now"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99593:Expr_L72_C4", "label": "publish()", "type": "expression", "loc": [72, 72], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99593:FunctionDef_L41_C0", "vector": [8, 1, 0.6207, 0.0086, 1, 0.5, 0.8889, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " marker_pub.publish(m)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99593:For_L74_C4", "label": "for m", "type": "for", "loc": [74, 76], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99593:FunctionDef_L41_C0", "vector": [6, 1, 0.6466, 0.0259, 1, 0.5, 1.0, 711, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for m in marker_list:\n m.header.stamp = rospy.Time.now()\n marker_pub.publish(m)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99593:Assign_L75_C8", "label": "m.header.stamp = now()", "type": "assigned_variable", "loc": [75, 75], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99593:For_L74_C4", "vector": [14, 2, 0.6466, 0.0086, 2, 0.93, 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_99593:Expr_L76_C8", "label": "publish()", "type": "expression", "loc": [76, 76], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99593:For_L74_C4", "vector": [8, 2, 0.6552, 0.0086, 2, 0.93, 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(m)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99593:If_L79_C0", "label": "if", "type": "if", "loc": [79, 113], "level": 0, "parent": null, "vector": [4, 0, 0.8276, 0.3017, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 24], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n rospy.init_node('pr2_skin_simulate')\n pub = rospy.Publisher('collision_object', CollisionObject)\n marker_pub = rospy.Publisher('/skin/viz_marker', Marker)\n\n fts = fvt.object_ft_sensors()\n fts.bias_fts()\n pr2_arms = pa.PR2Arms()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99593:Expr_L80_C4", "label": "init_node()", "type": "expression", "loc": [80, 80], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99593:If_L79_C0", "vector": [8, 1, 0.6897, 0.0086, 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('pr2_skin_simulate')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99593:Assign_L81_C4", "label": "pub = Publisher()", "type": "assigned_variable", "loc": [81, 81], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99593:If_L79_C0", "vector": [14, 1, 0.6983, 0.0086, 1, 0.05, 0.0556, 41, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " pub = rospy.Publisher('collision_object', CollisionObject)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99593:Assign_L82_C4", "label": "marker_pub = Publisher()", "type": "assigned_variable", "loc": [82, 82], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99593:If_L79_C0", "vector": [14, 1, 0.7069, 0.0086, 1, 0.05, 0.1111, 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('/skin/viz_marker', Marker)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99593:Assign_L84_C4", "label": "fts = object_ft_sensors()", "type": "assigned_variable", "loc": [84, 84], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99593:If_L79_C0", "vector": [14, 1, 0.7241, 0.0086, 1, 0.05, 0.1667, 318, 3, 0, 0, 0, 741, 10, 1], "semantic": {"name": "fts", "arg_names": [], "import_names": [], "rhs_call_name": "object_ft_sensors", "annotation": ""}, "snippet": " fts = fvt.object_ft_sensors()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99593:Expr_L85_C4", "label": "bias_fts()", "type": "expression", "loc": [85, 85], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99593:If_L79_C0", "vector": [8, 1, 0.7328, 0.0086, 1, 0.05, 0.2222, 594, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "bias_fts", "arg_names": [], "import_names": [], "rhs_call_name": "bias_fts", "annotation": ""}, "snippet": " fts.bias_fts()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99593:Assign_L86_C4", "label": "pr2_arms = PR2Arms()", "type": "assigned_variable", "loc": [86, 86], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99593:If_L79_C0", "vector": [14, 1, 0.7414, 0.0086, 1, 0.05, 0.2778, 369, 3, 0, 0, 0, 694, 10, 1], "semantic": {"name": "pr2_arms", "arg_names": [], "import_names": [], "rhs_call_name": "PR2Arms", "annotation": ""}, "snippet": " pr2_arms = pa.PR2Arms()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99593:Assign_L87_C4", "label": "r_arm, l_arm =", "type": "assigned_variable", "loc": [87, 87], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99593:If_L79_C0", "vector": [14, 1, 0.75, 0.0086, 1, 0.05, 0.3333, 451, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "r_arm, l_arm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " r_arm, l_arm = 0, 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99593:Assign_L88_C4", "label": "arm =", "type": "assigned_variable", "loc": [88, 88], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99593:If_L79_C0", "vector": [14, 1, 0.7586, 0.0086, 1, 0.05, 0.3889, 413, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "arm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " arm = r_arm"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99593:Expr_L90_C4", "label": "raw_input()", "type": "expression", "loc": [90, 90], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99593:If_L79_C0", "vector": [8, 1, 0.7759, 0.0086, 1, 0.05, 0.4444, 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('Touch the object and then hit ENTER.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99593:Assign_L92_C4", "label": "ee_pos, ee_rot = end_effector_pos()", "type": "assigned_variable", "loc": [92, 92], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99593:If_L79_C0", "vector": [14, 1, 0.7931, 0.0086, 1, 0.05, 0.5, 729, 3, 1, 0, 0, 889, 10, 1], "semantic": {"name": "ee_pos, ee_rot", "arg_names": [], "import_names": [], "rhs_call_name": "end_effector_pos", "annotation": ""}, "snippet": " ee_pos, ee_rot = pr2_arms.end_effector_pos(arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99593:Expr_L93_C4", "label": "print()", "type": "expression", "loc": [93, 93], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99593:If_L79_C0", "vector": [8, 1, 0.8017, 0.0086, 1, 0.05, 0.5556, 535, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('ee_pos:', ee_pos.flatten())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99593:Expr_L94_C4", "label": "print()", "type": "expression", "loc": [94, 94], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99593:If_L79_C0", "vector": [8, 1, 0.8103, 0.0086, 1, 0.05, 0.6111, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('ee_pos.shape:', ee_pos.shape)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99593:Assign_L97_C4", "label": "trans, quat = lookupTransform()", "type": "assigned_variable", "loc": [97, 98], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99593:If_L79_C0", "vector": [14, 1, 0.8405, 0.0172, 1, 0.05, 0.6667, 441, 3, 3, 0, 0, 926, 10, 2], "semantic": {"name": "trans, quat", "arg_names": [], "import_names": [], "rhs_call_name": "lookupTransform", "annotation": ""}, "snippet": " trans, quat = pr2_arms.tf_lstnr.lookupTransform('/base_footprint',\n '/torso_lift_link', rospy.Time(0))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99593:Assign_L99_C4", "label": "height =", "type": "assigned_variable", "loc": [99, 99], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99593:If_L79_C0", "vector": [14, 1, 0.8534, 0.0086, 1, 0.05, 0.7222, 751, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "height", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " height = ee_pos[2] + trans[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99593:Assign_L100_C4", "label": "assign", "type": "assigned_variable", "loc": [100, 100], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99593:If_L79_C0", "vector": [14, 1, 0.8621, 0.0086, 1, 0.05, 0.7778, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ee_pos[2] = -trans[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99593:Expr_L101_C4", "label": "add_cylinder()", "type": "expression", "loc": [101, 101], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99593:If_L79_C0", "vector": [8, 1, 0.8707, 0.0086, 1, 0.05, 0.8333, 412, 3, 6, 0, 0, 0, 0, 1], "semantic": {"name": "add_cylinder", "arg_names": [], "import_names": [], "rhs_call_name": "add_cylinder", "annotation": ""}, "snippet": " ac.add_cylinder('pole', ee_pos, 0.02, height, '/torso_lift_link', pub)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99593:Expr_L103_C4", "label": "loginfo()", "type": "expression", "loc": [103, 103], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99593:If_L79_C0", "vector": [8, 1, 0.8879, 0.0086, 1, 0.05, 0.8889, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo('Now starting the loop where I get contact locations.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99593:Assign_L104_C4", "label": "col_det = online_collision_detector()", "type": "assigned_variable", "loc": [104, 104], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99593:If_L79_C0", "vector": [14, 1, 0.8966, 0.0086, 1, 0.05, 0.9444, 401, 3, 0, 0, 0, 120, 10, 1], "semantic": {"name": "col_det", "arg_names": [], "import_names": [], "rhs_call_name": "online_collision_detector", "annotation": ""}, "snippet": " col_det = ocd.online_collision_detector()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99593:While_L105_C4", "label": "while", "type": "while", "loc": [105, 113], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99593:If_L79_C0", "vector": [5, 1, 0.9397, 0.0776, 1, 0.05, 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 rospy.sleep(0.1)\n res = col_det.check_validity(pr2_arms, arm)\n if res.error_code.val == res.error_code.SUCCESS:\n rospy.loginfo('No contact')\n else:\n contact_dict = contact_info_list_to_dict(res.contacts)\n print('contact_dict.keys:', contact_dict.keys())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99593:Expr_L106_C8", "label": "sleep()", "type": "expression", "loc": [106, 106], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99593:While_L105_C4", "vector": [8, 2, 0.9138, 0.0086, 2, 0.57, 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_99593:Assign_L107_C8", "label": "res = check_validity()", "type": "assigned_variable", "loc": [107, 107], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99593:While_L105_C4", "vector": [14, 2, 0.9224, 0.0086, 2, 0.57, 0.5, 413, 3, 2, 0, 0, 702, 10, 1], "semantic": {"name": "res", "arg_names": [], "import_names": [], "rhs_call_name": "check_validity", "annotation": ""}, "snippet": " res = col_det.check_validity(pr2_arms, arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99593:If_L108_C8", "label": "if", "type": "if", "loc": [108, 113], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99593:While_L105_C4", "vector": [4, 2, 0.9526, 0.0517, 2, 0.57, 1.0, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if res.error_code.val == res.error_code.SUCCESS:\n rospy.loginfo('No contact')\n else:\n contact_dict = contact_info_list_to_dict(res.contacts)\n print('contact_dict.keys:', contact_dict.keys())\n visualize_contact_dict(contact_dict, marker_pub, fts)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99593:Expr_L109_C12", "label": "loginfo()", "type": "expression", "loc": [109, 109], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99593:If_L108_C8", "vector": [8, 3, 0.9397, 0.0086, 3, 0.98, 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 contact')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99593:Assign_L111_C12", "label": "contact_dict = contact_info_list_to_dict()", "type": "assigned_variable", "loc": [111, 111], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99593:If_L108_C8", "vector": [14, 3, 0.9569, 0.0086, 3, 0.98, 0.3333, 953, 3, 1, 0, 0, 76, 10, 1], "semantic": {"name": "contact_dict", "arg_names": [], "import_names": [], "rhs_call_name": "contact_info_list_to_dict", "annotation": ""}, "snippet": " contact_dict = contact_info_list_to_dict(res.contacts)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99593:Expr_L112_C12", "label": "print()", "type": "expression", "loc": [112, 112], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99593:If_L108_C8", "vector": [8, 3, 0.9655, 0.0086, 3, 0.98, 0.6667, 535, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('contact_dict.keys:', contact_dict.keys())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99593:Expr_L113_C12", "label": "visualize_contact_dict()", "type": "expression", "loc": [113, 113], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99593:If_L108_C8", "vector": [8, 3, 0.9741, 0.0086, 3, 0.98, 1.0, 888, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "visualize_contact_dict", "arg_names": [], "import_names": [], "rhs_call_name": "visualize_contact_dict", "annotation": ""}, "snippet": " visualize_contact_dict(contact_dict, marker_pub, fts)"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99593:FunctionDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99593:Assign_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99593:FunctionDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99593:Assign_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99593:FunctionDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99593:Assign_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99593:FunctionDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99593:Assign_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99593:FunctionDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99593:Assign_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99593:FunctionDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99593:Assign_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99593:FunctionDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99593:For_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99593:For_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99593:If_L29_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99593:If_L29_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99593:Expr_L30_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99593:For_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99593:Assign_L32_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99593:For_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99593:Assign_L33_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99593:For_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99593:Assign_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99593:For_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99593:If_L35_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99593:If_L35_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99593:Assign_L36_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99593:For_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99593:Expr_L37_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99593:FunctionDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99593:Return_L39_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99593:FunctionDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99593:Assign_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99593:FunctionDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99593:Assign_L45_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99593:FunctionDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99593:Assign_L46_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99593:FunctionDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99593:Assign_L47_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99593:FunctionDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99593:For_L48_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99593:For_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99593:Assign_L49_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99593:For_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99593:Assign_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99593:For_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99593:Assign_L51_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99593:For_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99593:Assign_L52_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99593:For_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99593:Assign_L53_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99593:For_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99593:Assign_L54_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99593:For_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99593:Expr_L55_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99593:For_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99593:Expr_L56_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99593:For_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99593:Expr_L57_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99593:For_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99593:Assign_L58_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99593:For_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99593:Assign_L60_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99593:For_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99593:Assign_L61_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99593:For_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99593:Expr_L63_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99593:For_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99593:Expr_L64_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99593:FunctionDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99593:Assign_L66_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99593:FunctionDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99593:Assign_L70_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99593:FunctionDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99593:Assign_L71_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99593:FunctionDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99593:Expr_L72_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99593:FunctionDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99593:For_L74_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99593:For_L74_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99593:Assign_L75_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99593:For_L74_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99593:Expr_L76_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99593:If_L79_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99593:Expr_L80_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99593:If_L79_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99593:Assign_L81_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99593:If_L79_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99593:Assign_L82_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99593:If_L79_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99593:Assign_L84_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99593:If_L79_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99593:Expr_L85_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99593:If_L79_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99593:Assign_L86_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99593:If_L79_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99593:Assign_L87_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99593:If_L79_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99593:Assign_L88_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99593:If_L79_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99593:Expr_L90_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99593:If_L79_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99593:Assign_L92_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99593:If_L79_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99593:Expr_L93_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99593:If_L79_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99593:Expr_L94_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99593:If_L79_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99593:Assign_L97_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99593:If_L79_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99593:Assign_L99_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99593:If_L79_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99593:Assign_L100_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99593:If_L79_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99593:Expr_L101_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99593:If_L79_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99593:Expr_L103_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99593:If_L79_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99593:Assign_L104_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99593:If_L79_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99593:While_L105_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99593:While_L105_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99593:Expr_L106_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99593:While_L105_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99593:Assign_L107_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99593:While_L105_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99593:If_L108_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99593:If_L108_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99593:Expr_L109_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99593:If_L108_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99593:Assign_L111_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99593:If_L108_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99593:Expr_L112_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99593:If_L108_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99593:Expr_L113_C12"}]
import roslib; roslib.load_manifest('arm_navigation_tutorials') import sys import rospy from mapping_msgs.msg import CollisionObject from mapping_msgs.msg import CollisionObjectOperation from geometric_shapes_msgs.msg import Shape from geometry_msgs.msg import Pose def add_cylinder(id, bottom, radius, height, frameid, pub): cylinder_object = CollisionObject() cylinder_object.id = id cylinder_object.operation.operation = CollisionObjectOperation.ADD cylinder_object.header.frame_id = frameid cylinder_object.header.stamp = rospy.Time.now() shp = Shape() shp.type = Shape.CYLINDER shp.dimensions = [0, 0] shp.dimensions[0] = radius shp.dimensions[1] = height pose = Pose() pose.position.x = bottom[0] pose.position.y = bottom[1] pose.position.z = bottom[2] + height/2. pose.orientation.x = 0 pose.orientation.y = 0 pose.orientation.z = 0 pose.orientation.w = 1 cylinder_object.shapes.append(shp) cylinder_object.poses.append(pose) pub.publish(cylinder_object) if __name__ == '__main__': rospy.init_node('add_cylinder_python') pub = rospy.Publisher('collision_object', CollisionObject) rospy.sleep(2.) add_cylinder('pole', (0.6, -0.6, 0.), 0.1, 0.75, 'base_link', pub) rospy.loginfo('Should have published') rospy.sleep(2.)
ajibawa-2023/Python-Code-Large/train/row_99594
37
50
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99594:Import_L2_C0", "label": "roslib import roslib", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.04, 0.02, 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('arm_navigation_tutorials')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99594:Expr_L2_C15", "label": "load_manifest()", "type": "expression", "loc": [2, 2], "level": 0, "parent": null, "vector": [8, 0, 0.04, 0.02, 0, 0.66, 0.1111, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('arm_navigation_tutorials')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99594:Import_L3_C0", "label": "sys import sys", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.06, 0.02, 0, 0.66, 0.2222, 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_99594:Import_L4_C0", "label": "rospy import rospy", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.08, 0.02, 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_99594:ImportFrom_L6_C0", "label": "from mapping_msgs.msg import CollisionObject", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.12, 0.02, 0, 0.66, 0.4444, 483, 0, 1, 0, 0, 483, 0, 0], "semantic": {"name": "mapping_msgs.msg", "arg_names": [], "import_names": ["CollisionObject"], "rhs_call_name": "", "annotation": ""}, "snippet": "from mapping_msgs.msg import CollisionObject"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99594:ImportFrom_L7_C0", "label": "from mapping_msgs.msg import CollisionObjectOperation", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.14, 0.02, 0, 0.66, 0.5556, 483, 0, 1, 0, 0, 483, 0, 0], "semantic": {"name": "mapping_msgs.msg", "arg_names": [], "import_names": ["CollisionObjectOperation"], "rhs_call_name": "", "annotation": ""}, "snippet": "from mapping_msgs.msg import CollisionObjectOperation"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99594:ImportFrom_L8_C0", "label": "from geometric_shapes_msgs.msg import Shape", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.16, 0.02, 0, 0.66, 0.6667, 299, 0, 1, 0, 0, 299, 0, 0], "semantic": {"name": "geometric_shapes_msgs.msg", "arg_names": [], "import_names": ["Shape"], "rhs_call_name": "", "annotation": ""}, "snippet": "from geometric_shapes_msgs.msg import Shape"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99594:ImportFrom_L9_C0", "label": "from geometry_msgs.msg import Pose", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.18, 0.02, 0, 0.66, 0.7778, 951, 0, 1, 0, 0, 951, 0, 0], "semantic": {"name": "geometry_msgs.msg", "arg_names": [], "import_names": ["Pose"], "rhs_call_name": "", "annotation": ""}, "snippet": "from geometry_msgs.msg import Pose"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99594:FunctionDef_L12_C0", "label": "add_cylinder", "type": "function", "loc": [12, 36], "level": 0, "parent": null, "vector": [2, 0, 0.48, 0.5, 0, 0.66, 0.8889, 412, 0, 6, 0, 0, 0, 0, 7], "semantic": {"name": "add_cylinder", "arg_names": ["id", "bottom", "radius", "height", "frameid", "pub"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def add_cylinder(id, bottom, radius, height, frameid, pub):\n cylinder_object = CollisionObject()\n cylinder_object.id = id\n cylinder_object.operation.operation = CollisionObjectOperation.ADD\n cylinder_object.header.frame_id = frameid\n cylinder_object.header.stamp = rospy.Time.now()\n\n shp = Shape()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99594:Assign_L13_C4", "label": "cylinder_object = CollisionObject()", "type": "assigned_variable", "loc": [13, 13], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99594:FunctionDef_L12_C0", "vector": [14, 1, 0.26, 0.02, 1, 0.24, 0.0, 368, 3, 0, 0, 0, 39, 10, 1], "semantic": {"name": "cylinder_object", "arg_names": [], "import_names": [], "rhs_call_name": "CollisionObject", "annotation": ""}, "snippet": " cylinder_object = CollisionObject()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99594:Assign_L14_C4", "label": "cylinder_object.id =", "type": "assigned_variable", "loc": [14, 14], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99594:FunctionDef_L12_C0", "vector": [14, 1, 0.28, 0.02, 1, 0.24, 0.05, 746, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "cylinder_object.id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cylinder_object.id = id"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99594:Assign_L15_C4", "label": "cylinder_object.operation.operation =", "type": "assigned_variable", "loc": [15, 15], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99594:FunctionDef_L12_C0", "vector": [14, 1, 0.3, 0.02, 1, 0.24, 0.1, 370, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "cylinder_object.operation.operation", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cylinder_object.operation.operation = CollisionObjectOperation.ADD"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99594:Assign_L16_C4", "label": "cylinder_object.header.frame_id =", "type": "assigned_variable", "loc": [16, 16], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99594:FunctionDef_L12_C0", "vector": [14, 1, 0.32, 0.02, 1, 0.24, 0.15, 548, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "cylinder_object.header.frame_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cylinder_object.header.frame_id = frameid"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99594:Assign_L17_C4", "label": "cylinder_object.header.stamp = now()", "type": "assigned_variable", "loc": [17, 17], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99594:FunctionDef_L12_C0", "vector": [14, 1, 0.34, 0.02, 1, 0.24, 0.2, 696, 3, 0, 0, 0, 894, 10, 1], "semantic": {"name": "cylinder_object.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "now", "annotation": ""}, "snippet": " cylinder_object.header.stamp = rospy.Time.now()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99594:Assign_L19_C4", "label": "shp = Shape()", "type": "assigned_variable", "loc": [19, 19], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99594:FunctionDef_L12_C0", "vector": [14, 1, 0.38, 0.02, 1, 0.24, 0.25, 185, 3, 0, 0, 0, 739, 10, 1], "semantic": {"name": "shp", "arg_names": [], "import_names": [], "rhs_call_name": "Shape", "annotation": ""}, "snippet": " shp = Shape()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99594:Assign_L20_C4", "label": "shp.type =", "type": "assigned_variable", "loc": [20, 20], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99594:FunctionDef_L12_C0", "vector": [14, 1, 0.4, 0.02, 1, 0.24, 0.3, 505, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "shp.type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " shp.type = Shape.CYLINDER"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99594:Assign_L21_C4", "label": "shp.dimensions =", "type": "assigned_variable", "loc": [21, 21], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99594:FunctionDef_L12_C0", "vector": [14, 1, 0.42, 0.02, 1, 0.24, 0.35, 192, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "shp.dimensions", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " shp.dimensions = [0, 0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99594:Assign_L22_C4", "label": "assign", "type": "assigned_variable", "loc": [22, 22], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99594:FunctionDef_L12_C0", "vector": [14, 1, 0.44, 0.02, 1, 0.24, 0.4, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " shp.dimensions[0] = radius"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99594:Assign_L23_C4", "label": "assign", "type": "assigned_variable", "loc": [23, 23], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99594:FunctionDef_L12_C0", "vector": [14, 1, 0.46, 0.02, 1, 0.24, 0.45, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " shp.dimensions[1] = height"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99594:Assign_L25_C4", "label": "pose = Pose()", "type": "assigned_variable", "loc": [25, 25], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99594:FunctionDef_L12_C0", "vector": [14, 1, 0.5, 0.02, 1, 0.24, 0.5, 767, 3, 0, 0, 0, 902, 10, 1], "semantic": {"name": "pose", "arg_names": [], "import_names": [], "rhs_call_name": "Pose", "annotation": ""}, "snippet": " pose = Pose()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99594:Assign_L26_C4", "label": "pose.position.x =", "type": "assigned_variable", "loc": [26, 26], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99594:FunctionDef_L12_C0", "vector": [14, 1, 0.52, 0.02, 1, 0.24, 0.55, 6, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pose.position.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pose.position.x = bottom[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99594:Assign_L27_C4", "label": "pose.position.y =", "type": "assigned_variable", "loc": [27, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99594:FunctionDef_L12_C0", "vector": [14, 1, 0.54, 0.02, 1, 0.24, 0.6, 554, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pose.position.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pose.position.y = bottom[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99594:Assign_L28_C4", "label": "pose.position.z =", "type": "assigned_variable", "loc": [28, 28], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99594:FunctionDef_L12_C0", "vector": [14, 1, 0.56, 0.02, 1, 0.24, 0.65, 850, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pose.position.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pose.position.z = bottom[2] + height/2."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99594:Assign_L29_C4", "label": "pose.orientation.x =", "type": "assigned_variable", "loc": [29, 29], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99594:FunctionDef_L12_C0", "vector": [14, 1, 0.58, 0.02, 1, 0.24, 0.7, 169, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "pose.orientation.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pose.orientation.x = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99594:Assign_L30_C4", "label": "pose.orientation.y =", "type": "assigned_variable", "loc": [30, 30], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99594:FunctionDef_L12_C0", "vector": [14, 1, 0.6, 0.02, 1, 0.24, 0.75, 301, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "pose.orientation.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pose.orientation.y = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99594:Assign_L31_C4", "label": "pose.orientation.z =", "type": "assigned_variable", "loc": [31, 31], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99594:FunctionDef_L12_C0", "vector": [14, 1, 0.62, 0.02, 1, 0.24, 0.8, 569, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "pose.orientation.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pose.orientation.z = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99594:Assign_L32_C4", "label": "pose.orientation.w =", "type": "assigned_variable", "loc": [32, 32], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99594:FunctionDef_L12_C0", "vector": [14, 1, 0.64, 0.02, 1, 0.24, 0.85, 345, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "pose.orientation.w", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pose.orientation.w = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99594:Expr_L33_C4", "label": "append()", "type": "expression", "loc": [33, 33], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99594:FunctionDef_L12_C0", "vector": [8, 1, 0.66, 0.02, 1, 0.24, 0.9, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " cylinder_object.shapes.append(shp)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99594:Expr_L34_C4", "label": "append()", "type": "expression", "loc": [34, 34], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99594:FunctionDef_L12_C0", "vector": [8, 1, 0.68, 0.02, 1, 0.24, 0.95, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " cylinder_object.poses.append(pose)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99594:Expr_L36_C4", "label": "publish()", "type": "expression", "loc": [36, 36], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99594:FunctionDef_L12_C0", "vector": [8, 1, 0.72, 0.02, 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": " pub.publish(cylinder_object)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99594:If_L39_C0", "label": "if", "type": "if", "loc": [39, 47], "level": 0, "parent": null, "vector": [4, 0, 0.86, 0.18, 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('add_cylinder_python')\n\n pub = rospy.Publisher('collision_object', CollisionObject)\n rospy.sleep(2.)\n\n add_cylinder('pole', (0.6, -0.6, 0.), 0.1, 0.75, 'base_link', pub)\n rospy.loginfo('Should have published')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99594:Expr_L40_C4", "label": "init_node()", "type": "expression", "loc": [40, 40], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99594:If_L39_C0", "vector": [8, 1, 0.8, 0.02, 1, 0.68, 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('add_cylinder_python')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99594:Assign_L42_C4", "label": "pub = Publisher()", "type": "assigned_variable", "loc": [42, 42], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99594:If_L39_C0", "vector": [14, 1, 0.84, 0.02, 1, 0.68, 0.2, 41, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " pub = rospy.Publisher('collision_object', CollisionObject)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99594:Expr_L43_C4", "label": "sleep()", "type": "expression", "loc": [43, 43], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99594:If_L39_C0", "vector": [8, 1, 0.86, 0.02, 1, 0.68, 0.4, 476, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " rospy.sleep(2.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99594:Expr_L45_C4", "label": "add_cylinder()", "type": "expression", "loc": [45, 45], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99594:If_L39_C0", "vector": [8, 1, 0.9, 0.02, 1, 0.68, 0.6, 412, 3, 6, 0, 0, 0, 0, 1], "semantic": {"name": "add_cylinder", "arg_names": [], "import_names": [], "rhs_call_name": "add_cylinder", "annotation": ""}, "snippet": " add_cylinder('pole', (0.6, -0.6, 0.), 0.1, 0.75, 'base_link', pub)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99594:Expr_L46_C4", "label": "loginfo()", "type": "expression", "loc": [46, 46], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99594:If_L39_C0", "vector": [8, 1, 0.92, 0.02, 1, 0.68, 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('Should have published')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99594:Expr_L47_C4", "label": "sleep()", "type": "expression", "loc": [47, 47], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99594:If_L39_C0", "vector": [8, 1, 0.94, 0.02, 1, 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(2.)"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99594:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99594:Assign_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99594:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99594:Assign_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99594:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99594:Assign_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99594:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99594:Assign_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99594:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99594:Assign_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99594:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99594:Assign_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99594:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99594:Assign_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99594:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99594:Assign_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99594:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99594:Assign_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99594:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99594:Assign_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99594:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99594:Assign_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99594:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99594:Assign_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99594:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99594:Assign_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99594:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99594:Assign_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99594:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99594:Assign_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99594:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99594:Assign_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99594:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99594:Assign_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99594:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99594:Assign_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99594:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99594:Expr_L33_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99594:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99594:Expr_L34_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99594:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99594:Expr_L36_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99594:If_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99594:Expr_L40_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99594:If_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99594:Assign_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99594:If_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99594:Expr_L43_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99594:If_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99594:Expr_L45_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99594:If_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99594:Expr_L46_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99594:If_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99594:Expr_L47_C4"}]
import roslib; roslib.load_manifest('arm_navigation_tutorials') import sys import rospy import hrl_lib.transforms as tr from planning_environment_msgs.srv import GetStateValidity from planning_environment_msgs.srv import GetStateValidityRequest from sensor_msgs.msg import JointState roslib.load_manifest('hrl_pr2_lib') import hrl_pr2_lib.pr2_arms as pa class online_collision_detector(): def __init__(self): srv_nm = 'environment_server_right_arm/get_state_validity' rospy.wait_for_service(srv_nm) self.state_validator = rospy.ServiceProxy(srv_nm, GetStateValidity, persistent=True) def check_validity(self, pr2_arms, arm): q = pr2_arms.get_joint_angles(arm) joint_nm_list = ['r_shoulder_pan_joint', 'r_shoulder_lift_joint', 'r_upper_arm_roll_joint', 'r_elbow_flex_joint', 'r_forearm_roll_joint', 'r_wrist_flex_joint', 'r_wrist_roll_joint'] req = GetStateValidityRequest() req.robot_state.joint_state.name = joint_nm_list req.robot_state.joint_state.position = q req.robot_state.joint_state.header.stamp = rospy.Time.now() req.check_collisions = True res = self.state_validator.call(req) return res if __name__ == '__main__': rospy.init_node('get_state_validity_python') pr2_arms = pa.PR2Arms() r_arm, l_arm = 0, 1 arm = r_arm col_det = online_collision_detector() while not rospy.is_shutdown(): rospy.sleep(0.1) res = col_det.check_validity(pr2_arms, arm) if res.error_code.val == res.error_code.SUCCESS: rospy.loginfo('Requested state is not in collision') else: rospy.loginfo('Requested state is in collision. Error code: %d'%(res.error_code.val))
ajibawa-2023/Python-Code-Large/train/row_99595
37
60
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99595:Import_L2_C0", "label": "roslib import roslib", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0333, 0.0167, 0, 0.66, 0.0, 796, 0, 1, 0, 0, 796, 0, 0], "semantic": {"name": "roslib", "arg_names": [], "import_names": ["roslib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('arm_navigation_tutorials')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99595:Expr_L2_C15", "label": "load_manifest()", "type": "expression", "loc": [2, 2], "level": 0, "parent": null, "vector": [8, 0, 0.0333, 0.0167, 0, 0.66, 0.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('arm_navigation_tutorials')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99595:Import_L3_C0", "label": "sys import sys", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.05, 0.0167, 0, 0.66, 0.1818, 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_99595:Import_L4_C0", "label": "rospy import rospy", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0667, 0.0167, 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_99595:Import_L6_C0", "label": "hrl_lib.transforms import tr", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.1, 0.0167, 0, 0.66, 0.3636, 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_99595:ImportFrom_L8_C0", "label": "from planning_environment_msgs.srv import GetStateValidity", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.1333, 0.0167, 0, 0.66, 0.4545, 813, 0, 1, 0, 0, 813, 0, 0], "semantic": {"name": "planning_environment_msgs.srv", "arg_names": [], "import_names": ["GetStateValidity"], "rhs_call_name": "", "annotation": ""}, "snippet": "from planning_environment_msgs.srv import GetStateValidity"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99595:ImportFrom_L9_C0", "label": "from planning_environment_msgs.srv import GetStateValidityRequest", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.15, 0.0167, 0, 0.66, 0.5455, 813, 0, 1, 0, 0, 813, 0, 0], "semantic": {"name": "planning_environment_msgs.srv", "arg_names": [], "import_names": ["GetStateValidityRequest"], "rhs_call_name": "", "annotation": ""}, "snippet": "from planning_environment_msgs.srv import GetStateValidityRequest"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99595:ImportFrom_L10_C0", "label": "from sensor_msgs.msg import JointState", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.1667, 0.0167, 0, 0.66, 0.6364, 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_99595:Expr_L12_C0", "label": "load_manifest()", "type": "expression", "loc": [12, 12], "level": 0, "parent": null, "vector": [8, 0, 0.2, 0.0167, 0, 0.66, 0.7273, 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_99595:Import_L13_C0", "label": "hrl_pr2_lib.pr2_arms import pa", "type": "import", "loc": [13, 13], "level": 0, "parent": null, "vector": [1, 0, 0.2167, 0.0167, 0, 0.66, 0.8182, 359, 0, 1, 0, 0, 359, 0, 0], "semantic": {"name": "hrl_pr2_lib.pr2_arms", "arg_names": [], "import_names": ["pa"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_pr2_lib.pr2_arms as pa"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99595:ClassDef_L16_C0", "label": "online_collision_detector", "type": "class", "loc": [16, 40], "level": 0, "parent": null, "vector": [3, 0, 0.4667, 0.4167, 0, 0.66, 0.9091, 120, 0, 2, 0, 0, 0, 0, 6], "semantic": {"name": "online_collision_detector", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class online_collision_detector():\n\n def __init__(self):\n srv_nm = 'environment_server_right_arm/get_state_validity'\n rospy.wait_for_service(srv_nm)\n self.state_validator = rospy.ServiceProxy(srv_nm, GetStateValidity,\n persistent=True)\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99595:FunctionDef_L18_C4", "label": "__init__", "type": "function", "loc": [18, 22], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99595:ClassDef_L16_C0", "vector": [2, 1, 0.3333, 0.0833, 1, 0.82, 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 srv_nm = 'environment_server_right_arm/get_state_validity'\n rospy.wait_for_service(srv_nm)\n self.state_validator = rospy.ServiceProxy(srv_nm, GetStateValidity,\n persistent=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99595:Assign_L19_C8", "label": "srv_nm =", "type": "assigned_variable", "loc": [19, 19], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99595:FunctionDef_L18_C4", "vector": [14, 2, 0.3167, 0.0167, 2, 0.51, 0.0, 560, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "srv_nm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " srv_nm = 'environment_server_right_arm/get_state_validity'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99595:Expr_L20_C8", "label": "wait_for_service()", "type": "expression", "loc": [20, 20], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99595:FunctionDef_L18_C4", "vector": [8, 2, 0.3333, 0.0167, 2, 0.51, 0.5, 617, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "wait_for_service", "arg_names": [], "import_names": [], "rhs_call_name": "wait_for_service", "annotation": ""}, "snippet": " rospy.wait_for_service(srv_nm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99595:Assign_L21_C8", "label": "self.state_validator = ServiceProxy()", "type": "assigned_variable", "loc": [21, 22], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99595:FunctionDef_L18_C4", "vector": [14, 2, 0.3583, 0.0333, 2, 0.51, 1.0, 370, 3, 3, 0, 0, 915, 10, 1], "semantic": {"name": "self.state_validator", "arg_names": [], "import_names": [], "rhs_call_name": "ServiceProxy", "annotation": ""}, "snippet": " self.state_validator = rospy.ServiceProxy(srv_nm, GetStateValidity,\n persistent=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99595:FunctionDef_L24_C4", "label": "check_validity", "type": "function", "loc": [24, 40], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99595:ClassDef_L16_C0", "vector": [2, 1, 0.5333, 0.2833, 1, 0.82, 1.0, 702, 0, 3, 1, 0, 0, 0, 4], "semantic": {"name": "check_validity", "arg_names": ["self", "pr2_arms", "arm"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def check_validity(self, pr2_arms, arm):\n q = pr2_arms.get_joint_angles(arm)\n\n joint_nm_list = ['r_shoulder_pan_joint', 'r_shoulder_lift_joint',\n 'r_upper_arm_roll_joint', 'r_elbow_flex_joint',\n 'r_forearm_roll_joint', 'r_wrist_flex_joint',\n 'r_wrist_roll_joint']\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99595:Assign_L25_C8", "label": "q = get_joint_angles()", "type": "assigned_variable", "loc": [25, 25], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99595:FunctionDef_L24_C4", "vector": [14, 2, 0.4167, 0.0167, 2, 0.87, 0.0, 516, 3, 1, 0, 0, 820, 10, 1], "semantic": {"name": "q", "arg_names": [], "import_names": [], "rhs_call_name": "get_joint_angles", "annotation": ""}, "snippet": " q = pr2_arms.get_joint_angles(arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99595:Assign_L27_C8", "label": "joint_nm_list =", "type": "assigned_variable", "loc": [27, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99595:FunctionDef_L24_C4", "vector": [14, 2, 0.475, 0.0667, 2, 0.87, 0.125, 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 = ['r_shoulder_pan_joint', 'r_shoulder_lift_joint',\n 'r_upper_arm_roll_joint', 'r_elbow_flex_joint',\n 'r_forearm_roll_joint', 'r_wrist_flex_joint',\n 'r_wrist_roll_joint']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99595:Assign_L32_C8", "label": "req = GetStateValidityRequest()", "type": "assigned_variable", "loc": [32, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99595:FunctionDef_L24_C4", "vector": [14, 2, 0.5333, 0.0167, 2, 0.87, 0.25, 233, 3, 0, 0, 0, 4, 10, 1], "semantic": {"name": "req", "arg_names": [], "import_names": [], "rhs_call_name": "GetStateValidityRequest", "annotation": ""}, "snippet": " req = GetStateValidityRequest()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99595:Assign_L33_C8", "label": "req.robot_state.joint_state.name =", "type": "assigned_variable", "loc": [33, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99595:FunctionDef_L24_C4", "vector": [14, 2, 0.55, 0.0167, 2, 0.87, 0.375, 525, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "req.robot_state.joint_state.name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " req.robot_state.joint_state.name = joint_nm_list"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99595:Assign_L34_C8", "label": "req.robot_state.joint_state.position =", "type": "assigned_variable", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99595:FunctionDef_L24_C4", "vector": [14, 2, 0.5667, 0.0167, 2, 0.87, 0.5, 249, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "req.robot_state.joint_state.position", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " req.robot_state.joint_state.position = q"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99595:Assign_L36_C8", "label": "req.robot_state.joint_state.header.stamp = now()", "type": "assigned_variable", "loc": [36, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99595:FunctionDef_L24_C4", "vector": [14, 2, 0.6, 0.0167, 2, 0.87, 0.625, 1, 3, 0, 0, 0, 894, 10, 1], "semantic": {"name": "req.robot_state.joint_state.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "now", "annotation": ""}, "snippet": " req.robot_state.joint_state.header.stamp = rospy.Time.now()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99595:Assign_L37_C8", "label": "req.check_collisions =", "type": "assigned_variable", "loc": [37, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99595:FunctionDef_L24_C4", "vector": [14, 2, 0.6167, 0.0167, 2, 0.87, 0.75, 373, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "req.check_collisions", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " req.check_collisions = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99595:Assign_L39_C8", "label": "res = call()", "type": "assigned_variable", "loc": [39, 39], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99595:FunctionDef_L24_C4", "vector": [14, 2, 0.65, 0.0167, 2, 0.87, 0.875, 413, 3, 1, 0, 0, 832, 10, 1], "semantic": {"name": "res", "arg_names": [], "import_names": [], "rhs_call_name": "call", "annotation": ""}, "snippet": " res = self.state_validator.call(req)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99595:Return_L40_C8", "label": "return", "type": "return", "loc": [40, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99595:FunctionDef_L24_C4", "vector": [13, 2, 0.6667, 0.0167, 2, 0.87, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return res"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99595:If_L43_C0", "label": "if", "type": "if", "loc": [43, 57], "level": 0, "parent": null, "vector": [4, 0, 0.8333, 0.25, 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('get_state_validity_python')\n\n pr2_arms = pa.PR2Arms()\n r_arm, l_arm = 0, 1\n arm = r_arm\n col_det = online_collision_detector()\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99595:Expr_L44_C4", "label": "init_node()", "type": "expression", "loc": [44, 44], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99595:If_L43_C0", "vector": [8, 1, 0.7333, 0.0167, 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('get_state_validity_python')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99595:Assign_L46_C4", "label": "pr2_arms = PR2Arms()", "type": "assigned_variable", "loc": [46, 46], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99595:If_L43_C0", "vector": [14, 1, 0.7667, 0.0167, 1, 0.61, 0.2, 369, 3, 0, 0, 0, 694, 10, 1], "semantic": {"name": "pr2_arms", "arg_names": [], "import_names": [], "rhs_call_name": "PR2Arms", "annotation": ""}, "snippet": " pr2_arms = pa.PR2Arms()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99595:Assign_L47_C4", "label": "r_arm, l_arm =", "type": "assigned_variable", "loc": [47, 47], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99595:If_L43_C0", "vector": [14, 1, 0.7833, 0.0167, 1, 0.61, 0.4, 451, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "r_arm, l_arm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " r_arm, l_arm = 0, 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99595:Assign_L48_C4", "label": "arm =", "type": "assigned_variable", "loc": [48, 48], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99595:If_L43_C0", "vector": [14, 1, 0.8, 0.0167, 1, 0.61, 0.6, 413, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "arm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " arm = r_arm"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99595:Assign_L49_C4", "label": "col_det = online_collision_detector()", "type": "assigned_variable", "loc": [49, 49], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99595:If_L43_C0", "vector": [14, 1, 0.8167, 0.0167, 1, 0.61, 0.8, 401, 3, 0, 0, 0, 120, 10, 1], "semantic": {"name": "col_det", "arg_names": [], "import_names": [], "rhs_call_name": "online_collision_detector", "annotation": ""}, "snippet": " col_det = online_collision_detector()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99595:While_L51_C4", "label": "while", "type": "while", "loc": [51, 57], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99595:If_L43_C0", "vector": [5, 1, 0.9, 0.1167, 1, 0.61, 1.0, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while not rospy.is_shutdown():\n rospy.sleep(0.1)\n res = col_det.check_validity(pr2_arms, arm)\n if res.error_code.val == res.error_code.SUCCESS:\n rospy.loginfo('Requested state is not in collision')\n else:\n rospy.loginfo('Requested state is in collision. Error code: %d'%(res.error_code.val))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99595:Expr_L52_C8", "label": "sleep()", "type": "expression", "loc": [52, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99595:While_L51_C4", "vector": [8, 2, 0.8667, 0.0167, 2, 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(0.1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99595:Assign_L53_C8", "label": "res = check_validity()", "type": "assigned_variable", "loc": [53, 53], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99595:While_L51_C4", "vector": [14, 2, 0.8833, 0.0167, 2, 0.77, 0.5, 413, 3, 2, 0, 0, 702, 10, 1], "semantic": {"name": "res", "arg_names": [], "import_names": [], "rhs_call_name": "check_validity", "annotation": ""}, "snippet": " res = col_det.check_validity(pr2_arms, arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99595:If_L54_C8", "label": "if", "type": "if", "loc": [54, 57], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99595:While_L51_C4", "vector": [4, 2, 0.925, 0.0667, 2, 0.77, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if res.error_code.val == res.error_code.SUCCESS:\n rospy.loginfo('Requested state is not in collision')\n else:\n rospy.loginfo('Requested state is in collision. Error code: %d'%(res.error_code.val))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99595:Expr_L55_C12", "label": "loginfo()", "type": "expression", "loc": [55, 55], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99595:If_L54_C8", "vector": [8, 3, 0.9167, 0.0167, 3, 0.72, 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('Requested state is not in collision')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99595:Expr_L57_C12", "label": "loginfo()", "type": "expression", "loc": [57, 57], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99595:If_L54_C8", "vector": [8, 3, 0.95, 0.0167, 3, 0.72, 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('Requested state is in collision. Error code: %d'%(res.error_code.val))"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99595:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99595:FunctionDef_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99595:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99595:Assign_L19_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99595:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99595:Expr_L20_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99595:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99595:Assign_L21_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99595:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99595:FunctionDef_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99595:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99595:Assign_L25_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99595:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99595:Assign_L27_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99595:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99595:Assign_L32_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99595:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99595:Assign_L33_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99595:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99595:Assign_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99595:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99595:Assign_L36_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99595:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99595:Assign_L37_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99595:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99595:Assign_L39_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99595:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99595:Return_L40_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99595:If_L43_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99595:Expr_L44_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99595:If_L43_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99595:Assign_L46_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99595:If_L43_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99595:Assign_L47_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99595:If_L43_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99595:Assign_L48_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99595:If_L43_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99595:Assign_L49_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99595:If_L43_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99595:While_L51_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99595:While_L51_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99595:Expr_L52_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99595:While_L51_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99595:Assign_L53_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99595:While_L51_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99595:If_L54_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99595:If_L54_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99595:Expr_L55_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99595:If_L54_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99595:Expr_L57_C12"}]
# # Copyright (c) 2010, Georgia Tech Research Corporation # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # * Neither the name of the Georgia Tech Research Corporation nor the # names of its contributors may be used to endorse or promote products # derived from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY GEORGIA TECH RESEARCH CORPORATION ''AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL GEORGIA TECH BE LIABLE FOR ANY DIRECT, INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # Author: Advait Jain (advait@cc.gatech.edu), Healthcare Robotics Lab, Georgia Tech import roslib; roslib.load_manifest('arm_navigation_tutorials') import sys import rospy from planning_environment_msgs.srv import GetStateValidity from planning_environment_msgs.srv import GetStateValidityRequest if __name__ == '__main__': rospy.init_node('get_state_validity_python') srv_nm = 'environment_server_right_arm/get_state_validity' rospy.wait_for_service(srv_nm) get_state_validity = rospy.ServiceProxy(srv_nm, GetStateValidity) req = GetStateValidityRequest() req.robot_state.joint_state.name = ['r_shoulder_pan_joint', 'r_shoulder_lift_joint', 'r_upper_arm_roll_joint', 'r_elbow_flex_joint', 'r_forearm_roll_joint', 'r_wrist_flex_joint', 'r_wrist_roll_joint'] req.robot_state.joint_state.position = [0.] * 7 req.robot_state.joint_state.position[0] = 0.4 req.robot_state.joint_state.position[3] = -0.4 req.robot_state.joint_state.header.stamp = rospy.Time.now() req.check_collisions = True res = get_state_validity.call(req) if res.error_code.val == res.error_code.SUCCESS: rospy.loginfo('Requested state is not in collision') else: rospy.loginfo('Requested state is in collision. Error code: %d'%(res.error_code.val))
ajibawa-2023/Python-Code-Large/train/row_99596
22
68
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99596:Import_L30_C0", "label": "roslib import roslib", "type": "import", "loc": [30, 30], "level": 0, "parent": null, "vector": [1, 0, 0.4412, 0.0147, 0, 0.66, 0.0, 796, 0, 1, 0, 0, 796, 0, 0], "semantic": {"name": "roslib", "arg_names": [], "import_names": ["roslib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('arm_navigation_tutorials')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99596:Expr_L30_C15", "label": "load_manifest()", "type": "expression", "loc": [30, 30], "level": 0, "parent": null, "vector": [8, 0, 0.4412, 0.0147, 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('arm_navigation_tutorials')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99596:Import_L31_C0", "label": "sys import sys", "type": "import", "loc": [31, 31], "level": 0, "parent": null, "vector": [1, 0, 0.4559, 0.0147, 0, 0.66, 0.3333, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99596:Import_L32_C0", "label": "rospy import rospy", "type": "import", "loc": [32, 32], "level": 0, "parent": null, "vector": [1, 0, 0.4706, 0.0147, 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_99596:ImportFrom_L34_C0", "label": "from planning_environment_msgs.srv import GetStateValidity", "type": "import", "loc": [34, 34], "level": 0, "parent": null, "vector": [1, 0, 0.5, 0.0147, 0, 0.66, 0.6667, 813, 0, 1, 0, 0, 813, 0, 0], "semantic": {"name": "planning_environment_msgs.srv", "arg_names": [], "import_names": ["GetStateValidity"], "rhs_call_name": "", "annotation": ""}, "snippet": "from planning_environment_msgs.srv import GetStateValidity"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99596:ImportFrom_L35_C0", "label": "from planning_environment_msgs.srv import GetStateValidityRequest", "type": "import", "loc": [35, 35], "level": 0, "parent": null, "vector": [1, 0, 0.5147, 0.0147, 0, 0.66, 0.8333, 813, 0, 1, 0, 0, 813, 0, 0], "semantic": {"name": "planning_environment_msgs.srv", "arg_names": [], "import_names": ["GetStateValidityRequest"], "rhs_call_name": "", "annotation": ""}, "snippet": "from planning_environment_msgs.srv import GetStateValidityRequest"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99596:If_L38_C0", "label": "if", "type": "if", "loc": [38, 65], "level": 0, "parent": null, "vector": [4, 0, 0.7574, 0.4118, 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('get_state_validity_python')\n\n srv_nm = 'environment_server_right_arm/get_state_validity'\n rospy.wait_for_service(srv_nm)\n get_state_validity = rospy.ServiceProxy(srv_nm, GetStateValidity)\n\n req = GetStateValidityRequest()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99596:Expr_L39_C4", "label": "init_node()", "type": "expression", "loc": [39, 39], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99596:If_L38_C0", "vector": [8, 1, 0.5735, 0.0147, 1, 0.11, 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('get_state_validity_python')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99596:Assign_L41_C4", "label": "srv_nm =", "type": "assigned_variable", "loc": [41, 41], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99596:If_L38_C0", "vector": [14, 1, 0.6029, 0.0147, 1, 0.11, 0.0833, 560, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "srv_nm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " srv_nm = 'environment_server_right_arm/get_state_validity'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99596:Expr_L42_C4", "label": "wait_for_service()", "type": "expression", "loc": [42, 42], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99596:If_L38_C0", "vector": [8, 1, 0.6176, 0.0147, 1, 0.11, 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(srv_nm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99596:Assign_L43_C4", "label": "get_state_validity = ServiceProxy()", "type": "assigned_variable", "loc": [43, 43], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99596:If_L38_C0", "vector": [14, 1, 0.6324, 0.0147, 1, 0.11, 0.25, 583, 3, 2, 0, 0, 915, 10, 1], "semantic": {"name": "get_state_validity", "arg_names": [], "import_names": [], "rhs_call_name": "ServiceProxy", "annotation": ""}, "snippet": " get_state_validity = rospy.ServiceProxy(srv_nm, GetStateValidity)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99596:Assign_L45_C4", "label": "req = GetStateValidityRequest()", "type": "assigned_variable", "loc": [45, 45], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99596:If_L38_C0", "vector": [14, 1, 0.6618, 0.0147, 1, 0.11, 0.3333, 233, 3, 0, 0, 0, 4, 10, 1], "semantic": {"name": "req", "arg_names": [], "import_names": [], "rhs_call_name": "GetStateValidityRequest", "annotation": ""}, "snippet": " req = GetStateValidityRequest()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99596:Assign_L46_C4", "label": "req.robot_state.joint_state.name =", "type": "assigned_variable", "loc": [46, 52], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99596:If_L38_C0", "vector": [14, 1, 0.7206, 0.1029, 1, 0.11, 0.4167, 525, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "req.robot_state.joint_state.name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " req.robot_state.joint_state.name = ['r_shoulder_pan_joint',\n 'r_shoulder_lift_joint',\n 'r_upper_arm_roll_joint',\n 'r_elbow_flex_joint',\n 'r_forearm_roll_joint',\n 'r_wrist_flex_joint',\n 'r_wrist_roll_joint']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99596:Assign_L53_C4", "label": "req.robot_state.joint_state.position =", "type": "assigned_variable", "loc": [53, 53], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99596:If_L38_C0", "vector": [14, 1, 0.7794, 0.0147, 1, 0.11, 0.5, 249, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "req.robot_state.joint_state.position", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " req.robot_state.joint_state.position = [0.] * 7"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99596:Assign_L54_C4", "label": "assign", "type": "assigned_variable", "loc": [54, 54], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99596:If_L38_C0", "vector": [14, 1, 0.7941, 0.0147, 1, 0.11, 0.5833, 0, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " req.robot_state.joint_state.position[0] = 0.4"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99596:Assign_L55_C4", "label": "assign", "type": "assigned_variable", "loc": [55, 55], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99596:If_L38_C0", "vector": [14, 1, 0.8088, 0.0147, 1, 0.11, 0.6667, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " req.robot_state.joint_state.position[3] = -0.4"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99596:Assign_L57_C4", "label": "req.robot_state.joint_state.header.stamp = now()", "type": "assigned_variable", "loc": [57, 57], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99596:If_L38_C0", "vector": [14, 1, 0.8382, 0.0147, 1, 0.11, 0.75, 1, 3, 0, 0, 0, 894, 10, 1], "semantic": {"name": "req.robot_state.joint_state.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "now", "annotation": ""}, "snippet": " req.robot_state.joint_state.header.stamp = rospy.Time.now()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99596:Assign_L58_C4", "label": "req.check_collisions =", "type": "assigned_variable", "loc": [58, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99596:If_L38_C0", "vector": [14, 1, 0.8529, 0.0147, 1, 0.11, 0.8333, 373, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "req.check_collisions", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " req.check_collisions = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99596:Assign_L60_C4", "label": "res = call()", "type": "assigned_variable", "loc": [60, 60], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99596:If_L38_C0", "vector": [14, 1, 0.8824, 0.0147, 1, 0.11, 0.9167, 413, 3, 1, 0, 0, 832, 10, 1], "semantic": {"name": "res", "arg_names": [], "import_names": [], "rhs_call_name": "call", "annotation": ""}, "snippet": " res = get_state_validity.call(req)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99596:If_L62_C4", "label": "if", "type": "if", "loc": [62, 65], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99596:If_L38_C0", "vector": [4, 1, 0.9338, 0.0588, 1, 0.11, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if res.error_code.val == res.error_code.SUCCESS:\n rospy.loginfo('Requested state is not in collision')\n else:\n rospy.loginfo('Requested state is in collision. Error code: %d'%(res.error_code.val))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99596:Expr_L63_C8", "label": "loginfo()", "type": "expression", "loc": [63, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99596:If_L62_C4", "vector": [8, 2, 0.9265, 0.0147, 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('Requested state is not in collision')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99596:Expr_L65_C8", "label": "loginfo()", "type": "expression", "loc": [65, 65], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99596:If_L62_C4", "vector": [8, 2, 0.9559, 0.0147, 2, 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('Requested state is in collision. Error code: %d'%(res.error_code.val))"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99596:If_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99596:Expr_L39_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99596:If_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99596:Assign_L41_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99596:If_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99596:Expr_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99596:If_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99596:Assign_L43_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99596:If_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99596:Assign_L45_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99596:If_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99596:Assign_L46_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99596:If_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99596:Assign_L53_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99596:If_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99596:Assign_L54_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99596:If_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99596:Assign_L55_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99596:If_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99596:Assign_L57_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99596:If_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99596:Assign_L58_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99596:If_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99596:Assign_L60_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99596:If_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99596:If_L62_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99596:If_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99596:Expr_L63_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99596:If_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99596:Expr_L65_C8"}]
# # Copyright (c) 2010, Georgia Tech Research Corporation # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # * Neither the name of the Georgia Tech Research Corporation nor the # names of its contributors may be used to endorse or promote products # derived from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY GEORGIA TECH RESEARCH CORPORATION ''AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL GEORGIA TECH BE LIABLE FOR ANY DIRECT, INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # Author: Advait Jain (advait@cc.gatech.edu), Healthcare Robotics Lab, Georgia Tech import roslib; roslib.load_manifest('arm_navigation_tutorials') import sys import rospy from mapping_msgs.msg import CollisionObject from mapping_msgs.msg import CollisionObjectOperation from geometric_shapes_msgs.msg import Shape from geometry_msgs.msg import Pose def add_cylinder(id, bottom, radius, height, frameid): cylinder_object = CollisionObject() cylinder_object.id = id cylinder_object.operation.operation = CollisionObjectOperation.ADD cylinder_object.header.frame_id = frameid cylinder_object.header.stamp = rospy.Time.now() shp = Shape() shp.type = Shape.CYLINDER shp.dimensions = [0, 0] shp.dimensions[0] = radius shp.dimensions[1] = height pose = Pose() pose.position.x = bottom[0] pose.position.y = bottom[1] pose.position.z = bottom[2] + height/2. pose.orientation.x = 0 pose.orientation.y = 0 pose.orientation.z = 0 pose.orientation.w = 1 cylinder_object.shapes.append(shp) cylinder_object.poses.append(pose) pub.publish(cylinder_object) if __name__ == '__main__': rospy.init_node('add_cylinder_python') pub = rospy.Publisher('collision_object', CollisionObject) rospy.sleep(2.) add_cylinder('pole', (0.6, -0.6, 0.), 0.1, 0.75, 'base_link') rospy.loginfo('Should have published') rospy.sleep(2.)
ajibawa-2023/Python-Code-Large/train/row_99597
37
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_99597:Import_L31_C0", "label": "roslib import roslib", "type": "import", "loc": [31, 31], "level": 0, "parent": null, "vector": [1, 0, 0.3924, 0.0127, 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('arm_navigation_tutorials')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99597:Expr_L31_C15", "label": "load_manifest()", "type": "expression", "loc": [31, 31], "level": 0, "parent": null, "vector": [8, 0, 0.3924, 0.0127, 0, 0.66, 0.1111, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('arm_navigation_tutorials')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99597:Import_L32_C0", "label": "sys import sys", "type": "import", "loc": [32, 32], "level": 0, "parent": null, "vector": [1, 0, 0.4051, 0.0127, 0, 0.66, 0.2222, 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_99597:Import_L33_C0", "label": "rospy import rospy", "type": "import", "loc": [33, 33], "level": 0, "parent": null, "vector": [1, 0, 0.4177, 0.0127, 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_99597:ImportFrom_L35_C0", "label": "from mapping_msgs.msg import CollisionObject", "type": "import", "loc": [35, 35], "level": 0, "parent": null, "vector": [1, 0, 0.443, 0.0127, 0, 0.66, 0.4444, 483, 0, 1, 0, 0, 483, 0, 0], "semantic": {"name": "mapping_msgs.msg", "arg_names": [], "import_names": ["CollisionObject"], "rhs_call_name": "", "annotation": ""}, "snippet": "from mapping_msgs.msg import CollisionObject"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99597:ImportFrom_L36_C0", "label": "from mapping_msgs.msg import CollisionObjectOperation", "type": "import", "loc": [36, 36], "level": 0, "parent": null, "vector": [1, 0, 0.4557, 0.0127, 0, 0.66, 0.5556, 483, 0, 1, 0, 0, 483, 0, 0], "semantic": {"name": "mapping_msgs.msg", "arg_names": [], "import_names": ["CollisionObjectOperation"], "rhs_call_name": "", "annotation": ""}, "snippet": "from mapping_msgs.msg import CollisionObjectOperation"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99597:ImportFrom_L37_C0", "label": "from geometric_shapes_msgs.msg import Shape", "type": "import", "loc": [37, 37], "level": 0, "parent": null, "vector": [1, 0, 0.4684, 0.0127, 0, 0.66, 0.6667, 299, 0, 1, 0, 0, 299, 0, 0], "semantic": {"name": "geometric_shapes_msgs.msg", "arg_names": [], "import_names": ["Shape"], "rhs_call_name": "", "annotation": ""}, "snippet": "from geometric_shapes_msgs.msg import Shape"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99597:ImportFrom_L38_C0", "label": "from geometry_msgs.msg import Pose", "type": "import", "loc": [38, 38], "level": 0, "parent": null, "vector": [1, 0, 0.481, 0.0127, 0, 0.66, 0.7778, 951, 0, 1, 0, 0, 951, 0, 0], "semantic": {"name": "geometry_msgs.msg", "arg_names": [], "import_names": ["Pose"], "rhs_call_name": "", "annotation": ""}, "snippet": "from geometry_msgs.msg import Pose"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99597:FunctionDef_L41_C0", "label": "add_cylinder", "type": "function", "loc": [41, 65], "level": 0, "parent": null, "vector": [2, 0, 0.6709, 0.3165, 0, 0.66, 0.8889, 412, 0, 5, 0, 0, 0, 0, 7], "semantic": {"name": "add_cylinder", "arg_names": ["id", "bottom", "radius", "height", "frameid"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def add_cylinder(id, bottom, radius, height, frameid):\n cylinder_object = CollisionObject()\n cylinder_object.id = id\n cylinder_object.operation.operation = CollisionObjectOperation.ADD\n cylinder_object.header.frame_id = frameid\n cylinder_object.header.stamp = rospy.Time.now()\n\n shp = Shape()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99597:Assign_L42_C4", "label": "cylinder_object = CollisionObject()", "type": "assigned_variable", "loc": [42, 42], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99597:FunctionDef_L41_C0", "vector": [14, 1, 0.5316, 0.0127, 1, 0.58, 0.0, 368, 3, 0, 0, 0, 39, 10, 1], "semantic": {"name": "cylinder_object", "arg_names": [], "import_names": [], "rhs_call_name": "CollisionObject", "annotation": ""}, "snippet": " cylinder_object = CollisionObject()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99597:Assign_L43_C4", "label": "cylinder_object.id =", "type": "assigned_variable", "loc": [43, 43], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99597:FunctionDef_L41_C0", "vector": [14, 1, 0.5443, 0.0127, 1, 0.58, 0.05, 746, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "cylinder_object.id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cylinder_object.id = id"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99597:Assign_L44_C4", "label": "cylinder_object.operation.operation =", "type": "assigned_variable", "loc": [44, 44], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99597:FunctionDef_L41_C0", "vector": [14, 1, 0.557, 0.0127, 1, 0.58, 0.1, 370, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "cylinder_object.operation.operation", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cylinder_object.operation.operation = CollisionObjectOperation.ADD"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99597:Assign_L45_C4", "label": "cylinder_object.header.frame_id =", "type": "assigned_variable", "loc": [45, 45], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99597:FunctionDef_L41_C0", "vector": [14, 1, 0.5696, 0.0127, 1, 0.58, 0.15, 548, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "cylinder_object.header.frame_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cylinder_object.header.frame_id = frameid"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99597:Assign_L46_C4", "label": "cylinder_object.header.stamp = now()", "type": "assigned_variable", "loc": [46, 46], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99597:FunctionDef_L41_C0", "vector": [14, 1, 0.5823, 0.0127, 1, 0.58, 0.2, 696, 3, 0, 0, 0, 894, 10, 1], "semantic": {"name": "cylinder_object.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "now", "annotation": ""}, "snippet": " cylinder_object.header.stamp = rospy.Time.now()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99597:Assign_L48_C4", "label": "shp = Shape()", "type": "assigned_variable", "loc": [48, 48], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99597:FunctionDef_L41_C0", "vector": [14, 1, 0.6076, 0.0127, 1, 0.58, 0.25, 185, 3, 0, 0, 0, 739, 10, 1], "semantic": {"name": "shp", "arg_names": [], "import_names": [], "rhs_call_name": "Shape", "annotation": ""}, "snippet": " shp = Shape()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99597:Assign_L49_C4", "label": "shp.type =", "type": "assigned_variable", "loc": [49, 49], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99597:FunctionDef_L41_C0", "vector": [14, 1, 0.6203, 0.0127, 1, 0.58, 0.3, 505, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "shp.type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " shp.type = Shape.CYLINDER"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99597:Assign_L50_C4", "label": "shp.dimensions =", "type": "assigned_variable", "loc": [50, 50], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99597:FunctionDef_L41_C0", "vector": [14, 1, 0.6329, 0.0127, 1, 0.58, 0.35, 192, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "shp.dimensions", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " shp.dimensions = [0, 0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99597:Assign_L51_C4", "label": "assign", "type": "assigned_variable", "loc": [51, 51], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99597:FunctionDef_L41_C0", "vector": [14, 1, 0.6456, 0.0127, 1, 0.58, 0.4, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " shp.dimensions[0] = radius"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99597:Assign_L52_C4", "label": "assign", "type": "assigned_variable", "loc": [52, 52], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99597:FunctionDef_L41_C0", "vector": [14, 1, 0.6582, 0.0127, 1, 0.58, 0.45, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " shp.dimensions[1] = height"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99597:Assign_L54_C4", "label": "pose = Pose()", "type": "assigned_variable", "loc": [54, 54], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99597:FunctionDef_L41_C0", "vector": [14, 1, 0.6835, 0.0127, 1, 0.58, 0.5, 767, 3, 0, 0, 0, 902, 10, 1], "semantic": {"name": "pose", "arg_names": [], "import_names": [], "rhs_call_name": "Pose", "annotation": ""}, "snippet": " pose = Pose()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99597:Assign_L55_C4", "label": "pose.position.x =", "type": "assigned_variable", "loc": [55, 55], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99597:FunctionDef_L41_C0", "vector": [14, 1, 0.6962, 0.0127, 1, 0.58, 0.55, 6, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pose.position.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pose.position.x = bottom[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99597:Assign_L56_C4", "label": "pose.position.y =", "type": "assigned_variable", "loc": [56, 56], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99597:FunctionDef_L41_C0", "vector": [14, 1, 0.7089, 0.0127, 1, 0.58, 0.6, 554, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pose.position.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pose.position.y = bottom[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99597:Assign_L57_C4", "label": "pose.position.z =", "type": "assigned_variable", "loc": [57, 57], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99597:FunctionDef_L41_C0", "vector": [14, 1, 0.7215, 0.0127, 1, 0.58, 0.65, 850, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pose.position.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pose.position.z = bottom[2] + height/2."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99597:Assign_L58_C4", "label": "pose.orientation.x =", "type": "assigned_variable", "loc": [58, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99597:FunctionDef_L41_C0", "vector": [14, 1, 0.7342, 0.0127, 1, 0.58, 0.7, 169, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "pose.orientation.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pose.orientation.x = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99597:Assign_L59_C4", "label": "pose.orientation.y =", "type": "assigned_variable", "loc": [59, 59], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99597:FunctionDef_L41_C0", "vector": [14, 1, 0.7468, 0.0127, 1, 0.58, 0.75, 301, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "pose.orientation.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pose.orientation.y = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99597:Assign_L60_C4", "label": "pose.orientation.z =", "type": "assigned_variable", "loc": [60, 60], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99597:FunctionDef_L41_C0", "vector": [14, 1, 0.7595, 0.0127, 1, 0.58, 0.8, 569, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "pose.orientation.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pose.orientation.z = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99597:Assign_L61_C4", "label": "pose.orientation.w =", "type": "assigned_variable", "loc": [61, 61], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99597:FunctionDef_L41_C0", "vector": [14, 1, 0.7722, 0.0127, 1, 0.58, 0.85, 345, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "pose.orientation.w", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pose.orientation.w = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99597:Expr_L62_C4", "label": "append()", "type": "expression", "loc": [62, 62], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99597:FunctionDef_L41_C0", "vector": [8, 1, 0.7848, 0.0127, 1, 0.58, 0.9, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " cylinder_object.shapes.append(shp)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99597:Expr_L63_C4", "label": "append()", "type": "expression", "loc": [63, 63], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99597:FunctionDef_L41_C0", "vector": [8, 1, 0.7975, 0.0127, 1, 0.58, 0.95, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " cylinder_object.poses.append(pose)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99597:Expr_L65_C4", "label": "publish()", "type": "expression", "loc": [65, 65], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99597:FunctionDef_L41_C0", "vector": [8, 1, 0.8228, 0.0127, 1, 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": " pub.publish(cylinder_object)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99597:If_L68_C0", "label": "if", "type": "if", "loc": [68, 76], "level": 0, "parent": null, "vector": [4, 0, 0.9114, 0.1139, 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('add_cylinder_python')\n\n pub = rospy.Publisher('collision_object', CollisionObject)\n rospy.sleep(2.)\n\n add_cylinder('pole', (0.6, -0.6, 0.), 0.1, 0.75, 'base_link')\n rospy.loginfo('Should have published')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99597:Expr_L69_C4", "label": "init_node()", "type": "expression", "loc": [69, 69], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99597:If_L68_C0", "vector": [8, 1, 0.8734, 0.0127, 1, 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('add_cylinder_python')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99597:Assign_L71_C4", "label": "pub = Publisher()", "type": "assigned_variable", "loc": [71, 71], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99597:If_L68_C0", "vector": [14, 1, 0.8987, 0.0127, 1, 0.76, 0.2, 41, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " pub = rospy.Publisher('collision_object', CollisionObject)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99597:Expr_L72_C4", "label": "sleep()", "type": "expression", "loc": [72, 72], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99597:If_L68_C0", "vector": [8, 1, 0.9114, 0.0127, 1, 0.76, 0.4, 476, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " rospy.sleep(2.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99597:Expr_L74_C4", "label": "add_cylinder()", "type": "expression", "loc": [74, 74], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99597:If_L68_C0", "vector": [8, 1, 0.9367, 0.0127, 1, 0.76, 0.6, 412, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "add_cylinder", "arg_names": [], "import_names": [], "rhs_call_name": "add_cylinder", "annotation": ""}, "snippet": " add_cylinder('pole', (0.6, -0.6, 0.), 0.1, 0.75, 'base_link')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99597:Expr_L75_C4", "label": "loginfo()", "type": "expression", "loc": [75, 75], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99597:If_L68_C0", "vector": [8, 1, 0.9494, 0.0127, 1, 0.76, 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('Should have published')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99597:Expr_L76_C4", "label": "sleep()", "type": "expression", "loc": [76, 76], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99597:If_L68_C0", "vector": [8, 1, 0.962, 0.0127, 1, 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(2.)"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99597:FunctionDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99597:Assign_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99597:FunctionDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99597:Assign_L43_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99597:FunctionDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99597:Assign_L44_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99597:FunctionDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99597:Assign_L45_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99597:FunctionDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99597:Assign_L46_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99597:FunctionDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99597:Assign_L48_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99597:FunctionDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99597:Assign_L49_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99597:FunctionDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99597:Assign_L50_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99597:FunctionDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99597:Assign_L51_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99597:FunctionDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99597:Assign_L52_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99597:FunctionDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99597:Assign_L54_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99597:FunctionDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99597:Assign_L55_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99597:FunctionDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99597:Assign_L56_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99597:FunctionDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99597:Assign_L57_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99597:FunctionDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99597:Assign_L58_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99597:FunctionDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99597:Assign_L59_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99597:FunctionDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99597:Assign_L60_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99597:FunctionDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99597:Assign_L61_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99597:FunctionDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99597:Expr_L62_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99597:FunctionDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99597:Expr_L63_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99597:FunctionDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99597:Expr_L65_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99597:If_L68_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99597:Expr_L69_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99597:If_L68_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99597:Assign_L71_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99597:If_L68_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99597:Expr_L72_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99597:If_L68_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99597:Expr_L74_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99597:If_L68_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99597:Expr_L75_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99597:If_L68_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99597:Expr_L76_C4"}]
import PyKDL as kdl import numpy as np, math import roslib; roslib.load_manifest('pr2_arms_kdl') import rospy import hrl_lib.kdl_utils as ku class PR2_arm_kdl(): def __init__(self): self.right_chain = self.create_right_chain() fk, ik_v, ik_p = self.create_solvers(self.right_chain) self.right_fk = fk self.right_ik_v = ik_v self.right_ik_p = ik_p def create_right_chain(self): ch = kdl.Chain() self.right_arm_base_offset_from_torso_lift_link = np.matrix([0., -0.188, 0.]).T # shoulder pan ch.addSegment(kdl.Segment(kdl.Joint(kdl.Joint.RotZ),kdl.Frame(kdl.Vector(0.1,0.,0.)))) # shoulder lift ch.addSegment(kdl.Segment(kdl.Joint(kdl.Joint.RotY),kdl.Frame(kdl.Vector(0.,0.,0.)))) # upper arm roll ch.addSegment(kdl.Segment(kdl.Joint(kdl.Joint.RotX),kdl.Frame(kdl.Vector(0.4,0.,0.)))) # elbox flex ch.addSegment(kdl.Segment(kdl.Joint(kdl.Joint.RotY),kdl.Frame(kdl.Vector(0.0,0.,0.)))) # forearm roll ch.addSegment(kdl.Segment(kdl.Joint(kdl.Joint.RotX),kdl.Frame(kdl.Vector(0.321,0.,0.)))) # wrist flex ch.addSegment(kdl.Segment(kdl.Joint(kdl.Joint.RotY),kdl.Frame(kdl.Vector(0.,0.,0.)))) # wrist roll ch.addSegment(kdl.Segment(kdl.Joint(kdl.Joint.RotX),kdl.Frame(kdl.Vector(0.,0.,0.)))) return ch def create_solvers(self, ch): fk = kdl.ChainFkSolverPos_recursive(ch) ik_v = kdl.ChainIkSolverVel_pinv(ch) ik_p = kdl.ChainIkSolverPos_NR(ch, fk, ik_v) return fk, ik_v, ik_p def FK_kdl(self, arm, q, link_number): if arm == 'right_arm': fk = self.right_fk endeffec_frame = kdl.Frame() kinematics_status = fk.JntToCart(q, endeffec_frame, link_number) if kinematics_status >= 0: return endeffec_frame else: rospy.loginfo('Could not compute forward kinematics.') return None else: msg = '%s arm not supported.'%(arm) rospy.logerr(msg) raise RuntimeError(msg) ## returns point in torso lift link. def FK_all(self, arm, q, link_number = 7): q = self.pr2_to_kdl(q) frame = self.FK_kdl(arm, q, link_number) pos = frame.p pos = ku.kdl_vec_to_np(pos) pos = pos + self.right_arm_base_offset_from_torso_lift_link m = frame.M rot = ku.kdl_rot_to_np(m) return pos, rot def kdl_to_pr2(self, q): if q == None: return None q_pr2 = [0] * 7 q_pr2[0] = q[0] q_pr2[1] = q[1] q_pr2[2] = q[2] q_pr2[3] = q[3] q_pr2[4] = q[4] q_pr2[5] = q[5] q_pr2[6] = q[6] return q_pr2 def pr2_to_kdl(self, q): if q == None: return None n = len(q) q_kdl = kdl.JntArray(n) for i in range(n): q_kdl[i] = q[i] return q_kdl if __name__ == '__main__': roslib.load_manifest('hrl_pr2_lib') import hrl_pr2_lib.pr2_arms as pa import hrl_lib.viz as hv from visualization_msgs.msg import Marker rospy.init_node('kdl_pr2_test') marker_pub = rospy.Publisher('/kdl_pr2_arms/viz_marker', Marker) pr2_arms = pa.PR2Arms(gripper_point=(0.,0.,0.)) pr2_kdl = PR2_arm_kdl() r_arm, l_arm = 0, 1 while not rospy.is_shutdown(): q = pr2_arms.get_joint_angles(r_arm) p, r = pr2_kdl.FK_all('right_arm', q, 7) m = hv.create_frame_marker(p, r, 0.3, 'torso_lift_link') time_stamp = rospy.Time.now() m.header.stamp = time_stamp marker_pub.publish(m) rospy.sleep(0.1)
ajibawa-2023/Python-Code-Large/train/row_99598
87
118
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99598:Import_L1_C0", "label": "PyKDL import kdl", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0085, 0.0085, 0, 0.66, 0.0, 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_99598:Import_L3_C0", "label": "numpy import np, math", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0254, 0.0085, 0, 0.66, 0.1429, 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_99598:Import_L5_C0", "label": "roslib import roslib", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0424, 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('pr2_arms_kdl')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99598:Expr_L5_C15", "label": "load_manifest()", "type": "expression", "loc": [5, 5], "level": 0, "parent": null, "vector": [8, 0, 0.0424, 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('pr2_arms_kdl')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99598:Import_L6_C0", "label": "rospy import rospy", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0508, 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_99598:Import_L7_C0", "label": "hrl_lib.kdl_utils import ku", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.0593, 0.0085, 0, 0.66, 0.7143, 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_99598:ClassDef_L10_C0", "label": "PR2_arm_kdl", "type": "class", "loc": [10, 92], "level": 0, "parent": null, "vector": [3, 0, 0.4322, 0.7034, 0, 0.66, 0.8571, 254, 0, 7, 0, 0, 0, 0, 54], "semantic": {"name": "PR2_arm_kdl", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class PR2_arm_kdl():\n\n def __init__(self):\n self.right_chain = self.create_right_chain()\n fk, ik_v, ik_p = self.create_solvers(self.right_chain)\n self.right_fk = fk\n self.right_ik_v = ik_v\n self.right_ik_p = ik_p"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99598:FunctionDef_L12_C4", "label": "__init__", "type": "function", "loc": [12, 17], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99598:ClassDef_L10_C0", "vector": [2, 1, 0.1229, 0.0508, 1, 0.9, 0.0, 555, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self):\n self.right_chain = self.create_right_chain()\n fk, ik_v, ik_p = self.create_solvers(self.right_chain)\n self.right_fk = fk\n self.right_ik_v = ik_v\n self.right_ik_p = ik_p"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99598:Assign_L13_C8", "label": "self.right_chain = create_right_chain()", "type": "assigned_variable", "loc": [13, 13], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99598:FunctionDef_L12_C4", "vector": [14, 2, 0.1102, 0.0085, 2, 0.99, 0.0, 233, 3, 0, 0, 0, 956, 10, 1], "semantic": {"name": "self.right_chain", "arg_names": [], "import_names": [], "rhs_call_name": "create_right_chain", "annotation": ""}, "snippet": " self.right_chain = self.create_right_chain()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99598:Assign_L14_C8", "label": "fk, ik_v, ik_p = create_solvers()", "type": "assigned_variable", "loc": [14, 14], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99598:FunctionDef_L12_C4", "vector": [14, 2, 0.1186, 0.0085, 2, 0.99, 0.25, 683, 3, 1, 0, 0, 845, 10, 1], "semantic": {"name": "fk, ik_v, ik_p", "arg_names": [], "import_names": [], "rhs_call_name": "create_solvers", "annotation": ""}, "snippet": " fk, ik_v, ik_p = self.create_solvers(self.right_chain)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99598:Assign_L15_C8", "label": "self.right_fk =", "type": "assigned_variable", "loc": [15, 15], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99598:FunctionDef_L12_C4", "vector": [14, 2, 0.1271, 0.0085, 2, 0.99, 0.5, 700, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.right_fk", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.right_fk = fk"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99598:Assign_L16_C8", "label": "self.right_ik_v =", "type": "assigned_variable", "loc": [16, 16], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99598:FunctionDef_L12_C4", "vector": [14, 2, 0.1356, 0.0085, 2, 0.99, 0.75, 402, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.right_ik_v", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.right_ik_v = ik_v"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99598:Assign_L17_C8", "label": "self.right_ik_p =", "type": "assigned_variable", "loc": [17, 17], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99598:FunctionDef_L12_C4", "vector": [14, 2, 0.1441, 0.0085, 2, 0.99, 1.0, 101, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.right_ik_p", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.right_ik_p = ik_p"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99598:FunctionDef_L19_C4", "label": "create_right_chain", "type": "function", "loc": [19, 36], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99598:ClassDef_L10_C0", "vector": [2, 1, 0.2331, 0.1525, 1, 0.9, 0.1667, 956, 0, 1, 1, 0, 0, 0, 37], "semantic": {"name": "create_right_chain", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def create_right_chain(self):\n ch = kdl.Chain()\n self.right_arm_base_offset_from_torso_lift_link = np.matrix([0., -0.188, 0.]).T\n # shoulder pan\n ch.addSegment(kdl.Segment(kdl.Joint(kdl.Joint.RotZ),kdl.Frame(kdl.Vector(0.1,0.,0.))))\n # shoulder lift\n ch.addSegment(kdl.Segment(kdl.Joint(kdl.Joint.RotY),kdl.Frame(kdl.Vector(0.,0.,0.))))\n # upper arm roll"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99598:Assign_L20_C8", "label": "ch = Chain()", "type": "assigned_variable", "loc": [20, 20], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99598:FunctionDef_L19_C4", "vector": [14, 2, 0.1695, 0.0085, 2, 0.05, 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_99598:Assign_L21_C8", "label": "self.right_arm_base_offset_from_torso_lift_link =", "type": "assigned_variable", "loc": [21, 21], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99598:FunctionDef_L19_C4", "vector": [14, 2, 0.178, 0.0085, 2, 0.05, 0.1111, 255, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.right_arm_base_offset_from_torso_lift_link", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.right_arm_base_offset_from_torso_lift_link = np.matrix([0., -0.188, 0.]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99598:Expr_L23_C8", "label": "addSegment()", "type": "expression", "loc": [23, 23], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99598:FunctionDef_L19_C4", "vector": [8, 2, 0.1949, 0.0085, 2, 0.05, 0.2222, 73, 3, 1, 0, 0, 0, 0, 5], "semantic": {"name": "addSegment", "arg_names": [], "import_names": [], "rhs_call_name": "addSegment", "annotation": ""}, "snippet": " ch.addSegment(kdl.Segment(kdl.Joint(kdl.Joint.RotZ),kdl.Frame(kdl.Vector(0.1,0.,0.))))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99598:Expr_L25_C8", "label": "addSegment()", "type": "expression", "loc": [25, 25], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99598:FunctionDef_L19_C4", "vector": [8, 2, 0.2119, 0.0085, 2, 0.05, 0.3333, 73, 3, 1, 0, 0, 0, 0, 5], "semantic": {"name": "addSegment", "arg_names": [], "import_names": [], "rhs_call_name": "addSegment", "annotation": ""}, "snippet": " ch.addSegment(kdl.Segment(kdl.Joint(kdl.Joint.RotY),kdl.Frame(kdl.Vector(0.,0.,0.))))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99598:Expr_L27_C8", "label": "addSegment()", "type": "expression", "loc": [27, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99598:FunctionDef_L19_C4", "vector": [8, 2, 0.2288, 0.0085, 2, 0.05, 0.4444, 73, 3, 1, 0, 0, 0, 0, 5], "semantic": {"name": "addSegment", "arg_names": [], "import_names": [], "rhs_call_name": "addSegment", "annotation": ""}, "snippet": " ch.addSegment(kdl.Segment(kdl.Joint(kdl.Joint.RotX),kdl.Frame(kdl.Vector(0.4,0.,0.))))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99598:Expr_L29_C8", "label": "addSegment()", "type": "expression", "loc": [29, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99598:FunctionDef_L19_C4", "vector": [8, 2, 0.2458, 0.0085, 2, 0.05, 0.5556, 73, 3, 1, 0, 0, 0, 0, 5], "semantic": {"name": "addSegment", "arg_names": [], "import_names": [], "rhs_call_name": "addSegment", "annotation": ""}, "snippet": " ch.addSegment(kdl.Segment(kdl.Joint(kdl.Joint.RotY),kdl.Frame(kdl.Vector(0.0,0.,0.))))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99598:Expr_L31_C8", "label": "addSegment()", "type": "expression", "loc": [31, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99598:FunctionDef_L19_C4", "vector": [8, 2, 0.2627, 0.0085, 2, 0.05, 0.6667, 73, 3, 1, 0, 0, 0, 0, 5], "semantic": {"name": "addSegment", "arg_names": [], "import_names": [], "rhs_call_name": "addSegment", "annotation": ""}, "snippet": " ch.addSegment(kdl.Segment(kdl.Joint(kdl.Joint.RotX),kdl.Frame(kdl.Vector(0.321,0.,0.))))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99598:Expr_L33_C8", "label": "addSegment()", "type": "expression", "loc": [33, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99598:FunctionDef_L19_C4", "vector": [8, 2, 0.2797, 0.0085, 2, 0.05, 0.7778, 73, 3, 1, 0, 0, 0, 0, 5], "semantic": {"name": "addSegment", "arg_names": [], "import_names": [], "rhs_call_name": "addSegment", "annotation": ""}, "snippet": " ch.addSegment(kdl.Segment(kdl.Joint(kdl.Joint.RotY),kdl.Frame(kdl.Vector(0.,0.,0.))))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99598:Expr_L35_C8", "label": "addSegment()", "type": "expression", "loc": [35, 35], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99598:FunctionDef_L19_C4", "vector": [8, 2, 0.2966, 0.0085, 2, 0.05, 0.8889, 73, 3, 1, 0, 0, 0, 0, 5], "semantic": {"name": "addSegment", "arg_names": [], "import_names": [], "rhs_call_name": "addSegment", "annotation": ""}, "snippet": " ch.addSegment(kdl.Segment(kdl.Joint(kdl.Joint.RotX),kdl.Frame(kdl.Vector(0.,0.,0.))))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99598:Return_L36_C8", "label": "return", "type": "return", "loc": [36, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99598:FunctionDef_L19_C4", "vector": [13, 2, 0.3051, 0.0085, 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 ch"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99598:FunctionDef_L38_C4", "label": "create_solvers", "type": "function", "loc": [38, 42], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99598:ClassDef_L10_C0", "vector": [2, 1, 0.339, 0.0424, 1, 0.9, 0.3333, 845, 0, 2, 1, 0, 0, 0, 3], "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 return fk, ik_v, ik_p"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99598:Assign_L39_C9", "label": "fk = ChainFkSolverPos_recursive()", "type": "assigned_variable", "loc": [39, 39], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99598:FunctionDef_L38_C4", "vector": [14, 2, 0.3305, 0.0085, 2, 0.12, 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_99598:Assign_L40_C9", "label": "ik_v = ChainIkSolverVel_pinv()", "type": "assigned_variable", "loc": [40, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99598:FunctionDef_L38_C4", "vector": [14, 2, 0.339, 0.0085, 2, 0.12, 0.3333, 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_99598:Assign_L41_C9", "label": "ik_p = ChainIkSolverPos_NR()", "type": "assigned_variable", "loc": [41, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99598:FunctionDef_L38_C4", "vector": [14, 2, 0.3475, 0.0085, 2, 0.12, 0.6667, 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_99598:Return_L42_C9", "label": "return", "type": "return", "loc": [42, 42], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99598:FunctionDef_L38_C4", "vector": [13, 2, 0.3559, 0.0085, 2, 0.12, 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"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99598:FunctionDef_L44_C4", "label": "FK_kdl", "type": "function", "loc": [44, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99598:ClassDef_L10_C0", "vector": [2, 1, 0.4322, 0.1271, 1, 0.9, 0.5, 929, 0, 4, 1, 0, 0, 0, 5], "semantic": {"name": "FK_kdl", "arg_names": ["self", "arm", "q", "link_number"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def FK_kdl(self, arm, q, link_number):\n if arm == 'right_arm':\n fk = self.right_fk\n endeffec_frame = kdl.Frame()\n kinematics_status = fk.JntToCart(q, endeffec_frame,\n link_number)\n if kinematics_status >= 0:\n return endeffec_frame"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99598:If_L45_C8", "label": "if", "type": "if", "loc": [45, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99598:FunctionDef_L44_C4", "vector": [4, 2, 0.4364, 0.1186, 2, 0.24, 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 fk = self.right_fk\n endeffec_frame = kdl.Frame()\n kinematics_status = fk.JntToCart(q, endeffec_frame,\n link_number)\n if kinematics_status >= 0:\n return endeffec_frame\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99598:Assign_L46_C12", "label": "fk =", "type": "assigned_variable", "loc": [46, 46], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99598:If_L45_C8", "vector": [14, 3, 0.3898, 0.0085, 3, 0.78, 0.0, 714, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "fk", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " fk = self.right_fk"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99598:Assign_L47_C12", "label": "endeffec_frame = Frame()", "type": "assigned_variable", "loc": [47, 47], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99598:If_L45_C8", "vector": [14, 3, 0.3983, 0.0085, 3, 0.78, 0.2, 271, 3, 0, 0, 0, 342, 10, 1], "semantic": {"name": "endeffec_frame", "arg_names": [], "import_names": [], "rhs_call_name": "Frame", "annotation": ""}, "snippet": " endeffec_frame = kdl.Frame()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99598:Assign_L48_C12", "label": "kinematics_status = JntToCart()", "type": "assigned_variable", "loc": [48, 49], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99598:If_L45_C8", "vector": [14, 3, 0.411, 0.0169, 3, 0.78, 0.4, 714, 3, 3, 0, 0, 79, 10, 1], "semantic": {"name": "kinematics_status", "arg_names": [], "import_names": [], "rhs_call_name": "JntToCart", "annotation": ""}, "snippet": " kinematics_status = fk.JntToCart(q, endeffec_frame,\n link_number)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99598:If_L50_C12", "label": "if", "type": "if", "loc": [50, 54], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99598:If_L45_C8", "vector": [4, 3, 0.4407, 0.0424, 3, 0.78, 0.6, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if kinematics_status >= 0:\n return endeffec_frame\n else:\n rospy.loginfo('Could not compute forward kinematics.')\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99598:Return_L51_C16", "label": "return", "type": "return", "loc": [51, 51], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99598:If_L50_C12", "vector": [13, 4, 0.4322, 0.0085, 4, 0.09, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return endeffec_frame"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99598:Expr_L53_C16", "label": "loginfo()", "type": "expression", "loc": [53, 53], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99598:If_L50_C12", "vector": [8, 4, 0.4492, 0.0085, 4, 0.09, 0.5, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo('Could not compute forward kinematics.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99598:Return_L54_C16", "label": "return", "type": "return", "loc": [54, 54], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99598:If_L50_C12", "vector": [13, 4, 0.4576, 0.0085, 4, 0.09, 1.0, 0, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99598:Assign_L56_C12", "label": "msg =", "type": "assigned_variable", "loc": [56, 56], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99598:If_L45_C8", "vector": [14, 3, 0.4746, 0.0085, 3, 0.78, 0.8, 712, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "msg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " msg = '%s arm not supported.'%(arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99598:Expr_L57_C12", "label": "logerr()", "type": "expression", "loc": [57, 57], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99598:If_L45_C8", "vector": [8, 3, 0.4831, 0.0085, 3, 0.78, 1.0, 747, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logerr", "arg_names": [], "import_names": [], "rhs_call_name": "logerr", "annotation": ""}, "snippet": " rospy.logerr(msg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99598:FunctionDef_L61_C4", "label": "FK_all", "type": "function", "loc": [61, 69], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99598:ClassDef_L10_C0", "vector": [2, 1, 0.5508, 0.0763, 1, 0.9, 0.6667, 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.pr2_to_kdl(q)\n frame = self.FK_kdl(arm, q, link_number)\n pos = frame.p\n pos = ku.kdl_vec_to_np(pos)\n pos = pos + self.right_arm_base_offset_from_torso_lift_link\n m = frame.M\n rot = ku.kdl_rot_to_np(m)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99598:Assign_L62_C8", "label": "q = pr2_to_kdl()", "type": "assigned_variable", "loc": [62, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99598:FunctionDef_L61_C4", "vector": [14, 2, 0.5254, 0.0085, 2, 0.81, 0.0, 516, 3, 1, 0, 0, 85, 10, 1], "semantic": {"name": "q", "arg_names": [], "import_names": [], "rhs_call_name": "pr2_to_kdl", "annotation": ""}, "snippet": " q = self.pr2_to_kdl(q)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99598:Assign_L63_C8", "label": "frame = FK_kdl()", "type": "assigned_variable", "loc": [63, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99598:FunctionDef_L61_C4", "vector": [14, 2, 0.5339, 0.0085, 2, 0.81, 0.1429, 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_99598:Assign_L64_C8", "label": "pos =", "type": "assigned_variable", "loc": [64, 64], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99598:FunctionDef_L61_C4", "vector": [14, 2, 0.5424, 0.0085, 2, 0.81, 0.2857, 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_99598:Assign_L65_C8", "label": "pos = kdl_vec_to_np()", "type": "assigned_variable", "loc": [65, 65], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99598:FunctionDef_L61_C4", "vector": [14, 2, 0.5508, 0.0085, 2, 0.81, 0.4286, 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_99598:Assign_L66_C8", "label": "pos =", "type": "assigned_variable", "loc": [66, 66], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99598:FunctionDef_L61_C4", "vector": [14, 2, 0.5593, 0.0085, 2, 0.81, 0.5714, 627, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pos", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pos = pos + self.right_arm_base_offset_from_torso_lift_link"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99598:Assign_L67_C8", "label": "m =", "type": "assigned_variable", "loc": [67, 67], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99598:FunctionDef_L61_C4", "vector": [14, 2, 0.5678, 0.0085, 2, 0.81, 0.7143, 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_99598:Assign_L68_C8", "label": "rot = kdl_rot_to_np()", "type": "assigned_variable", "loc": [68, 68], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99598:FunctionDef_L61_C4", "vector": [14, 2, 0.5763, 0.0085, 2, 0.81, 0.8571, 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_99598:Return_L69_C8", "label": "return", "type": "return", "loc": [69, 69], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99598:FunctionDef_L61_C4", "vector": [13, 2, 0.5847, 0.0085, 2, 0.81, 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_99598:FunctionDef_L71_C4", "label": "kdl_to_pr2", "type": "function", "loc": [71, 83], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99598:ClassDef_L10_C0", "vector": [2, 1, 0.6525, 0.1102, 1, 0.9, 0.8333, 288, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "kdl_to_pr2", "arg_names": ["self", "q"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def kdl_to_pr2(self, q):\n if q == None:\n return None\n\n q_pr2 = [0] * 7\n q_pr2[0] = q[0]\n q_pr2[1] = q[1]\n q_pr2[2] = q[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99598:If_L72_C8", "label": "if", "type": "if", "loc": [72, 73], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99598:FunctionDef_L71_C4", "vector": [4, 2, 0.6144, 0.0169, 2, 0.56, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if q == None:\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99598:Return_L73_C12", "label": "return", "type": "return", "loc": [73, 73], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99598:If_L72_C8", "vector": [13, 3, 0.6186, 0.0085, 3, 0.59, 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_99598:Assign_L75_C8", "label": "q_pr2 =", "type": "assigned_variable", "loc": [75, 75], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99598:FunctionDef_L71_C4", "vector": [14, 2, 0.6356, 0.0085, 2, 0.56, 0.1111, 714, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "q_pr2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " q_pr2 = [0] * 7"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99598:Assign_L76_C8", "label": "assign", "type": "assigned_variable", "loc": [76, 76], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99598:FunctionDef_L71_C4", "vector": [14, 2, 0.6441, 0.0085, 2, 0.56, 0.2222, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " q_pr2[0] = q[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99598:Assign_L77_C8", "label": "assign", "type": "assigned_variable", "loc": [77, 77], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99598:FunctionDef_L71_C4", "vector": [14, 2, 0.6525, 0.0085, 2, 0.56, 0.3333, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " q_pr2[1] = q[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99598:Assign_L78_C8", "label": "assign", "type": "assigned_variable", "loc": [78, 78], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99598:FunctionDef_L71_C4", "vector": [14, 2, 0.661, 0.0085, 2, 0.56, 0.4444, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " q_pr2[2] = q[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99598:Assign_L79_C8", "label": "assign", "type": "assigned_variable", "loc": [79, 79], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99598:FunctionDef_L71_C4", "vector": [14, 2, 0.6695, 0.0085, 2, 0.56, 0.5556, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " q_pr2[3] = q[3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99598:Assign_L80_C8", "label": "assign", "type": "assigned_variable", "loc": [80, 80], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99598:FunctionDef_L71_C4", "vector": [14, 2, 0.678, 0.0085, 2, 0.56, 0.6667, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " q_pr2[4] = q[4]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99598:Assign_L81_C8", "label": "assign", "type": "assigned_variable", "loc": [81, 81], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99598:FunctionDef_L71_C4", "vector": [14, 2, 0.6864, 0.0085, 2, 0.56, 0.7778, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " q_pr2[5] = q[5]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99598:Assign_L82_C8", "label": "assign", "type": "assigned_variable", "loc": [82, 82], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99598:FunctionDef_L71_C4", "vector": [14, 2, 0.6949, 0.0085, 2, 0.56, 0.8889, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " q_pr2[6] = q[6]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99598:Return_L83_C8", "label": "return", "type": "return", "loc": [83, 83], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99598:FunctionDef_L71_C4", "vector": [13, 2, 0.7034, 0.0085, 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 q_pr2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99598:FunctionDef_L85_C4", "label": "pr2_to_kdl", "type": "function", "loc": [85, 92], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99598:ClassDef_L10_C0", "vector": [2, 1, 0.75, 0.0678, 1, 0.9, 1.0, 85, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "pr2_to_kdl", "arg_names": ["self", "q"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def pr2_to_kdl(self, q):\n if q == None:\n return None\n n = len(q)\n q_kdl = kdl.JntArray(n)\n for i in range(n):\n q_kdl[i] = q[i]\n return q_kdl"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99598:If_L86_C8", "label": "if", "type": "if", "loc": [86, 87], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99598:FunctionDef_L85_C4", "vector": [4, 2, 0.7331, 0.0169, 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 q == None:\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99598:Return_L87_C12", "label": "return", "type": "return", "loc": [87, 87], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99598:If_L86_C8", "vector": [13, 3, 0.7373, 0.0085, 3, 0.97, 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_99598:Assign_L88_C8", "label": "n = len()", "type": "assigned_variable", "loc": [88, 88], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99598:FunctionDef_L85_C4", "vector": [14, 2, 0.7458, 0.0085, 2, 0.14, 0.25, 773, 3, 1, 0, 0, 890, 10, 1], "semantic": {"name": "n", "arg_names": [], "import_names": [], "rhs_call_name": "len", "annotation": ""}, "snippet": " n = len(q)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99598:Assign_L89_C8", "label": "q_kdl = JntArray()", "type": "assigned_variable", "loc": [89, 89], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99598:FunctionDef_L85_C4", "vector": [14, 2, 0.7542, 0.0085, 2, 0.14, 0.5, 784, 3, 1, 0, 0, 115, 10, 1], "semantic": {"name": "q_kdl", "arg_names": [], "import_names": [], "rhs_call_name": "JntArray", "annotation": ""}, "snippet": " q_kdl = kdl.JntArray(n)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99598:For_L90_C8", "label": "for i", "type": "for", "loc": [90, 91], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99598:FunctionDef_L85_C4", "vector": [6, 2, 0.7669, 0.0169, 2, 0.14, 0.75, 826, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(n):\n q_kdl[i] = q[i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99598:Assign_L91_C12", "label": "assign", "type": "assigned_variable", "loc": [91, 91], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99598:For_L90_C8", "vector": [14, 3, 0.7712, 0.0085, 3, 0.62, 0.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " q_kdl[i] = q[i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99598:Return_L92_C8", "label": "return", "type": "return", "loc": [92, 92], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99598:FunctionDef_L85_C4", "vector": [13, 2, 0.7797, 0.0085, 2, 0.14, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return q_kdl"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99598:If_L95_C0", "label": "if", "type": "if", "loc": [95, 115], "level": 0, "parent": null, "vector": [4, 0, 0.8898, 0.178, 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 roslib.load_manifest('hrl_pr2_lib')\n import hrl_pr2_lib.pr2_arms as pa\n import hrl_lib.viz as hv\n from visualization_msgs.msg import Marker\n \n rospy.init_node('kdl_pr2_test')\n marker_pub = rospy.Publisher('/kdl_pr2_arms/viz_marker', Marker)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99598:Expr_L96_C4", "label": "load_manifest()", "type": "expression", "loc": [96, 96], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99598:If_L95_C0", "vector": [8, 1, 0.8136, 0.0085, 1, 0.65, 0.0, 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_99598:Import_L97_C4", "label": "hrl_pr2_lib.pr2_arms import pa", "type": "import", "loc": [97, 97], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99598:If_L95_C0", "vector": [1, 1, 0.822, 0.0085, 1, 0.65, 0.1111, 359, 0, 1, 0, 0, 359, 0, 0], "semantic": {"name": "hrl_pr2_lib.pr2_arms", "arg_names": [], "import_names": ["pa"], "rhs_call_name": "", "annotation": ""}, "snippet": " import hrl_pr2_lib.pr2_arms as pa"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99598:Import_L98_C4", "label": "hrl_lib.viz import hv", "type": "import", "loc": [98, 98], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99598:If_L95_C0", "vector": [1, 1, 0.8305, 0.0085, 1, 0.65, 0.2222, 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_99598:ImportFrom_L99_C4", "label": "from visualization_msgs.msg import Marker", "type": "import", "loc": [99, 99], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99598:If_L95_C0", "vector": [1, 1, 0.839, 0.0085, 1, 0.65, 0.3333, 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_99598:Expr_L101_C4", "label": "init_node()", "type": "expression", "loc": [101, 101], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99598:If_L95_C0", "vector": [8, 1, 0.8559, 0.0085, 1, 0.65, 0.4444, 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('kdl_pr2_test')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99598:Assign_L102_C4", "label": "marker_pub = Publisher()", "type": "assigned_variable", "loc": [102, 102], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99598:If_L95_C0", "vector": [14, 1, 0.8644, 0.0085, 1, 0.65, 0.5556, 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('/kdl_pr2_arms/viz_marker', Marker)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99598:Assign_L103_C4", "label": "pr2_arms = PR2Arms()", "type": "assigned_variable", "loc": [103, 103], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99598:If_L95_C0", "vector": [14, 1, 0.8729, 0.0085, 1, 0.65, 0.6667, 369, 3, 1, 0, 0, 694, 10, 1], "semantic": {"name": "pr2_arms", "arg_names": [], "import_names": [], "rhs_call_name": "PR2Arms", "annotation": ""}, "snippet": " pr2_arms = pa.PR2Arms(gripper_point=(0.,0.,0.))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99598:Assign_L104_C4", "label": "pr2_kdl = PR2_arm_kdl()", "type": "assigned_variable", "loc": [104, 104], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99598:If_L95_C0", "vector": [14, 1, 0.8814, 0.0085, 1, 0.65, 0.7778, 561, 3, 0, 0, 0, 254, 10, 1], "semantic": {"name": "pr2_kdl", "arg_names": [], "import_names": [], "rhs_call_name": "PR2_arm_kdl", "annotation": ""}, "snippet": " pr2_kdl = PR2_arm_kdl()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99598:Assign_L106_C4", "label": "r_arm, l_arm =", "type": "assigned_variable", "loc": [106, 106], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99598:If_L95_C0", "vector": [14, 1, 0.8983, 0.0085, 1, 0.65, 0.8889, 451, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "r_arm, l_arm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " r_arm, l_arm = 0, 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99598:While_L108_C4", "label": "while", "type": "while", "loc": [108, 115], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99598:If_L95_C0", "vector": [5, 1, 0.9449, 0.0678, 1, 0.65, 1.0, 0, 0, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while not rospy.is_shutdown():\n q = pr2_arms.get_joint_angles(r_arm)\n p, r = pr2_kdl.FK_all('right_arm', q, 7)\n m = hv.create_frame_marker(p, r, 0.3, 'torso_lift_link')\n time_stamp = rospy.Time.now()\n m.header.stamp = time_stamp\n marker_pub.publish(m)\n rospy.sleep(0.1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99598:Assign_L109_C8", "label": "q = get_joint_angles()", "type": "assigned_variable", "loc": [109, 109], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99598:While_L108_C4", "vector": [14, 2, 0.9237, 0.0085, 2, 0.69, 0.0, 516, 3, 1, 0, 0, 820, 10, 1], "semantic": {"name": "q", "arg_names": [], "import_names": [], "rhs_call_name": "get_joint_angles", "annotation": ""}, "snippet": " q = pr2_arms.get_joint_angles(r_arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99598:Assign_L110_C8", "label": "p, r = FK_all()", "type": "assigned_variable", "loc": [110, 110], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99598:While_L108_C4", "vector": [14, 2, 0.9322, 0.0085, 2, 0.69, 0.1667, 364, 3, 3, 0, 0, 415, 10, 1], "semantic": {"name": "p, r", "arg_names": [], "import_names": [], "rhs_call_name": "FK_all", "annotation": ""}, "snippet": " p, r = pr2_kdl.FK_all('right_arm', q, 7)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99598:Assign_L111_C8", "label": "m = create_frame_marker()", "type": "assigned_variable", "loc": [111, 111], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99598:While_L108_C4", "vector": [14, 2, 0.9407, 0.0085, 2, 0.69, 0.3333, 711, 3, 4, 0, 0, 345, 10, 1], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "create_frame_marker", "annotation": ""}, "snippet": " m = hv.create_frame_marker(p, r, 0.3, 'torso_lift_link')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99598:Assign_L112_C8", "label": "time_stamp = now()", "type": "assigned_variable", "loc": [112, 112], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99598:While_L108_C4", "vector": [14, 2, 0.9492, 0.0085, 2, 0.69, 0.5, 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_99598:Assign_L113_C8", "label": "m.header.stamp =", "type": "assigned_variable", "loc": [113, 113], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99598:While_L108_C4", "vector": [14, 2, 0.9576, 0.0085, 2, 0.69, 0.6667, 726, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "m.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " m.header.stamp = time_stamp"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99598:Expr_L114_C8", "label": "publish()", "type": "expression", "loc": [114, 114], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99598:While_L108_C4", "vector": [8, 2, 0.9661, 0.0085, 2, 0.69, 0.8333, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " marker_pub.publish(m)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99598:Expr_L115_C8", "label": "sleep()", "type": "expression", "loc": [115, 115], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99598:While_L108_C4", "vector": [8, 2, 0.9746, 0.0085, 2, 0.69, 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)"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99598:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99598:FunctionDef_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99598:FunctionDef_L12_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99598:Assign_L13_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99598:FunctionDef_L12_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99598:Assign_L14_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99598:FunctionDef_L12_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99598:Assign_L15_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99598:FunctionDef_L12_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99598:Assign_L16_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99598:FunctionDef_L12_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99598:Assign_L17_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99598:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99598:FunctionDef_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99598:FunctionDef_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99598:Assign_L20_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99598:FunctionDef_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99598:Assign_L21_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99598:FunctionDef_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99598:Expr_L23_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99598:FunctionDef_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99598:Expr_L25_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99598:FunctionDef_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99598:Expr_L27_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99598:FunctionDef_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99598:Expr_L29_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99598:FunctionDef_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99598:Expr_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99598:FunctionDef_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99598:Expr_L33_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99598:FunctionDef_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99598:Expr_L35_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99598:FunctionDef_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99598:Return_L36_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99598:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99598:FunctionDef_L38_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99598:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99598:Assign_L39_C9"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99598:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99598:Assign_L40_C9"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99598:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99598:Assign_L41_C9"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99598:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99598:Return_L42_C9"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99598:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99598:FunctionDef_L44_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99598:FunctionDef_L44_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99598:If_L45_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99598:If_L45_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99598:Assign_L46_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99598:If_L45_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99598:Assign_L47_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99598:If_L45_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99598:Assign_L48_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99598:If_L45_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99598:If_L50_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99598:If_L50_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99598:Return_L51_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99598:If_L50_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99598:Expr_L53_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99598:If_L50_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99598:Return_L54_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99598:If_L45_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99598:Assign_L56_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99598:If_L45_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99598:Expr_L57_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99598:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99598:FunctionDef_L61_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99598:FunctionDef_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99598:Assign_L62_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99598:FunctionDef_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99598:Assign_L63_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99598:FunctionDef_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99598:Assign_L64_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99598:FunctionDef_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99598:Assign_L65_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99598:FunctionDef_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99598:Assign_L66_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99598:FunctionDef_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99598:Assign_L67_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99598:FunctionDef_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99598:Assign_L68_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99598:FunctionDef_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99598:Return_L69_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99598:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99598:FunctionDef_L71_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99598:FunctionDef_L71_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99598:If_L72_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99598:If_L72_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99598:Return_L73_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99598:FunctionDef_L71_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99598:Assign_L75_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99598:FunctionDef_L71_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99598:Assign_L76_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99598:FunctionDef_L71_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99598:Assign_L77_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99598:FunctionDef_L71_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99598:Assign_L78_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99598:FunctionDef_L71_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99598:Assign_L79_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99598:FunctionDef_L71_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99598:Assign_L80_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99598:FunctionDef_L71_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99598:Assign_L81_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99598:FunctionDef_L71_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99598:Assign_L82_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99598:FunctionDef_L71_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99598:Return_L83_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99598:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99598:FunctionDef_L85_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99598:FunctionDef_L85_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99598:If_L86_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99598:If_L86_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99598:Return_L87_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99598:FunctionDef_L85_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99598:Assign_L88_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99598:FunctionDef_L85_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99598:Assign_L89_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99598:FunctionDef_L85_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99598:For_L90_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99598:For_L90_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99598:Assign_L91_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99598:FunctionDef_L85_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99598:Return_L92_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99598:If_L95_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99598:Expr_L96_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99598:If_L95_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99598:Import_L97_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99598:If_L95_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99598:Import_L98_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99598:If_L95_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99598:ImportFrom_L99_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99598:If_L95_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99598:Expr_L101_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99598:If_L95_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99598:Assign_L102_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99598:If_L95_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99598:Assign_L103_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99598:If_L95_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99598:Assign_L104_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99598:If_L95_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99598:Assign_L106_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99598:If_L95_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99598:While_L108_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99598:While_L108_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99598:Assign_L109_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99598:While_L108_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99598:Assign_L110_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99598:While_L108_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99598:Assign_L111_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99598:While_L108_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99598:Assign_L112_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99598:While_L108_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99598:Assign_L113_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99598:While_L108_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99598:Expr_L114_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99598:While_L108_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99598:Expr_L115_C8"}]
import numpy as np, math import roslib; roslib.load_manifest('point_cloud_ros') import rospy import hrl_tilting_hokuyo.display_3d_mayavi as d3m from point_cloud_ros.msg import OccupancyGrid import point_cloud_ros.occupancy_grid as pog ## convert OccupancyGrid message to the occupancy_grid_3d object. # @param to_binary - want the occupancy grid to be binarified. # @return occupancy_grid_3d object def og_msg_to_og3d(og, to_binary=True): c = np.matrix([og.center.x, og.center.y, og.center.z]).T s = np.matrix([og.grid_size.x, og.grid_size.y, og.grid_size.z]).T r = np.matrix([og.resolution.x, og.resolution.y, og.resolution.z]).T og3d = pog.occupancy_grid_3d(c, s, r, np.array(og.data), og.occupancy_threshold, to_binary = to_binary) return og3d ## convert occupancy_grid_3d object to OccupancyGrid message. # sets the frame to base_link and stamp to the current time. # @return OccupancyGrid object def og3d_to_og_msg(og3d): og = OccupancyGrid() og.center.x = og3d.center[0,0] og.center.y = og3d.center[1,0] og.center.z = og3d.center[2,0] og.grid_size.x = og3d.size[0,0] og.grid_size.y = og3d.size[1,0] og.grid_size.z = og3d.size[2,0] og.resolution.x = og3d.resolution[0,0] og.resolution.y = og3d.resolution[1,0] og.resolution.z = og3d.resolution[2,0] og.occupancy_threshold = 1 og.data = og3d.grid.flatten().tolist() og.header.frame_id = 'base_link' og.header.stamp = rospy.rostime.get_rostime() return og ## create an OccupancyGrid msg object for the purpose of setting the # grid parameters for pc_to_og node. # @param center - 3x1 np matrix. # @param size - 3x1 np matrix. # @param resolution - 3x1 np matrix. # @param occupancy_threshold - integer # @param frame_id - string. def og_param_msg(center, size, resolution, occupancy_threshold, frame_id): og = OccupancyGrid() og.center.x = center[0,0] og.center.y = center[1,0] og.center.z = center[2,0] og.grid_size.x = size[0,0] og.grid_size.y = size[1,0] og.grid_size.z = size[2,0] og.resolution.x = resolution[0,0] og.resolution.y = resolution[1,0] og.resolution.z = resolution[2,0] og.occupancy_threshold = occupancy_threshold og.header.frame_id = frame_id og.header.stamp = rospy.rostime.get_rostime() return og if __name__ == '__main__': rospy.init_node('og_sample_python') param_list = [None, False] rospy.Subscriber('occupancy_grid', OccupancyGrid, cb, param_list) rospy.logout('Ready') while not rospy.is_shutdown(): if param_list[1] == True: og3d = param_list[0] print 'grid_shape:', og3d.grid.shape pts = og3d.grid_to_points() print pts.shape break rospy.sleep(0.1) d3m.plot_points(pts) d3m.show()
ajibawa-2023/Python-Code-Large/train/row_99599
58
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_99599:Import_L2_C0", "label": "numpy import np, math", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0217, 0.0109, 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_99599:Import_L4_C0", "label": "roslib import roslib", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0435, 0.0109, 0, 0.66, 0.1, 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('point_cloud_ros')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99599:Expr_L4_C15", "label": "load_manifest()", "type": "expression", "loc": [4, 4], "level": 0, "parent": null, "vector": [8, 0, 0.0435, 0.0109, 0, 0.66, 0.2, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('point_cloud_ros')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99599:Import_L5_C0", "label": "rospy import rospy", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0543, 0.0109, 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_99599:Import_L7_C0", "label": "hrl_tilting_hokuyo.display_3d_mayavi import d3m", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.0761, 0.0109, 0, 0.66, 0.4, 181, 0, 1, 0, 0, 181, 0, 0], "semantic": {"name": "hrl_tilting_hokuyo.display_3d_mayavi", "arg_names": [], "import_names": ["d3m"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_tilting_hokuyo.display_3d_mayavi as d3m"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99599:ImportFrom_L8_C0", "label": "from point_cloud_ros.msg import OccupancyGrid", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.087, 0.0109, 0, 0.66, 0.5, 275, 0, 1, 0, 0, 275, 0, 0], "semantic": {"name": "point_cloud_ros.msg", "arg_names": [], "import_names": ["OccupancyGrid"], "rhs_call_name": "", "annotation": ""}, "snippet": "from point_cloud_ros.msg import OccupancyGrid"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99599:Import_L9_C0", "label": "point_cloud_ros.occupancy_grid import pog", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.0978, 0.0109, 0, 0.66, 0.6, 528, 0, 1, 0, 0, 528, 0, 0], "semantic": {"name": "point_cloud_ros.occupancy_grid", "arg_names": [], "import_names": ["pog"], "rhs_call_name": "", "annotation": ""}, "snippet": "import point_cloud_ros.occupancy_grid as pog"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99599:FunctionDef_L14_C0", "label": "og_msg_to_og3d", "type": "function", "loc": [14, 20], "level": 0, "parent": null, "vector": [2, 0, 0.1848, 0.0761, 0, 0.66, 0.7, 76, 0, 2, 1, 0, 0, 0, 5], "semantic": {"name": "og_msg_to_og3d", "arg_names": ["og", "to_binary"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def og_msg_to_og3d(og, to_binary=True):\n c = np.matrix([og.center.x, og.center.y, og.center.z]).T\n s = np.matrix([og.grid_size.x, og.grid_size.y, og.grid_size.z]).T\n r = np.matrix([og.resolution.x, og.resolution.y, og.resolution.z]).T\n og3d = pog.occupancy_grid_3d(c, s, r, np.array(og.data),\n og.occupancy_threshold, to_binary = to_binary)\n return og3d"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99599:Assign_L15_C4", "label": "c =", "type": "assigned_variable", "loc": [15, 15], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99599:FunctionDef_L14_C0", "vector": [14, 1, 0.163, 0.0109, 1, 0.5, 0.0, 411, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "c", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " c = np.matrix([og.center.x, og.center.y, og.center.z]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99599:Assign_L16_C4", "label": "s =", "type": "assigned_variable", "loc": [16, 16], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99599:FunctionDef_L14_C0", "vector": [14, 1, 0.1739, 0.0109, 1, 0.5, 0.25, 553, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "s", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " s = np.matrix([og.grid_size.x, og.grid_size.y, og.grid_size.z]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99599:Assign_L17_C4", "label": "r =", "type": "assigned_variable", "loc": [17, 17], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99599:FunctionDef_L14_C0", "vector": [14, 1, 0.1848, 0.0109, 1, 0.5, 0.5, 436, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " r = np.matrix([og.resolution.x, og.resolution.y, og.resolution.z]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99599:Assign_L18_C4", "label": "og3d = occupancy_grid_3d()", "type": "assigned_variable", "loc": [18, 19], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99599:FunctionDef_L14_C0", "vector": [14, 1, 0.2011, 0.0217, 1, 0.5, 0.75, 114, 3, 6, 0, 0, 222, 10, 2], "semantic": {"name": "og3d", "arg_names": [], "import_names": [], "rhs_call_name": "occupancy_grid_3d", "annotation": ""}, "snippet": " og3d = pog.occupancy_grid_3d(c, s, r, np.array(og.data),\n og.occupancy_threshold, to_binary = to_binary)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99599:Return_L20_C4", "label": "return", "type": "return", "loc": [20, 20], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99599:FunctionDef_L14_C0", "vector": [13, 1, 0.2174, 0.0109, 1, 0.5, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return og3d"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99599:FunctionDef_L25_C0", "label": "og3d_to_og_msg", "type": "function", "loc": [25, 45], "level": 0, "parent": null, "vector": [2, 0, 0.3804, 0.2283, 0, 0.66, 0.8, 614, 0, 1, 1, 0, 0, 0, 4], "semantic": {"name": "og3d_to_og_msg", "arg_names": ["og3d"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def og3d_to_og_msg(og3d):\n og = OccupancyGrid()\n\n og.center.x = og3d.center[0,0]\n og.center.y = og3d.center[1,0]\n og.center.z = og3d.center[2,0]\n\n og.grid_size.x = og3d.size[0,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99599:Assign_L26_C4", "label": "og = OccupancyGrid()", "type": "assigned_variable", "loc": [26, 26], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99599:FunctionDef_L25_C0", "vector": [14, 1, 0.2826, 0.0109, 1, 0.38, 0.0, 273, 3, 0, 0, 0, 945, 10, 1], "semantic": {"name": "og", "arg_names": [], "import_names": [], "rhs_call_name": "OccupancyGrid", "annotation": ""}, "snippet": " og = OccupancyGrid()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99599:Assign_L28_C4", "label": "og.center.x =", "type": "assigned_variable", "loc": [28, 28], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99599:FunctionDef_L25_C0", "vector": [14, 1, 0.3043, 0.0109, 1, 0.38, 0.0714, 814, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "og.center.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " og.center.x = og3d.center[0,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99599:Assign_L29_C4", "label": "og.center.y =", "type": "assigned_variable", "loc": [29, 29], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99599:FunctionDef_L25_C0", "vector": [14, 1, 0.3152, 0.0109, 1, 0.38, 0.1429, 444, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "og.center.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " og.center.y = og3d.center[1,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99599:Assign_L30_C4", "label": "og.center.z =", "type": "assigned_variable", "loc": [30, 30], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99599:FunctionDef_L25_C0", "vector": [14, 1, 0.3261, 0.0109, 1, 0.38, 0.2143, 383, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "og.center.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " og.center.z = og3d.center[2,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99599:Assign_L32_C4", "label": "og.grid_size.x =", "type": "assigned_variable", "loc": [32, 32], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99599:FunctionDef_L25_C0", "vector": [14, 1, 0.3478, 0.0109, 1, 0.38, 0.2857, 758, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "og.grid_size.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " og.grid_size.x = og3d.size[0,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99599:Assign_L33_C4", "label": "og.grid_size.y =", "type": "assigned_variable", "loc": [33, 33], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99599:FunctionDef_L25_C0", "vector": [14, 1, 0.3587, 0.0109, 1, 0.38, 0.3571, 212, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "og.grid_size.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " og.grid_size.y = og3d.size[1,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99599:Assign_L34_C4", "label": "og.grid_size.z =", "type": "assigned_variable", "loc": [34, 34], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99599:FunctionDef_L25_C0", "vector": [14, 1, 0.3696, 0.0109, 1, 0.38, 0.4286, 749, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "og.grid_size.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " og.grid_size.z = og3d.size[2,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99599:Assign_L36_C4", "label": "og.resolution.x =", "type": "assigned_variable", "loc": [36, 36], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99599:FunctionDef_L25_C0", "vector": [14, 1, 0.3913, 0.0109, 1, 0.38, 0.5, 22, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "og.resolution.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " og.resolution.x = og3d.resolution[0,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99599:Assign_L37_C4", "label": "og.resolution.y =", "type": "assigned_variable", "loc": [37, 37], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99599:FunctionDef_L25_C0", "vector": [14, 1, 0.4022, 0.0109, 1, 0.38, 0.5714, 779, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "og.resolution.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " og.resolution.y = og3d.resolution[1,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99599:Assign_L38_C4", "label": "og.resolution.z =", "type": "assigned_variable", "loc": [38, 38], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99599:FunctionDef_L25_C0", "vector": [14, 1, 0.413, 0.0109, 1, 0.38, 0.6429, 374, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "og.resolution.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " og.resolution.z = og3d.resolution[2,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99599:Assign_L40_C4", "label": "og.occupancy_threshold =", "type": "assigned_variable", "loc": [40, 40], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99599:FunctionDef_L25_C0", "vector": [14, 1, 0.4348, 0.0109, 1, 0.38, 0.7143, 687, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "og.occupancy_threshold", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " og.occupancy_threshold = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99599:Assign_L42_C4", "label": "og.data = tolist()", "type": "assigned_variable", "loc": [42, 42], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99599:FunctionDef_L25_C0", "vector": [14, 1, 0.4565, 0.0109, 1, 0.38, 0.7857, 740, 3, 0, 0, 0, 185, 10, 2], "semantic": {"name": "og.data", "arg_names": [], "import_names": [], "rhs_call_name": "tolist", "annotation": ""}, "snippet": " og.data = og3d.grid.flatten().tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99599:Assign_L43_C4", "label": "og.header.frame_id =", "type": "assigned_variable", "loc": [43, 43], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99599:FunctionDef_L25_C0", "vector": [14, 1, 0.4674, 0.0109, 1, 0.38, 0.8571, 392, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "og.header.frame_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " og.header.frame_id = 'base_link'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99599:Assign_L44_C4", "label": "og.header.stamp = get_rostime()", "type": "assigned_variable", "loc": [44, 44], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99599:FunctionDef_L25_C0", "vector": [14, 1, 0.4783, 0.0109, 1, 0.38, 0.9286, 703, 3, 0, 0, 0, 173, 10, 1], "semantic": {"name": "og.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "get_rostime", "annotation": ""}, "snippet": " og.header.stamp = rospy.rostime.get_rostime()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99599:Return_L45_C4", "label": "return", "type": "return", "loc": [45, 45], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99599:FunctionDef_L25_C0", "vector": [13, 1, 0.4891, 0.0109, 1, 0.38, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return og"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99599:FunctionDef_L54_C0", "label": "og_param_msg", "type": "function", "loc": [54, 72], "level": 0, "parent": null, "vector": [2, 0, 0.6848, 0.2065, 0, 0.66, 0.9, 361, 0, 5, 1, 0, 0, 0, 2], "semantic": {"name": "og_param_msg", "arg_names": ["center", "size", "resolution", "occupancy_threshold", "frame_id"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def og_param_msg(center, size, resolution, occupancy_threshold, frame_id):\n og = OccupancyGrid()\n\n og.center.x = center[0,0]\n og.center.y = center[1,0]\n og.center.z = center[2,0]\n\n og.grid_size.x = size[0,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99599:Assign_L55_C4", "label": "og = OccupancyGrid()", "type": "assigned_variable", "loc": [55, 55], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99599:FunctionDef_L54_C0", "vector": [14, 1, 0.5978, 0.0109, 1, 0.35, 0.0, 273, 3, 0, 0, 0, 945, 10, 1], "semantic": {"name": "og", "arg_names": [], "import_names": [], "rhs_call_name": "OccupancyGrid", "annotation": ""}, "snippet": " og = OccupancyGrid()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99599:Assign_L57_C4", "label": "og.center.x =", "type": "assigned_variable", "loc": [57, 57], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99599:FunctionDef_L54_C0", "vector": [14, 1, 0.6196, 0.0109, 1, 0.35, 0.0769, 814, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "og.center.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " og.center.x = center[0,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99599:Assign_L58_C4", "label": "og.center.y =", "type": "assigned_variable", "loc": [58, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99599:FunctionDef_L54_C0", "vector": [14, 1, 0.6304, 0.0109, 1, 0.35, 0.1538, 444, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "og.center.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " og.center.y = center[1,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99599:Assign_L59_C4", "label": "og.center.z =", "type": "assigned_variable", "loc": [59, 59], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99599:FunctionDef_L54_C0", "vector": [14, 1, 0.6413, 0.0109, 1, 0.35, 0.2308, 383, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "og.center.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " og.center.z = center[2,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99599:Assign_L61_C4", "label": "og.grid_size.x =", "type": "assigned_variable", "loc": [61, 61], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99599:FunctionDef_L54_C0", "vector": [14, 1, 0.663, 0.0109, 1, 0.35, 0.3077, 758, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "og.grid_size.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " og.grid_size.x = size[0,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99599:Assign_L62_C4", "label": "og.grid_size.y =", "type": "assigned_variable", "loc": [62, 62], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99599:FunctionDef_L54_C0", "vector": [14, 1, 0.6739, 0.0109, 1, 0.35, 0.3846, 212, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "og.grid_size.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " og.grid_size.y = size[1,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99599:Assign_L63_C4", "label": "og.grid_size.z =", "type": "assigned_variable", "loc": [63, 63], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99599:FunctionDef_L54_C0", "vector": [14, 1, 0.6848, 0.0109, 1, 0.35, 0.4615, 749, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "og.grid_size.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " og.grid_size.z = size[2,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99599:Assign_L65_C4", "label": "og.resolution.x =", "type": "assigned_variable", "loc": [65, 65], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99599:FunctionDef_L54_C0", "vector": [14, 1, 0.7065, 0.0109, 1, 0.35, 0.5385, 22, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "og.resolution.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " og.resolution.x = resolution[0,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99599:Assign_L66_C4", "label": "og.resolution.y =", "type": "assigned_variable", "loc": [66, 66], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99599:FunctionDef_L54_C0", "vector": [14, 1, 0.7174, 0.0109, 1, 0.35, 0.6154, 779, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "og.resolution.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " og.resolution.y = resolution[1,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99599:Assign_L67_C4", "label": "og.resolution.z =", "type": "assigned_variable", "loc": [67, 67], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99599:FunctionDef_L54_C0", "vector": [14, 1, 0.7283, 0.0109, 1, 0.35, 0.6923, 374, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "og.resolution.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " og.resolution.z = resolution[2,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99599:Assign_L69_C4", "label": "og.occupancy_threshold =", "type": "assigned_variable", "loc": [69, 69], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99599:FunctionDef_L54_C0", "vector": [14, 1, 0.75, 0.0109, 1, 0.35, 0.7692, 687, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "og.occupancy_threshold", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " og.occupancy_threshold = occupancy_threshold"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99599:Assign_L70_C4", "label": "og.header.frame_id =", "type": "assigned_variable", "loc": [70, 70], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99599:FunctionDef_L54_C0", "vector": [14, 1, 0.7609, 0.0109, 1, 0.35, 0.8462, 392, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "og.header.frame_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " og.header.frame_id = frame_id"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99599:Assign_L71_C4", "label": "og.header.stamp = get_rostime()", "type": "assigned_variable", "loc": [71, 71], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99599:FunctionDef_L54_C0", "vector": [14, 1, 0.7717, 0.0109, 1, 0.35, 0.9231, 703, 3, 0, 0, 0, 173, 10, 1], "semantic": {"name": "og.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "get_rostime", "annotation": ""}, "snippet": " og.header.stamp = rospy.rostime.get_rostime()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99599:Return_L72_C4", "label": "return", "type": "return", "loc": [72, 72], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99599:FunctionDef_L54_C0", "vector": [13, 1, 0.7826, 0.0109, 1, 0.35, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return og"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99599:If_L74_C0", "label": "if", "type": "if", "loc": [74, 90], "level": 0, "parent": null, "vector": [4, 0, 0.8913, 0.1848, 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 rospy.init_node('og_sample_python')\n param_list = [None, False]\n rospy.Subscriber('occupancy_grid', OccupancyGrid, cb, param_list)\n rospy.logout('Ready')\n\n while not rospy.is_shutdown():\n if param_list[1] == True:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99599:Expr_L75_C4", "label": "init_node()", "type": "expression", "loc": [75, 75], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99599:If_L74_C0", "vector": [8, 1, 0.8152, 0.0109, 1, 0.18, 0.0, 463, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "init_node", "arg_names": [], "import_names": [], "rhs_call_name": "init_node", "annotation": ""}, "snippet": " rospy.init_node('og_sample_python')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99599:Assign_L76_C4", "label": "param_list =", "type": "assigned_variable", "loc": [76, 76], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99599:If_L74_C0", "vector": [14, 1, 0.8261, 0.0109, 1, 0.18, 0.1667, 459, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "param_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " param_list = [None, False]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99599:Expr_L77_C4", "label": "Subscriber()", "type": "expression", "loc": [77, 77], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99599:If_L74_C0", "vector": [8, 1, 0.837, 0.0109, 1, 0.18, 0.3333, 455, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "Subscriber", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " rospy.Subscriber('occupancy_grid', OccupancyGrid, cb, param_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99599:Expr_L78_C4", "label": "logout()", "type": "expression", "loc": [78, 78], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99599:If_L74_C0", "vector": [8, 1, 0.8478, 0.0109, 1, 0.18, 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('Ready')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99599:While_L80_C4", "label": "while", "type": "while", "loc": [80, 87], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99599:If_L74_C0", "vector": [5, 1, 0.9076, 0.087, 1, 0.18, 0.6667, 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 param_list[1] == True:\n og3d = param_list[0]\n print('grid_shape:', og3d.grid.shape)\n pts = og3d.grid_to_points()\n print(pts.shape)\n break\n rospy.sleep(0.1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99599:If_L81_C8", "label": "if", "type": "if", "loc": [81, 86], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99599:While_L80_C4", "vector": [4, 2, 0.9076, 0.0652, 2, 0.7, 0.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if param_list[1] == True:\n og3d = param_list[0]\n print('grid_shape:', og3d.grid.shape)\n pts = og3d.grid_to_points()\n print(pts.shape)\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99599:Assign_L82_C12", "label": "og3d =", "type": "assigned_variable", "loc": [82, 82], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99599:If_L81_C8", "vector": [14, 3, 0.8913, 0.0109, 3, 0.4, 0.0, 114, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "og3d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " og3d = param_list[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99599:Expr_L83_C12", "label": "print()", "type": "expression", "loc": [83, 83], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99599:If_L81_C8", "vector": [8, 3, 0.9022, 0.0109, 3, 0.4, 0.3333, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('grid_shape:', og3d.grid.shape)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99599:Assign_L84_C12", "label": "pts = grid_to_points()", "type": "assigned_variable", "loc": [84, 84], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99599:If_L81_C8", "vector": [14, 3, 0.913, 0.0109, 3, 0.4, 0.6667, 195, 3, 0, 0, 0, 558, 10, 1], "semantic": {"name": "pts", "arg_names": [], "import_names": [], "rhs_call_name": "grid_to_points", "annotation": ""}, "snippet": " pts = og3d.grid_to_points()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99599:Expr_L85_C12", "label": "print()", "type": "expression", "loc": [85, 85], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99599:If_L81_C8", "vector": [8, 3, 0.9239, 0.0109, 3, 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(pts.shape)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99599:Expr_L87_C8", "label": "sleep()", "type": "expression", "loc": [87, 87], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99599:While_L80_C4", "vector": [8, 2, 0.9457, 0.0109, 2, 0.7, 1.0, 476, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " rospy.sleep(0.1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99599:Expr_L89_C4", "label": "plot_points()", "type": "expression", "loc": [89, 89], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99599:If_L74_C0", "vector": [8, 1, 0.9674, 0.0109, 1, 0.18, 0.8333, 111, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "plot_points", "arg_names": [], "import_names": [], "rhs_call_name": "plot_points", "annotation": ""}, "snippet": " d3m.plot_points(pts)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99599:Expr_L90_C4", "label": "show()", "type": "expression", "loc": [90, 90], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99599:If_L74_C0", "vector": [8, 1, 0.9783, 0.0109, 1, 0.18, 1.0, 497, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "show", "arg_names": [], "import_names": [], "rhs_call_name": "show", "annotation": ""}, "snippet": " d3m.show()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99599:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99599:Assign_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99599:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99599:Assign_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99599:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99599:Assign_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99599:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99599:Assign_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99599:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99599:Return_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99599:FunctionDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99599:Assign_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99599:FunctionDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99599:Assign_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99599:FunctionDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99599:Assign_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99599:FunctionDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99599:Assign_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99599:FunctionDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99599:Assign_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99599:FunctionDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99599:Assign_L33_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99599:FunctionDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99599:Assign_L34_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99599:FunctionDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99599:Assign_L36_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99599:FunctionDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99599:Assign_L37_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99599:FunctionDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99599:Assign_L38_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99599:FunctionDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99599:Assign_L40_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99599:FunctionDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99599:Assign_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99599:FunctionDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99599:Assign_L43_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99599:FunctionDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99599:Assign_L44_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99599:FunctionDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99599:Return_L45_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99599:FunctionDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99599:Assign_L55_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99599:FunctionDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99599:Assign_L57_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99599:FunctionDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99599:Assign_L58_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99599:FunctionDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99599:Assign_L59_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99599:FunctionDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99599:Assign_L61_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99599:FunctionDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99599:Assign_L62_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99599:FunctionDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99599:Assign_L63_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99599:FunctionDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99599:Assign_L65_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99599:FunctionDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99599:Assign_L66_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99599:FunctionDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99599:Assign_L67_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99599:FunctionDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99599:Assign_L69_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99599:FunctionDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99599:Assign_L70_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99599:FunctionDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99599:Assign_L71_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99599:FunctionDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99599:Return_L72_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99599:If_L74_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99599:Expr_L75_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99599:If_L74_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99599:Assign_L76_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99599:If_L74_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99599:Expr_L77_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99599:If_L74_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99599:Expr_L78_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99599:If_L74_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99599:While_L80_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99599:While_L80_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99599:If_L81_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99599:If_L81_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99599:Assign_L82_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99599:If_L81_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99599:Expr_L83_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99599:If_L81_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99599:Assign_L84_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99599:If_L81_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99599:Expr_L85_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99599:While_L80_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99599:Expr_L87_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99599:If_L74_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99599:Expr_L89_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99599:If_L74_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99599:Expr_L90_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. # ## Testing point_cloud_mapping from python ## author Advait Jain (Healthcare Robotics Lab, Georgia Tech.) import roslib; roslib.load_manifest('point_cloud_ros') import rospy from sensor_msgs.msg import PointCloud from geometry_msgs.msg import Point32 import numpy as np, math from numpy import pi import sys, os, optparse, time import copy import hrl_lib.util as ut import point_cloud_ros.point_cloud_utils as pcu from enthought.mayavi import mlab def SphereToCart(rho, theta, phi): x = rho * np.sin(phi) * np.cos(theta) y = rho * np.sin(phi) * np.sin(theta) z = rho * np.cos(phi) return (x,y,z) def generate_sphere(): pts = 4e3 theta = np.random.rand(pts) * 2*pi phi = np.random.rand(pts) * pi rho = 1*np.ones(len(theta)) x,y,z = SphereToCart(rho,theta,phi) pts = np.matrix(np.row_stack((x,y,z))) return pcu.np_points_to_ros(pts) def plot_cloud(pts): x = pts[0,:].A1 y = pts[1,:].A1 z = pts[2,:].A1 mlab.points3d(x,y,z,mode='point') mlab.show() def plot_normals(pts,normals,curvature=None): x = pts[0,:].A1 y = pts[1,:].A1 z = pts[2,:].A1 u = normals[0,:].A1 v = normals[1,:].A1 w = normals[2,:].A1 if curvature != None: #mlab.points3d(x,y,z,curvature,mode='point',scale_factor=1.0) mlab.points3d(x,y,z,curvature,mode='sphere',scale_factor=0.1,mask_points=1) mlab.colorbar() else: mlab.points3d(x,y,z,mode='point') mlab.quiver3d(x,y,z,u,v,w,mask_points=16,scale_factor=0.1) # mlab.axes() mlab.show() def downsample_cb(cloud_down): print 'downsample_cb got called.' pts = ros_pts_to_np(cloud_down.pts) x = pts[0,:].A1 y = pts[1,:].A1 z = pts[2,:].A1 mlab.points3d(x,y,z,mode='point') mlab.show() def normals_cb(normals_cloud): print 'normals_cb got called.' d = {} t0 = time.time() pts = ros_pts_to_np(normals_cloud.pts) t1 = time.time() print 'time to go from ROS point cloud to np matrx:', t1-t0 d['pts'] = pts if normals_cloud.chan[0].name != 'nx': print '################################################################################' print 'synthetic_point_clouds.normals_cloud: DANGER DANGER normals_cloud.chan[0] is NOT nx, it is:', normals_cloud.chan[0].name print 'Exiting...' print '################################################################################' sys.exit() normals_list = [] for i in range(3): normals_list.append(normals_cloud.chan[i].vals) d['normals'] = np.matrix(normals_list) d['curvature'] = normals_cloud.chan[3].vals print 'd[\'pts\'].shape:', d['pts'].shape print 'd[\'normals\'].shape:', d['normals'].shape ut.save_pickle(d, 'normals_cloud_'+ut.formatted_time()+'.pkl') if __name__ == '__main__': p = optparse.OptionParser() p.add_option('--sphere', action='store_true', dest='sphere', help='sample a sphere and publish the point cloud') p.add_option('--plot', action='store_true', dest='plot', help='plot the result') p.add_option('-f', action='store', type='string',dest='fname', default=None, help='pkl file with the normals.') p.add_option('--pc', action='store', type='string',dest='pc_fname', default=None, help='pkl file with 3xN numpy matrix (numpy point cloud).') opt, args = p.parse_args() sphere_flag = opt.sphere plot_flag = opt.plot fname = opt.fname pc_fname = opt.pc_fname if sphere_flag or pc_fname!=None: rospy.init_node('point_cloud_tester', anonymous=True) pub = rospy.Publisher("tilt_laser_cloud", PointCloud) rospy.Subscriber("cloud_normals", PointCloud, normals_cb) rospy.Subscriber("cloud_downsampled", PointCloud, downsample_cb) time.sleep(1) if sphere_flag: pc = generate_sphere() if pc_fname != None: pts = ut.load_pickle(pc_fname) print 'before np_points_to_ros' t0 = time.time() pc = pcu.np_points_to_ros(pts) t1 = time.time() print 'time to go from numpy to ros:', t1-t0 t0 = time.time() pcu.ros_pointcloud_to_np(pc) t1 = time.time() print 'time to go from ros to numpy:', t1-t0 pub.publish(pc) rospy.spin() if plot_flag: if fname == None: print 'Please give a pkl file for plotting (-f option)' print 'Exiting...' sys.exit() d = ut.load_pickle(fname) plot_normals(d['pts'],d['normals'],d['curvature'])
ajibawa-2023/Python-Code-Large/train/row_99600
113
190
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99600:Import_L33_C0", "label": "roslib import roslib", "type": "import", "loc": [33, 33], "level": 0, "parent": null, "vector": [1, 0, 0.1737, 0.0053, 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('point_cloud_ros')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99600:Expr_L33_C15", "label": "load_manifest()", "type": "expression", "loc": [33, 33], "level": 0, "parent": null, "vector": [8, 0, 0.1737, 0.0053, 0, 0.66, 0.0556, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('point_cloud_ros')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99600:Import_L35_C0", "label": "rospy import rospy", "type": "import", "loc": [35, 35], "level": 0, "parent": null, "vector": [1, 0, 0.1842, 0.0053, 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_99600:ImportFrom_L37_C0", "label": "from sensor_msgs.msg import PointCloud", "type": "import", "loc": [37, 37], "level": 0, "parent": null, "vector": [1, 0, 0.1947, 0.0053, 0, 0.66, 0.1667, 531, 0, 1, 0, 0, 531, 0, 0], "semantic": {"name": "sensor_msgs.msg", "arg_names": [], "import_names": ["PointCloud"], "rhs_call_name": "", "annotation": ""}, "snippet": "from sensor_msgs.msg import PointCloud"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99600:ImportFrom_L38_C0", "label": "from geometry_msgs.msg import Point32", "type": "import", "loc": [38, 38], "level": 0, "parent": null, "vector": [1, 0, 0.2, 0.0053, 0, 0.66, 0.2222, 951, 0, 1, 0, 0, 951, 0, 0], "semantic": {"name": "geometry_msgs.msg", "arg_names": [], "import_names": ["Point32"], "rhs_call_name": "", "annotation": ""}, "snippet": "from geometry_msgs.msg import Point32"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99600:Import_L40_C0", "label": "numpy import np, math", "type": "import", "loc": [40, 40], "level": 0, "parent": null, "vector": [1, 0, 0.2105, 0.0053, 0, 0.66, 0.2778, 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_99600:ImportFrom_L41_C0", "label": "from numpy import pi", "type": "import", "loc": [41, 41], "level": 0, "parent": null, "vector": [1, 0, 0.2158, 0.0053, 0, 0.66, 0.3333, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["pi"], "rhs_call_name": "", "annotation": ""}, "snippet": "from numpy import pi"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99600:Import_L42_C0", "label": "sys import sys, os, optparse\u2026", "type": "import", "loc": [42, 42], "level": 0, "parent": null, "vector": [1, 0, 0.2211, 0.0053, 0, 0.66, 0.3889, 509, 0, 4, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys", "os", "optparse", "time"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys, os, optparse, time"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99600:Import_L43_C0", "label": "copy import copy", "type": "import", "loc": [43, 43], "level": 0, "parent": null, "vector": [1, 0, 0.2263, 0.0053, 0, 0.66, 0.4444, 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_99600:Import_L45_C0", "label": "hrl_lib.util import ut", "type": "import", "loc": [45, 45], "level": 0, "parent": null, "vector": [1, 0, 0.2368, 0.0053, 0, 0.66, 0.5, 775, 0, 1, 0, 0, 775, 0, 0], "semantic": {"name": "hrl_lib.util", "arg_names": [], "import_names": ["ut"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.util as ut"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99600:Import_L46_C0", "label": "point_cloud_ros.point_cloud_utils import pcu", "type": "import", "loc": [46, 46], "level": 0, "parent": null, "vector": [1, 0, 0.2421, 0.0053, 0, 0.66, 0.5556, 484, 0, 1, 0, 0, 484, 0, 0], "semantic": {"name": "point_cloud_ros.point_cloud_utils", "arg_names": [], "import_names": ["pcu"], "rhs_call_name": "", "annotation": ""}, "snippet": "import point_cloud_ros.point_cloud_utils as pcu"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99600:ImportFrom_L48_C0", "label": "from enthought.mayavi import mlab", "type": "import", "loc": [48, 48], "level": 0, "parent": null, "vector": [1, 0, 0.2526, 0.0053, 0, 0.66, 0.6111, 226, 0, 1, 0, 0, 226, 0, 0], "semantic": {"name": "enthought.mayavi", "arg_names": [], "import_names": ["mlab"], "rhs_call_name": "", "annotation": ""}, "snippet": "from enthought.mayavi import mlab"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99600:FunctionDef_L51_C0", "label": "SphereToCart", "type": "function", "loc": [51, 55], "level": 0, "parent": null, "vector": [2, 0, 0.2789, 0.0263, 0, 0.66, 0.6667, 334, 0, 3, 1, 0, 0, 0, 5], "semantic": {"name": "SphereToCart", "arg_names": ["rho", "theta", "phi"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def SphereToCart(rho, theta, phi):\n x = rho * np.sin(phi) * np.cos(theta)\n y = rho * np.sin(phi) * np.sin(theta)\n z = rho * np.cos(phi)\n return (x,y,z)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99600:Assign_L52_C4", "label": "x =", "type": "assigned_variable", "loc": [52, 52], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99600:FunctionDef_L51_C0", "vector": [14, 1, 0.2737, 0.0053, 1, 0.58, 0.0, 190, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " x = rho * np.sin(phi) * np.cos(theta)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99600:Assign_L53_C4", "label": "y =", "type": "assigned_variable", "loc": [53, 53], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99600:FunctionDef_L51_C0", "vector": [14, 1, 0.2789, 0.0053, 1, 0.58, 0.3333, 304, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " y = rho * np.sin(phi) * np.sin(theta)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99600:Assign_L54_C4", "label": "z =", "type": "assigned_variable", "loc": [54, 54], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99600:FunctionDef_L51_C0", "vector": [14, 1, 0.2842, 0.0053, 1, 0.58, 0.6667, 859, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " z = rho * np.cos(phi)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99600:Return_L55_C4", "label": "return", "type": "return", "loc": [55, 55], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99600:FunctionDef_L51_C0", "vector": [13, 1, 0.2895, 0.0053, 1, 0.58, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return (x,y,z)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99600:FunctionDef_L57_C0", "label": "generate_sphere", "type": "function", "loc": [57, 66], "level": 0, "parent": null, "vector": [2, 0, 0.3237, 0.0526, 0, 0.66, 0.7222, 549, 0, 0, 1, 0, 0, 0, 8], "semantic": {"name": "generate_sphere", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def generate_sphere():\n pts = 4e3\n theta = np.random.rand(pts) * 2*pi\n phi = np.random.rand(pts) * pi\n rho = 1*np.ones(len(theta))\n\n x,y,z = SphereToCart(rho,theta,phi)\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99600:Assign_L58_C4", "label": "pts =", "type": "assigned_variable", "loc": [58, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99600:FunctionDef_L57_C0", "vector": [14, 1, 0.3053, 0.0053, 1, 0.77, 0.0, 195, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "pts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pts = 4e3"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99600:Assign_L59_C4", "label": "theta =", "type": "assigned_variable", "loc": [59, 59], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99600:FunctionDef_L57_C0", "vector": [14, 1, 0.3105, 0.0053, 1, 0.77, 0.1667, 729, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "theta", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " theta = np.random.rand(pts) * 2*pi"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99600:Assign_L60_C4", "label": "phi =", "type": "assigned_variable", "loc": [60, 60], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99600:FunctionDef_L57_C0", "vector": [14, 1, 0.3158, 0.0053, 1, 0.77, 0.3333, 388, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "phi", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " phi = np.random.rand(pts) * pi"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99600:Assign_L61_C4", "label": "rho =", "type": "assigned_variable", "loc": [61, 61], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99600:FunctionDef_L57_C0", "vector": [14, 1, 0.3211, 0.0053, 1, 0.77, 0.5, 498, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "rho", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rho = 1*np.ones(len(theta))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99600:Assign_L63_C4", "label": "x, y, z = SphereToCart()", "type": "assigned_variable", "loc": [63, 63], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99600:FunctionDef_L57_C0", "vector": [14, 1, 0.3316, 0.0053, 1, 0.77, 0.6667, 971, 3, 3, 0, 0, 334, 10, 1], "semantic": {"name": "x, y, z", "arg_names": [], "import_names": [], "rhs_call_name": "SphereToCart", "annotation": ""}, "snippet": " x,y,z = SphereToCart(rho,theta,phi)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99600:Assign_L65_C4", "label": "pts = matrix()", "type": "assigned_variable", "loc": [65, 65], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99600:FunctionDef_L57_C0", "vector": [14, 1, 0.3421, 0.0053, 1, 0.77, 0.8333, 195, 3, 1, 0, 0, 162, 10, 2], "semantic": {"name": "pts", "arg_names": [], "import_names": [], "rhs_call_name": "matrix", "annotation": ""}, "snippet": " pts = np.matrix(np.row_stack((x,y,z)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99600:Return_L66_C4", "label": "return", "type": "return", "loc": [66, 66], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99600:FunctionDef_L57_C0", "vector": [13, 1, 0.3474, 0.0053, 1, 0.77, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return pcu.np_points_to_ros(pts)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99600:FunctionDef_L68_C0", "label": "plot_cloud", "type": "function", "loc": [68, 73], "level": 0, "parent": null, "vector": [2, 0, 0.3711, 0.0316, 0, 0.66, 0.7778, 230, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "plot_cloud", "arg_names": ["pts"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def plot_cloud(pts):\n x = pts[0,:].A1\n y = pts[1,:].A1\n z = pts[2,:].A1\n mlab.points3d(x,y,z,mode='point')\n mlab.show()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99600:Assign_L69_C4", "label": "x =", "type": "assigned_variable", "loc": [69, 69], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99600:FunctionDef_L68_C0", "vector": [14, 1, 0.3632, 0.0053, 1, 0.79, 0.0, 190, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " x = pts[0,:].A1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99600:Assign_L70_C4", "label": "y =", "type": "assigned_variable", "loc": [70, 70], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99600:FunctionDef_L68_C0", "vector": [14, 1, 0.3684, 0.0053, 1, 0.79, 0.25, 304, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " y = pts[1,:].A1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99600:Assign_L71_C4", "label": "z =", "type": "assigned_variable", "loc": [71, 71], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99600:FunctionDef_L68_C0", "vector": [14, 1, 0.3737, 0.0053, 1, 0.79, 0.5, 859, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " z = pts[2,:].A1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99600:Expr_L72_C4", "label": "points3d()", "type": "expression", "loc": [72, 72], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99600:FunctionDef_L68_C0", "vector": [8, 1, 0.3789, 0.0053, 1, 0.79, 0.75, 243, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "points3d", "arg_names": [], "import_names": [], "rhs_call_name": "points3d", "annotation": ""}, "snippet": " mlab.points3d(x,y,z,mode='point')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99600:Expr_L73_C4", "label": "show()", "type": "expression", "loc": [73, 73], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99600:FunctionDef_L68_C0", "vector": [8, 1, 0.3842, 0.0053, 1, 0.79, 1.0, 497, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "show", "arg_names": [], "import_names": [], "rhs_call_name": "show", "annotation": ""}, "snippet": " mlab.show()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99600:FunctionDef_L75_C0", "label": "plot_normals", "type": "function", "loc": [75, 93], "level": 0, "parent": null, "vector": [2, 0, 0.4421, 0.1, 0, 0.66, 0.8333, 568, 0, 3, 0, 0, 0, 0, 5], "semantic": {"name": "plot_normals", "arg_names": ["pts", "normals", "curvature"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def plot_normals(pts,normals,curvature=None):\n\n x = pts[0,:].A1\n y = pts[1,:].A1\n z = pts[2,:].A1\n\n u = normals[0,:].A1\n v = normals[1,:].A1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99600:Assign_L77_C4", "label": "x =", "type": "assigned_variable", "loc": [77, 77], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99600:FunctionDef_L75_C0", "vector": [14, 1, 0.4053, 0.0053, 1, 0.22, 0.0, 190, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " x = pts[0,:].A1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99600:Assign_L78_C4", "label": "y =", "type": "assigned_variable", "loc": [78, 78], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99600:FunctionDef_L75_C0", "vector": [14, 1, 0.4105, 0.0053, 1, 0.22, 0.125, 304, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " y = pts[1,:].A1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99600:Assign_L79_C4", "label": "z =", "type": "assigned_variable", "loc": [79, 79], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99600:FunctionDef_L75_C0", "vector": [14, 1, 0.4158, 0.0053, 1, 0.22, 0.25, 859, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " z = pts[2,:].A1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99600:Assign_L81_C4", "label": "u =", "type": "assigned_variable", "loc": [81, 81], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99600:FunctionDef_L75_C0", "vector": [14, 1, 0.4263, 0.0053, 1, 0.22, 0.375, 609, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "u", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " u = normals[0,:].A1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99600:Assign_L82_C4", "label": "v =", "type": "assigned_variable", "loc": [82, 82], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99600:FunctionDef_L75_C0", "vector": [14, 1, 0.4316, 0.0053, 1, 0.22, 0.5, 553, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "v", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " v = normals[1,:].A1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99600:Assign_L83_C4", "label": "w =", "type": "assigned_variable", "loc": [83, 83], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99600:FunctionDef_L75_C0", "vector": [14, 1, 0.4368, 0.0053, 1, 0.22, 0.625, 549, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "w", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " w = normals[2,:].A1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99600:If_L85_C4", "label": "if", "type": "if", "loc": [85, 90], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99600:FunctionDef_L75_C0", "vector": [4, 1, 0.4605, 0.0316, 1, 0.22, 0.75, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if curvature != None:\n #mlab.points3d(x,y,z,curvature,mode='point',scale_factor=1.0)\n mlab.points3d(x,y,z,curvature,mode='sphere',scale_factor=0.1,mask_points=1)\n mlab.colorbar()\n else:\n mlab.points3d(x,y,z,mode='point')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99600:Expr_L87_C8", "label": "points3d()", "type": "expression", "loc": [87, 87], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99600:If_L85_C4", "vector": [8, 2, 0.4579, 0.0053, 2, 0.6, 0.0, 243, 3, 7, 0, 0, 0, 0, 1], "semantic": {"name": "points3d", "arg_names": [], "import_names": [], "rhs_call_name": "points3d", "annotation": ""}, "snippet": " mlab.points3d(x,y,z,curvature,mode='sphere',scale_factor=0.1,mask_points=1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99600:Expr_L88_C8", "label": "colorbar()", "type": "expression", "loc": [88, 88], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99600:If_L85_C4", "vector": [8, 2, 0.4632, 0.0053, 2, 0.6, 0.5, 915, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "colorbar", "arg_names": [], "import_names": [], "rhs_call_name": "colorbar", "annotation": ""}, "snippet": " mlab.colorbar()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99600:Expr_L90_C8", "label": "points3d()", "type": "expression", "loc": [90, 90], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99600:If_L85_C4", "vector": [8, 2, 0.4737, 0.0053, 2, 0.6, 1.0, 243, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "points3d", "arg_names": [], "import_names": [], "rhs_call_name": "points3d", "annotation": ""}, "snippet": " mlab.points3d(x,y,z,mode='point')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99600:Expr_L91_C4", "label": "quiver3d()", "type": "expression", "loc": [91, 91], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99600:FunctionDef_L75_C0", "vector": [8, 1, 0.4789, 0.0053, 1, 0.22, 0.875, 147, 3, 8, 0, 0, 0, 0, 1], "semantic": {"name": "quiver3d", "arg_names": [], "import_names": [], "rhs_call_name": "quiver3d", "annotation": ""}, "snippet": " mlab.quiver3d(x,y,z,u,v,w,mask_points=16,scale_factor=0.1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99600:Expr_L93_C4", "label": "show()", "type": "expression", "loc": [93, 93], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99600:FunctionDef_L75_C0", "vector": [8, 1, 0.4895, 0.0053, 1, 0.22, 1.0, 497, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "show", "arg_names": [], "import_names": [], "rhs_call_name": "show", "annotation": ""}, "snippet": " mlab.show()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99600:FunctionDef_L95_C0", "label": "downsample_cb", "type": "function", "loc": [95, 102], "level": 0, "parent": null, "vector": [2, 0, 0.5184, 0.0421, 0, 0.66, 0.8889, 775, 0, 1, 0, 0, 0, 0, 4], "semantic": {"name": "downsample_cb", "arg_names": ["cloud_down"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def downsample_cb(cloud_down):\n print('downsample_cb got called.')\n pts = ros_pts_to_np(cloud_down.pts)\n x = pts[0,:].A1\n y = pts[1,:].A1\n z = pts[2,:].A1\n mlab.points3d(x,y,z,mode='point')\n mlab.show()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99600:Expr_L96_C4", "label": "print()", "type": "expression", "loc": [96, 96], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99600:FunctionDef_L95_C0", "vector": [8, 1, 0.5053, 0.0053, 1, 0.28, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('downsample_cb got called.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99600:Assign_L97_C4", "label": "pts = ros_pts_to_np()", "type": "assigned_variable", "loc": [97, 97], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99600:FunctionDef_L95_C0", "vector": [14, 1, 0.5105, 0.0053, 1, 0.28, 0.1667, 195, 3, 1, 0, 0, 846, 10, 1], "semantic": {"name": "pts", "arg_names": [], "import_names": [], "rhs_call_name": "ros_pts_to_np", "annotation": ""}, "snippet": " pts = ros_pts_to_np(cloud_down.pts)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99600:Assign_L98_C4", "label": "x =", "type": "assigned_variable", "loc": [98, 98], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99600:FunctionDef_L95_C0", "vector": [14, 1, 0.5158, 0.0053, 1, 0.28, 0.3333, 190, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " x = pts[0,:].A1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99600:Assign_L99_C4", "label": "y =", "type": "assigned_variable", "loc": [99, 99], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99600:FunctionDef_L95_C0", "vector": [14, 1, 0.5211, 0.0053, 1, 0.28, 0.5, 304, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " y = pts[1,:].A1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99600:Assign_L100_C4", "label": "z =", "type": "assigned_variable", "loc": [100, 100], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99600:FunctionDef_L95_C0", "vector": [14, 1, 0.5263, 0.0053, 1, 0.28, 0.6667, 859, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " z = pts[2,:].A1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99600:Expr_L101_C4", "label": "points3d()", "type": "expression", "loc": [101, 101], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99600:FunctionDef_L95_C0", "vector": [8, 1, 0.5316, 0.0053, 1, 0.28, 0.8333, 243, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "points3d", "arg_names": [], "import_names": [], "rhs_call_name": "points3d", "annotation": ""}, "snippet": " mlab.points3d(x,y,z,mode='point')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99600:Expr_L102_C4", "label": "show()", "type": "expression", "loc": [102, 102], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99600:FunctionDef_L95_C0", "vector": [8, 1, 0.5368, 0.0053, 1, 0.28, 1.0, 497, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "show", "arg_names": [], "import_names": [], "rhs_call_name": "show", "annotation": ""}, "snippet": " mlab.show()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99600:FunctionDef_L104_C0", "label": "normals_cb", "type": "function", "loc": [104, 129], "level": 0, "parent": null, "vector": [2, 0, 0.6132, 0.1368, 0, 0.66, 0.9444, 935, 0, 1, 0, 0, 0, 0, 17], "semantic": {"name": "normals_cb", "arg_names": ["normals_cloud"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def normals_cb(normals_cloud):\n print('normals_cb got called.')\n d = {}\n t0 = time.time()\n pts = ros_pts_to_np(normals_cloud.pts)\n t1 = time.time()\n print('time to go from ROS point cloud to np matrx:', t1-t0)\n d['pts'] = pts"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99600:Expr_L105_C4", "label": "print()", "type": "expression", "loc": [105, 105], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99600:FunctionDef_L104_C0", "vector": [8, 1, 0.5526, 0.0053, 1, 0.94, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('normals_cb got called.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99600:Assign_L106_C4", "label": "d =", "type": "assigned_variable", "loc": [106, 106], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99600:FunctionDef_L104_C0", "vector": [14, 1, 0.5579, 0.0053, 1, 0.94, 0.0714, 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_99600:Assign_L107_C4", "label": "t0 = time()", "type": "assigned_variable", "loc": [107, 107], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99600:FunctionDef_L104_C0", "vector": [14, 1, 0.5632, 0.0053, 1, 0.94, 0.1429, 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_99600:Assign_L108_C4", "label": "pts = ros_pts_to_np()", "type": "assigned_variable", "loc": [108, 108], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99600:FunctionDef_L104_C0", "vector": [14, 1, 0.5684, 0.0053, 1, 0.94, 0.2143, 195, 3, 1, 0, 0, 846, 10, 1], "semantic": {"name": "pts", "arg_names": [], "import_names": [], "rhs_call_name": "ros_pts_to_np", "annotation": ""}, "snippet": " pts = ros_pts_to_np(normals_cloud.pts)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99600:Assign_L109_C4", "label": "t1 = time()", "type": "assigned_variable", "loc": [109, 109], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99600:FunctionDef_L104_C0", "vector": [14, 1, 0.5737, 0.0053, 1, 0.94, 0.2857, 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_99600:Expr_L110_C4", "label": "print()", "type": "expression", "loc": [110, 110], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99600:FunctionDef_L104_C0", "vector": [8, 1, 0.5789, 0.0053, 1, 0.94, 0.3571, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('time to go from ROS point cloud to np matrx:', t1-t0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99600:Assign_L111_C4", "label": "assign", "type": "assigned_variable", "loc": [111, 111], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99600:FunctionDef_L104_C0", "vector": [14, 1, 0.5842, 0.0053, 1, 0.94, 0.4286, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " d['pts'] = pts"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99600:If_L113_C4", "label": "if", "type": "if", "loc": [113, 118], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99600:FunctionDef_L104_C0", "vector": [4, 1, 0.6079, 0.0316, 1, 0.94, 0.5, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if normals_cloud.chan[0].name != 'nx':\n print('################################################################################')\n print('synthetic_point_clouds.normals_cloud: DANGER DANGER normals_cloud.chan[0] is NOT nx, it is:', normals_cloud.chan[0].name)\n print('Exiting...')\n print('################################################################################')\n sys.exit()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99600:Expr_L114_C8", "label": "print()", "type": "expression", "loc": [114, 114], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99600:If_L113_C4", "vector": [8, 2, 0.6, 0.0053, 2, 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('################################################################################')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99600:Expr_L115_C8", "label": "print()", "type": "expression", "loc": [115, 115], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99600:If_L113_C4", "vector": [8, 2, 0.6053, 0.0053, 2, 0.47, 0.25, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('synthetic_point_clouds.normals_cloud: DANGER DANGER normals_cloud.chan[0] is NOT nx, it is:', normals_cloud.chan[0].name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99600:Expr_L116_C8", "label": "print()", "type": "expression", "loc": [116, 116], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99600:If_L113_C4", "vector": [8, 2, 0.6105, 0.0053, 2, 0.47, 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_99600:Expr_L117_C8", "label": "print()", "type": "expression", "loc": [117, 117], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99600:If_L113_C4", "vector": [8, 2, 0.6158, 0.0053, 2, 0.47, 0.75, 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_99600:Expr_L118_C8", "label": "exit()", "type": "expression", "loc": [118, 118], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99600:If_L113_C4", "vector": [8, 2, 0.6211, 0.0053, 2, 0.47, 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_99600:Assign_L120_C4", "label": "normals_list =", "type": "assigned_variable", "loc": [120, 120], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99600:FunctionDef_L104_C0", "vector": [14, 1, 0.6316, 0.0053, 1, 0.94, 0.5714, 174, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "normals_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " normals_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99600:For_L121_C4", "label": "for i", "type": "for", "loc": [121, 122], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99600:FunctionDef_L104_C0", "vector": [6, 1, 0.6395, 0.0105, 1, 0.94, 0.6429, 826, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(3):\n normals_list.append(normals_cloud.chan[i].vals)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99600:Expr_L122_C8", "label": "append()", "type": "expression", "loc": [122, 122], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99600:For_L121_C4", "vector": [8, 2, 0.6421, 0.0053, 2, 0.01, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " normals_list.append(normals_cloud.chan[i].vals)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99600:Assign_L124_C4", "label": " = matrix()", "type": "assigned_variable", "loc": [124, 124], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99600:FunctionDef_L104_C0", "vector": [14, 1, 0.6526, 0.0053, 1, 0.94, 0.7143, 0, 3, 1, 0, 0, 162, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "matrix", "annotation": ""}, "snippet": " d['normals'] = np.matrix(normals_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99600:Assign_L125_C4", "label": "assign", "type": "assigned_variable", "loc": [125, 125], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99600:FunctionDef_L104_C0", "vector": [14, 1, 0.6579, 0.0053, 1, 0.94, 0.7857, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " d['curvature'] = normals_cloud.chan[3].vals"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99600:Expr_L127_C4", "label": "print()", "type": "expression", "loc": [127, 127], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99600:FunctionDef_L104_C0", "vector": [8, 1, 0.6684, 0.0053, 1, 0.94, 0.8571, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('d[\\'pts\\'].shape:', d['pts'].shape)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99600:Expr_L128_C4", "label": "print()", "type": "expression", "loc": [128, 128], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99600:FunctionDef_L104_C0", "vector": [8, 1, 0.6737, 0.0053, 1, 0.94, 0.9286, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('d[\\'normals\\'].shape:', d['normals'].shape)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99600:Expr_L129_C4", "label": "save_pickle()", "type": "expression", "loc": [129, 129], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99600:FunctionDef_L104_C0", "vector": [8, 1, 0.6789, 0.0053, 1, 0.94, 1.0, 390, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "save_pickle", "arg_names": [], "import_names": [], "rhs_call_name": "save_pickle", "annotation": ""}, "snippet": " ut.save_pickle(d, 'normals_cloud_'+ut.formatted_time()+'.pkl')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99600:If_L134_C0", "label": "if", "type": "if", "loc": [134, 188], "level": 0, "parent": null, "vector": [4, 0, 0.8474, 0.2895, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 29], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n p = optparse.OptionParser()\n p.add_option('--sphere', action='store_true', dest='sphere',\n help='sample a sphere and publish the point cloud')\n p.add_option('--plot', action='store_true', dest='plot',\n help='plot the result')\n p.add_option('-f', action='store', type='string',dest='fname',\n default=None, help='pkl file with the normals.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99600:Assign_L135_C4", "label": "p = OptionParser()", "type": "assigned_variable", "loc": [135, 135], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99600:If_L134_C0", "vector": [14, 1, 0.7105, 0.0053, 1, 0.75, 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_99600:Expr_L136_C4", "label": "add_option()", "type": "expression", "loc": [136, 137], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99600:If_L134_C0", "vector": [8, 1, 0.7184, 0.0105, 1, 0.75, 0.0909, 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('--sphere', action='store_true', dest='sphere',\n help='sample a sphere and publish the point cloud')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99600:Expr_L138_C4", "label": "add_option()", "type": "expression", "loc": [138, 139], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99600:If_L134_C0", "vector": [8, 1, 0.7289, 0.0105, 1, 0.75, 0.1818, 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('--plot', action='store_true', dest='plot',\n help='plot the result')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99600:Expr_L140_C4", "label": "add_option()", "type": "expression", "loc": [140, 141], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99600:If_L134_C0", "vector": [8, 1, 0.7395, 0.0105, 1, 0.75, 0.2727, 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 default=None, help='pkl file with the normals.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99600:Expr_L142_C4", "label": "add_option()", "type": "expression", "loc": [142, 143], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99600:If_L134_C0", "vector": [8, 1, 0.75, 0.0105, 1, 0.75, 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('--pc', action='store', type='string',dest='pc_fname',\n default=None, help='pkl file with 3xN numpy matrix (numpy point cloud).')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99600:Assign_L145_C4", "label": "opt, args = parse_args()", "type": "assigned_variable", "loc": [145, 145], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99600:If_L134_C0", "vector": [14, 1, 0.7632, 0.0053, 1, 0.75, 0.4545, 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_99600:Assign_L146_C4", "label": "sphere_flag =", "type": "assigned_variable", "loc": [146, 146], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99600:If_L134_C0", "vector": [14, 1, 0.7684, 0.0053, 1, 0.75, 0.5455, 580, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "sphere_flag", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " sphere_flag = opt.sphere"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99600:Assign_L147_C4", "label": "plot_flag =", "type": "assigned_variable", "loc": [147, 147], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99600:If_L134_C0", "vector": [14, 1, 0.7737, 0.0053, 1, 0.75, 0.6364, 964, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "plot_flag", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " plot_flag = opt.plot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99600:Assign_L148_C4", "label": "fname =", "type": "assigned_variable", "loc": [148, 148], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99600:If_L134_C0", "vector": [14, 1, 0.7789, 0.0053, 1, 0.75, 0.7273, 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_99600:Assign_L149_C4", "label": "pc_fname =", "type": "assigned_variable", "loc": [149, 149], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99600:If_L134_C0", "vector": [14, 1, 0.7842, 0.0053, 1, 0.75, 0.8182, 521, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pc_fname", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pc_fname = opt.pc_fname"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99600:If_L152_C4", "label": "if", "type": "if", "loc": [152, 178], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99600:If_L134_C0", "vector": [4, 1, 0.8684, 0.1421, 1, 0.75, 0.9091, 0, 0, 0, 0, 0, 0, 0, 18], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if sphere_flag or pc_fname!=None:\n rospy.init_node('point_cloud_tester', anonymous=True)\n pub = rospy.Publisher(\"tilt_laser_cloud\", PointCloud)\n rospy.Subscriber(\"cloud_normals\", PointCloud, normals_cb)\n rospy.Subscriber(\"cloud_downsampled\", PointCloud, downsample_cb)\n\n time.sleep(1)\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99600:Expr_L153_C8", "label": "init_node()", "type": "expression", "loc": [153, 153], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99600:If_L152_C4", "vector": [8, 2, 0.8053, 0.0053, 2, 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('point_cloud_tester', anonymous=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99600:Assign_L154_C8", "label": "pub = Publisher()", "type": "assigned_variable", "loc": [154, 154], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99600:If_L152_C4", "vector": [14, 2, 0.8105, 0.0053, 2, 0.63, 0.125, 41, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " pub = rospy.Publisher(\"tilt_laser_cloud\", PointCloud)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99600:Expr_L155_C8", "label": "Subscriber()", "type": "expression", "loc": [155, 155], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99600:If_L152_C4", "vector": [8, 2, 0.8158, 0.0053, 2, 0.63, 0.25, 455, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "Subscriber", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " rospy.Subscriber(\"cloud_normals\", PointCloud, normals_cb)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99600:Expr_L156_C8", "label": "Subscriber()", "type": "expression", "loc": [156, 156], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99600:If_L152_C4", "vector": [8, 2, 0.8211, 0.0053, 2, 0.63, 0.375, 455, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "Subscriber", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " rospy.Subscriber(\"cloud_downsampled\", PointCloud, downsample_cb)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99600:Expr_L158_C8", "label": "sleep()", "type": "expression", "loc": [158, 158], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99600:If_L152_C4", "vector": [8, 2, 0.8316, 0.0053, 2, 0.63, 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(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99600:If_L160_C8", "label": "if", "type": "if", "loc": [160, 161], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99600:If_L152_C4", "vector": [4, 2, 0.8447, 0.0105, 2, 0.63, 0.625, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if sphere_flag:\n pc = generate_sphere()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99600:Assign_L161_C12", "label": "pc = generate_sphere()", "type": "assigned_variable", "loc": [161, 161], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99600:If_L160_C8", "vector": [14, 3, 0.8474, 0.0053, 3, 0.3, 0.0, 876, 3, 0, 0, 0, 549, 10, 1], "semantic": {"name": "pc", "arg_names": [], "import_names": [], "rhs_call_name": "generate_sphere", "annotation": ""}, "snippet": " pc = generate_sphere()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99600:If_L163_C8", "label": "if", "type": "if", "loc": [163, 174], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99600:If_L152_C4", "vector": [4, 2, 0.8868, 0.0632, 2, 0.63, 0.75, 0, 0, 0, 0, 0, 0, 0, 10], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if pc_fname != None:\n pts = ut.load_pickle(pc_fname)\n print('before np_points_to_ros')\n t0 = time.time()\n pc = pcu.np_points_to_ros(pts)\n t1 = time.time()\n print('time to go from numpy to ros:', t1-t0)\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99600:Assign_L164_C12", "label": "pts = load_pickle()", "type": "assigned_variable", "loc": [164, 164], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99600:If_L163_C8", "vector": [14, 3, 0.8632, 0.0053, 3, 0.08, 0.0, 195, 3, 1, 0, 0, 65, 10, 1], "semantic": {"name": "pts", "arg_names": [], "import_names": [], "rhs_call_name": "load_pickle", "annotation": ""}, "snippet": " pts = ut.load_pickle(pc_fname)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99600:Expr_L165_C12", "label": "print()", "type": "expression", "loc": [165, 165], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99600:If_L163_C8", "vector": [8, 3, 0.8684, 0.0053, 3, 0.08, 0.1111, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('before np_points_to_ros')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99600:Assign_L166_C12", "label": "t0 = time()", "type": "assigned_variable", "loc": [166, 166], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99600:If_L163_C8", "vector": [14, 3, 0.8737, 0.0053, 3, 0.08, 0.2222, 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_99600:Assign_L167_C12", "label": "pc = np_points_to_ros()", "type": "assigned_variable", "loc": [167, 167], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99600:If_L163_C8", "vector": [14, 3, 0.8789, 0.0053, 3, 0.08, 0.3333, 876, 3, 1, 0, 0, 955, 10, 1], "semantic": {"name": "pc", "arg_names": [], "import_names": [], "rhs_call_name": "np_points_to_ros", "annotation": ""}, "snippet": " pc = pcu.np_points_to_ros(pts)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99600:Assign_L168_C12", "label": "t1 = time()", "type": "assigned_variable", "loc": [168, 168], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99600:If_L163_C8", "vector": [14, 3, 0.8842, 0.0053, 3, 0.08, 0.4444, 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_99600:Expr_L169_C12", "label": "print()", "type": "expression", "loc": [169, 169], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99600:If_L163_C8", "vector": [8, 3, 0.8895, 0.0053, 3, 0.08, 0.5556, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('time to go from numpy to ros:', t1-t0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99600:Assign_L171_C12", "label": "t0 = time()", "type": "assigned_variable", "loc": [171, 171], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99600:If_L163_C8", "vector": [14, 3, 0.9, 0.0053, 3, 0.08, 0.6667, 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_99600:Expr_L172_C12", "label": "ros_pointcloud_to_np()", "type": "expression", "loc": [172, 172], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99600:If_L163_C8", "vector": [8, 3, 0.9053, 0.0053, 3, 0.08, 0.7778, 928, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "ros_pointcloud_to_np", "arg_names": [], "import_names": [], "rhs_call_name": "ros_pointcloud_to_np", "annotation": ""}, "snippet": " pcu.ros_pointcloud_to_np(pc)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99600:Assign_L173_C12", "label": "t1 = time()", "type": "assigned_variable", "loc": [173, 173], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99600:If_L163_C8", "vector": [14, 3, 0.9105, 0.0053, 3, 0.08, 0.8889, 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_99600:Expr_L174_C12", "label": "print()", "type": "expression", "loc": [174, 174], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99600:If_L163_C8", "vector": [8, 3, 0.9158, 0.0053, 3, 0.08, 1.0, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('time to go from ros to numpy:', t1-t0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99600:Expr_L177_C8", "label": "publish()", "type": "expression", "loc": [177, 177], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99600:If_L152_C4", "vector": [8, 2, 0.9316, 0.0053, 2, 0.63, 0.875, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " pub.publish(pc)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99600:Expr_L178_C8", "label": "spin()", "type": "expression", "loc": [178, 178], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99600:If_L152_C4", "vector": [8, 2, 0.9368, 0.0053, 2, 0.63, 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_99600:If_L181_C4", "label": "if", "type": "if", "loc": [181, 188], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99600:If_L134_C0", "vector": [4, 1, 0.9711, 0.0421, 1, 0.75, 1.0, 0, 2, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if plot_flag:\n if fname == None:\n print('Please give a pkl file for plotting (-f option)')\n print('Exiting...')\n sys.exit()\n\n d = ut.load_pickle(fname)\n plot_normals(d['pts'],d['normals'],d['curvature'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99600:If_L182_C8", "label": "if", "type": "if", "loc": [182, 185], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99600:If_L181_C4", "vector": [4, 2, 0.9658, 0.0211, 2, 0.6, 0.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if fname == None:\n print('Please give a pkl file for plotting (-f option)')\n print('Exiting...')\n sys.exit()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99600:Expr_L183_C12", "label": "print()", "type": "expression", "loc": [183, 183], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99600:If_L182_C8", "vector": [8, 3, 0.9632, 0.0053, 3, 0.29, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Please give a pkl file for plotting (-f option)')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99600:Expr_L184_C12", "label": "print()", "type": "expression", "loc": [184, 184], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99600:If_L182_C8", "vector": [8, 3, 0.9684, 0.0053, 3, 0.29, 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_99600:Expr_L185_C12", "label": "exit()", "type": "expression", "loc": [185, 185], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99600:If_L182_C8", "vector": [8, 3, 0.9737, 0.0053, 3, 0.29, 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_99600:Assign_L187_C8", "label": "d = load_pickle()", "type": "assigned_variable", "loc": [187, 187], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99600:If_L181_C4", "vector": [14, 2, 0.9842, 0.0053, 2, 0.6, 0.5, 355, 3, 1, 0, 0, 65, 10, 1], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "load_pickle", "annotation": ""}, "snippet": " d = ut.load_pickle(fname)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99600:Expr_L188_C8", "label": "plot_normals()", "type": "expression", "loc": [188, 188], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99600:If_L181_C4", "vector": [8, 2, 0.9895, 0.0053, 2, 0.6, 1.0, 568, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "plot_normals", "arg_names": [], "import_names": [], "rhs_call_name": "plot_normals", "annotation": ""}, "snippet": " plot_normals(d['pts'],d['normals'],d['curvature'])"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99600:FunctionDef_L51_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99600:Assign_L52_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99600:FunctionDef_L51_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99600:Assign_L53_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99600:FunctionDef_L51_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99600:Assign_L54_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99600:FunctionDef_L51_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99600:Return_L55_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99600:FunctionDef_L57_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99600:Assign_L58_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99600:FunctionDef_L57_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99600:Assign_L59_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99600:FunctionDef_L57_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99600:Assign_L60_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99600:FunctionDef_L57_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99600:Assign_L61_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99600:FunctionDef_L57_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99600:Assign_L63_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99600:FunctionDef_L57_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99600:Assign_L65_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99600:FunctionDef_L57_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99600:Return_L66_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99600:FunctionDef_L68_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99600:Assign_L69_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99600:FunctionDef_L68_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99600:Assign_L70_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99600:FunctionDef_L68_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99600:Assign_L71_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99600:FunctionDef_L68_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99600:Expr_L72_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99600:FunctionDef_L68_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99600:Expr_L73_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99600:FunctionDef_L75_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99600:Assign_L77_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99600:FunctionDef_L75_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99600:Assign_L78_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99600:FunctionDef_L75_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99600:Assign_L79_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99600:FunctionDef_L75_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99600:Assign_L81_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99600:FunctionDef_L75_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99600:Assign_L82_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99600:FunctionDef_L75_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99600:Assign_L83_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99600:FunctionDef_L75_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99600:If_L85_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99600:If_L85_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99600:Expr_L87_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99600:If_L85_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99600:Expr_L88_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99600:If_L85_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99600:Expr_L90_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99600:FunctionDef_L75_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99600:Expr_L91_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99600:FunctionDef_L75_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99600:Expr_L93_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99600:FunctionDef_L95_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99600:Expr_L96_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99600:FunctionDef_L95_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99600:Assign_L97_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99600:FunctionDef_L95_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99600:Assign_L98_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99600:FunctionDef_L95_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99600:Assign_L99_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99600:FunctionDef_L95_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99600:Assign_L100_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99600:FunctionDef_L95_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99600:Expr_L101_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99600:FunctionDef_L95_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99600:Expr_L102_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99600:FunctionDef_L104_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99600:Expr_L105_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99600:FunctionDef_L104_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99600:Assign_L106_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99600:FunctionDef_L104_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99600:Assign_L107_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99600:FunctionDef_L104_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99600:Assign_L108_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99600:FunctionDef_L104_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99600:Assign_L109_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99600:FunctionDef_L104_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99600:Expr_L110_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99600:FunctionDef_L104_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99600:Assign_L111_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99600:FunctionDef_L104_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99600:If_L113_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99600:If_L113_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99600:Expr_L114_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99600:If_L113_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99600:Expr_L115_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99600:If_L113_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99600:Expr_L116_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99600:If_L113_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99600:Expr_L117_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99600:If_L113_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99600:Expr_L118_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99600:FunctionDef_L104_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99600:Assign_L120_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99600:FunctionDef_L104_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99600:For_L121_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99600:For_L121_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99600:Expr_L122_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99600:FunctionDef_L104_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99600:Assign_L124_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99600:FunctionDef_L104_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99600:Assign_L125_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99600:FunctionDef_L104_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99600:Expr_L127_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99600:FunctionDef_L104_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99600:Expr_L128_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99600:FunctionDef_L104_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99600:Expr_L129_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99600:If_L134_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99600:Assign_L135_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99600:If_L134_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99600:Expr_L136_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99600:If_L134_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99600:Expr_L138_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99600:If_L134_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99600:Expr_L140_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99600:If_L134_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99600:Expr_L142_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99600:If_L134_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99600:Assign_L145_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99600:If_L134_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99600:Assign_L146_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99600:If_L134_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99600:Assign_L147_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99600:If_L134_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99600:Assign_L148_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99600:If_L134_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99600:Assign_L149_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99600:If_L134_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99600:If_L152_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99600:If_L152_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99600:Expr_L153_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99600:If_L152_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99600:Assign_L154_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99600:If_L152_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99600:Expr_L155_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99600:If_L152_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99600:Expr_L156_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99600:If_L152_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99600:Expr_L158_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99600:If_L152_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99600:If_L160_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99600:If_L160_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99600:Assign_L161_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99600:If_L152_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99600:If_L163_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99600:If_L163_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99600:Assign_L164_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99600:If_L163_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99600:Expr_L165_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99600:If_L163_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99600:Assign_L166_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99600:If_L163_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99600:Assign_L167_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99600:If_L163_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99600:Assign_L168_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99600:If_L163_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99600:Expr_L169_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99600:If_L163_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99600:Assign_L171_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99600:If_L163_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99600:Expr_L172_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99600:If_L163_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99600:Assign_L173_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99600:If_L163_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99600:Expr_L174_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99600:If_L152_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99600:Expr_L177_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99600:If_L152_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99600:Expr_L178_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99600:If_L134_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99600:If_L181_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99600:If_L181_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99600:If_L182_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99600:If_L182_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99600:Expr_L183_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99600:If_L182_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99600:Expr_L184_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99600:If_L182_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99600:Expr_L185_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99600:If_L181_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99600:Assign_L187_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99600:If_L181_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99600:Expr_L188_C8"}]
# # Copyright (c) 2009, Georgia Tech Research Corporation # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # * Neither the name of the Georgia Tech Research Corporation nor the # names of its contributors may be used to endorse or promote products # derived from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY GEORGIA TECH RESEARCH CORPORATION ''AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL GEORGIA TECH BE LIABLE FOR ANY DIRECT, INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # \author Advait Jain (Healthcare Robotics Lab, Georgia Tech.) import sys, optparse, os import time import math, numpy as np import scipy.ndimage as ni import copy import hrl_lib.util as ut, hrl_lib.transforms as tr ## subtract occupancy grids. og1 = og1-og2 # # @param og1 - occupancy_grid_3d object. # @param og2 - occupancy_grid_3d object. # #will position og2 at an appropriate location within og1 (hopefully) #will copy points in og2 but not in og1 into og1 # # points corresponding to the gird cells whose occupancy drops to # zero will still be in grid_points_list #UNTESTED: # * subtracting grids of different sizes. # * how the rotation_z of the occupancy grid will affect things. def subtract(og1,og2): if np.all(og1.resolution==og2.resolution) == False: print 'occupancy_grid_3d.subtract: The resolution of the two grids is not the same.' print 'res1, res2:', og1.resolution.A1.tolist(), og2.resolution.A1.tolist() print 'Exiting...' sys.exit() sub_tlb = og2.tlb sub_brf = og2.brf sub_tlb_idx = np.round((sub_tlb-og1.brf)/og1.resolution) sub_brf_idx = np.round((sub_brf-og1.brf)/og1.resolution) x_s,y_s,z_s = int(sub_brf_idx[0,0]),int(sub_brf_idx[1,0]),int(sub_brf_idx[2,0]) x_e,y_e,z_e = int(sub_tlb_idx[0,0]),int(sub_tlb_idx[1,0]),int(sub_tlb_idx[2,0]) x_e = min(x_e+1,og1.grid_shape[0,0]) y_e = min(y_e+1,og1.grid_shape[1,0]) z_e = min(z_e+1,og1.grid_shape[2,0]) sub_grid = og1.grid[x_s:x_e,y_s:y_e,z_s:z_e] if np.any(og1.grid_shape!=og2.grid_shape): print '#############################################################################' print 'WARNING: occupancy_grid_3d.subtract has not been tested for grids of different sizes.' print '#############################################################################' sub_grid = sub_grid-og2.grid sub_grid = np.abs(sub_grid) # for now. og1.grid[x_s:x_e,y_s:y_e,z_s:z_e] = sub_grid idxs = np.where(sub_grid>=1) shp = og2.grid_shape list_idxs = (idxs[0]+idxs[1]*shp[0,0]+idxs[2]*shp[0,0]*shp[1,0]).tolist() og1_list_idxs = (idxs[0]+x_s+(idxs[1]+y_s)*shp[0,0]+(idxs[2]+z_s)*shp[0,0]*shp[1,0]).tolist() og1_list_len = len(og1.grid_points_list) for og1_pts_idxs,pts_idxs in zip(og1_list_idxs,list_idxs): if og1_pts_idxs<og1_list_len: og1.grid_points_list[og1_pts_idxs] += og2.grid_points_list[pts_idxs] ## class which implements the occupancy grid class occupancy_grid_3d(): ## # @param brf - 3x1 matrix. Bottom Right Front. # @param tlb - 3x1 matrix (coord of center of the top left back cell) # @param resolution - 3x1 matrix. size of each cell (in meters) along # the different directions. def __init__(self, brf, tlb, resolution, rotation_z=math.radians(0.)): #print np.round((tlb-brf)/resolution).astype('int')+1 self.grid = np.zeros(np.round((tlb-brf)/resolution).astype('int')+1,dtype='int') self.tlb = tlb self.brf = brf self.grid_shape = np.matrix(self.grid.shape).T self.resolution = resolution n_cells = self.grid.shape[0]*self.grid.shape[1]*self.grid.shape[2] self.grid_points_list = [[] for i in range(n_cells)] self.rotation_z = rotation_z ## returns list of 8 tuples of 3x1 points which form the edges of the grid. # Useful for displaying the extents of the volume of interest (VOI). # @return list of 8 tuples of 3x1 points which form the edges of the grid. def grid_lines(self, rotation_angle=0.): grid_size = np.multiply(self.grid_shape,self.resolution) rot_mat = tr.rotZ(rotation_angle) p5 = self.tlb p6 = p5+np.matrix([0.,-grid_size[1,0],0.]).T p8 = p5+np.matrix([0.,0.,-grid_size[2,0]]).T p7 = p8+np.matrix([0.,-grid_size[1,0],0.]).T p3 = self.brf p4 = p3+np.matrix([0.,grid_size[1,0],0.]).T p2 = p3+np.matrix([0.,0.,grid_size[2,0]]).T p1 = p2+np.matrix([0.,grid_size[1,0],0.]).T p1 = rot_mat*p1 p2 = rot_mat*p2 p3 = rot_mat*p3 p4 = rot_mat*p4 p5 = rot_mat*p5 p6 = rot_mat*p6 p7 = rot_mat*p7 p8 = rot_mat*p8 l = [(p1,p2),(p1,p4),(p2,p3),(p3,p4),(p5,p6),(p6,p7),(p7,p8),(p8,p5),(p1,p5),(p2,p6),(p4,p8),(p3,p7)] #l = [(p5,p6),(p5,p3),(p1,p2)] return l ## fill the occupancy grid. # @param pts - 3xN matrix of points. # @param ignore_z - not use the z coord of the points. grid will be like a 2D grid. # #each cell of the grid gets filled the number of points that fall in the cell. def fill_grid(self,pts,ignore_z=False): if ignore_z: idx = np.where(np.min(np.multiply(pts[0:2,:]>self.brf[0:2,:], pts[0:2,:]<self.tlb[0:2,:]),0))[1] else: idx = np.where(np.min(np.multiply(pts[0:3,:]>self.brf,pts[0:3,:]<self.tlb),0))[1] if idx.shape[1] == 0: print 'aha!' return pts = pts[:,idx.A1.tolist()] # Find coordinates p_all = np.round((pts[0:3,:]-self.brf)/self.resolution) # Rotate points pts[0:3,:] = tr.Rz(self.rotation_z).T*pts[0:3,:] for i,p in enumerate(p_all.astype('int').T): if ignore_z: p[0,2] = 0 if np.any(p<0) or np.any(p>=self.grid_shape.T): continue tup = tuple(p.A1) self.grid_points_list[ tup[0] + self.grid_shape[0,0] * tup[1] + self.grid_shape[0,0] * self.grid_shape[1,0] * tup[2]].append(pts[:,i]) self.grid[tuple(p.A1)] += 1 def to_binary(self,thresh=1): ''' all cells with occupancy>=thresh set to 1, others set to 0. ''' filled = (self.grid>=thresh) self.grid[np.where(filled==True)] = 1 self.grid[np.where(filled==False)] = 0 def argmax_z(self,index_min=-np.Inf,index_max=np.Inf,search_up=False,search_down=False): ''' searches in the z direction for maximum number of cells with occupancy==1 call this function after calling to_binary() returns index. ''' index_min = int(max(index_min,0)) index_max = int(min(index_max,self.grid_shape[2,0]-1)) z_count_mat = [] #for i in xrange(self.grid_shape[2,0]): for i in xrange(index_min,index_max+1): z_count_mat.append(np.where(self.grid[:,:,i]==1)[0].shape[0]) if z_count_mat == []: return None z_count_mat = np.matrix(z_count_mat).T max_z = np.argmax(z_count_mat) max_count = z_count_mat[max_z,0] max_z += index_min print '#### max_count:', max_count if search_up: max_z_temp = max_z for i in range(1,5): #if (z_count_mat[max_z+i,0]*3.0)>max_count: #A #if (z_count_mat[max_z+i,0]*8.0)>max_count: #B if (max_z+i)>index_max: break if (z_count_mat[max_z+i-index_min,0]*5.0)>max_count: #B' max_z_temp = max_z+i max_z = max_z_temp if search_down: max_z_temp = max_z for i in range(1,5): if (max_z-i)<index_min: break if (max_z-i)>index_max: continue if (z_count_mat[max_z-i-index_min,0]*5.0)>max_count: max_z_temp = max_z-i max_z = max_z_temp return max_z,max_count def find_plane_indices(self,hmin=-np.Inf,hmax=np.Inf,assume_plane=False): ''' assume_plane - always return something. returns list of indices (z) corrresponding to horizontal plane points. returns [] if there is no plane ''' index_min = int(max(round((hmin-self.brf[2,0])/self.resolution[2,0]),0)) index_max = int(min(round((hmax-self.brf[2,0])/self.resolution[2,0]),self.grid_shape[2,0]-1)) z_plane,max_count = self.argmax_z(index_min,index_max,search_up=True) if z_plane == None: print 'oink oink.' return [] #---------- A # extra_remove_meters = 0.01 # n_more_to_remove = int(round(extra_remove_meters/self.resolution[2,0])) # l = range(max(z_plane-n_more_to_remove-1,0), # min(z_plane+n_more_to_remove+1,self.grid_shape[2,0]-1)) #---------- B extra_remove_meters = 0.005 n_more_to_remove = int(round(extra_remove_meters/self.resolution[2,0])) l = range(max(z_plane-10,0), min(z_plane+n_more_to_remove+1,self.grid_shape[2,0]-1)) # figure out whether this is indeed a plane. if assume_plane == False: n_more = int(round(0.1/self.resolution[2,0])) l_confirm = l+ range(max(l),min(z_plane+n_more+1,self.grid_shape[2,0]-1)) grid_2d = np.max(self.grid[:,:,l],2) n_plane_cells = grid_2d.sum() grid_2d = ni.binary_fill_holes(grid_2d) # I want 4-connectivity while filling holes. n_plane_cells = grid_2d.sum() min_plane_pts_threshold = (self.grid_shape[0,0]*self.grid_shape[1,0])/4 print '###n_plane_cells:', n_plane_cells print 'min_plane_pts_threshold:', min_plane_pts_threshold print 'find_plane_indices grid shape:',self.grid_shape.T if n_plane_cells < min_plane_pts_threshold: print 'occupancy_grid_3d.find_plane_indices: There is no plane.' print 'n_plane_cells:', n_plane_cells print 'min_plane_pts_threshold:', min_plane_pts_threshold l = [] return l ## get centroids of all the occupied cells as a 3xN np matrix # @param occupancy_threshold - number of points in a cell for it to be "occupied" # @return 3xN matrix of 3d coord of the cells which have occupancy >= occupancy_threshold def grid_to_centroids(self,occupancy_threshold=1): p = np.matrix(np.row_stack(np.where(self.grid>=occupancy_threshold))).astype('float') p[0,:] = p[0,:]*self.resolution[0,0] p[1,:] = p[1,:]*self.resolution[1,0] p[2,:] = p[2,:]*self.resolution[2,0] p += self.brf return p def grid_to_points(self,array=None,occupancy_threshold=1): ''' array - if not None then this will be used instead of self.grid returns 3xN matrix of 3d coord of the cells which have occupancy >= occupancy_threshold ''' if array == None: array = self.grid idxs = np.where(array>=occupancy_threshold) list_idxs = (idxs[0]+idxs[1]*self.grid_shape[0,0]+idxs[2]*self.grid_shape[0,0]*self.grid_shape[1,0]).tolist() l = [] for pts_idxs in list_idxs: l += self.grid_points_list[pts_idxs] if l == []: p = np.matrix([]) else: p = np.column_stack(l) return p def labeled_array_to_points(self,array,label): ''' returns coordinates of centers of grid cells corresponding to label as a 3xN matrix. ''' idxs = np.where(array==label) list_idxs = (idxs[0]+idxs[1]*self.grid_shape[0,0]+idxs[2]*self.grid_shape[0,0]*self.grid_shape[1,0]).tolist() l = [] for pts_idxs in list_idxs: l += self.grid_points_list[pts_idxs] if l == []: p = np.matrix([]) else: p = np.column_stack(l) return p def remove_vertical_plane(self): ''' removes plane parallel to the YZ plane. changes grid. returns plane_indices, slice corresponding to the vertical plane. points behind the plane are lost for ever! ''' self.grid = self.grid.swapaxes(2,0) self.grid_shape = np.matrix(self.grid.shape).T # z_max_first,max_count = self.argmax_z(search_up=False) # z_max_second,max_count_second = self.argmax_z(index_min=z_max_first+int(round(0.03/self.resolution[0,0])) ,search_up=False) z_max_first,max_count = self.argmax_z(search_down=False) z_max_second,max_count_second = self.argmax_z(index_min=z_max_first+int(round(0.035/self.resolution[0,0])) ,search_down=False) z_max_first,max_count = self.argmax_z(search_down=False) #z_max = self.argmax_z(search_up=True) if (max_count_second*1./max_count) > 0.3: z_max = z_max_second else: z_max = z_max_first print 'z_max_first', z_max_first print 'z_max_second', z_max_second print 'z_max', z_max more = int(round(0.03/self.resolution[0,0])) plane_indices = range(max(0,z_max-more),min(z_max+more,self.grid_shape[2,0])) self.grid = self.grid.swapaxes(2,0) self.grid_shape = np.matrix(self.grid.shape).T ver_plane_slice = self.grid[plane_indices,:,:] self.grid[plane_indices,:,:] = 0 max_x = max(plane_indices) behind_indices = range(max_x,self.grid_shape[0,0]) self.grid[behind_indices,:,:] = 0 return plane_indices,ver_plane_slice def remove_horizontal_plane(self, remove_below=True,hmin=-np.Inf,hmax=np.Inf, extra_layers=0): ''' call after to_binary() removes points corresponding to the horizontal plane from the grid. remove_below - remove points below the plane also. hmin,hmax - min and max possible height of the plane. (meters) This function changes grid. extra_layers - number of layers above the plane to remove. Sometimes I want to be over zealous while removing plane points. e.g. max_fwd_without_collision it returns the slice which has been set to zero, in case you want to leave the grid unchanged. ''' l = self.find_plane_indices(hmin,hmax) if l == []: print 'occupancy_grid_3d.remove_horizontal_plane: No plane found.' return None,l add_num = min(10,self.grid_shape[2,0]-max(l)-1) max_l = max(l)+add_num l_edge = l+range(max(l),max_l+1) grid_2d = np.max(self.grid[:,:,l_edge],2) # grid_2d = ni.binary_dilation(grid_2d,iterations=1) # I want 4-connectivity while filling holes. grid_2d = ni.binary_fill_holes(grid_2d) # I want 4-connectivity while filling holes. connect_structure = np.empty((3,3),dtype='int') connect_structure[:,:] = 1 eroded_2d = ni.binary_erosion(grid_2d,connect_structure,iterations=2) grid_2d = grid_2d-eroded_2d idxs = np.where(grid_2d!=0) if max_l>max(l): for i in range(min(5,add_num)): self.grid[idxs[0],idxs[1],max(l)+i+1] = 0 if remove_below: l = range(0,min(l)+1)+l max_z = max(l) for i in range(extra_layers): l.append(max_z+i+1) l_edge = l+range(max(l),max_l+1) plane_and_below_pts = self.grid[:,:,l_edge] self.grid[:,:,l] = 0 # set occupancy to zero. return plane_and_below_pts,l_edge def segment_objects(self, twod=False): ''' segments out objects after removing the plane. call after calling to_binary. returns labelled_array,n_labels labelled_array - same dimen as occupancy grid, each object has a different label. ''' plane_and_below_pts,l = self.remove_horizontal_plane(extra_layers=0) if l == []: print 'occupancy_grid_3d.segment_objects: There is no plane.' return None,None if twod == False: labelled_arr,n_labels = self.find_objects() else: labelled_arr,n_labels = self.find_objects_2d() self.grid[:,:,l] = plane_and_below_pts return labelled_arr,n_labels def find_objects_2d(self): ''' projects all points into the xy plane and then performs segmentation by region growing. ''' connect_structure = np.empty((3,3),dtype='int') connect_structure[:,:] = 1 grid_2d = np.max(self.grid[:,:,:],2) # grid_2d = ni.binary_erosion(grid_2d) # grid_2d = ni.binary_erosion(grid_2d,connect_structure) labeled_arr,n_labels = ni.label(grid_2d,connect_structure) print 'found %d objects'%(n_labels) labeled_arr_3d = self.grid.swapaxes(2,0) labeled_arr_3d = labeled_arr_3d.swapaxes(1,2) print 'labeled_arr.shape:',labeled_arr.shape print 'labeled_arr_3d.shape:',labeled_arr_3d.shape labeled_arr_3d = labeled_arr_3d*labeled_arr labeled_arr_3d = labeled_arr_3d.swapaxes(2,0) labeled_arr_3d = labeled_arr_3d.swapaxes(1,0) labeled_arr = labeled_arr_3d # I still want to count cells in 3d (thin but tall objects.) if n_labels > 0: labels_list = range(1,n_labels+1) #count_objects = ni.sum(grid_2d,labeled_arr,labels_list) count_objects = ni.sum(self.grid,labeled_arr,labels_list) if n_labels == 1: count_objects = [count_objects] t0 = time.time() new_labels_list = [] for c,l in zip(count_objects,labels_list): if c > 3: new_labels_list.append(l) else: labeled_arr[np.where(labeled_arr == l)] = 0 # relabel stuff for nl,l in enumerate(new_labels_list): labeled_arr[np.where(labeled_arr == l)] = nl+1 n_labels = len(new_labels_list) t1 = time.time() print 'time:', t1-t0 print 'found %d objects'%(n_labels) # return labeled_arr,n_labels return labeled_arr_3d,n_labels def find_objects(self): ''' region growing kind of thing for segmentation. Useful if plane has been removed. ''' connect_structure = np.empty((3,3,3),dtype='int') grid = copy.copy(self.grid) connect_structure[:,:,:] = 0 connect_structure[1,1,:] = 1 iterations = int(round(0.005/self.resolution[2,0])) # iterations=5 #grid = ni.binary_closing(grid,connect_structure,iterations=iterations) connect_structure[:,:,:] = 1 labeled_arr,n_labels = ni.label(grid,connect_structure) print 'ho!' print 'found %d objects'%(n_labels) if n_labels == 0: return labeled_arr,n_labels labels_list = range(1,n_labels+1) count_objects = ni.sum(grid,labeled_arr,labels_list) if n_labels == 1: count_objects = [count_objects] # t0 = time.time() # remove_labels = np.where(np.matrix(count_objects) <= 5)[1].A1.tolist() # for r in remove_labels: # labeled_arr[np.where(labeled_arr == r)] = 0 # t1 = time.time() # labeled_arr,n_labels = ni.label(labeled_arr,connect_structure) # print 'time:', t1-t0 t0 = time.time() new_labels_list = [] for c,l in zip(count_objects,labels_list): if c > 3: new_labels_list.append(l) else: labeled_arr[np.where(labeled_arr == l)] = 0 # relabel stuff for nl,l in enumerate(new_labels_list): labeled_arr[np.where(labeled_arr == l)] = nl+1 n_labels = len(new_labels_list) t1 = time.time() print 'time:', t1-t0 print 'found %d objects'%(n_labels) return labeled_arr,n_labels if __name__ == '__main__': import pygame_opengl_3d_display as po3d import hokuyo.pygame_utils as pu import processing_3d as p3d p = optparse.OptionParser() p.add_option('-f', action='store', type='string', dest='pkl_file_name', help='file.pkl File with the scan,pos dict.',default=None) p.add_option('-c', action='store', type='string', dest='pts_pkl', help='pkl file with 3D points',default=None) opt, args = p.parse_args() pts_pkl = opt.pts_pkl pkl_file_name = opt.pkl_file_name #-------------- simple test --------------- # gr = occupancy_grid_3d(np.matrix([0.,0.,0]).T, np.matrix([1.,1.,1]).T, # np.matrix([1,1,1]).T) # pts = np.matrix([[1.1,0,-0.2],[0,0,0],[0.7,0.7,0.3],[0.6,0.8,-0.2]]).T # gr.fill_grid(pts) ## print gr.grid resolution = np.matrix([0.01,0.01,0.01]).T gr = occupancy_grid_3d(np.matrix([0.45,-0.5,-1.0]).T, np.matrix([0.65,0.05,-0.2]).T, resolution) if pts_pkl != None: pts = ut.load_pickle(pts_pkl) elif pkl_file_name != None: dict = ut.load_pickle(pkl_file_name) pos_list = dict['pos_list'] scan_list = dict['scan_list'] min_angle = math.radians(-40) max_angle = math.radians(40) l1 = dict['l1'] l2 = dict['l2'] pts = p3d.generate_pointcloud(pos_list, scan_list, min_angle, max_angle, l1, l2) else: print 'specify a pkl file -c or -f' print 'Exiting...' sys.exit() print 'started filling the grid' t0 = time.time() gr.fill_grid(pts) t1 = time.time() print 'time to fill the grid:', t1-t0 #grid_pts = gr.grid_to_points() grid_pts = gr.grid_to_centroids() ## print grid_pts cloud = pu.CubeCloud(grid_pts,(0,0,0),(resolution/2).A1.tolist()) pc = pu.PointCloud(pts,(100,100,100)) lc = pu.LineCloud(gr.grid_lines(),(100,100,0)) po3d.run([cloud,pc,lc])
ajibawa-2023/Python-Code-Large/train/row_99601
334
613
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Import_L30_C0", "label": "sys import sys, optparse, os", "type": "import", "loc": [30, 30], "level": 0, "parent": null, "vector": [1, 0, 0.0489, 0.0016, 0, 0.66, 0.0, 509, 0, 3, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys", "optparse", "os"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys, optparse, os"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Import_L31_C0", "label": "time import time", "type": "import", "loc": [31, 31], "level": 0, "parent": null, "vector": [1, 0, 0.0506, 0.0016, 0, 0.66, 0.125, 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_99601:Import_L33_C0", "label": "math import math, np", "type": "import", "loc": [33, 33], "level": 0, "parent": null, "vector": [1, 0, 0.0538, 0.0016, 0, 0.66, 0.25, 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_99601:Import_L34_C0", "label": "scipy.ndimage import ni", "type": "import", "loc": [34, 34], "level": 0, "parent": null, "vector": [1, 0, 0.0555, 0.0016, 0, 0.66, 0.375, 348, 0, 1, 0, 0, 348, 0, 0], "semantic": {"name": "scipy.ndimage", "arg_names": [], "import_names": ["ni"], "rhs_call_name": "", "annotation": ""}, "snippet": "import scipy.ndimage as ni"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Import_L35_C0", "label": "copy import copy", "type": "import", "loc": [35, 35], "level": 0, "parent": null, "vector": [1, 0, 0.0571, 0.0016, 0, 0.66, 0.5, 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_99601:Import_L37_C0", "label": "hrl_lib.util import ut, tr", "type": "import", "loc": [37, 37], "level": 0, "parent": null, "vector": [1, 0, 0.0604, 0.0016, 0, 0.66, 0.625, 775, 0, 2, 0, 0, 775, 0, 0], "semantic": {"name": "hrl_lib.util", "arg_names": [], "import_names": ["ut", "tr"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.util as ut, hrl_lib.transforms as tr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L53_C0", "label": "subtract", "type": "function", "loc": [53, 90], "level": 0, "parent": null, "vector": [2, 0, 0.1166, 0.062, 0, 0.66, 0.75, 495, 0, 2, 0, 0, 0, 0, 28], "semantic": {"name": "subtract", "arg_names": ["og1", "og2"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def subtract(og1,og2):\n\n if np.all(og1.resolution==og2.resolution) == False:\n print('occupancy_grid_3d.subtract: The resolution of the two grids is not the same.')\n print('res1, res2:', og1.resolution.A1.tolist(), og2.resolution.A1.tolist())\n print('Exiting...')\n sys.exit()\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L55_C4", "label": "if", "type": "if", "loc": [55, 59], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L53_C0", "vector": [4, 1, 0.093, 0.0082, 1, 0.02, 0.0, 0, 0, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if np.all(og1.resolution==og2.resolution) == False:\n print('occupancy_grid_3d.subtract: The resolution of the two grids is not the same.')\n print('res1, res2:', og1.resolution.A1.tolist(), og2.resolution.A1.tolist())\n print('Exiting...')\n sys.exit()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Expr_L56_C8", "label": "print()", "type": "expression", "loc": [56, 56], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L55_C4", "vector": [8, 2, 0.0914, 0.0016, 2, 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": " print('occupancy_grid_3d.subtract: The resolution of the two grids is not the same.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Expr_L57_C8", "label": "print()", "type": "expression", "loc": [57, 57], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L55_C4", "vector": [8, 2, 0.093, 0.0016, 2, 0.68, 0.3333, 535, 3, 3, 0, 0, 0, 0, 3], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('res1, res2:', og1.resolution.A1.tolist(), og2.resolution.A1.tolist())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Expr_L58_C8", "label": "print()", "type": "expression", "loc": [58, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L55_C4", "vector": [8, 2, 0.0946, 0.0016, 2, 0.68, 0.6667, 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_99601:Expr_L59_C8", "label": "exit()", "type": "expression", "loc": [59, 59], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L55_C4", "vector": [8, 2, 0.0962, 0.0016, 2, 0.68, 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_99601:Assign_L61_C4", "label": "sub_tlb =", "type": "assigned_variable", "loc": [61, 61], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L53_C0", "vector": [14, 1, 0.0995, 0.0016, 1, 0.02, 0.05, 443, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "sub_tlb", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " sub_tlb = og2.tlb"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L62_C4", "label": "sub_brf =", "type": "assigned_variable", "loc": [62, 62], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L53_C0", "vector": [14, 1, 0.1011, 0.0016, 1, 0.02, 0.1, 514, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "sub_brf", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " sub_brf = og2.brf"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L64_C4", "label": "sub_tlb_idx = round()", "type": "assigned_variable", "loc": [64, 64], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L53_C0", "vector": [14, 1, 0.1044, 0.0016, 1, 0.02, 0.15, 12, 3, 1, 0, 0, 19, 10, 1], "semantic": {"name": "sub_tlb_idx", "arg_names": [], "import_names": [], "rhs_call_name": "round", "annotation": ""}, "snippet": " sub_tlb_idx = np.round((sub_tlb-og1.brf)/og1.resolution)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L65_C4", "label": "sub_brf_idx = round()", "type": "assigned_variable", "loc": [65, 65], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L53_C0", "vector": [14, 1, 0.106, 0.0016, 1, 0.02, 0.2, 285, 3, 1, 0, 0, 19, 10, 1], "semantic": {"name": "sub_brf_idx", "arg_names": [], "import_names": [], "rhs_call_name": "round", "annotation": ""}, "snippet": " sub_brf_idx = np.round((sub_brf-og1.brf)/og1.resolution)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L67_C4", "label": "x_s, y_s, z_s =", "type": "assigned_variable", "loc": [67, 67], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L53_C0", "vector": [14, 1, 0.1093, 0.0016, 1, 0.02, 0.25, 672, 0, 0, 0, 0, 0, 8, 3], "semantic": {"name": "x_s, y_s, z_s", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " x_s,y_s,z_s = int(sub_brf_idx[0,0]),int(sub_brf_idx[1,0]),int(sub_brf_idx[2,0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L68_C4", "label": "x_e, y_e, z_e =", "type": "assigned_variable", "loc": [68, 68], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L53_C0", "vector": [14, 1, 0.1109, 0.0016, 1, 0.02, 0.3, 769, 0, 0, 0, 0, 0, 8, 3], "semantic": {"name": "x_e, y_e, z_e", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " x_e,y_e,z_e = int(sub_tlb_idx[0,0]),int(sub_tlb_idx[1,0]),int(sub_tlb_idx[2,0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L70_C4", "label": "x_e = min()", "type": "assigned_variable", "loc": [70, 70], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L53_C0", "vector": [14, 1, 0.1142, 0.0016, 1, 0.02, 0.35, 526, 3, 2, 0, 0, 867, 10, 1], "semantic": {"name": "x_e", "arg_names": [], "import_names": [], "rhs_call_name": "min", "annotation": ""}, "snippet": " x_e = min(x_e+1,og1.grid_shape[0,0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L71_C4", "label": "y_e = min()", "type": "assigned_variable", "loc": [71, 71], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L53_C0", "vector": [14, 1, 0.1158, 0.0016, 1, 0.02, 0.4, 768, 3, 2, 0, 0, 867, 10, 1], "semantic": {"name": "y_e", "arg_names": [], "import_names": [], "rhs_call_name": "min", "annotation": ""}, "snippet": " y_e = min(y_e+1,og1.grid_shape[1,0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L72_C4", "label": "z_e = min()", "type": "assigned_variable", "loc": [72, 72], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L53_C0", "vector": [14, 1, 0.1175, 0.0016, 1, 0.02, 0.45, 413, 3, 2, 0, 0, 867, 10, 1], "semantic": {"name": "z_e", "arg_names": [], "import_names": [], "rhs_call_name": "min", "annotation": ""}, "snippet": " z_e = min(z_e+1,og1.grid_shape[2,0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L73_C4", "label": "sub_grid =", "type": "assigned_variable", "loc": [73, 73], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L53_C0", "vector": [14, 1, 0.1191, 0.0016, 1, 0.02, 0.5, 668, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "sub_grid", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " sub_grid = og1.grid[x_s:x_e,y_s:y_e,z_s:z_e]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L75_C4", "label": "if", "type": "if", "loc": [75, 78], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L53_C0", "vector": [4, 1, 0.1248, 0.0065, 1, 0.02, 0.55, 0, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if np.any(og1.grid_shape!=og2.grid_shape):\n print('#############################################################################')\n print('WARNING: occupancy_grid_3d.subtract has not been tested for grids of different sizes.')\n print('#############################################################################')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Expr_L76_C8", "label": "print()", "type": "expression", "loc": [76, 76], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L75_C4", "vector": [8, 2, 0.124, 0.0016, 2, 0.73, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('#############################################################################')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Expr_L77_C8", "label": "print()", "type": "expression", "loc": [77, 77], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L75_C4", "vector": [8, 2, 0.1256, 0.0016, 2, 0.73, 0.5, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('WARNING: occupancy_grid_3d.subtract has not been tested for grids of different sizes.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Expr_L78_C8", "label": "print()", "type": "expression", "loc": [78, 78], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L75_C4", "vector": [8, 2, 0.1272, 0.0016, 2, 0.73, 1.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('#############################################################################')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L79_C4", "label": "sub_grid =", "type": "assigned_variable", "loc": [79, 79], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L53_C0", "vector": [14, 1, 0.1289, 0.0016, 1, 0.02, 0.6, 668, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "sub_grid", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " sub_grid = sub_grid-og2.grid"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L80_C4", "label": "sub_grid = abs()", "type": "assigned_variable", "loc": [80, 80], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L53_C0", "vector": [14, 1, 0.1305, 0.0016, 1, 0.02, 0.65, 668, 3, 1, 0, 0, 799, 10, 1], "semantic": {"name": "sub_grid", "arg_names": [], "import_names": [], "rhs_call_name": "abs", "annotation": ""}, "snippet": " sub_grid = np.abs(sub_grid) # for now."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L81_C4", "label": "assign", "type": "assigned_variable", "loc": [81, 81], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L53_C0", "vector": [14, 1, 0.1321, 0.0016, 1, 0.02, 0.7, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " og1.grid[x_s:x_e,y_s:y_e,z_s:z_e] = sub_grid"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L82_C4", "label": "idxs = where()", "type": "assigned_variable", "loc": [82, 82], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L53_C0", "vector": [14, 1, 0.1338, 0.0016, 1, 0.02, 0.75, 677, 3, 1, 0, 0, 169, 10, 1], "semantic": {"name": "idxs", "arg_names": [], "import_names": [], "rhs_call_name": "where", "annotation": ""}, "snippet": " idxs = np.where(sub_grid>=1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L83_C4", "label": "shp =", "type": "assigned_variable", "loc": [83, 83], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L53_C0", "vector": [14, 1, 0.1354, 0.0016, 1, 0.02, 0.8, 185, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "shp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " shp = og2.grid_shape"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L84_C4", "label": "list_idxs = tolist()", "type": "assigned_variable", "loc": [84, 84], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L53_C0", "vector": [14, 1, 0.137, 0.0016, 1, 0.02, 0.85, 227, 3, 0, 0, 0, 185, 10, 1], "semantic": {"name": "list_idxs", "arg_names": [], "import_names": [], "rhs_call_name": "tolist", "annotation": ""}, "snippet": " list_idxs = (idxs[0]+idxs[1]*shp[0,0]+idxs[2]*shp[0,0]*shp[1,0]).tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L86_C4", "label": "og1_list_idxs = tolist()", "type": "assigned_variable", "loc": [86, 86], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L53_C0", "vector": [14, 1, 0.1403, 0.0016, 1, 0.02, 0.9, 686, 3, 0, 0, 0, 185, 10, 1], "semantic": {"name": "og1_list_idxs", "arg_names": [], "import_names": [], "rhs_call_name": "tolist", "annotation": ""}, "snippet": " og1_list_idxs = (idxs[0]+x_s+(idxs[1]+y_s)*shp[0,0]+(idxs[2]+z_s)*shp[0,0]*shp[1,0]).tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L87_C4", "label": "og1_list_len = len()", "type": "assigned_variable", "loc": [87, 87], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L53_C0", "vector": [14, 1, 0.1419, 0.0016, 1, 0.02, 0.95, 97, 3, 1, 0, 0, 890, 10, 1], "semantic": {"name": "og1_list_len", "arg_names": [], "import_names": [], "rhs_call_name": "len", "annotation": ""}, "snippet": " og1_list_len = len(og1.grid_points_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:For_L88_C4", "label": "for og1_pts_idxs, pts_idxs", "type": "for", "loc": [88, 90], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L53_C0", "vector": [6, 1, 0.1452, 0.0049, 1, 0.02, 1.0, 18, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "og1_pts_idxs, pts_idxs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for og1_pts_idxs,pts_idxs in zip(og1_list_idxs,list_idxs):\n if og1_pts_idxs<og1_list_len:\n og1.grid_points_list[og1_pts_idxs] += og2.grid_points_list[pts_idxs]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L89_C8", "label": "if", "type": "if", "loc": [89, 90], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:For_L88_C4", "vector": [4, 2, 0.146, 0.0033, 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 og1_pts_idxs<og1_list_len:\n og1.grid_points_list[og1_pts_idxs] += og2.grid_points_list[pts_idxs]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:ClassDef_L93_C0", "label": "occupancy_grid_3d", "type": "class", "loc": [93, 545], "level": 0, "parent": null, "vector": [3, 0, 0.5204, 0.739, 0, 0.66, 0.875, 222, 0, 14, 0, 0, 0, 0, 99], "semantic": {"name": "occupancy_grid_3d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class occupancy_grid_3d():\n\n ##\n # @param brf - 3x1 matrix. Bottom Right Front.\n # @param tlb - 3x1 matrix (coord of center of the top left back cell)\n # @param resolution - 3x1 matrix. size of each cell (in meters) along\n # the different directions.\n def __init__(self, brf, tlb, resolution, rotation_z=math.radians(0.)):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L100_C4", "label": "__init__", "type": "function", "loc": [100, 111], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:ClassDef_L93_C0", "vector": [2, 1, 0.1721, 0.0196, 1, 0.74, 0.0, 555, 0, 5, 0, 0, 0, 0, 6], "semantic": {"name": "__init__", "arg_names": ["self", "brf", "tlb", "resolution", "rotation_z"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, brf, tlb, resolution, rotation_z=math.radians(0.)):\n #print np.round((tlb-brf)/resolution).astype('int')+1\n self.grid = np.zeros(np.round((tlb-brf)/resolution).astype('int')+1,dtype='int')\n\n self.tlb = tlb\n self.brf = brf\n self.grid_shape = np.matrix(self.grid.shape).T\n self.resolution = resolution"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L102_C8", "label": "self.grid = zeros()", "type": "assigned_variable", "loc": [102, 102], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L100_C4", "vector": [14, 2, 0.1664, 0.0016, 2, 0.3, 0.0, 16, 3, 2, 0, 0, 213, 10, 3], "semantic": {"name": "self.grid", "arg_names": [], "import_names": [], "rhs_call_name": "zeros", "annotation": ""}, "snippet": " self.grid = np.zeros(np.round((tlb-brf)/resolution).astype('int')+1,dtype='int')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L104_C8", "label": "self.tlb =", "type": "assigned_variable", "loc": [104, 104], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L100_C4", "vector": [14, 2, 0.1697, 0.0016, 2, 0.3, 0.1429, 478, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.tlb", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.tlb = tlb"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L105_C8", "label": "self.brf =", "type": "assigned_variable", "loc": [105, 105], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L100_C4", "vector": [14, 2, 0.1713, 0.0016, 2, 0.3, 0.2857, 962, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.brf", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.brf = brf"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L106_C8", "label": "self.grid_shape =", "type": "assigned_variable", "loc": [106, 106], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L100_C4", "vector": [14, 2, 0.1729, 0.0016, 2, 0.3, 0.4286, 573, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.grid_shape", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.grid_shape = np.matrix(self.grid.shape).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L107_C8", "label": "self.resolution =", "type": "assigned_variable", "loc": [107, 107], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L100_C4", "vector": [14, 2, 0.1746, 0.0016, 2, 0.3, 0.5714, 440, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.resolution", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.resolution = resolution"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L109_C8", "label": "n_cells =", "type": "assigned_variable", "loc": [109, 109], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L100_C4", "vector": [14, 2, 0.1778, 0.0016, 2, 0.3, 0.7143, 203, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "n_cells", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " n_cells = self.grid.shape[0]*self.grid.shape[1]*self.grid.shape[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L110_C8", "label": "self.grid_points_list =", "type": "assigned_variable", "loc": [110, 110], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L100_C4", "vector": [14, 2, 0.1794, 0.0016, 2, 0.3, 0.8571, 102, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.grid_points_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.grid_points_list = [[] for i in range(n_cells)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L111_C8", "label": "self.rotation_z =", "type": "assigned_variable", "loc": [111, 111], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L100_C4", "vector": [14, 2, 0.1811, 0.0016, 2, 0.3, 1.0, 878, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.rotation_z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.rotation_z = rotation_z"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L116_C4", "label": "grid_lines", "type": "function", "loc": [116, 140], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:ClassDef_L93_C0", "vector": [2, 1, 0.2088, 0.0408, 1, 0.74, 0.0769, 457, 0, 2, 1, 0, 0, 0, 8], "semantic": {"name": "grid_lines", "arg_names": ["self", "rotation_angle"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def grid_lines(self, rotation_angle=0.):\n grid_size = np.multiply(self.grid_shape,self.resolution)\n rot_mat = tr.rotZ(rotation_angle)\n p5 = self.tlb\n p6 = p5+np.matrix([0.,-grid_size[1,0],0.]).T\n p8 = p5+np.matrix([0.,0.,-grid_size[2,0]]).T\n p7 = p8+np.matrix([0.,-grid_size[1,0],0.]).T\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L117_C8", "label": "grid_size = multiply()", "type": "assigned_variable", "loc": [117, 117], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L116_C4", "vector": [14, 2, 0.1909, 0.0016, 2, 0.25, 0.0, 140, 3, 2, 0, 0, 960, 10, 1], "semantic": {"name": "grid_size", "arg_names": [], "import_names": [], "rhs_call_name": "multiply", "annotation": ""}, "snippet": " grid_size = np.multiply(self.grid_shape,self.resolution)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L118_C8", "label": "rot_mat = rotZ()", "type": "assigned_variable", "loc": [118, 118], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L116_C4", "vector": [14, 2, 0.1925, 0.0016, 2, 0.25, 0.0526, 968, 3, 1, 0, 0, 728, 10, 1], "semantic": {"name": "rot_mat", "arg_names": [], "import_names": [], "rhs_call_name": "rotZ", "annotation": ""}, "snippet": " rot_mat = tr.rotZ(rotation_angle)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L119_C8", "label": "p5 =", "type": "assigned_variable", "loc": [119, 119], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L116_C4", "vector": [14, 2, 0.1941, 0.0016, 2, 0.25, 0.1053, 735, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "p5", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p5 = self.tlb"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L120_C8", "label": "p6 =", "type": "assigned_variable", "loc": [120, 120], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L116_C4", "vector": [14, 2, 0.1958, 0.0016, 2, 0.25, 0.1579, 214, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "p6", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p6 = p5+np.matrix([0.,-grid_size[1,0],0.]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L121_C8", "label": "p8 =", "type": "assigned_variable", "loc": [121, 121], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L116_C4", "vector": [14, 2, 0.1974, 0.0016, 2, 0.25, 0.2105, 582, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "p8", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p8 = p5+np.matrix([0.,0.,-grid_size[2,0]]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L122_C8", "label": "p7 =", "type": "assigned_variable", "loc": [122, 122], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L116_C4", "vector": [14, 2, 0.199, 0.0016, 2, 0.25, 0.2632, 15, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "p7", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p7 = p8+np.matrix([0.,-grid_size[1,0],0.]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L124_C8", "label": "p3 =", "type": "assigned_variable", "loc": [124, 124], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L116_C4", "vector": [14, 2, 0.2023, 0.0016, 2, 0.25, 0.3158, 80, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "p3", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p3 = self.brf"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L125_C8", "label": "p4 =", "type": "assigned_variable", "loc": [125, 125], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L116_C4", "vector": [14, 2, 0.2039, 0.0016, 2, 0.25, 0.3684, 80, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "p4", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p4 = p3+np.matrix([0.,grid_size[1,0],0.]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L126_C8", "label": "p2 =", "type": "assigned_variable", "loc": [126, 126], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L116_C4", "vector": [14, 2, 0.2055, 0.0016, 2, 0.25, 0.4211, 843, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "p2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p2 = p3+np.matrix([0.,0.,grid_size[2,0]]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L127_C8", "label": "p1 =", "type": "assigned_variable", "loc": [127, 127], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L116_C4", "vector": [14, 2, 0.2072, 0.0016, 2, 0.25, 0.4737, 87, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "p1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p1 = p2+np.matrix([0.,grid_size[1,0],0.]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L129_C8", "label": "p1 =", "type": "assigned_variable", "loc": [129, 129], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L116_C4", "vector": [14, 2, 0.2104, 0.0016, 2, 0.25, 0.5263, 87, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "p1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p1 = rot_mat*p1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L130_C8", "label": "p2 =", "type": "assigned_variable", "loc": [130, 130], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L116_C4", "vector": [14, 2, 0.2121, 0.0016, 2, 0.25, 0.5789, 843, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "p2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p2 = rot_mat*p2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L131_C8", "label": "p3 =", "type": "assigned_variable", "loc": [131, 131], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L116_C4", "vector": [14, 2, 0.2137, 0.0016, 2, 0.25, 0.6316, 80, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "p3", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p3 = rot_mat*p3"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L132_C8", "label": "p4 =", "type": "assigned_variable", "loc": [132, 132], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L116_C4", "vector": [14, 2, 0.2153, 0.0016, 2, 0.25, 0.6842, 80, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "p4", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p4 = rot_mat*p4"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L133_C8", "label": "p5 =", "type": "assigned_variable", "loc": [133, 133], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L116_C4", "vector": [14, 2, 0.217, 0.0016, 2, 0.25, 0.7368, 735, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "p5", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p5 = rot_mat*p5"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L134_C8", "label": "p6 =", "type": "assigned_variable", "loc": [134, 134], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L116_C4", "vector": [14, 2, 0.2186, 0.0016, 2, 0.25, 0.7895, 214, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "p6", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p6 = rot_mat*p6"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L135_C8", "label": "p7 =", "type": "assigned_variable", "loc": [135, 135], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L116_C4", "vector": [14, 2, 0.2202, 0.0016, 2, 0.25, 0.8421, 15, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "p7", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p7 = rot_mat*p7"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L136_C8", "label": "p8 =", "type": "assigned_variable", "loc": [136, 136], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L116_C4", "vector": [14, 2, 0.2219, 0.0016, 2, 0.25, 0.8947, 582, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "p8", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p8 = rot_mat*p8"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L138_C8", "label": "l =", "type": "assigned_variable", "loc": [138, 138], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L116_C4", "vector": [14, 2, 0.2251, 0.0016, 2, 0.25, 0.9474, 810, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " l = [(p1,p2),(p1,p4),(p2,p3),(p3,p4),(p5,p6),(p6,p7),(p7,p8),(p8,p5),(p1,p5),(p2,p6),(p4,p8),(p3,p7)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Return_L140_C8", "label": "return", "type": "return", "loc": [140, 140], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L116_C4", "vector": [13, 2, 0.2284, 0.0016, 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 l"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L147_C4", "label": "fill_grid", "type": "function", "loc": [147, 177], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:ClassDef_L93_C0", "vector": [2, 1, 0.2643, 0.0506, 1, 0.74, 0.1538, 619, 0, 3, 0, 0, 0, 0, 17], "semantic": {"name": "fill_grid", "arg_names": ["self", "pts", "ignore_z"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def fill_grid(self,pts,ignore_z=False):\n if ignore_z:\n idx = np.where(np.min(np.multiply(pts[0:2,:]>self.brf[0:2,:],\n pts[0:2,:]<self.tlb[0:2,:]),0))[1]\n else:\n idx = np.where(np.min(np.multiply(pts[0:3,:]>self.brf,pts[0:3,:]<self.tlb),0))[1]\n\n if idx.shape[1] == 0:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L148_C8", "label": "if", "type": "if", "loc": [148, 152], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L147_C4", "vector": [4, 2, 0.2447, 0.0082, 2, 0.77, 0.0, 0, 2, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if ignore_z:\n idx = np.where(np.min(np.multiply(pts[0:2,:]>self.brf[0:2,:],\n pts[0:2,:]<self.tlb[0:2,:]),0))[1]\n else:\n idx = np.where(np.min(np.multiply(pts[0:3,:]>self.brf,pts[0:3,:]<self.tlb),0))[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L149_C12", "label": "idx =", "type": "assigned_variable", "loc": [149, 150], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L148_C8", "vector": [14, 3, 0.2439, 0.0033, 3, 0.05, 0.0, 187, 6, 0, 0, 0, 0, 0, 3], "semantic": {"name": "idx", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " idx = np.where(np.min(np.multiply(pts[0:2,:]>self.brf[0:2,:],\n pts[0:2,:]<self.tlb[0:2,:]),0))[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L152_C12", "label": "idx =", "type": "assigned_variable", "loc": [152, 152], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L148_C8", "vector": [14, 3, 0.248, 0.0016, 3, 0.05, 1.0, 187, 6, 0, 0, 0, 0, 0, 3], "semantic": {"name": "idx", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " idx = np.where(np.min(np.multiply(pts[0:3,:]>self.brf,pts[0:3,:]<self.tlb),0))[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L154_C8", "label": "if", "type": "if", "loc": [154, 156], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L147_C4", "vector": [4, 2, 0.2529, 0.0049, 2, 0.77, 0.2, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if idx.shape[1] == 0:\n print('aha!')\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Expr_L155_C12", "label": "print()", "type": "expression", "loc": [155, 155], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L154_C8", "vector": [8, 3, 0.2529, 0.0016, 3, 0.7, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('aha!')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Return_L156_C12", "label": "return", "type": "return", "loc": [156, 156], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L154_C8", "vector": [13, 3, 0.2545, 0.0016, 3, 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_99601:Assign_L157_C8", "label": "pts =", "type": "assigned_variable", "loc": [157, 157], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L147_C4", "vector": [14, 2, 0.2561, 0.0016, 2, 0.77, 0.4, 195, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "pts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pts = pts[:,idx.A1.tolist()]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L160_C8", "label": "p_all = round()", "type": "assigned_variable", "loc": [160, 160], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L147_C4", "vector": [14, 2, 0.261, 0.0016, 2, 0.77, 0.6, 45, 3, 1, 0, 0, 19, 10, 1], "semantic": {"name": "p_all", "arg_names": [], "import_names": [], "rhs_call_name": "round", "annotation": ""}, "snippet": " p_all = np.round((pts[0:3,:]-self.brf)/self.resolution)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L162_C8", "label": "assign", "type": "assigned_variable", "loc": [162, 162], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L147_C4", "vector": [14, 2, 0.2643, 0.0016, 2, 0.77, 0.8, 0, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pts[0:3,:] = tr.Rz(self.rotation_z).T*pts[0:3,:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:For_L164_C8", "label": "for i, p", "type": "for", "loc": [164, 177], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L147_C4", "vector": [6, 2, 0.2781, 0.0228, 2, 0.77, 1.0, 816, 3, 0, 0, 0, 0, 0, 7], "semantic": {"name": "i, p", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i,p in enumerate(p_all.astype('int').T):\n if ignore_z:\n p[0,2] = 0\n\n if np.any(p<0) or np.any(p>=self.grid_shape.T):\n continue\n\n tup = tuple(p.A1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L165_C12", "label": "if", "type": "if", "loc": [165, 166], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:For_L164_C8", "vector": [4, 3, 0.27, 0.0033, 3, 0.1, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if ignore_z:\n p[0,2] = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L166_C16", "label": "assign", "type": "assigned_variable", "loc": [166, 166], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L165_C12", "vector": [14, 4, 0.2708, 0.0016, 4, 0.35, 0.0, 0, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p[0,2] = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L168_C12", "label": "if", "type": "if", "loc": [168, 169], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:For_L164_C8", "vector": [4, 3, 0.2749, 0.0033, 3, 0.1, 0.3333, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if np.any(p<0) or np.any(p>=self.grid_shape.T):\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L171_C12", "label": "tup = tuple()", "type": "assigned_variable", "loc": [171, 171], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:For_L164_C8", "vector": [14, 3, 0.279, 0.0016, 3, 0.1, 0.6667, 218, 3, 1, 0, 0, 259, 10, 1], "semantic": {"name": "tup", "arg_names": [], "import_names": [], "rhs_call_name": "tuple", "annotation": ""}, "snippet": " tup = tuple(p.A1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Expr_L172_C12", "label": "append()", "type": "expression", "loc": [172, 176], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:For_L164_C8", "vector": [8, 3, 0.2838, 0.0082, 3, 0.1, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.grid_points_list[\n tup[0] + self.grid_shape[0,0] * \n tup[1] + self.grid_shape[0,0] * \n self.grid_shape[1,0] * \n tup[2]].append(pts[:,i])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L180_C4", "label": "to_binary", "type": "function", "loc": [180, 185], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:ClassDef_L93_C0", "vector": [2, 1, 0.2977, 0.0098, 1, 0.74, 0.2308, 206, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "to_binary", "arg_names": ["self", "thresh"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def to_binary(self,thresh=1):\n ''' all cells with occupancy>=thresh set to 1, others set to 0.\n '''\n filled = (self.grid>=thresh)\n self.grid[np.where(filled==True)] = 1\n self.grid[np.where(filled==False)] = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Expr_L181_C8", "label": "expression", "type": "expression", "loc": [181, 182], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L180_C4", "vector": [8, 2, 0.2961, 0.0033, 2, 0.04, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' all cells with occupancy>=thresh set to 1, others set to 0.\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L183_C8", "label": "filled =", "type": "assigned_variable", "loc": [183, 183], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L180_C4", "vector": [14, 2, 0.2985, 0.0016, 2, 0.04, 0.3333, 984, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "filled", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " filled = (self.grid>=thresh)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L184_C8", "label": "assign", "type": "assigned_variable", "loc": [184, 184], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L180_C4", "vector": [14, 2, 0.3002, 0.0016, 2, 0.04, 0.6667, 0, 1, 0, 0, 0, 0, 1, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.grid[np.where(filled==True)] = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L185_C8", "label": "assign", "type": "assigned_variable", "loc": [185, 185], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L180_C4", "vector": [14, 2, 0.3018, 0.0016, 2, 0.04, 1.0, 0, 1, 0, 0, 0, 0, 1, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.grid[np.where(filled==False)] = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L187_C4", "label": "argmax_z", "type": "function", "loc": [187, 230], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:ClassDef_L93_C0", "vector": [2, 1, 0.3401, 0.0718, 1, 0.74, 0.3077, 859, 0, 5, 1, 0, 0, 0, 12], "semantic": {"name": "argmax_z", "arg_names": ["self", "index_min", "index_max", "search_up", "search_down"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def argmax_z(self,index_min=-np.Inf,index_max=np.Inf,search_up=False,search_down=False):\n ''' searches in the z direction for maximum number of cells with occupancy==1\n call this function after calling to_binary()\n returns index.\n '''\n index_min = int(max(index_min,0))\n index_max = int(min(index_max,self.grid_shape[2,0]-1))\n z_count_mat = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Expr_L188_C8", "label": "expression", "type": "expression", "loc": [188, 191], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L187_C4", "vector": [8, 2, 0.3091, 0.0065, 2, 0.7, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' searches in the z direction for maximum number of cells with occupancy==1\n call this function after calling to_binary()\n returns index.\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L192_C8", "label": "index_min = int()", "type": "assigned_variable", "loc": [192, 192], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L187_C4", "vector": [14, 2, 0.3132, 0.0016, 2, 0.7, 0.0833, 28, 3, 1, 0, 0, 901, 10, 2], "semantic": {"name": "index_min", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": " index_min = int(max(index_min,0))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L193_C8", "label": "index_max = int()", "type": "assigned_variable", "loc": [193, 193], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L187_C4", "vector": [14, 2, 0.3148, 0.0016, 2, 0.7, 0.1667, 818, 3, 1, 0, 0, 901, 10, 2], "semantic": {"name": "index_max", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": " index_max = int(min(index_max,self.grid_shape[2,0]-1))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L194_C8", "label": "z_count_mat =", "type": "assigned_variable", "loc": [194, 194], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L187_C4", "vector": [14, 2, 0.3165, 0.0016, 2, 0.7, 0.25, 469, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "z_count_mat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " z_count_mat = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:For_L196_C8", "label": "for i", "type": "for", "loc": [196, 197], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L187_C4", "vector": [6, 2, 0.3206, 0.0033, 2, 0.7, 0.3333, 826, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in xrange(index_min,index_max+1):\n z_count_mat.append(np.where(self.grid[:,:,i]==1)[0].shape[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Expr_L197_C12", "label": "append()", "type": "expression", "loc": [197, 197], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:For_L196_C8", "vector": [8, 3, 0.3214, 0.0016, 3, 0.3, 0.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " z_count_mat.append(np.where(self.grid[:,:,i]==1)[0].shape[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L199_C8", "label": "if", "type": "if", "loc": [199, 200], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L187_C4", "vector": [4, 2, 0.3254, 0.0033, 2, 0.7, 0.4167, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if z_count_mat == []:\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Return_L200_C12", "label": "return", "type": "return", "loc": [200, 200], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L199_C8", "vector": [13, 3, 0.3263, 0.0016, 3, 0.74, 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_99601:Assign_L201_C8", "label": "z_count_mat =", "type": "assigned_variable", "loc": [201, 201], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L187_C4", "vector": [14, 2, 0.3279, 0.0016, 2, 0.7, 0.5, 469, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "z_count_mat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " z_count_mat = np.matrix(z_count_mat).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L202_C8", "label": "max_z = argmax()", "type": "assigned_variable", "loc": [202, 202], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L187_C4", "vector": [14, 2, 0.3295, 0.0016, 2, 0.7, 0.5833, 119, 3, 1, 0, 0, 593, 10, 1], "semantic": {"name": "max_z", "arg_names": [], "import_names": [], "rhs_call_name": "argmax", "annotation": ""}, "snippet": " max_z = np.argmax(z_count_mat)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L203_C8", "label": "max_count =", "type": "assigned_variable", "loc": [203, 203], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L187_C4", "vector": [14, 2, 0.3312, 0.0016, 2, 0.7, 0.6667, 632, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "max_count", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " max_count = z_count_mat[max_z,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Expr_L205_C8", "label": "print()", "type": "expression", "loc": [205, 205], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L187_C4", "vector": [8, 2, 0.3344, 0.0016, 2, 0.7, 0.75, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('#### max_count:', max_count)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L207_C8", "label": "if", "type": "if", "loc": [207, 216], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L187_C4", "vector": [4, 2, 0.345, 0.0163, 2, 0.7, 0.8333, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if search_up:\n max_z_temp = max_z\n for i in range(1,5):\n #if (z_count_mat[max_z+i,0]*3.0)>max_count: #A\n #if (z_count_mat[max_z+i,0]*8.0)>max_count: #B\n if (max_z+i)>index_max:\n break\n if (z_count_mat[max_z+i-index_min,0]*5.0)>max_count: #B'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L208_C12", "label": "max_z_temp =", "type": "assigned_variable", "loc": [208, 208], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L207_C8", "vector": [14, 3, 0.3393, 0.0016, 3, 0.0, 0.0, 155, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "max_z_temp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " max_z_temp = max_z"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:For_L209_C12", "label": "for i", "type": "for", "loc": [209, 215], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L207_C8", "vector": [6, 3, 0.3458, 0.0114, 3, 0.0, 0.5, 826, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(1,5):\n #if (z_count_mat[max_z+i,0]*3.0)>max_count: #A\n #if (z_count_mat[max_z+i,0]*8.0)>max_count: #B\n if (max_z+i)>index_max:\n break\n if (z_count_mat[max_z+i-index_min,0]*5.0)>max_count: #B'\n max_z_temp = max_z+i"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L212_C16", "label": "if", "type": "if", "loc": [212, 213], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:For_L209_C12", "vector": [4, 4, 0.3467, 0.0033, 4, 0.26, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (max_z+i)>index_max:\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L214_C16", "label": "if", "type": "if", "loc": [214, 215], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:For_L209_C12", "vector": [4, 4, 0.3499, 0.0033, 4, 0.26, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (z_count_mat[max_z+i-index_min,0]*5.0)>max_count: #B'\n max_z_temp = max_z+i"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L215_C20", "label": "max_z_temp =", "type": "assigned_variable", "loc": [215, 215], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L214_C16", "vector": [14, 5, 0.3507, 0.0016, 5, 0.67, 0.0, 155, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "max_z_temp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " max_z_temp = max_z+i"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L216_C12", "label": "max_z =", "type": "assigned_variable", "loc": [216, 216], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L207_C8", "vector": [14, 3, 0.3524, 0.0016, 3, 0.0, 1.0, 119, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "max_z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " max_z = max_z_temp"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L218_C8", "label": "if", "type": "if", "loc": [218, 228], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L187_C4", "vector": [4, 2, 0.3638, 0.0179, 2, 0.7, 0.9167, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if search_down:\n max_z_temp = max_z\n for i in range(1,5):\n if (max_z-i)<index_min:\n break\n if (max_z-i)>index_max:\n continue\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L219_C12", "label": "max_z_temp =", "type": "assigned_variable", "loc": [219, 219], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L218_C8", "vector": [14, 3, 0.3573, 0.0016, 3, 0.1, 0.0, 155, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "max_z_temp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " max_z_temp = max_z"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:For_L220_C12", "label": "for i", "type": "for", "loc": [220, 227], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L218_C8", "vector": [6, 3, 0.3646, 0.0131, 3, 0.1, 0.5, 826, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(1,5):\n if (max_z-i)<index_min:\n break\n if (max_z-i)>index_max:\n continue\n\n if (z_count_mat[max_z-i-index_min,0]*5.0)>max_count:\n max_z_temp = max_z-i"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L221_C16", "label": "if", "type": "if", "loc": [221, 222], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:For_L220_C12", "vector": [4, 4, 0.3613, 0.0033, 4, 0.9, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (max_z-i)<index_min:\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L223_C16", "label": "if", "type": "if", "loc": [223, 224], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:For_L220_C12", "vector": [4, 4, 0.3646, 0.0033, 4, 0.9, 0.5, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (max_z-i)>index_max:\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L226_C16", "label": "if", "type": "if", "loc": [226, 227], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:For_L220_C12", "vector": [4, 4, 0.3695, 0.0033, 4, 0.9, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (z_count_mat[max_z-i-index_min,0]*5.0)>max_count:\n max_z_temp = max_z-i"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L227_C20", "label": "max_z_temp =", "type": "assigned_variable", "loc": [227, 227], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L226_C16", "vector": [14, 5, 0.3703, 0.0016, 5, 0.63, 0.0, 155, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "max_z_temp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " max_z_temp = max_z-i"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L228_C12", "label": "max_z =", "type": "assigned_variable", "loc": [228, 228], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L218_C8", "vector": [14, 3, 0.3719, 0.0016, 3, 0.1, 1.0, 119, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "max_z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " max_z = max_z_temp"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Return_L230_C8", "label": "return", "type": "return", "loc": [230, 230], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L187_C4", "vector": [13, 2, 0.3752, 0.0016, 2, 0.7, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return max_z,max_count"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L232_C4", "label": "find_plane_indices", "type": "function", "loc": [232, 277], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:ClassDef_L93_C0", "vector": [2, 1, 0.4152, 0.075, 1, 0.74, 0.3846, 383, 0, 4, 1, 0, 0, 0, 28], "semantic": {"name": "find_plane_indices", "arg_names": ["self", "hmin", "hmax", "assume_plane"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def find_plane_indices(self,hmin=-np.Inf,hmax=np.Inf,assume_plane=False):\n ''' assume_plane - always return something.\n returns list of indices (z) corrresponding to horizontal plane points.\n returns [] if there is no plane\n '''\n index_min = int(max(round((hmin-self.brf[2,0])/self.resolution[2,0]),0))\n index_max = int(min(round((hmax-self.brf[2,0])/self.resolution[2,0]),self.grid_shape[2,0]-1))\n z_plane,max_count = self.argmax_z(index_min,index_max,search_up=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Expr_L233_C8", "label": "expression", "type": "expression", "loc": [233, 236], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L232_C4", "vector": [8, 2, 0.3825, 0.0065, 2, 0.55, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' assume_plane - always return something.\n returns list of indices (z) corrresponding to horizontal plane points.\n returns [] if there is no plane\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L237_C8", "label": "index_min = int()", "type": "assigned_variable", "loc": [237, 237], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L232_C4", "vector": [14, 2, 0.3866, 0.0016, 2, 0.55, 0.1111, 28, 3, 1, 0, 0, 901, 10, 3], "semantic": {"name": "index_min", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": " index_min = int(max(round((hmin-self.brf[2,0])/self.resolution[2,0]),0))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L238_C8", "label": "index_max = int()", "type": "assigned_variable", "loc": [238, 238], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L232_C4", "vector": [14, 2, 0.3883, 0.0016, 2, 0.55, 0.2222, 818, 3, 1, 0, 0, 901, 10, 3], "semantic": {"name": "index_max", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": " index_max = int(min(round((hmax-self.brf[2,0])/self.resolution[2,0]),self.grid_shape[2,0]-1))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L239_C8", "label": "z_plane, max_count = argmax_z()", "type": "assigned_variable", "loc": [239, 239], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L232_C4", "vector": [14, 2, 0.3899, 0.0016, 2, 0.55, 0.3333, 246, 3, 3, 0, 0, 859, 10, 1], "semantic": {"name": "z_plane, max_count", "arg_names": [], "import_names": [], "rhs_call_name": "argmax_z", "annotation": ""}, "snippet": " z_plane,max_count = self.argmax_z(index_min,index_max,search_up=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L240_C8", "label": "if", "type": "if", "loc": [240, 242], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L232_C4", "vector": [4, 2, 0.3931, 0.0049, 2, 0.55, 0.4444, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if z_plane == None:\n print('oink oink.')\n return []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Expr_L241_C12", "label": "print()", "type": "expression", "loc": [241, 241], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L240_C8", "vector": [8, 3, 0.3931, 0.0016, 3, 0.52, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('oink oink.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Return_L242_C12", "label": "return", "type": "return", "loc": [242, 242], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L240_C8", "vector": [13, 3, 0.3948, 0.0016, 3, 0.52, 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_99601:Assign_L251_C8", "label": "extra_remove_meters =", "type": "assigned_variable", "loc": [251, 251], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L232_C4", "vector": [14, 2, 0.4095, 0.0016, 2, 0.55, 0.5556, 582, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "extra_remove_meters", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " extra_remove_meters = 0.005"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L252_C8", "label": "n_more_to_remove = int()", "type": "assigned_variable", "loc": [252, 252], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L232_C4", "vector": [14, 2, 0.4111, 0.0016, 2, 0.55, 0.6667, 797, 3, 1, 0, 0, 901, 10, 2], "semantic": {"name": "n_more_to_remove", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": " n_more_to_remove = int(round(extra_remove_meters/self.resolution[2,0]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L253_C8", "label": "l = range()", "type": "assigned_variable", "loc": [253, 254], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L232_C4", "vector": [14, 2, 0.4135, 0.0033, 2, 0.55, 0.7778, 810, 3, 2, 0, 0, 816, 10, 3], "semantic": {"name": "l", "arg_names": [], "import_names": [], "rhs_call_name": "range", "annotation": ""}, "snippet": " l = range(max(z_plane-10,0),\n min(z_plane+n_more_to_remove+1,self.grid_shape[2,0]-1))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L257_C8", "label": "if", "type": "if", "loc": [257, 275], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L232_C4", "vector": [4, 2, 0.4339, 0.031, 2, 0.55, 0.8889, 0, 0, 0, 0, 0, 0, 0, 15], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if assume_plane == False:\n n_more = int(round(0.1/self.resolution[2,0]))\n l_confirm = l+ range(max(l),min(z_plane+n_more+1,self.grid_shape[2,0]-1))\n\n grid_2d = np.max(self.grid[:,:,l],2)\n n_plane_cells = grid_2d.sum()\n grid_2d = ni.binary_fill_holes(grid_2d) # I want 4-connectivity while filling holes.\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L258_C12", "label": "n_more = int()", "type": "assigned_variable", "loc": [258, 258], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L257_C8", "vector": [14, 3, 0.4209, 0.0016, 3, 0.31, 0.0, 365, 3, 1, 0, 0, 901, 10, 2], "semantic": {"name": "n_more", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": " n_more = int(round(0.1/self.resolution[2,0]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L259_C12", "label": "l_confirm =", "type": "assigned_variable", "loc": [259, 259], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L257_C8", "vector": [14, 3, 0.4225, 0.0016, 3, 0.31, 0.1, 114, 4, 0, 0, 0, 0, 0, 3], "semantic": {"name": "l_confirm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " l_confirm = l+ range(max(l),min(z_plane+n_more+1,self.grid_shape[2,0]-1))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L261_C12", "label": "grid_2d = max()", "type": "assigned_variable", "loc": [261, 261], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L257_C8", "vector": [14, 3, 0.4258, 0.0016, 3, 0.31, 0.2, 804, 3, 2, 0, 0, 442, 10, 1], "semantic": {"name": "grid_2d", "arg_names": [], "import_names": [], "rhs_call_name": "max", "annotation": ""}, "snippet": " grid_2d = np.max(self.grid[:,:,l],2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L262_C12", "label": "n_plane_cells = sum()", "type": "assigned_variable", "loc": [262, 262], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L257_C8", "vector": [14, 3, 0.4274, 0.0016, 3, 0.31, 0.3, 394, 3, 0, 0, 0, 824, 10, 1], "semantic": {"name": "n_plane_cells", "arg_names": [], "import_names": [], "rhs_call_name": "sum", "annotation": ""}, "snippet": " n_plane_cells = grid_2d.sum()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L263_C12", "label": "grid_2d = binary_fill_holes()", "type": "assigned_variable", "loc": [263, 263], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L257_C8", "vector": [14, 3, 0.429, 0.0016, 3, 0.31, 0.4, 804, 3, 1, 0, 0, 385, 10, 1], "semantic": {"name": "grid_2d", "arg_names": [], "import_names": [], "rhs_call_name": "binary_fill_holes", "annotation": ""}, "snippet": " grid_2d = ni.binary_fill_holes(grid_2d) # I want 4-connectivity while filling holes."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L265_C12", "label": "n_plane_cells = sum()", "type": "assigned_variable", "loc": [265, 265], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L257_C8", "vector": [14, 3, 0.4323, 0.0016, 3, 0.31, 0.5, 394, 3, 0, 0, 0, 824, 10, 1], "semantic": {"name": "n_plane_cells", "arg_names": [], "import_names": [], "rhs_call_name": "sum", "annotation": ""}, "snippet": " n_plane_cells = grid_2d.sum()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L266_C12", "label": "min_plane_pts_threshold =", "type": "assigned_variable", "loc": [266, 266], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L257_C8", "vector": [14, 3, 0.4339, 0.0016, 3, 0.31, 0.6, 811, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "min_plane_pts_threshold", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " min_plane_pts_threshold = (self.grid_shape[0,0]*self.grid_shape[1,0])/4"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Expr_L267_C12", "label": "print()", "type": "expression", "loc": [267, 267], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L257_C8", "vector": [8, 3, 0.4356, 0.0016, 3, 0.31, 0.7, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('###n_plane_cells:', n_plane_cells)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Expr_L268_C12", "label": "print()", "type": "expression", "loc": [268, 268], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L257_C8", "vector": [8, 3, 0.4372, 0.0016, 3, 0.31, 0.8, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('min_plane_pts_threshold:', min_plane_pts_threshold)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Expr_L269_C12", "label": "print()", "type": "expression", "loc": [269, 269], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L257_C8", "vector": [8, 3, 0.4388, 0.0016, 3, 0.31, 0.9, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('find_plane_indices grid shape:',self.grid_shape.T)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L271_C12", "label": "if", "type": "if", "loc": [271, 275], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L257_C8", "vector": [4, 3, 0.4454, 0.0082, 3, 0.31, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if n_plane_cells < min_plane_pts_threshold:\n print('occupancy_grid_3d.find_plane_indices: There is no plane.')\n print('n_plane_cells:', n_plane_cells)\n print('min_plane_pts_threshold:', min_plane_pts_threshold)\n l = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Expr_L272_C16", "label": "print()", "type": "expression", "loc": [272, 272], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L271_C12", "vector": [8, 4, 0.4437, 0.0016, 4, 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": " print('occupancy_grid_3d.find_plane_indices: There is no plane.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Expr_L273_C16", "label": "print()", "type": "expression", "loc": [273, 273], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L271_C12", "vector": [8, 4, 0.4454, 0.0016, 4, 0.68, 0.3333, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('n_plane_cells:', n_plane_cells)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Expr_L274_C16", "label": "print()", "type": "expression", "loc": [274, 274], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L271_C12", "vector": [8, 4, 0.447, 0.0016, 4, 0.68, 0.6667, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('min_plane_pts_threshold:', min_plane_pts_threshold)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L275_C16", "label": "l =", "type": "assigned_variable", "loc": [275, 275], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L271_C12", "vector": [14, 4, 0.4486, 0.0016, 4, 0.68, 1.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_99601:Return_L277_C8", "label": "return", "type": "return", "loc": [277, 277], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L232_C4", "vector": [13, 2, 0.4519, 0.0016, 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 l"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L283_C4", "label": "grid_to_centroids", "type": "function", "loc": [283, 289], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:ClassDef_L93_C0", "vector": [2, 1, 0.4666, 0.0114, 1, 0.74, 0.4615, 694, 0, 2, 1, 0, 0, 0, 4], "semantic": {"name": "grid_to_centroids", "arg_names": ["self", "occupancy_threshold"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def grid_to_centroids(self,occupancy_threshold=1):\n p = np.matrix(np.row_stack(np.where(self.grid>=occupancy_threshold))).astype('float')\n p[0,:] = p[0,:]*self.resolution[0,0]\n p[1,:] = p[1,:]*self.resolution[1,0]\n p[2,:] = p[2,:]*self.resolution[2,0]\n p += self.brf\n return p"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L284_C8", "label": "p = astype()", "type": "assigned_variable", "loc": [284, 284], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L283_C4", "vector": [14, 2, 0.4633, 0.0016, 2, 0.56, 0.0, 491, 3, 1, 0, 0, 32, 10, 4], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "astype", "annotation": ""}, "snippet": " p = np.matrix(np.row_stack(np.where(self.grid>=occupancy_threshold))).astype('float')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L285_C8", "label": "assign", "type": "assigned_variable", "loc": [285, 285], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L283_C4", "vector": [14, 2, 0.4649, 0.0016, 2, 0.56, 0.25, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p[0,:] = p[0,:]*self.resolution[0,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L286_C8", "label": "assign", "type": "assigned_variable", "loc": [286, 286], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L283_C4", "vector": [14, 2, 0.4666, 0.0016, 2, 0.56, 0.5, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p[1,:] = p[1,:]*self.resolution[1,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L287_C8", "label": "assign", "type": "assigned_variable", "loc": [287, 287], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L283_C4", "vector": [14, 2, 0.4682, 0.0016, 2, 0.56, 0.75, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p[2,:] = p[2,:]*self.resolution[2,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Return_L289_C8", "label": "return", "type": "return", "loc": [289, 289], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L283_C4", "vector": [13, 2, 0.4715, 0.0016, 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 p"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L292_C4", "label": "grid_to_points", "type": "function", "loc": [292, 312], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:ClassDef_L93_C0", "vector": [2, 1, 0.4927, 0.0343, 1, 0.74, 0.5385, 558, 0, 3, 1, 0, 0, 0, 4], "semantic": {"name": "grid_to_points", "arg_names": ["self", "array", "occupancy_threshold"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def grid_to_points(self,array=None,occupancy_threshold=1):\n ''' array - if not None then this will be used instead of self.grid\n returns 3xN matrix of 3d coord of the cells which have occupancy >= occupancy_threshold\n '''\n\n if array == None:\n array = self.grid\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Expr_L293_C8", "label": "expression", "type": "expression", "loc": [293, 295], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L292_C4", "vector": [8, 2, 0.4796, 0.0049, 2, 0.43, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' array - if not None then this will be used instead of self.grid\n returns 3xN matrix of 3d coord of the cells which have occupancy >= occupancy_threshold\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L297_C8", "label": "if", "type": "if", "loc": [297, 298], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L292_C4", "vector": [4, 2, 0.4853, 0.0033, 2, 0.43, 0.1429, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if array == None:\n array = self.grid"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L298_C12", "label": "array =", "type": "assigned_variable", "loc": [298, 298], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L297_C8", "vector": [14, 3, 0.4861, 0.0016, 3, 0.47, 0.0, 80, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "array", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " array = self.grid"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L300_C8", "label": "idxs = where()", "type": "assigned_variable", "loc": [300, 300], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L292_C4", "vector": [14, 2, 0.4894, 0.0016, 2, 0.43, 0.2857, 677, 3, 1, 0, 0, 169, 10, 1], "semantic": {"name": "idxs", "arg_names": [], "import_names": [], "rhs_call_name": "where", "annotation": ""}, "snippet": " idxs = np.where(array>=occupancy_threshold)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L301_C8", "label": "list_idxs = tolist()", "type": "assigned_variable", "loc": [301, 301], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L292_C4", "vector": [14, 2, 0.491, 0.0016, 2, 0.43, 0.4286, 227, 3, 0, 0, 0, 185, 10, 1], "semantic": {"name": "list_idxs", "arg_names": [], "import_names": [], "rhs_call_name": "tolist", "annotation": ""}, "snippet": " list_idxs = (idxs[0]+idxs[1]*self.grid_shape[0,0]+idxs[2]*self.grid_shape[0,0]*self.grid_shape[1,0]).tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L303_C8", "label": "l =", "type": "assigned_variable", "loc": [303, 303], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L292_C4", "vector": [14, 2, 0.4943, 0.0016, 2, 0.43, 0.5714, 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_99601:For_L304_C8", "label": "for pts_idxs", "type": "for", "loc": [304, 305], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L292_C4", "vector": [6, 2, 0.4967, 0.0033, 2, 0.43, 0.7143, 171, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pts_idxs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for pts_idxs in list_idxs:\n l += self.grid_points_list[pts_idxs]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L307_C8", "label": "if", "type": "if", "loc": [307, 310], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L292_C4", "vector": [4, 2, 0.5033, 0.0065, 2, 0.43, 0.8571, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if l == []:\n p = np.matrix([])\n else:\n p = np.column_stack(l)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L308_C12", "label": "p = matrix()", "type": "assigned_variable", "loc": [308, 308], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L307_C8", "vector": [14, 3, 0.5024, 0.0016, 3, 0.22, 0.0, 491, 3, 1, 0, 0, 162, 10, 1], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "matrix", "annotation": ""}, "snippet": " p = np.matrix([])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L310_C12", "label": "p = column_stack()", "type": "assigned_variable", "loc": [310, 310], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L307_C8", "vector": [14, 3, 0.5057, 0.0016, 3, 0.22, 1.0, 491, 3, 1, 0, 0, 724, 10, 1], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "column_stack", "annotation": ""}, "snippet": " p = np.column_stack(l)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Return_L312_C8", "label": "return", "type": "return", "loc": [312, 312], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L292_C4", "vector": [13, 2, 0.509, 0.0016, 2, 0.43, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return p"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L314_C4", "label": "labeled_array_to_points", "type": "function", "loc": [314, 330], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:ClassDef_L93_C0", "vector": [2, 1, 0.5253, 0.0277, 1, 0.74, 0.6154, 366, 0, 3, 1, 0, 0, 0, 4], "semantic": {"name": "labeled_array_to_points", "arg_names": ["self", "array", "label"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def labeled_array_to_points(self,array,label):\n ''' returns coordinates of centers of grid cells corresponding to\n label as a 3xN matrix.\n '''\n idxs = np.where(array==label)\n list_idxs = (idxs[0]+idxs[1]*self.grid_shape[0,0]+idxs[2]*self.grid_shape[0,0]*self.grid_shape[1,0]).tolist()\n\n l = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Expr_L315_C8", "label": "expression", "type": "expression", "loc": [315, 317], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L314_C4", "vector": [8, 2, 0.5155, 0.0049, 2, 0.79, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' returns coordinates of centers of grid cells corresponding to\n label as a 3xN matrix.\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L318_C8", "label": "idxs = where()", "type": "assigned_variable", "loc": [318, 318], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L314_C4", "vector": [14, 2, 0.5188, 0.0016, 2, 0.79, 0.1667, 677, 3, 1, 0, 0, 169, 10, 1], "semantic": {"name": "idxs", "arg_names": [], "import_names": [], "rhs_call_name": "where", "annotation": ""}, "snippet": " idxs = np.where(array==label)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L319_C8", "label": "list_idxs = tolist()", "type": "assigned_variable", "loc": [319, 319], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L314_C4", "vector": [14, 2, 0.5204, 0.0016, 2, 0.79, 0.3333, 227, 3, 0, 0, 0, 185, 10, 1], "semantic": {"name": "list_idxs", "arg_names": [], "import_names": [], "rhs_call_name": "tolist", "annotation": ""}, "snippet": " list_idxs = (idxs[0]+idxs[1]*self.grid_shape[0,0]+idxs[2]*self.grid_shape[0,0]*self.grid_shape[1,0]).tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L321_C8", "label": "l =", "type": "assigned_variable", "loc": [321, 321], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L314_C4", "vector": [14, 2, 0.5237, 0.0016, 2, 0.79, 0.5, 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_99601:For_L322_C8", "label": "for pts_idxs", "type": "for", "loc": [322, 323], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L314_C4", "vector": [6, 2, 0.5261, 0.0033, 2, 0.79, 0.6667, 171, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pts_idxs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for pts_idxs in list_idxs:\n l += self.grid_points_list[pts_idxs]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L325_C8", "label": "if", "type": "if", "loc": [325, 328], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L314_C4", "vector": [4, 2, 0.5326, 0.0065, 2, 0.79, 0.8333, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if l == []:\n p = np.matrix([])\n else:\n p = np.column_stack(l)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L326_C12", "label": "p = matrix()", "type": "assigned_variable", "loc": [326, 326], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L325_C8", "vector": [14, 3, 0.5318, 0.0016, 3, 0.82, 0.0, 491, 3, 1, 0, 0, 162, 10, 1], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "matrix", "annotation": ""}, "snippet": " p = np.matrix([])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L328_C12", "label": "p = column_stack()", "type": "assigned_variable", "loc": [328, 328], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L325_C8", "vector": [14, 3, 0.5351, 0.0016, 3, 0.82, 1.0, 491, 3, 1, 0, 0, 724, 10, 1], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "column_stack", "annotation": ""}, "snippet": " p = np.column_stack(l)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Return_L330_C8", "label": "return", "type": "return", "loc": [330, 330], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L314_C4", "vector": [13, 2, 0.5383, 0.0016, 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 p"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L332_C4", "label": "remove_vertical_plane", "type": "function", "loc": [332, 368], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:ClassDef_L93_C0", "vector": [2, 1, 0.571, 0.0604, 1, 0.74, 0.6923, 627, 0, 1, 1, 0, 0, 0, 19], "semantic": {"name": "remove_vertical_plane", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def remove_vertical_plane(self):\n ''' removes plane parallel to the YZ plane.\n changes grid.\n returns plane_indices, slice corresponding to the vertical plane.\n points behind the plane are lost for ever!\n '''\n self.grid = self.grid.swapaxes(2,0)\n self.grid_shape = np.matrix(self.grid.shape).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Expr_L333_C8", "label": "expression", "type": "expression", "loc": [333, 337], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L332_C4", "vector": [8, 2, 0.5465, 0.0082, 2, 0.33, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' removes plane parallel to the YZ plane.\n changes grid.\n returns plane_indices, slice corresponding to the vertical plane.\n points behind the plane are lost for ever!\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L338_C8", "label": "self.grid = swapaxes()", "type": "assigned_variable", "loc": [338, 338], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L332_C4", "vector": [14, 2, 0.5514, 0.0016, 2, 0.33, 0.0526, 16, 3, 2, 0, 0, 289, 10, 1], "semantic": {"name": "self.grid", "arg_names": [], "import_names": [], "rhs_call_name": "swapaxes", "annotation": ""}, "snippet": " self.grid = self.grid.swapaxes(2,0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L339_C8", "label": "self.grid_shape =", "type": "assigned_variable", "loc": [339, 339], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L332_C4", "vector": [14, 2, 0.553, 0.0016, 2, 0.33, 0.1053, 573, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.grid_shape", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.grid_shape = np.matrix(self.grid.shape).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L344_C8", "label": "z_max_first, max_count = argmax_z()", "type": "assigned_variable", "loc": [344, 344], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L332_C4", "vector": [14, 2, 0.5612, 0.0016, 2, 0.33, 0.1579, 959, 3, 1, 0, 0, 859, 10, 1], "semantic": {"name": "z_max_first, max_count", "arg_names": [], "import_names": [], "rhs_call_name": "argmax_z", "annotation": ""}, "snippet": " z_max_first,max_count = self.argmax_z(search_down=False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L345_C8", "label": "z_max_second, max_count_second = argmax_z()", "type": "assigned_variable", "loc": [345, 345], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L332_C4", "vector": [14, 2, 0.5628, 0.0016, 2, 0.33, 0.2105, 113, 3, 2, 0, 0, 859, 10, 3], "semantic": {"name": "z_max_second, max_count_second", "arg_names": [], "import_names": [], "rhs_call_name": "argmax_z", "annotation": ""}, "snippet": " z_max_second,max_count_second = self.argmax_z(index_min=z_max_first+int(round(0.035/self.resolution[0,0])) ,search_down=False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L346_C8", "label": "z_max_first, max_count = argmax_z()", "type": "assigned_variable", "loc": [346, 346], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L332_C4", "vector": [14, 2, 0.5644, 0.0016, 2, 0.33, 0.2632, 959, 3, 1, 0, 0, 859, 10, 1], "semantic": {"name": "z_max_first, max_count", "arg_names": [], "import_names": [], "rhs_call_name": "argmax_z", "annotation": ""}, "snippet": " z_max_first,max_count = self.argmax_z(search_down=False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L349_C8", "label": "if", "type": "if", "loc": [349, 352], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L332_C4", "vector": [4, 2, 0.5718, 0.0065, 2, 0.33, 0.3158, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (max_count_second*1./max_count) > 0.3:\n z_max = z_max_second\n else:\n z_max = z_max_first"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L350_C12", "label": "z_max =", "type": "assigned_variable", "loc": [350, 350], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L349_C8", "vector": [14, 3, 0.571, 0.0016, 3, 0.78, 0.0, 465, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "z_max", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " z_max = z_max_second"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L352_C12", "label": "z_max =", "type": "assigned_variable", "loc": [352, 352], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L349_C8", "vector": [14, 3, 0.5742, 0.0016, 3, 0.78, 1.0, 465, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "z_max", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " z_max = z_max_first"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Expr_L353_C8", "label": "print()", "type": "expression", "loc": [353, 353], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L332_C4", "vector": [8, 2, 0.5759, 0.0016, 2, 0.33, 0.3684, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('z_max_first', z_max_first)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Expr_L354_C8", "label": "print()", "type": "expression", "loc": [354, 354], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L332_C4", "vector": [8, 2, 0.5775, 0.0016, 2, 0.33, 0.4211, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('z_max_second', z_max_second)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Expr_L355_C8", "label": "print()", "type": "expression", "loc": [355, 355], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L332_C4", "vector": [8, 2, 0.5791, 0.0016, 2, 0.33, 0.4737, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('z_max', z_max)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L357_C8", "label": "more = int()", "type": "assigned_variable", "loc": [357, 357], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L332_C4", "vector": [14, 2, 0.5824, 0.0016, 2, 0.33, 0.5263, 179, 3, 1, 0, 0, 901, 10, 2], "semantic": {"name": "more", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": " more = int(round(0.03/self.resolution[0,0]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L358_C8", "label": "plane_indices = range()", "type": "assigned_variable", "loc": [358, 358], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L332_C4", "vector": [14, 2, 0.584, 0.0016, 2, 0.33, 0.5789, 595, 3, 2, 0, 0, 816, 10, 3], "semantic": {"name": "plane_indices", "arg_names": [], "import_names": [], "rhs_call_name": "range", "annotation": ""}, "snippet": " plane_indices = range(max(0,z_max-more),min(z_max+more,self.grid_shape[2,0]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L360_C8", "label": "self.grid = swapaxes()", "type": "assigned_variable", "loc": [360, 360], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L332_C4", "vector": [14, 2, 0.5873, 0.0016, 2, 0.33, 0.6316, 16, 3, 2, 0, 0, 289, 10, 1], "semantic": {"name": "self.grid", "arg_names": [], "import_names": [], "rhs_call_name": "swapaxes", "annotation": ""}, "snippet": " self.grid = self.grid.swapaxes(2,0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L361_C8", "label": "self.grid_shape =", "type": "assigned_variable", "loc": [361, 361], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L332_C4", "vector": [14, 2, 0.5889, 0.0016, 2, 0.33, 0.6842, 573, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.grid_shape", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.grid_shape = np.matrix(self.grid.shape).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L363_C8", "label": "ver_plane_slice =", "type": "assigned_variable", "loc": [363, 363], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L332_C4", "vector": [14, 2, 0.5922, 0.0016, 2, 0.33, 0.7368, 177, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ver_plane_slice", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ver_plane_slice = self.grid[plane_indices,:,:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L364_C8", "label": "assign", "type": "assigned_variable", "loc": [364, 364], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L332_C4", "vector": [14, 2, 0.5938, 0.0016, 2, 0.33, 0.7895, 0, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.grid[plane_indices,:,:] = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L365_C8", "label": "max_x = max()", "type": "assigned_variable", "loc": [365, 365], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L332_C4", "vector": [14, 2, 0.5954, 0.0016, 2, 0.33, 0.8421, 64, 3, 1, 0, 0, 442, 10, 1], "semantic": {"name": "max_x", "arg_names": [], "import_names": [], "rhs_call_name": "max", "annotation": ""}, "snippet": " max_x = max(plane_indices)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L366_C8", "label": "behind_indices = range()", "type": "assigned_variable", "loc": [366, 366], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L332_C4", "vector": [14, 2, 0.5971, 0.0016, 2, 0.33, 0.8947, 386, 3, 2, 0, 0, 816, 10, 1], "semantic": {"name": "behind_indices", "arg_names": [], "import_names": [], "rhs_call_name": "range", "annotation": ""}, "snippet": " behind_indices = range(max_x,self.grid_shape[0,0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L367_C8", "label": "assign", "type": "assigned_variable", "loc": [367, 367], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L332_C4", "vector": [14, 2, 0.5987, 0.0016, 2, 0.33, 0.9474, 0, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.grid[behind_indices,:,:] = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Return_L368_C8", "label": "return", "type": "return", "loc": [368, 368], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L332_C4", "vector": [13, 2, 0.6003, 0.0016, 2, 0.33, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return plane_indices,ver_plane_slice"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L370_C4", "label": "remove_horizontal_plane", "type": "function", "loc": [370, 420], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:ClassDef_L93_C0", "vector": [2, 1, 0.6444, 0.0832, 1, 0.74, 0.7692, 651, 0, 5, 1, 0, 0, 0, 23], "semantic": {"name": "remove_horizontal_plane", "arg_names": ["self", "remove_below", "hmin", "hmax", "extra_layers"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def remove_horizontal_plane(self, remove_below=True,hmin=-np.Inf,hmax=np.Inf,\n extra_layers=0):\n ''' call after to_binary()\n removes points corresponding to the horizontal plane from the grid.\n remove_below - remove points below the plane also.\n hmin,hmax - min and max possible height of the plane. (meters)\n This function changes grid.\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Expr_L372_C8", "label": "expression", "type": "expression", "loc": [372, 384], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L370_C4", "vector": [8, 2, 0.6166, 0.0212, 2, 0.19, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' call after to_binary()\n removes points corresponding to the horizontal plane from the grid.\n remove_below - remove points below the plane also.\n hmin,hmax - min and max possible height of the plane. (meters)\n This function changes grid.\n\n extra_layers - number of layers above the plane to remove. Sometimes\n I want to be over zealous while removing plane points."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L385_C8", "label": "l = find_plane_indices()", "type": "assigned_variable", "loc": [385, 385], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L370_C4", "vector": [14, 2, 0.6281, 0.0016, 2, 0.19, 0.05, 810, 3, 2, 0, 0, 383, 10, 1], "semantic": {"name": "l", "arg_names": [], "import_names": [], "rhs_call_name": "find_plane_indices", "annotation": ""}, "snippet": " l = self.find_plane_indices(hmin,hmax)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L387_C8", "label": "if", "type": "if", "loc": [387, 389], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L370_C4", "vector": [4, 2, 0.633, 0.0049, 2, 0.19, 0.1, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if l == []:\n print('occupancy_grid_3d.remove_horizontal_plane: No plane found.')\n return None,l"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Expr_L388_C12", "label": "print()", "type": "expression", "loc": [388, 388], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L387_C8", "vector": [8, 3, 0.633, 0.0016, 3, 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('occupancy_grid_3d.remove_horizontal_plane: No plane found.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Return_L389_C12", "label": "return", "type": "return", "loc": [389, 389], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L387_C8", "vector": [13, 3, 0.6346, 0.0016, 3, 0.32, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return None,l"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L391_C8", "label": "add_num = min()", "type": "assigned_variable", "loc": [391, 391], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L370_C4", "vector": [14, 2, 0.6378, 0.0016, 2, 0.19, 0.15, 660, 3, 2, 0, 0, 867, 10, 2], "semantic": {"name": "add_num", "arg_names": [], "import_names": [], "rhs_call_name": "min", "annotation": ""}, "snippet": " add_num = min(10,self.grid_shape[2,0]-max(l)-1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L392_C8", "label": "max_l =", "type": "assigned_variable", "loc": [392, 392], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L370_C4", "vector": [14, 2, 0.6395, 0.0016, 2, 0.19, 0.2, 756, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "max_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " max_l = max(l)+add_num"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L393_C8", "label": "l_edge =", "type": "assigned_variable", "loc": [393, 393], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L370_C4", "vector": [14, 2, 0.6411, 0.0016, 2, 0.19, 0.25, 370, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "l_edge", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " l_edge = l+range(max(l),max_l+1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L395_C8", "label": "grid_2d = max()", "type": "assigned_variable", "loc": [395, 395], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L370_C4", "vector": [14, 2, 0.6444, 0.0016, 2, 0.19, 0.3, 804, 3, 2, 0, 0, 442, 10, 1], "semantic": {"name": "grid_2d", "arg_names": [], "import_names": [], "rhs_call_name": "max", "annotation": ""}, "snippet": " grid_2d = np.max(self.grid[:,:,l_edge],2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L397_C8", "label": "grid_2d = binary_fill_holes()", "type": "assigned_variable", "loc": [397, 397], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L370_C4", "vector": [14, 2, 0.6476, 0.0016, 2, 0.19, 0.35, 804, 3, 1, 0, 0, 385, 10, 1], "semantic": {"name": "grid_2d", "arg_names": [], "import_names": [], "rhs_call_name": "binary_fill_holes", "annotation": ""}, "snippet": " grid_2d = ni.binary_fill_holes(grid_2d) # I want 4-connectivity while filling holes."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L399_C8", "label": "connect_structure = empty()", "type": "assigned_variable", "loc": [399, 399], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L370_C4", "vector": [14, 2, 0.6509, 0.0016, 2, 0.19, 0.4, 297, 3, 2, 0, 0, 365, 10, 1], "semantic": {"name": "connect_structure", "arg_names": [], "import_names": [], "rhs_call_name": "empty", "annotation": ""}, "snippet": " connect_structure = np.empty((3,3),dtype='int')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L400_C8", "label": "assign", "type": "assigned_variable", "loc": [400, 400], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L370_C4", "vector": [14, 2, 0.6525, 0.0016, 2, 0.19, 0.45, 0, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " connect_structure[:,:] = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L401_C8", "label": "eroded_2d = binary_erosion()", "type": "assigned_variable", "loc": [401, 401], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L370_C4", "vector": [14, 2, 0.6542, 0.0016, 2, 0.19, 0.5, 36, 3, 3, 0, 0, 333, 10, 1], "semantic": {"name": "eroded_2d", "arg_names": [], "import_names": [], "rhs_call_name": "binary_erosion", "annotation": ""}, "snippet": " eroded_2d = ni.binary_erosion(grid_2d,connect_structure,iterations=2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L402_C8", "label": "grid_2d =", "type": "assigned_variable", "loc": [402, 402], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L370_C4", "vector": [14, 2, 0.6558, 0.0016, 2, 0.19, 0.55, 804, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "grid_2d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " grid_2d = grid_2d-eroded_2d"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L403_C8", "label": "idxs = where()", "type": "assigned_variable", "loc": [403, 403], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L370_C4", "vector": [14, 2, 0.6574, 0.0016, 2, 0.19, 0.6, 677, 3, 1, 0, 0, 169, 10, 1], "semantic": {"name": "idxs", "arg_names": [], "import_names": [], "rhs_call_name": "where", "annotation": ""}, "snippet": " idxs = np.where(grid_2d!=0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L405_C8", "label": "if", "type": "if", "loc": [405, 407], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L370_C4", "vector": [4, 2, 0.6623, 0.0049, 2, 0.19, 0.65, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if max_l>max(l):\n for i in range(min(5,add_num)):\n self.grid[idxs[0],idxs[1],max(l)+i+1] = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:For_L406_C12", "label": "for i", "type": "for", "loc": [406, 407], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L405_C8", "vector": [6, 3, 0.6631, 0.0033, 3, 0.17, 0.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(min(5,add_num)):\n self.grid[idxs[0],idxs[1],max(l)+i+1] = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L407_C16", "label": "assign", "type": "assigned_variable", "loc": [407, 407], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:For_L406_C12", "vector": [14, 4, 0.6639, 0.0016, 4, 0.13, 0.0, 0, 1, 0, 0, 0, 0, 1, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.grid[idxs[0],idxs[1],max(l)+i+1] = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L409_C8", "label": "if", "type": "if", "loc": [409, 410], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L370_C4", "vector": [4, 2, 0.668, 0.0033, 2, 0.19, 0.7, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if remove_below:\n l = range(0,min(l)+1)+l"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L410_C12", "label": "l =", "type": "assigned_variable", "loc": [410, 410], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L409_C8", "vector": [14, 3, 0.6688, 0.0016, 3, 0.8, 0.0, 810, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " l = range(0,min(l)+1)+l"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L412_C8", "label": "max_z = max()", "type": "assigned_variable", "loc": [412, 412], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L370_C4", "vector": [14, 2, 0.6721, 0.0016, 2, 0.19, 0.75, 119, 3, 1, 0, 0, 442, 10, 1], "semantic": {"name": "max_z", "arg_names": [], "import_names": [], "rhs_call_name": "max", "annotation": ""}, "snippet": " max_z = max(l)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:For_L413_C8", "label": "for i", "type": "for", "loc": [413, 414], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L370_C4", "vector": [6, 2, 0.6746, 0.0033, 2, 0.19, 0.8, 826, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(extra_layers):\n l.append(max_z+i+1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Expr_L414_C12", "label": "append()", "type": "expression", "loc": [414, 414], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:For_L413_C8", "vector": [8, 3, 0.6754, 0.0016, 3, 0.53, 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(max_z+i+1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L416_C8", "label": "l_edge =", "type": "assigned_variable", "loc": [416, 416], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L370_C4", "vector": [14, 2, 0.6786, 0.0016, 2, 0.19, 0.85, 370, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "l_edge", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " l_edge = l+range(max(l),max_l+1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L418_C8", "label": "plane_and_below_pts =", "type": "assigned_variable", "loc": [418, 418], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L370_C4", "vector": [14, 2, 0.6819, 0.0016, 2, 0.19, 0.9, 756, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "plane_and_below_pts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " plane_and_below_pts = self.grid[:,:,l_edge]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L419_C8", "label": "assign", "type": "assigned_variable", "loc": [419, 419], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L370_C4", "vector": [14, 2, 0.6835, 0.0016, 2, 0.19, 0.95, 0, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.grid[:,:,l] = 0 # set occupancy to zero."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Return_L420_C8", "label": "return", "type": "return", "loc": [420, 420], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L370_C4", "vector": [13, 2, 0.6852, 0.0016, 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 plane_and_below_pts,l_edge"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L422_C4", "label": "segment_objects", "type": "function", "loc": [422, 438], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:ClassDef_L93_C0", "vector": [2, 1, 0.7015, 0.0277, 1, 0.74, 0.8462, 295, 0, 2, 1, 0, 0, 0, 4], "semantic": {"name": "segment_objects", "arg_names": ["self", "twod"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def segment_objects(self, twod=False):\n ''' segments out objects after removing the plane.\n call after calling to_binary.\n returns labelled_array,n_labels\n labelled_array - same dimen as occupancy grid, each object has a different label.\n '''\n plane_and_below_pts,l = self.remove_horizontal_plane(extra_layers=0)\n if l == []:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Expr_L423_C8", "label": "expression", "type": "expression", "loc": [423, 427], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L422_C4", "vector": [8, 2, 0.6933, 0.0082, 2, 0.98, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' segments out objects after removing the plane.\n call after calling to_binary.\n returns labelled_array,n_labels\n labelled_array - same dimen as occupancy grid, each object has a different label.\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L428_C8", "label": "plane_and_below_pts, l = remove_horizontal_plane()", "type": "assigned_variable", "loc": [428, 428], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L422_C4", "vector": [14, 2, 0.6982, 0.0016, 2, 0.98, 0.2, 297, 3, 1, 0, 0, 651, 10, 1], "semantic": {"name": "plane_and_below_pts, l", "arg_names": [], "import_names": [], "rhs_call_name": "remove_horizontal_plane", "annotation": ""}, "snippet": " plane_and_below_pts,l = self.remove_horizontal_plane(extra_layers=0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L429_C8", "label": "if", "type": "if", "loc": [429, 431], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L422_C4", "vector": [4, 2, 0.7015, 0.0049, 2, 0.98, 0.4, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if l == []:\n print('occupancy_grid_3d.segment_objects: There is no plane.')\n return None,None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Expr_L430_C12", "label": "print()", "type": "expression", "loc": [430, 430], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L429_C8", "vector": [8, 3, 0.7015, 0.0016, 3, 0.52, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('occupancy_grid_3d.segment_objects: There is no plane.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Return_L431_C12", "label": "return", "type": "return", "loc": [431, 431], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L429_C8", "vector": [13, 3, 0.7031, 0.0016, 3, 0.52, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return None,None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L433_C8", "label": "if", "type": "if", "loc": [433, 436], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L422_C4", "vector": [4, 2, 0.7088, 0.0065, 2, 0.98, 0.6, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if twod == False:\n labelled_arr,n_labels = self.find_objects()\n else:\n labelled_arr,n_labels = self.find_objects_2d()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L434_C12", "label": "labelled_arr, n_labels = find_objects()", "type": "assigned_variable", "loc": [434, 434], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L433_C8", "vector": [14, 3, 0.708, 0.0016, 3, 0.84, 0.0, 775, 3, 0, 0, 0, 936, 10, 1], "semantic": {"name": "labelled_arr, n_labels", "arg_names": [], "import_names": [], "rhs_call_name": "find_objects", "annotation": ""}, "snippet": " labelled_arr,n_labels = self.find_objects()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L436_C12", "label": "labelled_arr, n_labels = find_objects_2d()", "type": "assigned_variable", "loc": [436, 436], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L433_C8", "vector": [14, 3, 0.7113, 0.0016, 3, 0.84, 1.0, 775, 3, 0, 0, 0, 417, 10, 1], "semantic": {"name": "labelled_arr, n_labels", "arg_names": [], "import_names": [], "rhs_call_name": "find_objects_2d", "annotation": ""}, "snippet": " labelled_arr,n_labels = self.find_objects_2d()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L437_C8", "label": "assign", "type": "assigned_variable", "loc": [437, 437], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L422_C4", "vector": [14, 2, 0.7129, 0.0016, 2, 0.98, 0.8, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.grid[:,:,l] = plane_and_below_pts"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Return_L438_C8", "label": "return", "type": "return", "loc": [438, 438], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L422_C4", "vector": [13, 2, 0.7145, 0.0016, 2, 0.98, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return labelled_arr,n_labels"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L440_C4", "label": "find_objects_2d", "type": "function", "loc": [440, 488], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:ClassDef_L93_C0", "vector": [2, 1, 0.7569, 0.0799, 1, 0.74, 0.9231, 417, 0, 1, 1, 0, 0, 0, 22], "semantic": {"name": "find_objects_2d", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def find_objects_2d(self):\n ''' projects all points into the xy plane and then performs\n segmentation by region growing.\n '''\n connect_structure = np.empty((3,3),dtype='int')\n connect_structure[:,:] = 1\n grid_2d = np.max(self.grid[:,:,:],2)\n# grid_2d = ni.binary_erosion(grid_2d)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Expr_L441_C8", "label": "expression", "type": "expression", "loc": [441, 443], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L440_C4", "vector": [8, 2, 0.721, 0.0049, 2, 0.67, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' projects all points into the xy plane and then performs\n segmentation by region growing.\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L444_C8", "label": "connect_structure = empty()", "type": "assigned_variable", "loc": [444, 444], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L440_C4", "vector": [14, 2, 0.7243, 0.0016, 2, 0.67, 0.0625, 297, 3, 2, 0, 0, 365, 10, 1], "semantic": {"name": "connect_structure", "arg_names": [], "import_names": [], "rhs_call_name": "empty", "annotation": ""}, "snippet": " connect_structure = np.empty((3,3),dtype='int')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L445_C8", "label": "assign", "type": "assigned_variable", "loc": [445, 445], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L440_C4", "vector": [14, 2, 0.7259, 0.0016, 2, 0.67, 0.125, 0, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " connect_structure[:,:] = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L446_C8", "label": "grid_2d = max()", "type": "assigned_variable", "loc": [446, 446], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L440_C4", "vector": [14, 2, 0.7276, 0.0016, 2, 0.67, 0.1875, 804, 3, 2, 0, 0, 442, 10, 1], "semantic": {"name": "grid_2d", "arg_names": [], "import_names": [], "rhs_call_name": "max", "annotation": ""}, "snippet": " grid_2d = np.max(self.grid[:,:,:],2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L449_C8", "label": "labeled_arr, n_labels = label()", "type": "assigned_variable", "loc": [449, 449], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L440_C4", "vector": [14, 2, 0.7325, 0.0016, 2, 0.67, 0.25, 952, 3, 2, 0, 0, 811, 10, 1], "semantic": {"name": "labeled_arr, n_labels", "arg_names": [], "import_names": [], "rhs_call_name": "label", "annotation": ""}, "snippet": " labeled_arr,n_labels = ni.label(grid_2d,connect_structure)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Expr_L450_C8", "label": "print()", "type": "expression", "loc": [450, 450], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L440_C4", "vector": [8, 2, 0.7341, 0.0016, 2, 0.67, 0.3125, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('found %d objects'%(n_labels))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L452_C8", "label": "labeled_arr_3d = swapaxes()", "type": "assigned_variable", "loc": [452, 452], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L440_C4", "vector": [14, 2, 0.7374, 0.0016, 2, 0.67, 0.375, 689, 3, 2, 0, 0, 289, 10, 1], "semantic": {"name": "labeled_arr_3d", "arg_names": [], "import_names": [], "rhs_call_name": "swapaxes", "annotation": ""}, "snippet": " labeled_arr_3d = self.grid.swapaxes(2,0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L453_C8", "label": "labeled_arr_3d = swapaxes()", "type": "assigned_variable", "loc": [453, 453], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L440_C4", "vector": [14, 2, 0.739, 0.0016, 2, 0.67, 0.4375, 689, 3, 2, 0, 0, 289, 10, 1], "semantic": {"name": "labeled_arr_3d", "arg_names": [], "import_names": [], "rhs_call_name": "swapaxes", "annotation": ""}, "snippet": " labeled_arr_3d = labeled_arr_3d.swapaxes(1,2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Expr_L454_C8", "label": "print()", "type": "expression", "loc": [454, 454], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L440_C4", "vector": [8, 2, 0.7406, 0.0016, 2, 0.67, 0.5, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('labeled_arr.shape:',labeled_arr.shape)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Expr_L455_C8", "label": "print()", "type": "expression", "loc": [455, 455], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L440_C4", "vector": [8, 2, 0.7423, 0.0016, 2, 0.67, 0.5625, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('labeled_arr_3d.shape:',labeled_arr_3d.shape)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L456_C8", "label": "labeled_arr_3d =", "type": "assigned_variable", "loc": [456, 456], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L440_C4", "vector": [14, 2, 0.7439, 0.0016, 2, 0.67, 0.625, 689, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "labeled_arr_3d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " labeled_arr_3d = labeled_arr_3d*labeled_arr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L457_C8", "label": "labeled_arr_3d = swapaxes()", "type": "assigned_variable", "loc": [457, 457], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L440_C4", "vector": [14, 2, 0.7455, 0.0016, 2, 0.67, 0.6875, 689, 3, 2, 0, 0, 289, 10, 1], "semantic": {"name": "labeled_arr_3d", "arg_names": [], "import_names": [], "rhs_call_name": "swapaxes", "annotation": ""}, "snippet": " labeled_arr_3d = labeled_arr_3d.swapaxes(2,0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L458_C8", "label": "labeled_arr_3d = swapaxes()", "type": "assigned_variable", "loc": [458, 458], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L440_C4", "vector": [14, 2, 0.7471, 0.0016, 2, 0.67, 0.75, 689, 3, 2, 0, 0, 289, 10, 1], "semantic": {"name": "labeled_arr_3d", "arg_names": [], "import_names": [], "rhs_call_name": "swapaxes", "annotation": ""}, "snippet": " labeled_arr_3d = labeled_arr_3d.swapaxes(1,0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L459_C8", "label": "labeled_arr =", "type": "assigned_variable", "loc": [459, 459], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L440_C4", "vector": [14, 2, 0.7488, 0.0016, 2, 0.67, 0.8125, 434, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "labeled_arr", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " labeled_arr = labeled_arr_3d"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L462_C8", "label": "if", "type": "if", "loc": [462, 484], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L440_C4", "vector": [4, 2, 0.7716, 0.0375, 2, 0.67, 0.875, 0, 0, 0, 0, 0, 0, 0, 11], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if n_labels > 0:\n labels_list = range(1,n_labels+1)\n #count_objects = ni.sum(grid_2d,labeled_arr,labels_list)\n count_objects = ni.sum(self.grid,labeled_arr,labels_list)\n if n_labels == 1:\n count_objects = [count_objects]\n\n t0 = time.time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L463_C12", "label": "labels_list = range()", "type": "assigned_variable", "loc": [463, 463], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L462_C8", "vector": [14, 3, 0.7553, 0.0016, 3, 0.99, 0.0, 325, 3, 2, 0, 0, 816, 10, 1], "semantic": {"name": "labels_list", "arg_names": [], "import_names": [], "rhs_call_name": "range", "annotation": ""}, "snippet": " labels_list = range(1,n_labels+1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L465_C12", "label": "count_objects = sum()", "type": "assigned_variable", "loc": [465, 465], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L462_C8", "vector": [14, 3, 0.7586, 0.0016, 3, 0.99, 0.1111, 769, 3, 3, 0, 0, 824, 10, 1], "semantic": {"name": "count_objects", "arg_names": [], "import_names": [], "rhs_call_name": "sum", "annotation": ""}, "snippet": " count_objects = ni.sum(self.grid,labeled_arr,labels_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L466_C12", "label": "if", "type": "if", "loc": [466, 467], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L462_C8", "vector": [4, 3, 0.761, 0.0033, 3, 0.99, 0.2222, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if n_labels == 1:\n count_objects = [count_objects]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L467_C16", "label": "count_objects =", "type": "assigned_variable", "loc": [467, 467], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L466_C12", "vector": [14, 4, 0.7618, 0.0016, 4, 0.1, 0.0, 769, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "count_objects", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " count_objects = [count_objects]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L469_C12", "label": "t0 = time()", "type": "assigned_variable", "loc": [469, 469], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L462_C8", "vector": [14, 3, 0.7651, 0.0016, 3, 0.99, 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_99601:Assign_L470_C12", "label": "new_labels_list =", "type": "assigned_variable", "loc": [470, 470], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L462_C8", "vector": [14, 3, 0.7667, 0.0016, 3, 0.99, 0.4444, 12, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "new_labels_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " new_labels_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:For_L472_C12", "label": "for c, l", "type": "for", "loc": [472, 476], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L462_C8", "vector": [6, 3, 0.7732, 0.0082, 3, 0.99, 0.5556, 723, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "c, l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for c,l in zip(count_objects,labels_list):\n if c > 3:\n new_labels_list.append(l)\n else:\n labeled_arr[np.where(labeled_arr == l)] = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L473_C16", "label": "if", "type": "if", "loc": [473, 476], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:For_L472_C12", "vector": [4, 4, 0.7741, 0.0065, 4, 0.16, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if c > 3:\n new_labels_list.append(l)\n else:\n labeled_arr[np.where(labeled_arr == l)] = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Expr_L474_C20", "label": "append()", "type": "expression", "loc": [474, 474], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L473_C16", "vector": [8, 5, 0.7732, 0.0016, 5, 0.21, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " new_labels_list.append(l)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L476_C20", "label": "assign", "type": "assigned_variable", "loc": [476, 476], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L473_C16", "vector": [14, 5, 0.7765, 0.0016, 5, 0.21, 1.0, 0, 1, 0, 0, 0, 0, 1, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " labeled_arr[np.where(labeled_arr == l)] = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:For_L479_C12", "label": "for nl, l", "type": "for", "loc": [479, 480], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L462_C8", "vector": [6, 3, 0.7822, 0.0033, 3, 0.99, 0.6667, 313, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "nl, l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for nl,l in enumerate(new_labels_list):\n labeled_arr[np.where(labeled_arr == l)] = nl+1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L480_C16", "label": "assign", "type": "assigned_variable", "loc": [480, 480], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:For_L479_C12", "vector": [14, 4, 0.783, 0.0016, 4, 0.71, 0.0, 0, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " labeled_arr[np.where(labeled_arr == l)] = nl+1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L482_C12", "label": "n_labels = len()", "type": "assigned_variable", "loc": [482, 482], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L462_C8", "vector": [14, 3, 0.7863, 0.0016, 3, 0.99, 0.7778, 797, 3, 1, 0, 0, 890, 10, 1], "semantic": {"name": "n_labels", "arg_names": [], "import_names": [], "rhs_call_name": "len", "annotation": ""}, "snippet": " n_labels = len(new_labels_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L483_C12", "label": "t1 = time()", "type": "assigned_variable", "loc": [483, 483], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L462_C8", "vector": [14, 3, 0.7879, 0.0016, 3, 0.99, 0.8889, 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_99601:Expr_L484_C12", "label": "print()", "type": "expression", "loc": [484, 484], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L462_C8", "vector": [8, 3, 0.7896, 0.0016, 3, 0.99, 1.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-t0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Expr_L486_C8", "label": "print()", "type": "expression", "loc": [486, 486], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L440_C4", "vector": [8, 2, 0.7928, 0.0016, 2, 0.67, 0.9375, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('found %d objects'%(n_labels))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Return_L488_C8", "label": "return", "type": "return", "loc": [488, 488], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L440_C4", "vector": [13, 2, 0.7961, 0.0016, 2, 0.67, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return labeled_arr_3d,n_labels"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L490_C4", "label": "find_objects", "type": "function", "loc": [490, 545], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:ClassDef_L93_C0", "vector": [2, 1, 0.8442, 0.0914, 1, 0.74, 1.0, 936, 0, 1, 1, 0, 0, 0, 19], "semantic": {"name": "find_objects", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def find_objects(self):\n ''' region growing kind of thing for segmentation. Useful if plane has been removed.\n '''\n connect_structure = np.empty((3,3,3),dtype='int')\n grid = copy.copy(self.grid)\n\n connect_structure[:,:,:] = 0\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Expr_L491_C8", "label": "expression", "type": "expression", "loc": [491, 492], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L490_C4", "vector": [8, 2, 0.8018, 0.0033, 2, 0.94, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' region growing kind of thing for segmentation. Useful if plane has been removed.\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L493_C8", "label": "connect_structure = empty()", "type": "assigned_variable", "loc": [493, 493], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L490_C4", "vector": [14, 2, 0.8042, 0.0016, 2, 0.94, 0.0455, 297, 3, 2, 0, 0, 365, 10, 1], "semantic": {"name": "connect_structure", "arg_names": [], "import_names": [], "rhs_call_name": "empty", "annotation": ""}, "snippet": " connect_structure = np.empty((3,3,3),dtype='int')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L494_C8", "label": "grid = copy()", "type": "assigned_variable", "loc": [494, 494], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L490_C4", "vector": [14, 2, 0.8059, 0.0016, 2, 0.94, 0.0909, 690, 3, 1, 0, 0, 739, 10, 1], "semantic": {"name": "grid", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " grid = copy.copy(self.grid)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L496_C8", "label": "assign", "type": "assigned_variable", "loc": [496, 496], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L490_C4", "vector": [14, 2, 0.8091, 0.0016, 2, 0.94, 0.1364, 0, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " connect_structure[:,:,:] = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L498_C8", "label": "assign", "type": "assigned_variable", "loc": [498, 498], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L490_C4", "vector": [14, 2, 0.8124, 0.0016, 2, 0.94, 0.1818, 0, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " connect_structure[1,1,:] = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L499_C8", "label": "iterations = int()", "type": "assigned_variable", "loc": [499, 499], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L490_C4", "vector": [14, 2, 0.814, 0.0016, 2, 0.94, 0.2273, 143, 3, 1, 0, 0, 901, 10, 2], "semantic": {"name": "iterations", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": " iterations = int(round(0.005/self.resolution[2,0]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L505_C8", "label": "assign", "type": "assigned_variable", "loc": [505, 505], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L490_C4", "vector": [14, 2, 0.8238, 0.0016, 2, 0.94, 0.2727, 0, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " connect_structure[:,:,:] = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L506_C8", "label": "labeled_arr, n_labels = label()", "type": "assigned_variable", "loc": [506, 506], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L490_C4", "vector": [14, 2, 0.8254, 0.0016, 2, 0.94, 0.3182, 952, 3, 2, 0, 0, 811, 10, 1], "semantic": {"name": "labeled_arr, n_labels", "arg_names": [], "import_names": [], "rhs_call_name": "label", "annotation": ""}, "snippet": " labeled_arr,n_labels = ni.label(grid,connect_structure)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Expr_L507_C8", "label": "print()", "type": "expression", "loc": [507, 507], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L490_C4", "vector": [8, 2, 0.8271, 0.0016, 2, 0.94, 0.3636, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('ho!')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Expr_L508_C8", "label": "print()", "type": "expression", "loc": [508, 508], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L490_C4", "vector": [8, 2, 0.8287, 0.0016, 2, 0.94, 0.4091, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('found %d objects'%(n_labels))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L510_C8", "label": "if", "type": "if", "loc": [510, 511], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L490_C4", "vector": [4, 2, 0.8328, 0.0033, 2, 0.94, 0.4545, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if n_labels == 0:\n return labeled_arr,n_labels"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Return_L511_C12", "label": "return", "type": "return", "loc": [511, 511], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L510_C8", "vector": [13, 3, 0.8336, 0.0016, 3, 0.57, 0.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return labeled_arr,n_labels"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L513_C8", "label": "labels_list = range()", "type": "assigned_variable", "loc": [513, 513], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L490_C4", "vector": [14, 2, 0.8369, 0.0016, 2, 0.94, 0.5, 325, 3, 2, 0, 0, 816, 10, 1], "semantic": {"name": "labels_list", "arg_names": [], "import_names": [], "rhs_call_name": "range", "annotation": ""}, "snippet": " labels_list = range(1,n_labels+1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L514_C8", "label": "count_objects = sum()", "type": "assigned_variable", "loc": [514, 514], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L490_C4", "vector": [14, 2, 0.8385, 0.0016, 2, 0.94, 0.5455, 769, 3, 3, 0, 0, 824, 10, 1], "semantic": {"name": "count_objects", "arg_names": [], "import_names": [], "rhs_call_name": "sum", "annotation": ""}, "snippet": " count_objects = ni.sum(grid,labeled_arr,labels_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L515_C8", "label": "if", "type": "if", "loc": [515, 516], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L490_C4", "vector": [4, 2, 0.8409, 0.0033, 2, 0.94, 0.5909, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if n_labels == 1:\n count_objects = [count_objects]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L516_C12", "label": "count_objects =", "type": "assigned_variable", "loc": [516, 516], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L515_C8", "vector": [14, 3, 0.8418, 0.0016, 3, 0.87, 0.0, 769, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "count_objects", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " count_objects = [count_objects]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L526_C8", "label": "t0 = time()", "type": "assigned_variable", "loc": [526, 526], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L490_C4", "vector": [14, 2, 0.8581, 0.0016, 2, 0.94, 0.6364, 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_99601:Assign_L527_C8", "label": "new_labels_list =", "type": "assigned_variable", "loc": [527, 527], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L490_C4", "vector": [14, 2, 0.8597, 0.0016, 2, 0.94, 0.6818, 12, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "new_labels_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " new_labels_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:For_L529_C8", "label": "for c, l", "type": "for", "loc": [529, 533], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L490_C4", "vector": [6, 2, 0.8662, 0.0082, 2, 0.94, 0.7273, 723, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "c, l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for c,l in zip(count_objects,labels_list):\n if c > 3:\n new_labels_list.append(l)\n else:\n labeled_arr[np.where(labeled_arr == l)] = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L530_C12", "label": "if", "type": "if", "loc": [530, 533], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:For_L529_C8", "vector": [4, 3, 0.867, 0.0065, 3, 0.3, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if c > 3:\n new_labels_list.append(l)\n else:\n labeled_arr[np.where(labeled_arr == l)] = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Expr_L531_C16", "label": "append()", "type": "expression", "loc": [531, 531], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L530_C12", "vector": [8, 4, 0.8662, 0.0016, 4, 0.15, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " new_labels_list.append(l)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L533_C16", "label": "assign", "type": "assigned_variable", "loc": [533, 533], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L530_C12", "vector": [14, 4, 0.8695, 0.0016, 4, 0.15, 1.0, 0, 1, 0, 0, 0, 0, 1, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " labeled_arr[np.where(labeled_arr == l)] = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:For_L536_C8", "label": "for nl, l", "type": "for", "loc": [536, 537], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L490_C4", "vector": [6, 2, 0.8752, 0.0033, 2, 0.94, 0.7727, 313, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "nl, l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for nl,l in enumerate(new_labels_list):\n labeled_arr[np.where(labeled_arr == l)] = nl+1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L537_C12", "label": "assign", "type": "assigned_variable", "loc": [537, 537], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:For_L536_C8", "vector": [14, 3, 0.876, 0.0016, 3, 0.49, 0.0, 0, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " labeled_arr[np.where(labeled_arr == l)] = nl+1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L539_C8", "label": "n_labels = len()", "type": "assigned_variable", "loc": [539, 539], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L490_C4", "vector": [14, 2, 0.8793, 0.0016, 2, 0.94, 0.8182, 797, 3, 1, 0, 0, 890, 10, 1], "semantic": {"name": "n_labels", "arg_names": [], "import_names": [], "rhs_call_name": "len", "annotation": ""}, "snippet": " n_labels = len(new_labels_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L540_C8", "label": "t1 = time()", "type": "assigned_variable", "loc": [540, 540], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L490_C4", "vector": [14, 2, 0.8809, 0.0016, 2, 0.94, 0.8636, 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_99601:Expr_L541_C8", "label": "print()", "type": "expression", "loc": [541, 541], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L490_C4", "vector": [8, 2, 0.8825, 0.0016, 2, 0.94, 0.9091, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('time:', t1-t0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Expr_L544_C8", "label": "print()", "type": "expression", "loc": [544, 544], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L490_C4", "vector": [8, 2, 0.8874, 0.0016, 2, 0.94, 0.9545, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('found %d objects'%(n_labels))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Return_L545_C8", "label": "return", "type": "return", "loc": [545, 545], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L490_C4", "vector": [13, 2, 0.8891, 0.0016, 2, 0.94, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return labeled_arr,n_labels"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L549_C0", "label": "if", "type": "if", "loc": [549, 609], "level": 0, "parent": null, "vector": [4, 0, 0.9445, 0.0995, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 28], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n import pygame_opengl_3d_display as po3d\n import hokuyo.pygame_utils as pu\n import processing_3d as p3d\n\n p = optparse.OptionParser()\n\n p.add_option('-f', action='store', type='string', dest='pkl_file_name',"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Import_L550_C4", "label": "pygame_opengl_3d_display import po3d", "type": "import", "loc": [550, 550], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L549_C0", "vector": [1, 1, 0.8972, 0.0016, 1, 0.91, 0.0, 8, 0, 1, 0, 0, 8, 0, 0], "semantic": {"name": "pygame_opengl_3d_display", "arg_names": [], "import_names": ["po3d"], "rhs_call_name": "", "annotation": ""}, "snippet": " import pygame_opengl_3d_display as po3d"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Import_L551_C4", "label": "hokuyo.pygame_utils import pu", "type": "import", "loc": [551, 551], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L549_C0", "vector": [1, 1, 0.8989, 0.0016, 1, 0.91, 0.0476, 87, 0, 1, 0, 0, 87, 0, 0], "semantic": {"name": "hokuyo.pygame_utils", "arg_names": [], "import_names": ["pu"], "rhs_call_name": "", "annotation": ""}, "snippet": " import hokuyo.pygame_utils as pu"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Import_L552_C4", "label": "processing_3d import p3d", "type": "import", "loc": [552, 552], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L549_C0", "vector": [1, 1, 0.9005, 0.0016, 1, 0.91, 0.0952, 842, 0, 1, 0, 0, 842, 0, 0], "semantic": {"name": "processing_3d", "arg_names": [], "import_names": ["p3d"], "rhs_call_name": "", "annotation": ""}, "snippet": " import processing_3d as p3d"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L554_C4", "label": "p = OptionParser()", "type": "assigned_variable", "loc": [554, 554], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L549_C0", "vector": [14, 1, 0.9038, 0.0016, 1, 0.91, 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_99601:Expr_L556_C4", "label": "add_option()", "type": "expression", "loc": [556, 557], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L549_C0", "vector": [8, 1, 0.9078, 0.0033, 1, 0.91, 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('-f', action='store', type='string', dest='pkl_file_name',\n help='file.pkl File with the scan,pos dict.',default=None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Expr_L558_C4", "label": "add_option()", "type": "expression", "loc": [558, 559], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L549_C0", "vector": [8, 1, 0.9111, 0.0033, 1, 0.91, 0.2381, 176, 3, 6, 0, 0, 0, 0, 1], "semantic": {"name": "add_option", "arg_names": [], "import_names": [], "rhs_call_name": "add_option", "annotation": ""}, "snippet": " p.add_option('-c', action='store', type='string', dest='pts_pkl',\n help='pkl file with 3D points',default=None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L561_C4", "label": "opt, args = parse_args()", "type": "assigned_variable", "loc": [561, 561], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L549_C0", "vector": [14, 1, 0.9152, 0.0016, 1, 0.91, 0.2857, 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_99601:Assign_L562_C4", "label": "pts_pkl =", "type": "assigned_variable", "loc": [562, 562], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L549_C0", "vector": [14, 1, 0.9168, 0.0016, 1, 0.91, 0.3333, 967, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pts_pkl", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pts_pkl = opt.pts_pkl"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L563_C4", "label": "pkl_file_name =", "type": "assigned_variable", "loc": [563, 563], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L549_C0", "vector": [14, 1, 0.9184, 0.0016, 1, 0.91, 0.381, 696, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pkl_file_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pkl_file_name = opt.pkl_file_name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L573_C4", "label": "resolution =", "type": "assigned_variable", "loc": [573, 573], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L549_C0", "vector": [14, 1, 0.9347, 0.0016, 1, 0.91, 0.4286, 615, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "resolution", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " resolution = np.matrix([0.01,0.01,0.01]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L574_C4", "label": "gr = occupancy_grid_3d()", "type": "assigned_variable", "loc": [574, 575], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L549_C0", "vector": [14, 1, 0.9372, 0.0033, 1, 0.91, 0.4762, 8, 3, 3, 0, 0, 222, 10, 3], "semantic": {"name": "gr", "arg_names": [], "import_names": [], "rhs_call_name": "occupancy_grid_3d", "annotation": ""}, "snippet": " gr = occupancy_grid_3d(np.matrix([0.45,-0.5,-1.0]).T, np.matrix([0.65,0.05,-0.2]).T,\n resolution)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L577_C4", "label": "if", "type": "if", "loc": [577, 594], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L549_C0", "vector": [4, 1, 0.9551, 0.0294, 1, 0.91, 0.5238, 0, 0, 0, 0, 0, 0, 0, 8], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if pts_pkl != None:\n pts = ut.load_pickle(pts_pkl)\n\n elif pkl_file_name != None:\n dict = ut.load_pickle(pkl_file_name)\n pos_list = dict['pos_list']\n scan_list = dict['scan_list']\n min_angle = math.radians(-40)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L578_C8", "label": "pts = load_pickle()", "type": "assigned_variable", "loc": [578, 578], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L577_C4", "vector": [14, 2, 0.9429, 0.0016, 2, 0.61, 0.0, 195, 3, 1, 0, 0, 65, 10, 1], "semantic": {"name": "pts", "arg_names": [], "import_names": [], "rhs_call_name": "load_pickle", "annotation": ""}, "snippet": " pts = ut.load_pickle(pts_pkl)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L580_C4", "label": "if", "type": "if", "loc": [580, 594], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L577_C4", "vector": [4, 2, 0.9576, 0.0245, 2, 0.61, 1.0, 0, 0, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif pkl_file_name != None:\n dict = ut.load_pickle(pkl_file_name)\n pos_list = dict['pos_list']\n scan_list = dict['scan_list']\n min_angle = math.radians(-40)\n max_angle = math.radians(40)\n\n l1 = dict['l1']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L581_C8", "label": "dict = load_pickle()", "type": "assigned_variable", "loc": [581, 581], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L580_C4", "vector": [14, 3, 0.9478, 0.0016, 3, 0.64, 0.0, 827, 3, 1, 0, 0, 65, 10, 1], "semantic": {"name": "dict", "arg_names": [], "import_names": [], "rhs_call_name": "load_pickle", "annotation": ""}, "snippet": " dict = ut.load_pickle(pkl_file_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L582_C8", "label": "pos_list =", "type": "assigned_variable", "loc": [582, 582], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L580_C4", "vector": [14, 3, 0.9494, 0.0016, 3, 0.64, 0.1, 279, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pos_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pos_list = dict['pos_list']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L583_C8", "label": "scan_list =", "type": "assigned_variable", "loc": [583, 583], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L580_C4", "vector": [14, 3, 0.9511, 0.0016, 3, 0.64, 0.2, 378, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "scan_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " scan_list = dict['scan_list']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L584_C8", "label": "min_angle = radians()", "type": "assigned_variable", "loc": [584, 584], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L580_C4", "vector": [14, 3, 0.9527, 0.0016, 3, 0.64, 0.3, 278, 3, 1, 0, 0, 383, 10, 1], "semantic": {"name": "min_angle", "arg_names": [], "import_names": [], "rhs_call_name": "radians", "annotation": ""}, "snippet": " min_angle = math.radians(-40)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L585_C8", "label": "max_angle = radians()", "type": "assigned_variable", "loc": [585, 585], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L580_C4", "vector": [14, 3, 0.9543, 0.0016, 3, 0.64, 0.4, 451, 3, 1, 0, 0, 383, 10, 1], "semantic": {"name": "max_angle", "arg_names": [], "import_names": [], "rhs_call_name": "radians", "annotation": ""}, "snippet": " max_angle = math.radians(40)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L587_C8", "label": "l1 =", "type": "assigned_variable", "loc": [587, 587], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L580_C4", "vector": [14, 3, 0.9576, 0.0016, 3, 0.64, 0.5, 888, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "l1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " l1 = dict['l1']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L588_C8", "label": "l2 =", "type": "assigned_variable", "loc": [588, 588], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L580_C4", "vector": [14, 3, 0.9592, 0.0016, 3, 0.64, 0.6, 40, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "l2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " l2 = dict['l2']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L589_C8", "label": "pts = generate_pointcloud()", "type": "assigned_variable", "loc": [589, 589], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L580_C4", "vector": [14, 3, 0.9608, 0.0016, 3, 0.64, 0.7, 195, 3, 6, 0, 0, 989, 10, 1], "semantic": {"name": "pts", "arg_names": [], "import_names": [], "rhs_call_name": "generate_pointcloud", "annotation": ""}, "snippet": " pts = p3d.generate_pointcloud(pos_list, scan_list, min_angle, max_angle, l1, l2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Expr_L592_C8", "label": "print()", "type": "expression", "loc": [592, 592], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L580_C4", "vector": [8, 3, 0.9657, 0.0016, 3, 0.64, 0.8, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('specify a pkl file -c or -f')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Expr_L593_C8", "label": "print()", "type": "expression", "loc": [593, 593], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L580_C4", "vector": [8, 3, 0.9674, 0.0016, 3, 0.64, 0.9, 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_99601:Expr_L594_C8", "label": "exit()", "type": "expression", "loc": [594, 594], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L580_C4", "vector": [8, 3, 0.969, 0.0016, 3, 0.64, 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_99601:Expr_L597_C4", "label": "print()", "type": "expression", "loc": [597, 597], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L549_C0", "vector": [8, 1, 0.9739, 0.0016, 1, 0.91, 0.5714, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('started filling the grid')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L598_C4", "label": "t0 = time()", "type": "assigned_variable", "loc": [598, 598], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L549_C0", "vector": [14, 1, 0.9755, 0.0016, 1, 0.91, 0.619, 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_99601:Expr_L599_C4", "label": "fill_grid()", "type": "expression", "loc": [599, 599], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L549_C0", "vector": [8, 1, 0.9772, 0.0016, 1, 0.91, 0.6667, 619, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "fill_grid", "arg_names": [], "import_names": [], "rhs_call_name": "fill_grid", "annotation": ""}, "snippet": " gr.fill_grid(pts)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L600_C4", "label": "t1 = time()", "type": "assigned_variable", "loc": [600, 600], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L549_C0", "vector": [14, 1, 0.9788, 0.0016, 1, 0.91, 0.7143, 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_99601:Expr_L601_C4", "label": "print()", "type": "expression", "loc": [601, 601], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L549_C0", "vector": [8, 1, 0.9804, 0.0016, 1, 0.91, 0.7619, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('time to fill the grid:', t1-t0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L604_C4", "label": "grid_pts = grid_to_centroids()", "type": "assigned_variable", "loc": [604, 604], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L549_C0", "vector": [14, 1, 0.9853, 0.0016, 1, 0.91, 0.8095, 251, 3, 0, 0, 0, 694, 10, 1], "semantic": {"name": "grid_pts", "arg_names": [], "import_names": [], "rhs_call_name": "grid_to_centroids", "annotation": ""}, "snippet": " grid_pts = gr.grid_to_centroids()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L606_C4", "label": "cloud = CubeCloud()", "type": "assigned_variable", "loc": [606, 606], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L549_C0", "vector": [14, 1, 0.9886, 0.0016, 1, 0.91, 0.8571, 824, 3, 3, 0, 0, 751, 10, 2], "semantic": {"name": "cloud", "arg_names": [], "import_names": [], "rhs_call_name": "CubeCloud", "annotation": ""}, "snippet": " cloud = pu.CubeCloud(grid_pts,(0,0,0),(resolution/2).A1.tolist())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L607_C4", "label": "pc = PointCloud()", "type": "assigned_variable", "loc": [607, 607], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L549_C0", "vector": [14, 1, 0.9902, 0.0016, 1, 0.91, 0.9048, 876, 3, 2, 0, 0, 428, 10, 1], "semantic": {"name": "pc", "arg_names": [], "import_names": [], "rhs_call_name": "PointCloud", "annotation": ""}, "snippet": " pc = pu.PointCloud(pts,(100,100,100))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L608_C4", "label": "lc = LineCloud()", "type": "assigned_variable", "loc": [608, 608], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L549_C0", "vector": [14, 1, 0.9918, 0.0016, 1, 0.91, 0.9524, 255, 3, 2, 0, 0, 344, 10, 2], "semantic": {"name": "lc", "arg_names": [], "import_names": [], "rhs_call_name": "LineCloud", "annotation": ""}, "snippet": " lc = pu.LineCloud(gr.grid_lines(),(100,100,0))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99601:Expr_L609_C4", "label": "run()", "type": "expression", "loc": [609, 609], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L549_C0", "vector": [8, 1, 0.9935, 0.0016, 1, 0.91, 1.0, 679, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "run", "arg_names": [], "import_names": [], "rhs_call_name": "run", "annotation": ""}, "snippet": " po3d.run([cloud,pc,lc])"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L55_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Expr_L56_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Expr_L57_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Expr_L58_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Expr_L59_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L61_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L62_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L64_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L65_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L67_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L68_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L70_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L71_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L72_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L73_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L75_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L75_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Expr_L76_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L75_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Expr_L77_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L75_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Expr_L78_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L79_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L80_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L81_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L82_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L83_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L84_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L86_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L87_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:For_L88_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:For_L88_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L89_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:ClassDef_L93_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L100_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L100_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L102_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L100_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L104_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L100_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L105_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L100_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L106_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L100_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L107_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L100_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L109_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L100_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L110_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L100_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L111_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:ClassDef_L93_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L116_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L116_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L117_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L116_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L118_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L116_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L119_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L116_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L120_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L116_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L121_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L116_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L122_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L116_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L124_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L116_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L125_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L116_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L126_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L116_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L127_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L116_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L129_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L116_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L130_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L116_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L131_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L116_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L132_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L116_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L133_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L116_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L134_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L116_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L135_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L116_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L136_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L116_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L138_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L116_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Return_L140_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:ClassDef_L93_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L147_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L148_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L148_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L149_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L148_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L152_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L154_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L154_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Expr_L155_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L154_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Return_L156_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L157_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L160_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L162_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:For_L164_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:For_L164_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L165_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L165_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L166_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:For_L164_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L168_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:For_L164_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L171_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:For_L164_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Expr_L172_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:ClassDef_L93_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L180_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L180_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Expr_L181_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L180_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L183_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L180_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L184_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L180_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L185_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:ClassDef_L93_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L187_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L187_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Expr_L188_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L187_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L192_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L187_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L193_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L187_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L194_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L187_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:For_L196_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:For_L196_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Expr_L197_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L187_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L199_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L199_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Return_L200_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L187_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L201_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L187_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L202_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L187_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L203_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L187_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Expr_L205_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L187_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L207_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L207_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L208_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L207_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:For_L209_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:For_L209_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L212_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:For_L209_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L214_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L214_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L215_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L207_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L216_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L187_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L218_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L218_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L219_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L218_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:For_L220_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:For_L220_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L221_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:For_L220_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L223_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:For_L220_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L226_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L226_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L227_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L218_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L228_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L187_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Return_L230_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:ClassDef_L93_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L232_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L232_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Expr_L233_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L232_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L237_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L232_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L238_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L232_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L239_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L232_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L240_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L240_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Expr_L241_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L240_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Return_L242_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L232_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L251_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L232_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L252_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L232_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L253_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L232_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L257_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L257_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L258_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L257_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L259_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L257_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L261_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L257_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L262_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L257_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L263_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L257_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L265_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L257_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L266_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L257_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Expr_L267_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L257_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Expr_L268_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L257_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Expr_L269_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L257_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L271_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L271_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Expr_L272_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L271_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Expr_L273_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L271_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Expr_L274_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L271_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L275_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L232_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Return_L277_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:ClassDef_L93_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L283_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L283_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L284_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L283_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L285_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L283_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L286_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L283_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L287_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L283_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Return_L289_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:ClassDef_L93_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L292_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L292_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Expr_L293_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L292_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L297_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L297_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L298_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L292_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L300_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L292_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L301_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L292_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L303_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L292_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:For_L304_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L292_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L307_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L307_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L308_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L307_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L310_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L292_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Return_L312_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:ClassDef_L93_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L314_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L314_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Expr_L315_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L314_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L318_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L314_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L319_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L314_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L321_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L314_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:For_L322_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L314_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L325_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L325_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L326_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L325_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L328_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L314_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Return_L330_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:ClassDef_L93_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L332_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L332_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Expr_L333_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L332_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L338_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L332_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L339_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L332_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L344_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L332_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L345_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L332_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L346_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L332_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L349_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L349_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L350_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L349_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L352_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L332_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Expr_L353_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L332_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Expr_L354_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L332_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Expr_L355_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L332_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L357_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L332_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L358_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L332_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L360_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L332_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L361_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L332_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L363_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L332_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L364_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L332_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L365_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L332_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L366_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L332_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L367_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L332_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Return_L368_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:ClassDef_L93_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L370_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L370_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Expr_L372_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L370_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L385_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L370_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L387_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L387_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Expr_L388_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L387_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Return_L389_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L370_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L391_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L370_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L392_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L370_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L393_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L370_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L395_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L370_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L397_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L370_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L399_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L370_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L400_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L370_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L401_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L370_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L402_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L370_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L403_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L370_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L405_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L405_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:For_L406_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:For_L406_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L407_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L370_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L409_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L409_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L410_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L370_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L412_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L370_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:For_L413_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:For_L413_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Expr_L414_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L370_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L416_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L370_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L418_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L370_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L419_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L370_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Return_L420_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:ClassDef_L93_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L422_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L422_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Expr_L423_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L422_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L428_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L422_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L429_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L429_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Expr_L430_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L429_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Return_L431_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L422_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L433_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L433_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L434_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L433_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L436_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L422_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L437_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L422_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Return_L438_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:ClassDef_L93_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L440_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L440_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Expr_L441_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L440_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L444_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L440_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L445_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L440_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L446_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L440_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L449_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L440_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Expr_L450_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L440_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L452_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L440_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L453_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L440_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Expr_L454_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L440_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Expr_L455_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L440_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L456_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L440_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L457_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L440_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L458_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L440_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L459_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L440_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L462_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L462_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L463_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L462_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L465_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L462_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L466_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L466_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L467_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L462_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L469_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L462_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L470_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L462_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:For_L472_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:For_L472_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L473_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L473_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Expr_L474_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L473_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L476_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L462_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:For_L479_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:For_L479_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L480_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L462_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L482_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L462_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L483_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L462_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Expr_L484_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L440_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Expr_L486_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L440_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Return_L488_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:ClassDef_L93_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L490_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L490_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Expr_L491_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L490_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L493_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L490_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L494_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L490_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L496_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L490_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L498_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L490_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L499_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L490_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L505_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L490_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L506_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L490_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Expr_L507_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L490_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Expr_L508_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L490_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L510_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L510_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Return_L511_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L490_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L513_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L490_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L514_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L490_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L515_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L515_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L516_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L490_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L526_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L490_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L527_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L490_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:For_L529_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:For_L529_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L530_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L530_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Expr_L531_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L530_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L533_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L490_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:For_L536_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:For_L536_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L537_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L490_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L539_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L490_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L540_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L490_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Expr_L541_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L490_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Expr_L544_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:FunctionDef_L490_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Return_L545_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L549_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Import_L550_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L549_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Import_L551_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L549_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Import_L552_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L549_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L554_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L549_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Expr_L556_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L549_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Expr_L558_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L549_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L561_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L549_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L562_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L549_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L563_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L549_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L573_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L549_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L574_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L549_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L577_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L577_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L578_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L577_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L580_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L580_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L581_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L580_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L582_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L580_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L583_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L580_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L584_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L580_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L585_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L580_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L587_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L580_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L588_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L580_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L589_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L580_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Expr_L592_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L580_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Expr_L593_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L580_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Expr_L594_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L549_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Expr_L597_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L549_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L598_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L549_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Expr_L599_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L549_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L600_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L549_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Expr_L601_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L549_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L604_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L549_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L606_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L549_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L607_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L549_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Assign_L608_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99601:If_L549_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99601:Expr_L609_C4"}]
import roslib; roslib.load_manifest('point_cloud_ros') from sensor_msgs.msg import PointCloud from geometry_msgs.msg import Point32 from sensor_msgs.msg import ChannelFloat32 import numpy as np import time ## PointCloud -> 3xN np matrix # @param ros_pointcloud - robot_msgs/PointCloud # @return 3xN np matrix def ros_pointcloud_to_np(ros_pointcloud): ''' ros PointCloud.pts -> 3xN numpy matrix ''' return ros_pts_to_np(ros_pointcloud.points) ## list of Point32 points -> 3xN np matrix # @param ros_points - Point32[ ] (for e.g. from robot_msgs/PointCloud or Polygon3D) # @return 3xN np matrix def ros_pts_to_np(ros_pts): pts_list = [] for p in ros_pts: pts_list.append([p.x,p.y,p.z]) return np.matrix(pts_list).T ## 3xN np matrix -> ros PointCloud # @param pts - 3xN np matrix # @return PointCloud as defined in robot_msgs/msg/PointCloud.msg def np_points_to_ros(pts): p_list = [] chlist = [] # p_list = [Point32(p[0,0], p[0,1], p[0,2]) for p in pts.T] # chlist = np.zeros(pts.shape[1]).tolist() for p in pts.T: p_list.append(Point32(p[0,0],p[0,1],p[0,2])) chlist.append(0.) ch = ChannelFloat32('t',chlist) pc = PointCloud() pc.points = p_list pc.channels = [ch] return pc
ajibawa-2023/Python-Code-Large/train/row_99602
26
45
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99602:Import_L1_C0", "label": "roslib import roslib", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0222, 0.0222, 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('point_cloud_ros')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99602:Expr_L1_C15", "label": "load_manifest()", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.0222, 0.0222, 0, 0.66, 0.1111, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('point_cloud_ros')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99602:ImportFrom_L2_C0", "label": "from sensor_msgs.msg import PointCloud", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0444, 0.0222, 0, 0.66, 0.2222, 531, 0, 1, 0, 0, 531, 0, 0], "semantic": {"name": "sensor_msgs.msg", "arg_names": [], "import_names": ["PointCloud"], "rhs_call_name": "", "annotation": ""}, "snippet": "from sensor_msgs.msg import PointCloud"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99602:ImportFrom_L3_C0", "label": "from geometry_msgs.msg import Point32", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0667, 0.0222, 0, 0.66, 0.3333, 951, 0, 1, 0, 0, 951, 0, 0], "semantic": {"name": "geometry_msgs.msg", "arg_names": [], "import_names": ["Point32"], "rhs_call_name": "", "annotation": ""}, "snippet": "from geometry_msgs.msg import Point32"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99602:ImportFrom_L4_C0", "label": "from sensor_msgs.msg import ChannelFloat32", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0889, 0.0222, 0, 0.66, 0.4444, 531, 0, 1, 0, 0, 531, 0, 0], "semantic": {"name": "sensor_msgs.msg", "arg_names": [], "import_names": ["ChannelFloat32"], "rhs_call_name": "", "annotation": ""}, "snippet": "from sensor_msgs.msg import ChannelFloat32"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99602:Import_L5_C0", "label": "numpy import np", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.1111, 0.0222, 0, 0.66, 0.5556, 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_99602:Import_L6_C0", "label": "time import time", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.1333, 0.0222, 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_99602:FunctionDef_L11_C0", "label": "ros_pointcloud_to_np", "type": "function", "loc": [11, 14], "level": 0, "parent": null, "vector": [2, 0, 0.2778, 0.0889, 0, 0.66, 0.7778, 928, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "ros_pointcloud_to_np", "arg_names": ["ros_pointcloud"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def ros_pointcloud_to_np(ros_pointcloud):\n ''' ros PointCloud.pts -> 3xN numpy matrix\n '''\n return ros_pts_to_np(ros_pointcloud.points)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99602:Expr_L12_C4", "label": "expression", "type": "expression", "loc": [12, 13], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99602:FunctionDef_L11_C0", "vector": [8, 1, 0.2778, 0.0444, 1, 0.83, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' ros PointCloud.pts -> 3xN numpy matrix\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99602:Return_L14_C4", "label": "return", "type": "return", "loc": [14, 14], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99602:FunctionDef_L11_C0", "vector": [13, 1, 0.3111, 0.0222, 1, 0.83, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ros_pts_to_np(ros_pointcloud.points)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99602:FunctionDef_L19_C0", "label": "ros_pts_to_np", "type": "function", "loc": [19, 24], "level": 0, "parent": null, "vector": [2, 0, 0.4778, 0.1333, 0, 0.66, 0.8889, 846, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "ros_pts_to_np", "arg_names": ["ros_pts"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def ros_pts_to_np(ros_pts):\n pts_list = []\n for p in ros_pts:\n pts_list.append([p.x,p.y,p.z])\n\n return np.matrix(pts_list).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99602:Assign_L20_C4", "label": "pts_list =", "type": "assigned_variable", "loc": [20, 20], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99602:FunctionDef_L19_C0", "vector": [14, 1, 0.4444, 0.0222, 1, 0.09, 0.0, 713, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "pts_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pts_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99602:For_L21_C4", "label": "for p", "type": "for", "loc": [21, 22], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99602:FunctionDef_L19_C0", "vector": [6, 1, 0.4778, 0.0444, 1, 0.09, 0.5, 491, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for p in ros_pts:\n pts_list.append([p.x,p.y,p.z])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99602:Expr_L22_C8", "label": "append()", "type": "expression", "loc": [22, 22], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99602:For_L21_C4", "vector": [8, 2, 0.4889, 0.0222, 2, 0.01, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " pts_list.append([p.x,p.y,p.z])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99602:Return_L24_C4", "label": "return", "type": "return", "loc": [24, 24], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99602:FunctionDef_L19_C0", "vector": [13, 1, 0.5333, 0.0222, 1, 0.09, 1.0, 0, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return np.matrix(pts_list).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99602:FunctionDef_L29_C0", "label": "np_points_to_ros", "type": "function", "loc": [29, 43], "level": 0, "parent": null, "vector": [2, 0, 0.8, 0.3333, 0, 0.66, 1.0, 955, 0, 1, 1, 0, 0, 0, 5], "semantic": {"name": "np_points_to_ros", "arg_names": ["pts"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def np_points_to_ros(pts):\n p_list = []\n chlist = []\n\n# p_list = [Point32(p[0,0], p[0,1], p[0,2]) for p in pts.T]\n# chlist = np.zeros(pts.shape[1]).tolist()\n for p in pts.T:\n p_list.append(Point32(p[0,0],p[0,1],p[0,2]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99602:Assign_L30_C4", "label": "p_list =", "type": "assigned_variable", "loc": [30, 30], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99602:FunctionDef_L29_C0", "vector": [14, 1, 0.6667, 0.0222, 1, 0.39, 0.0, 98, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "p_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99602:Assign_L31_C4", "label": "chlist =", "type": "assigned_variable", "loc": [31, 31], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99602:FunctionDef_L29_C0", "vector": [14, 1, 0.6889, 0.0222, 1, 0.39, 0.1429, 132, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "chlist", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " chlist = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99602:For_L35_C4", "label": "for p", "type": "for", "loc": [35, 37], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99602:FunctionDef_L29_C0", "vector": [6, 1, 0.8, 0.0667, 1, 0.39, 0.2857, 491, 7, 0, 0, 0, 0, 0, 3], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for p in pts.T:\n p_list.append(Point32(p[0,0],p[0,1],p[0,2]))\n chlist.append(0.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99602:Expr_L36_C8", "label": "append()", "type": "expression", "loc": [36, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99602:For_L35_C4", "vector": [8, 2, 0.8, 0.0222, 2, 0.26, 0.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " p_list.append(Point32(p[0,0],p[0,1],p[0,2]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99602:Expr_L37_C8", "label": "append()", "type": "expression", "loc": [37, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99602:For_L35_C4", "vector": [8, 2, 0.8222, 0.0222, 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": " chlist.append(0.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99602:Assign_L39_C4", "label": "ch = ChannelFloat32()", "type": "assigned_variable", "loc": [39, 39], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99602:FunctionDef_L29_C0", "vector": [14, 1, 0.8667, 0.0222, 1, 0.39, 0.4286, 263, 3, 2, 0, 0, 678, 10, 1], "semantic": {"name": "ch", "arg_names": [], "import_names": [], "rhs_call_name": "ChannelFloat32", "annotation": ""}, "snippet": " ch = ChannelFloat32('t',chlist)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99602:Assign_L40_C4", "label": "pc = PointCloud()", "type": "assigned_variable", "loc": [40, 40], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99602:FunctionDef_L29_C0", "vector": [14, 1, 0.8889, 0.0222, 1, 0.39, 0.5714, 876, 3, 0, 0, 0, 428, 10, 1], "semantic": {"name": "pc", "arg_names": [], "import_names": [], "rhs_call_name": "PointCloud", "annotation": ""}, "snippet": " pc = PointCloud()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99602:Assign_L41_C4", "label": "pc.points =", "type": "assigned_variable", "loc": [41, 41], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99602:FunctionDef_L29_C0", "vector": [14, 1, 0.9111, 0.0222, 1, 0.39, 0.7143, 774, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pc.points", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pc.points = p_list"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99602:Assign_L42_C4", "label": "pc.channels =", "type": "assigned_variable", "loc": [42, 42], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99602:FunctionDef_L29_C0", "vector": [14, 1, 0.9333, 0.0222, 1, 0.39, 0.8571, 626, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "pc.channels", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pc.channels = [ch]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99602:Return_L43_C4", "label": "return", "type": "return", "loc": [43, 43], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99602:FunctionDef_L29_C0", "vector": [13, 1, 0.9556, 0.0222, 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 pc"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99602:FunctionDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99602:Expr_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99602:FunctionDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99602:Return_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99602:FunctionDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99602:Assign_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99602:FunctionDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99602:For_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99602:For_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99602:Expr_L22_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99602:FunctionDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99602:Return_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99602:FunctionDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99602:Assign_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99602:FunctionDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99602:Assign_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99602:FunctionDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99602:For_L35_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99602:For_L35_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99602:Expr_L36_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99602:For_L35_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99602:Expr_L37_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99602:FunctionDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99602:Assign_L39_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99602:FunctionDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99602:Assign_L40_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99602:FunctionDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99602:Assign_L41_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99602:FunctionDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99602:Assign_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99602:FunctionDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99602:Return_L43_C4"}]
#!/usr/bin/python import numpy as np, math import scipy.ndimage as ni import roslib; roslib.load_manifest('point_cloud_ros') import rospy import hrl_lib.util as ut import point_cloud_ros.occupancy_grid as pog import point_cloud_ros.ros_occupancy_grid as rog from point_cloud_ros.msg import OccupancyGrid def og_cb(og_msg, param_list): global occupancy_difference_threshold, connected_comonents_size_threshold rospy.loginfo('og_cb called') diff_og = param_list[0] curr_og = rog.og_msg_to_og3d(og_msg, to_binary = False) if diff_og == None: param_list[0] = curr_og return pog.subtract(diff_og, curr_og) param_list[0] = curr_og diff_og.to_binary(occupancy_difference_threshold) # filter the noise connect_structure = np.zeros((3,3,3), dtype=int) connect_structure[1,1,:] = 1 # connect_structure[1,1,0] = 0 diff_og.grid = ni.binary_opening(diff_og.grid, connect_structure, iterations = 1) # diff_og.grid, n_labels = diff_og.connected_comonents(connected_comonents_size_threshold) print 'np.all(diff_og == 0)', np.all(diff_og.grid == 0) diff_og_msg = rog.og3d_to_og_msg(diff_og) diff_og_msg.header.frame_id = og_msg.header.frame_id diff_og_msg.header.stamp = og_msg.header.stamp param_list[1].publish(diff_og_msg) #------ arbitrarily set paramters ------- occupancy_difference_threshold = 5 connected_comonents_size_threshold = 10 if __name__ == '__main__': rospy.init_node('pc_difference_node') pub = rospy.Publisher('difference_occupancy_grid', OccupancyGrid) param_list = [None, pub] rospy.Subscriber('occupancy_grid', OccupancyGrid, og_cb, param_list) rospy.logout('Ready') rospy.spin()
ajibawa-2023/Python-Code-Large/train/row_99603
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_99603: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_99603:Import_L4_C0", "label": "scipy.ndimage import ni", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0678, 0.0169, 0, 0.66, 0.0833, 348, 0, 1, 0, 0, 348, 0, 0], "semantic": {"name": "scipy.ndimage", "arg_names": [], "import_names": ["ni"], "rhs_call_name": "", "annotation": ""}, "snippet": "import scipy.ndimage as ni"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99603: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.1667, 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('point_cloud_ros')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99603: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.25, 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('point_cloud_ros')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99603: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.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_99603:Import_L9_C0", "label": "hrl_lib.util import ut", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.1525, 0.0169, 0, 0.66, 0.4167, 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_99603:Import_L10_C0", "label": "point_cloud_ros.occupancy_grid import pog", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.1695, 0.0169, 0, 0.66, 0.5, 528, 0, 1, 0, 0, 528, 0, 0], "semantic": {"name": "point_cloud_ros.occupancy_grid", "arg_names": [], "import_names": ["pog"], "rhs_call_name": "", "annotation": ""}, "snippet": "import point_cloud_ros.occupancy_grid as pog"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99603:Import_L11_C0", "label": "point_cloud_ros.ros_occupancy_grid import rog", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.1864, 0.0169, 0, 0.66, 0.5833, 0, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "point_cloud_ros.ros_occupancy_grid", "arg_names": [], "import_names": ["rog"], "rhs_call_name": "", "annotation": ""}, "snippet": "import point_cloud_ros.ros_occupancy_grid as rog"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99603:ImportFrom_L13_C0", "label": "from point_cloud_ros.msg import OccupancyGrid", "type": "import", "loc": [13, 13], "level": 0, "parent": null, "vector": [1, 0, 0.2203, 0.0169, 0, 0.66, 0.6667, 275, 0, 1, 0, 0, 275, 0, 0], "semantic": {"name": "point_cloud_ros.msg", "arg_names": [], "import_names": ["OccupancyGrid"], "rhs_call_name": "", "annotation": ""}, "snippet": "from point_cloud_ros.msg import OccupancyGrid"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99603:FunctionDef_L16_C0", "label": "og_cb", "type": "function", "loc": [16, 42], "level": 0, "parent": null, "vector": [2, 0, 0.4915, 0.4576, 0, 0.66, 0.75, 857, 0, 2, 0, 0, 0, 0, 10], "semantic": {"name": "og_cb", "arg_names": ["og_msg", "param_list"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def og_cb(og_msg, param_list):\n global occupancy_difference_threshold, connected_comonents_size_threshold\n rospy.loginfo('og_cb called')\n diff_og = param_list[0]\n curr_og = rog.og_msg_to_og3d(og_msg, to_binary = False)\n\n if diff_og == None:\n param_list[0] = curr_og"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99603:Expr_L18_C4", "label": "loginfo()", "type": "expression", "loc": [18, 18], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99603:FunctionDef_L16_C0", "vector": [8, 1, 0.3051, 0.0169, 1, 0.75, 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('og_cb called')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99603:Assign_L19_C4", "label": "diff_og =", "type": "assigned_variable", "loc": [19, 19], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99603:FunctionDef_L16_C0", "vector": [14, 1, 0.322, 0.0169, 1, 0.75, 0.0714, 542, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "diff_og", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " diff_og = param_list[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99603:Assign_L20_C4", "label": "curr_og = og_msg_to_og3d()", "type": "assigned_variable", "loc": [20, 20], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99603:FunctionDef_L16_C0", "vector": [14, 1, 0.339, 0.0169, 1, 0.75, 0.1429, 422, 3, 2, 0, 0, 76, 10, 1], "semantic": {"name": "curr_og", "arg_names": [], "import_names": [], "rhs_call_name": "og_msg_to_og3d", "annotation": ""}, "snippet": " curr_og = rog.og_msg_to_og3d(og_msg, to_binary = False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99603:If_L22_C4", "label": "if", "type": "if", "loc": [22, 24], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99603:FunctionDef_L16_C0", "vector": [4, 1, 0.3898, 0.0508, 1, 0.75, 0.2143, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if diff_og == None:\n param_list[0] = curr_og\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99603:Assign_L23_C8", "label": "assign", "type": "assigned_variable", "loc": [23, 23], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99603:If_L22_C4", "vector": [14, 2, 0.3898, 0.0169, 2, 0.61, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " param_list[0] = curr_og"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99603:Return_L24_C8", "label": "return", "type": "return", "loc": [24, 24], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99603:If_L22_C4", "vector": [13, 2, 0.4068, 0.0169, 2, 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_99603:Expr_L26_C4", "label": "subtract()", "type": "expression", "loc": [26, 26], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99603:FunctionDef_L16_C0", "vector": [8, 1, 0.4407, 0.0169, 1, 0.75, 0.2857, 495, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "subtract", "arg_names": [], "import_names": [], "rhs_call_name": "subtract", "annotation": ""}, "snippet": " pog.subtract(diff_og, curr_og)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99603:Assign_L27_C4", "label": "assign", "type": "assigned_variable", "loc": [27, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99603:FunctionDef_L16_C0", "vector": [14, 1, 0.4576, 0.0169, 1, 0.75, 0.3571, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " param_list[0] = curr_og"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99603:Expr_L29_C4", "label": "to_binary()", "type": "expression", "loc": [29, 29], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99603:FunctionDef_L16_C0", "vector": [8, 1, 0.4915, 0.0169, 1, 0.75, 0.4286, 206, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "to_binary", "arg_names": [], "import_names": [], "rhs_call_name": "to_binary", "annotation": ""}, "snippet": " diff_og.to_binary(occupancy_difference_threshold)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99603:Assign_L31_C4", "label": "connect_structure = zeros()", "type": "assigned_variable", "loc": [31, 31], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99603:FunctionDef_L16_C0", "vector": [14, 1, 0.5254, 0.0169, 1, 0.75, 0.5, 297, 3, 2, 0, 0, 213, 10, 1], "semantic": {"name": "connect_structure", "arg_names": [], "import_names": [], "rhs_call_name": "zeros", "annotation": ""}, "snippet": " connect_structure = np.zeros((3,3,3), dtype=int)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99603:Assign_L32_C4", "label": "assign", "type": "assigned_variable", "loc": [32, 32], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99603:FunctionDef_L16_C0", "vector": [14, 1, 0.5424, 0.0169, 1, 0.75, 0.5714, 0, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " connect_structure[1,1,:] = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99603:Assign_L34_C4", "label": "diff_og.grid = binary_opening()", "type": "assigned_variable", "loc": [34, 35], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99603:FunctionDef_L16_C0", "vector": [14, 1, 0.5847, 0.0339, 1, 0.75, 0.6429, 33, 3, 3, 0, 0, 428, 10, 1], "semantic": {"name": "diff_og.grid", "arg_names": [], "import_names": [], "rhs_call_name": "binary_opening", "annotation": ""}, "snippet": " diff_og.grid = ni.binary_opening(diff_og.grid, connect_structure,\n iterations = 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99603:Expr_L38_C4", "label": "print()", "type": "expression", "loc": [38, 38], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99603:FunctionDef_L16_C0", "vector": [8, 1, 0.6441, 0.0169, 1, 0.75, 0.7143, 535, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('np.all(diff_og == 0)', np.all(diff_og.grid == 0))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99603:Assign_L39_C4", "label": "diff_og_msg = og3d_to_og_msg()", "type": "assigned_variable", "loc": [39, 39], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99603:FunctionDef_L16_C0", "vector": [14, 1, 0.661, 0.0169, 1, 0.75, 0.7857, 471, 3, 1, 0, 0, 614, 10, 1], "semantic": {"name": "diff_og_msg", "arg_names": [], "import_names": [], "rhs_call_name": "og3d_to_og_msg", "annotation": ""}, "snippet": " diff_og_msg = rog.og3d_to_og_msg(diff_og)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99603:Assign_L40_C4", "label": "diff_og_msg.header.frame_id =", "type": "assigned_variable", "loc": [40, 40], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99603:FunctionDef_L16_C0", "vector": [14, 1, 0.678, 0.0169, 1, 0.75, 0.8571, 980, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "diff_og_msg.header.frame_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " diff_og_msg.header.frame_id = og_msg.header.frame_id"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99603:Assign_L41_C4", "label": "diff_og_msg.header.stamp =", "type": "assigned_variable", "loc": [41, 41], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99603:FunctionDef_L16_C0", "vector": [14, 1, 0.6949, 0.0169, 1, 0.75, 0.9286, 727, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "diff_og_msg.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " diff_og_msg.header.stamp = og_msg.header.stamp"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99603:Expr_L42_C4", "label": "publish()", "type": "expression", "loc": [42, 42], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99603:FunctionDef_L16_C0", "vector": [8, 1, 0.7119, 0.0169, 1, 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": " param_list[1].publish(diff_og_msg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99603:Assign_L46_C0", "label": "occupancy_difference_threshold =", "type": "assigned_variable", "loc": [46, 46], "level": 0, "parent": null, "vector": [14, 0, 0.7797, 0.0169, 0, 0.66, 0.8333, 559, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "occupancy_difference_threshold", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "occupancy_difference_threshold = 5"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99603:Assign_L47_C0", "label": "connected_comonents_size_threshold =", "type": "assigned_variable", "loc": [47, 47], "level": 0, "parent": null, "vector": [14, 0, 0.7966, 0.0169, 0, 0.66, 0.9167, 407, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "connected_comonents_size_threshold", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "connected_comonents_size_threshold = 10"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99603:If_L49_C0", "label": "if", "type": "if", "loc": [49, 57], "level": 0, "parent": null, "vector": [4, 0, 0.8983, 0.1525, 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 rospy.init_node('pc_difference_node')\n\n pub = rospy.Publisher('difference_occupancy_grid', OccupancyGrid)\n param_list = [None, pub]\n rospy.Subscriber('occupancy_grid', OccupancyGrid, og_cb, param_list)\n rospy.logout('Ready')\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99603:Expr_L50_C4", "label": "init_node()", "type": "expression", "loc": [50, 50], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99603:If_L49_C0", "vector": [8, 1, 0.8475, 0.0169, 1, 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('pc_difference_node')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99603:Assign_L52_C4", "label": "pub = Publisher()", "type": "assigned_variable", "loc": [52, 52], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99603:If_L49_C0", "vector": [14, 1, 0.8814, 0.0169, 1, 0.65, 0.2, 41, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " pub = rospy.Publisher('difference_occupancy_grid', OccupancyGrid)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99603:Assign_L53_C4", "label": "param_list =", "type": "assigned_variable", "loc": [53, 53], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99603:If_L49_C0", "vector": [14, 1, 0.8983, 0.0169, 1, 0.65, 0.4, 459, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "param_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " param_list = [None, pub]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99603:Expr_L54_C4", "label": "Subscriber()", "type": "expression", "loc": [54, 54], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99603:If_L49_C0", "vector": [8, 1, 0.9153, 0.0169, 1, 0.65, 0.6, 455, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "Subscriber", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " rospy.Subscriber('occupancy_grid', OccupancyGrid, og_cb, param_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99603:Expr_L55_C4", "label": "logout()", "type": "expression", "loc": [55, 55], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99603:If_L49_C0", "vector": [8, 1, 0.9322, 0.0169, 1, 0.65, 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('Ready')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99603:Expr_L57_C4", "label": "spin()", "type": "expression", "loc": [57, 57], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99603:If_L49_C0", "vector": [8, 1, 0.9661, 0.0169, 1, 0.65, 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_99603:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99603:Expr_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99603:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99603:Assign_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99603:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99603:Assign_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99603:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99603:If_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99603:If_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99603:Assign_L23_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99603:If_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99603:Return_L24_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99603:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99603:Expr_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99603:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99603:Assign_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99603:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99603:Expr_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99603:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99603:Assign_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99603:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99603:Assign_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99603:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99603:Assign_L34_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99603:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99603:Expr_L38_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99603:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99603:Assign_L39_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99603:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99603:Assign_L40_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99603:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99603:Assign_L41_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99603:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99603:Expr_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99603:If_L49_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99603:Expr_L50_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99603:If_L49_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99603:Assign_L52_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99603:If_L49_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99603:Assign_L53_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99603:If_L49_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99603:Expr_L54_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99603:If_L49_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99603:Expr_L55_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99603:If_L49_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99603:Expr_L57_C4"}]
import time import sys, os, copy import numpy as np, math import scipy.ndimage as ni class occupancy_grid_3d(): ## # @param resolution - 3x1 matrix. size of each cell (in meters) along # the different directions. def __init__(self, center, size, resolution, data, occupancy_threshold, to_binary = True): self.grid_shape = size/resolution tlb = center + size/2 brf = center + size/2 self.size = size self.grid = np.reshape(data, self.grid_shape) self.grid_shape = np.matrix(self.grid.shape).T self.resolution = resolution self.center = center if to_binary: self.to_binary(occupancy_threshold) ## binarize the grid # @param occupancy_threshold - voxels with occupancy less than this are set to zero. def to_binary(self, occupancy_threshold): filled = (self.grid >= occupancy_threshold) self.grid[np.where(filled==True)] = 1 self.grid[np.where(filled==False)] = 0 ## # @param array - if not None then this will be used instead of self.grid # @return 3xN matrix of 3d coord of the cells which have occupancy = 1 def grid_to_points(self, array=None): if array == None: array = self.grid idxs = np.where(array == 1) x_idx = idxs[0] y_idx = idxs[1] z_idx = idxs[2] x = x_idx * self.resolution[0,0] + self.center[0,0] - self.size[0,0]/2 y = y_idx * self.resolution[1,0] + self.center[1,0] - self.size[1,0]/2 z = z_idx * self.resolution[2,0] + self.center[2,0] - self.size[2,0]/2 return np.matrix(np.row_stack([x,y,z])) ## 27-connected components. # @param threshold - min allowed size of connected component def connected_comonents(self, threshold): connect_structure = np.ones((3,3,3), dtype='int') grid = self.grid labeled_arr, n_labels = ni.label(grid, connect_structure) if n_labels == 0: return labeled_arr, n_labels labels_list = range(1,n_labels+1) count_objects = ni.sum(grid, labeled_arr, labels_list) if n_labels == 1: count_objects = [count_objects] t0 = time.time() new_labels_list = [] for c,l in zip(count_objects, labels_list): if c > threshold: new_labels_list.append(l) else: labeled_arr[np.where(labeled_arr == l)] = 0 # relabel stuff for nl,l in enumerate(new_labels_list): labeled_arr[np.where(labeled_arr == l)] = nl+1 n_labels = len(new_labels_list) t1 = time.time() print 'time:', t1-t0 return labeled_arr, n_labels ## subtract occupancy grids. og1 = abs(og1-og2) # @param og1 - occupancy_grid_3d object. # @param og2 - occupancy_grid_3d object. # # will position og2 at an appropriate location within og1 (hopefully) # will copy points in og2 but not in og1 into og1 # #UNTESTED: # * subtracting grids of different sizes. def subtract(og1, og2): if np.all(og1.resolution == og2.resolution) == False: print 'occupancy_grid_3d.subtract: The resolution of the two grids is not the same.' print 'res1, res2:', og1.resolution.A1.tolist(), og2.resolution.A1.tolist() return if np.any(og1.grid_shape!=og2.grid_shape): print 'Grid Sizes:', og1.grid_shape.A1, og2.grid_shape.A1 raise RuntimeError('grids are of different sizes') og1.grid = np.abs(og1.grid - og2.grid) if __name__ == '__main__': print 'Hello World'
ajibawa-2023/Python-Code-Large/train/row_99604
63
109
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99604:Import_L2_C0", "label": "time import time", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0183, 0.0092, 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_99604:Import_L3_C0", "label": "sys import sys, os, copy", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0275, 0.0092, 0, 0.66, 0.1667, 509, 0, 3, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys", "os", "copy"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys, os, copy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99604:Import_L4_C0", "label": "numpy import np, math", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0367, 0.0092, 0, 0.66, 0.3333, 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_99604:Import_L5_C0", "label": "scipy.ndimage import ni", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0459, 0.0092, 0, 0.66, 0.5, 348, 0, 1, 0, 0, 348, 0, 0], "semantic": {"name": "scipy.ndimage", "arg_names": [], "import_names": ["ni"], "rhs_call_name": "", "annotation": ""}, "snippet": "import scipy.ndimage as ni"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99604:ClassDef_L7_C0", "label": "occupancy_grid_3d", "type": "class", "loc": [7, 82], "level": 0, "parent": null, "vector": [3, 0, 0.4083, 0.6972, 0, 0.66, 0.6667, 222, 0, 4, 0, 0, 0, 0, 21], "semantic": {"name": "occupancy_grid_3d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class occupancy_grid_3d():\n\n ##\n # @param resolution - 3x1 matrix. size of each cell (in meters) along\n # the different directions.\n def __init__(self, center, size, resolution, data,\n occupancy_threshold, to_binary = True):\n self.grid_shape = size/resolution"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99604:FunctionDef_L12_C4", "label": "__init__", "type": "function", "loc": [12, 25], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99604:ClassDef_L7_C0", "vector": [2, 1, 0.1697, 0.1284, 1, 0.76, 0.0, 555, 0, 7, 0, 0, 0, 0, 3], "semantic": {"name": "__init__", "arg_names": ["self", "center", "size", "resolution", "data", "occupancy_threshold", "to_binary"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, center, size, resolution, data,\n occupancy_threshold, to_binary = True):\n self.grid_shape = size/resolution\n tlb = center + size/2\n brf = center + size/2\n\n self.size = size\n self.grid = np.reshape(data, self.grid_shape)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99604:Assign_L14_C8", "label": "self.grid_shape =", "type": "assigned_variable", "loc": [14, 14], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99604:FunctionDef_L12_C4", "vector": [14, 2, 0.1284, 0.0092, 2, 0.85, 0.0, 573, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.grid_shape", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.grid_shape = size/resolution"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99604:Assign_L15_C8", "label": "tlb =", "type": "assigned_variable", "loc": [15, 15], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99604:FunctionDef_L12_C4", "vector": [14, 2, 0.1376, 0.0092, 2, 0.85, 0.125, 90, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "tlb", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tlb = center + size/2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99604:Assign_L16_C8", "label": "brf =", "type": "assigned_variable", "loc": [16, 16], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99604:FunctionDef_L12_C4", "vector": [14, 2, 0.1468, 0.0092, 2, 0.85, 0.25, 17, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "brf", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " brf = center + size/2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99604:Assign_L18_C8", "label": "self.size =", "type": "assigned_variable", "loc": [18, 18], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99604:FunctionDef_L12_C4", "vector": [14, 2, 0.1651, 0.0092, 2, 0.85, 0.375, 183, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.size", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.size = size"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99604:Assign_L19_C8", "label": "self.grid = reshape()", "type": "assigned_variable", "loc": [19, 19], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99604:FunctionDef_L12_C4", "vector": [14, 2, 0.1743, 0.0092, 2, 0.85, 0.5, 16, 3, 2, 0, 0, 276, 10, 1], "semantic": {"name": "self.grid", "arg_names": [], "import_names": [], "rhs_call_name": "reshape", "annotation": ""}, "snippet": " self.grid = np.reshape(data, self.grid_shape)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99604:Assign_L20_C8", "label": "self.grid_shape =", "type": "assigned_variable", "loc": [20, 20], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99604:FunctionDef_L12_C4", "vector": [14, 2, 0.1835, 0.0092, 2, 0.85, 0.625, 573, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.grid_shape", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.grid_shape = np.matrix(self.grid.shape).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99604:Assign_L21_C8", "label": "self.resolution =", "type": "assigned_variable", "loc": [21, 21], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99604:FunctionDef_L12_C4", "vector": [14, 2, 0.1927, 0.0092, 2, 0.85, 0.75, 440, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.resolution", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.resolution = resolution"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99604:Assign_L22_C8", "label": "self.center =", "type": "assigned_variable", "loc": [22, 22], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99604:FunctionDef_L12_C4", "vector": [14, 2, 0.2018, 0.0092, 2, 0.85, 0.875, 46, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.center", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.center = center"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99604:If_L24_C8", "label": "if", "type": "if", "loc": [24, 25], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99604:FunctionDef_L12_C4", "vector": [4, 2, 0.2248, 0.0183, 2, 0.85, 1.0, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if to_binary:\n self.to_binary(occupancy_threshold)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99604:Expr_L25_C12", "label": "to_binary()", "type": "expression", "loc": [25, 25], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99604:If_L24_C8", "vector": [8, 3, 0.2294, 0.0092, 3, 0.32, 0.0, 206, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "to_binary", "arg_names": [], "import_names": [], "rhs_call_name": "to_binary", "annotation": ""}, "snippet": " self.to_binary(occupancy_threshold)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99604:FunctionDef_L29_C4", "label": "to_binary", "type": "function", "loc": [29, 32], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99604:ClassDef_L7_C0", "vector": [2, 1, 0.2798, 0.0367, 1, 0.76, 0.3333, 206, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "to_binary", "arg_names": ["self", "occupancy_threshold"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def to_binary(self, occupancy_threshold):\n filled = (self.grid >= occupancy_threshold)\n self.grid[np.where(filled==True)] = 1\n self.grid[np.where(filled==False)] = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99604:Assign_L30_C8", "label": "filled =", "type": "assigned_variable", "loc": [30, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99604:FunctionDef_L29_C4", "vector": [14, 2, 0.2752, 0.0092, 2, 0.57, 0.0, 984, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "filled", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " filled = (self.grid >= occupancy_threshold)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99604:Assign_L31_C8", "label": "assign", "type": "assigned_variable", "loc": [31, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99604:FunctionDef_L29_C4", "vector": [14, 2, 0.2844, 0.0092, 2, 0.57, 0.5, 0, 1, 0, 0, 0, 0, 1, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.grid[np.where(filled==True)] = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99604:Assign_L32_C8", "label": "assign", "type": "assigned_variable", "loc": [32, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99604:FunctionDef_L29_C4", "vector": [14, 2, 0.2936, 0.0092, 2, 0.57, 1.0, 0, 1, 0, 0, 0, 0, 1, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.grid[np.where(filled==False)] = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99604:FunctionDef_L37_C4", "label": "grid_to_points", "type": "function", "loc": [37, 50], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99604:ClassDef_L7_C0", "vector": [2, 1, 0.3991, 0.1284, 1, 0.76, 0.6667, 558, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "grid_to_points", "arg_names": ["self", "array"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def grid_to_points(self, array=None):\n if array == None:\n array = self.grid\n\n idxs = np.where(array == 1)\n x_idx = idxs[0]\n y_idx = idxs[1]\n z_idx = idxs[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99604:If_L38_C8", "label": "if", "type": "if", "loc": [38, 39], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99604:FunctionDef_L37_C4", "vector": [4, 2, 0.3532, 0.0183, 2, 0.04, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if array == None:\n array = self.grid"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99604:Assign_L39_C12", "label": "array =", "type": "assigned_variable", "loc": [39, 39], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99604:If_L38_C8", "vector": [14, 3, 0.3578, 0.0092, 3, 0.76, 0.0, 80, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "array", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " array = self.grid"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99604:Assign_L41_C8", "label": "idxs = where()", "type": "assigned_variable", "loc": [41, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99604:FunctionDef_L37_C4", "vector": [14, 2, 0.3761, 0.0092, 2, 0.04, 0.125, 677, 3, 1, 0, 0, 169, 10, 1], "semantic": {"name": "idxs", "arg_names": [], "import_names": [], "rhs_call_name": "where", "annotation": ""}, "snippet": " idxs = np.where(array == 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99604:Assign_L42_C8", "label": "x_idx =", "type": "assigned_variable", "loc": [42, 42], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99604:FunctionDef_L37_C4", "vector": [14, 2, 0.3853, 0.0092, 2, 0.04, 0.25, 380, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "x_idx", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " x_idx = idxs[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99604:Assign_L43_C8", "label": "y_idx =", "type": "assigned_variable", "loc": [43, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99604:FunctionDef_L37_C4", "vector": [14, 2, 0.3945, 0.0092, 2, 0.04, 0.375, 821, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "y_idx", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " y_idx = idxs[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99604:Assign_L44_C8", "label": "z_idx =", "type": "assigned_variable", "loc": [44, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99604:FunctionDef_L37_C4", "vector": [14, 2, 0.4037, 0.0092, 2, 0.04, 0.5, 160, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "z_idx", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " z_idx = idxs[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99604:Assign_L46_C8", "label": "x =", "type": "assigned_variable", "loc": [46, 46], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99604:FunctionDef_L37_C4", "vector": [14, 2, 0.422, 0.0092, 2, 0.04, 0.625, 190, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " x = x_idx * self.resolution[0,0] + self.center[0,0] - self.size[0,0]/2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99604:Assign_L47_C8", "label": "y =", "type": "assigned_variable", "loc": [47, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99604:FunctionDef_L37_C4", "vector": [14, 2, 0.4312, 0.0092, 2, 0.04, 0.75, 304, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " y = y_idx * self.resolution[1,0] + self.center[1,0] - self.size[1,0]/2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99604:Assign_L48_C8", "label": "z =", "type": "assigned_variable", "loc": [48, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99604:FunctionDef_L37_C4", "vector": [14, 2, 0.4404, 0.0092, 2, 0.04, 0.875, 859, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " z = z_idx * self.resolution[2,0] + self.center[2,0] - self.size[2,0]/2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99604:Return_L50_C8", "label": "return", "type": "return", "loc": [50, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99604:FunctionDef_L37_C4", "vector": [13, 2, 0.4587, 0.0092, 2, 0.04, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return np.matrix(np.row_stack([x,y,z]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99604:FunctionDef_L54_C4", "label": "connected_comonents", "type": "function", "loc": [54, 82], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99604:ClassDef_L7_C0", "vector": [2, 1, 0.6239, 0.2661, 1, 0.76, 1.0, 553, 0, 2, 1, 0, 0, 0, 13], "semantic": {"name": "connected_comonents", "arg_names": ["self", "threshold"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def connected_comonents(self, threshold):\n connect_structure = np.ones((3,3,3), dtype='int')\n grid = self.grid\n labeled_arr, n_labels = ni.label(grid, connect_structure)\n\n if n_labels == 0:\n return labeled_arr, n_labels\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99604:Assign_L55_C8", "label": "connect_structure = ones()", "type": "assigned_variable", "loc": [55, 55], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99604:FunctionDef_L54_C4", "vector": [14, 2, 0.5046, 0.0092, 2, 0.91, 0.0, 297, 3, 2, 0, 0, 530, 10, 1], "semantic": {"name": "connect_structure", "arg_names": [], "import_names": [], "rhs_call_name": "ones", "annotation": ""}, "snippet": " connect_structure = np.ones((3,3,3), dtype='int')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99604:Assign_L56_C8", "label": "grid =", "type": "assigned_variable", "loc": [56, 56], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99604:FunctionDef_L54_C4", "vector": [14, 2, 0.5138, 0.0092, 2, 0.91, 0.0714, 690, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "grid", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " grid = self.grid"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99604:Assign_L57_C8", "label": "labeled_arr, n_labels = label()", "type": "assigned_variable", "loc": [57, 57], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99604:FunctionDef_L54_C4", "vector": [14, 2, 0.5229, 0.0092, 2, 0.91, 0.1429, 952, 3, 2, 0, 0, 811, 10, 1], "semantic": {"name": "labeled_arr, n_labels", "arg_names": [], "import_names": [], "rhs_call_name": "label", "annotation": ""}, "snippet": " labeled_arr, n_labels = ni.label(grid, connect_structure)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99604:If_L59_C8", "label": "if", "type": "if", "loc": [59, 60], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99604:FunctionDef_L54_C4", "vector": [4, 2, 0.5459, 0.0183, 2, 0.91, 0.2143, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if n_labels == 0:\n return labeled_arr, n_labels"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99604:Return_L60_C12", "label": "return", "type": "return", "loc": [60, 60], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99604:If_L59_C8", "vector": [13, 3, 0.5505, 0.0092, 3, 0.95, 0.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return labeled_arr, n_labels"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99604:Assign_L62_C8", "label": "labels_list = range()", "type": "assigned_variable", "loc": [62, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99604:FunctionDef_L54_C4", "vector": [14, 2, 0.5688, 0.0092, 2, 0.91, 0.2857, 325, 3, 2, 0, 0, 816, 10, 1], "semantic": {"name": "labels_list", "arg_names": [], "import_names": [], "rhs_call_name": "range", "annotation": ""}, "snippet": " labels_list = range(1,n_labels+1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99604:Assign_L63_C8", "label": "count_objects = sum()", "type": "assigned_variable", "loc": [63, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99604:FunctionDef_L54_C4", "vector": [14, 2, 0.578, 0.0092, 2, 0.91, 0.3571, 769, 3, 3, 0, 0, 824, 10, 1], "semantic": {"name": "count_objects", "arg_names": [], "import_names": [], "rhs_call_name": "sum", "annotation": ""}, "snippet": " count_objects = ni.sum(grid, labeled_arr, labels_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99604:If_L64_C8", "label": "if", "type": "if", "loc": [64, 65], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99604:FunctionDef_L54_C4", "vector": [4, 2, 0.5917, 0.0183, 2, 0.91, 0.4286, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if n_labels == 1:\n count_objects = [count_objects]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99604:Assign_L65_C12", "label": "count_objects =", "type": "assigned_variable", "loc": [65, 65], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99604:If_L64_C8", "vector": [14, 3, 0.5963, 0.0092, 3, 0.57, 0.0, 769, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "count_objects", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " count_objects = [count_objects]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99604:Assign_L67_C8", "label": "t0 = time()", "type": "assigned_variable", "loc": [67, 67], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99604:FunctionDef_L54_C4", "vector": [14, 2, 0.6147, 0.0092, 2, 0.91, 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_99604:Assign_L68_C8", "label": "new_labels_list =", "type": "assigned_variable", "loc": [68, 68], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99604:FunctionDef_L54_C4", "vector": [14, 2, 0.6239, 0.0092, 2, 0.91, 0.5714, 12, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "new_labels_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " new_labels_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99604:For_L70_C8", "label": "for c, l", "type": "for", "loc": [70, 74], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99604:FunctionDef_L54_C4", "vector": [6, 2, 0.6606, 0.0459, 2, 0.91, 0.6429, 723, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "c, l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for c,l in zip(count_objects, labels_list):\n if c > threshold:\n new_labels_list.append(l)\n else:\n labeled_arr[np.where(labeled_arr == l)] = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99604:If_L71_C12", "label": "if", "type": "if", "loc": [71, 74], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99604:For_L70_C8", "vector": [4, 3, 0.6651, 0.0367, 3, 0.32, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if c > threshold:\n new_labels_list.append(l)\n else:\n labeled_arr[np.where(labeled_arr == l)] = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99604:Expr_L72_C16", "label": "append()", "type": "expression", "loc": [72, 72], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99604:If_L71_C12", "vector": [8, 4, 0.6606, 0.0092, 4, 0.28, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " new_labels_list.append(l)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99604:Assign_L74_C16", "label": "assign", "type": "assigned_variable", "loc": [74, 74], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99604:If_L71_C12", "vector": [14, 4, 0.6789, 0.0092, 4, 0.28, 1.0, 0, 1, 0, 0, 0, 0, 1, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " labeled_arr[np.where(labeled_arr == l)] = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99604:For_L77_C8", "label": "for nl, l", "type": "for", "loc": [77, 78], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99604:FunctionDef_L54_C4", "vector": [6, 2, 0.711, 0.0183, 2, 0.91, 0.7143, 313, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "nl, l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for nl,l in enumerate(new_labels_list):\n labeled_arr[np.where(labeled_arr == l)] = nl+1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99604:Assign_L78_C12", "label": "assign", "type": "assigned_variable", "loc": [78, 78], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99604:For_L77_C8", "vector": [14, 3, 0.7156, 0.0092, 3, 0.76, 0.0, 0, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " labeled_arr[np.where(labeled_arr == l)] = nl+1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99604:Assign_L79_C8", "label": "n_labels = len()", "type": "assigned_variable", "loc": [79, 79], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99604:FunctionDef_L54_C4", "vector": [14, 2, 0.7248, 0.0092, 2, 0.91, 0.7857, 797, 3, 1, 0, 0, 890, 10, 1], "semantic": {"name": "n_labels", "arg_names": [], "import_names": [], "rhs_call_name": "len", "annotation": ""}, "snippet": " n_labels = len(new_labels_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99604:Assign_L80_C8", "label": "t1 = time()", "type": "assigned_variable", "loc": [80, 80], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99604:FunctionDef_L54_C4", "vector": [14, 2, 0.7339, 0.0092, 2, 0.91, 0.8571, 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_99604:Expr_L81_C8", "label": "print()", "type": "expression", "loc": [81, 81], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99604:FunctionDef_L54_C4", "vector": [8, 2, 0.7431, 0.0092, 2, 0.91, 0.9286, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('time:', t1-t0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99604:Return_L82_C8", "label": "return", "type": "return", "loc": [82, 82], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99604:FunctionDef_L54_C4", "vector": [13, 2, 0.7523, 0.0092, 2, 0.91, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return labeled_arr, n_labels"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99604:FunctionDef_L94_C0", "label": "subtract", "type": "function", "loc": [94, 104], "level": 0, "parent": null, "vector": [2, 0, 0.9083, 0.1009, 0, 0.66, 0.8333, 495, 0, 2, 0, 0, 0, 0, 9], "semantic": {"name": "subtract", "arg_names": ["og1", "og2"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def subtract(og1, og2):\n if np.all(og1.resolution == og2.resolution) == False:\n print('occupancy_grid_3d.subtract: The resolution of the two grids is not the same.')\n print('res1, res2:', og1.resolution.A1.tolist(), og2.resolution.A1.tolist())\n return\n\n if np.any(og1.grid_shape!=og2.grid_shape):\n print('Grid Sizes:', og1.grid_shape.A1, og2.grid_shape.A1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99604:If_L95_C4", "label": "if", "type": "if", "loc": [95, 98], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99604:FunctionDef_L94_C0", "vector": [4, 1, 0.8853, 0.0367, 1, 0.38, 0.0, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if np.all(og1.resolution == og2.resolution) == False:\n print('occupancy_grid_3d.subtract: The resolution of the two grids is not the same.')\n print('res1, res2:', og1.resolution.A1.tolist(), og2.resolution.A1.tolist())\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99604:Expr_L96_C8", "label": "print()", "type": "expression", "loc": [96, 96], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99604:If_L95_C4", "vector": [8, 2, 0.8807, 0.0092, 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('occupancy_grid_3d.subtract: The resolution of the two grids is not the same.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99604:Expr_L97_C8", "label": "print()", "type": "expression", "loc": [97, 97], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99604:If_L95_C4", "vector": [8, 2, 0.8899, 0.0092, 2, 0.19, 0.5, 535, 3, 3, 0, 0, 0, 0, 3], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('res1, res2:', og1.resolution.A1.tolist(), og2.resolution.A1.tolist())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99604:Return_L98_C8", "label": "return", "type": "return", "loc": [98, 98], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99604:If_L95_C4", "vector": [13, 2, 0.8991, 0.0092, 2, 0.19, 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_99604:If_L100_C4", "label": "if", "type": "if", "loc": [100, 102], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99604:FunctionDef_L94_C0", "vector": [4, 1, 0.9266, 0.0275, 1, 0.38, 0.5, 0, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if np.any(og1.grid_shape!=og2.grid_shape):\n print('Grid Sizes:', og1.grid_shape.A1, og2.grid_shape.A1)\n raise RuntimeError('grids are of different sizes')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99604:Expr_L101_C8", "label": "print()", "type": "expression", "loc": [101, 101], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99604:If_L100_C4", "vector": [8, 2, 0.9266, 0.0092, 2, 0.82, 0.0, 535, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Grid Sizes:', og1.grid_shape.A1, og2.grid_shape.A1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99604:Assign_L104_C4", "label": "og1.grid = abs()", "type": "assigned_variable", "loc": [104, 104], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99604:FunctionDef_L94_C0", "vector": [14, 1, 0.9541, 0.0092, 1, 0.38, 1.0, 366, 3, 1, 0, 0, 799, 10, 1], "semantic": {"name": "og1.grid", "arg_names": [], "import_names": [], "rhs_call_name": "abs", "annotation": ""}, "snippet": " og1.grid = np.abs(og1.grid - og2.grid)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99604:If_L107_C0", "label": "if", "type": "if", "loc": [107, 108], "level": 0, "parent": null, "vector": [4, 0, 0.9862, 0.0183, 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 print('Hello World')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99604:Expr_L108_C4", "label": "print()", "type": "expression", "loc": [108, 108], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99604:If_L107_C0", "vector": [8, 1, 0.9908, 0.0092, 1, 0.87, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Hello World')"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99604:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99604:FunctionDef_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99604:FunctionDef_L12_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99604:Assign_L14_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99604:FunctionDef_L12_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99604:Assign_L15_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99604:FunctionDef_L12_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99604:Assign_L16_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99604:FunctionDef_L12_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99604:Assign_L18_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99604:FunctionDef_L12_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99604:Assign_L19_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99604:FunctionDef_L12_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99604:Assign_L20_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99604:FunctionDef_L12_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99604:Assign_L21_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99604:FunctionDef_L12_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99604:Assign_L22_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99604:FunctionDef_L12_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99604:If_L24_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99604:If_L24_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99604:Expr_L25_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99604:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99604:FunctionDef_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99604:FunctionDef_L29_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99604:Assign_L30_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99604:FunctionDef_L29_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99604:Assign_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99604:FunctionDef_L29_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99604:Assign_L32_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99604:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99604:FunctionDef_L37_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99604:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99604:If_L38_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99604:If_L38_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99604:Assign_L39_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99604:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99604:Assign_L41_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99604:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99604:Assign_L42_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99604:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99604:Assign_L43_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99604:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99604:Assign_L44_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99604:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99604:Assign_L46_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99604:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99604:Assign_L47_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99604:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99604:Assign_L48_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99604:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99604:Return_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99604:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99604:FunctionDef_L54_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99604:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99604:Assign_L55_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99604:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99604:Assign_L56_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99604:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99604:Assign_L57_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99604:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99604:If_L59_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99604:If_L59_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99604:Return_L60_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99604:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99604:Assign_L62_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99604:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99604:Assign_L63_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99604:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99604:If_L64_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99604:If_L64_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99604:Assign_L65_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99604:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99604:Assign_L67_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99604:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99604:Assign_L68_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99604:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99604:For_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99604:For_L70_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99604:If_L71_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99604:If_L71_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99604:Expr_L72_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99604:If_L71_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99604:Assign_L74_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99604:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99604:For_L77_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99604:For_L77_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99604:Assign_L78_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99604:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99604:Assign_L79_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99604:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99604:Assign_L80_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99604:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99604:Expr_L81_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99604:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99604:Return_L82_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99604:FunctionDef_L94_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99604:If_L95_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99604:If_L95_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99604:Expr_L96_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99604:If_L95_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99604:Expr_L97_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99604:If_L95_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99604:Return_L98_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99604:FunctionDef_L94_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99604:If_L100_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99604:If_L100_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99604:Expr_L101_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99604:FunctionDef_L94_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99604:Assign_L104_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99604:If_L107_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99604:Expr_L108_C4"}]
#!/usr/bin/python import numpy as np, math import time import roslib; roslib.load_manifest('point_cloud_ros') import rospy from point_cloud_ros.msg import OccupancyGrid import hrl_tilting_hokuyo.display_3d_mayavi as d3m import point_cloud_ros.ros_occupancy_grid as rog def mayavi_cb(og, param_list): og3d = rog.og_msg_to_og3d(og) param_list[0] = og3d param_list[1] = True def relay_cb(og, og_pub): rospy.logout('relay_cb called') og3d = rog.og_msg_to_og3d(og) og_new = rog.og3d_to_og_msg(og3d) og_pub.publish(og_new) def vis_occupancy_cb(og, param_list): og3d = rog.og_msg_to_og3d(og, to_binary = False) param_list[0] = og3d param_list[1] = True if __name__ == '__main__': og_pub = rospy.Publisher('relay_og_out', OccupancyGrid) rospy.Subscriber('relay_og_in', OccupancyGrid, relay_cb, og_pub) param_list = [None, False] rospy.init_node('og_sample_python') rospy.logout('Ready') #mode = rospy.get_param('~mode') #mode = 'mayavi' mode = 'vis_occupancy' if mode == 'mayavi': rospy.Subscriber('occupancy_grid', OccupancyGrid, mayavi_cb, param_list) while not rospy.is_shutdown(): if param_list[1] == True: og3d = param_list[0] print 'grid_shape:', og3d.grid.shape pts = og3d.grid_to_points() print pts.shape # param_list[1] = False break rospy.sleep(0.1) d3m.plot_points(pts) d3m.show() if mode == 'vis_occupancy': rospy.Subscriber('occupancy_grid', OccupancyGrid, vis_occupancy_cb, param_list) import matplotlib_util.util as mpu while not rospy.is_shutdown(): if param_list[1] == True: og3d = param_list[0] break rospy.sleep(0.1) occ_array = og3d.grid.flatten() mpu.pl.hist(occ_array, 100) # mpu.plot_yx(occ_array) mpu.show() elif mode == 'relay': rospy.spin()
ajibawa-2023/Python-Code-Large/train/row_99605
51
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_99605:Import_L3_C0", "label": "numpy import np, math", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0375, 0.0125, 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_99605:Import_L4_C0", "label": "time import time", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.05, 0.0125, 0, 0.66, 0.0909, 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_99605:Import_L6_C0", "label": "roslib import roslib", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.075, 0.0125, 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('point_cloud_ros')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99605:Expr_L6_C15", "label": "load_manifest()", "type": "expression", "loc": [6, 6], "level": 0, "parent": null, "vector": [8, 0, 0.075, 0.0125, 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('point_cloud_ros')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99605:Import_L7_C0", "label": "rospy import rospy", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.0875, 0.0125, 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_99605:ImportFrom_L9_C0", "label": "from point_cloud_ros.msg import OccupancyGrid", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.1125, 0.0125, 0, 0.66, 0.4545, 275, 0, 1, 0, 0, 275, 0, 0], "semantic": {"name": "point_cloud_ros.msg", "arg_names": [], "import_names": ["OccupancyGrid"], "rhs_call_name": "", "annotation": ""}, "snippet": "from point_cloud_ros.msg import OccupancyGrid"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99605:Import_L11_C0", "label": "hrl_tilting_hokuyo.display_3d_mayavi import d3m", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.1375, 0.0125, 0, 0.66, 0.5455, 181, 0, 1, 0, 0, 181, 0, 0], "semantic": {"name": "hrl_tilting_hokuyo.display_3d_mayavi", "arg_names": [], "import_names": ["d3m"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_tilting_hokuyo.display_3d_mayavi as d3m"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99605:Import_L12_C0", "label": "point_cloud_ros.ros_occupancy_grid import rog", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.15, 0.0125, 0, 0.66, 0.6364, 0, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "point_cloud_ros.ros_occupancy_grid", "arg_names": [], "import_names": ["rog"], "rhs_call_name": "", "annotation": ""}, "snippet": "import point_cloud_ros.ros_occupancy_grid as rog"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99605:FunctionDef_L14_C0", "label": "mayavi_cb", "type": "function", "loc": [14, 17], "level": 0, "parent": null, "vector": [2, 0, 0.1938, 0.05, 0, 0.66, 0.7273, 518, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "mayavi_cb", "arg_names": ["og", "param_list"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def mayavi_cb(og, param_list):\n og3d = rog.og_msg_to_og3d(og)\n param_list[0] = og3d\n param_list[1] = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99605:Assign_L15_C4", "label": "og3d = og_msg_to_og3d()", "type": "assigned_variable", "loc": [15, 15], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99605:FunctionDef_L14_C0", "vector": [14, 1, 0.1875, 0.0125, 1, 0.91, 0.0, 114, 3, 1, 0, 0, 76, 10, 1], "semantic": {"name": "og3d", "arg_names": [], "import_names": [], "rhs_call_name": "og_msg_to_og3d", "annotation": ""}, "snippet": " og3d = rog.og_msg_to_og3d(og)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99605:Assign_L16_C4", "label": "assign", "type": "assigned_variable", "loc": [16, 16], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99605:FunctionDef_L14_C0", "vector": [14, 1, 0.2, 0.0125, 1, 0.91, 0.5, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " param_list[0] = og3d"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99605:Assign_L17_C4", "label": "assign", "type": "assigned_variable", "loc": [17, 17], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99605:FunctionDef_L14_C0", "vector": [14, 1, 0.2125, 0.0125, 1, 0.91, 1.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " param_list[1] = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99605:FunctionDef_L19_C0", "label": "relay_cb", "type": "function", "loc": [19, 23], "level": 0, "parent": null, "vector": [2, 0, 0.2625, 0.0625, 0, 0.66, 0.8182, 286, 0, 2, 0, 0, 0, 0, 4], "semantic": {"name": "relay_cb", "arg_names": ["og", "og_pub"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def relay_cb(og, og_pub):\n rospy.logout('relay_cb called')\n og3d = rog.og_msg_to_og3d(og)\n og_new = rog.og3d_to_og_msg(og3d)\n og_pub.publish(og_new)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99605:Expr_L20_C4", "label": "logout()", "type": "expression", "loc": [20, 20], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99605:FunctionDef_L19_C0", "vector": [8, 1, 0.25, 0.0125, 1, 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('relay_cb called')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99605:Assign_L21_C4", "label": "og3d = og_msg_to_og3d()", "type": "assigned_variable", "loc": [21, 21], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99605:FunctionDef_L19_C0", "vector": [14, 1, 0.2625, 0.0125, 1, 0.93, 0.3333, 114, 3, 1, 0, 0, 76, 10, 1], "semantic": {"name": "og3d", "arg_names": [], "import_names": [], "rhs_call_name": "og_msg_to_og3d", "annotation": ""}, "snippet": " og3d = rog.og_msg_to_og3d(og)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99605:Assign_L22_C4", "label": "og_new = og3d_to_og_msg()", "type": "assigned_variable", "loc": [22, 22], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99605:FunctionDef_L19_C0", "vector": [14, 1, 0.275, 0.0125, 1, 0.93, 0.6667, 848, 3, 1, 0, 0, 614, 10, 1], "semantic": {"name": "og_new", "arg_names": [], "import_names": [], "rhs_call_name": "og3d_to_og_msg", "annotation": ""}, "snippet": " og_new = rog.og3d_to_og_msg(og3d)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99605:Expr_L23_C4", "label": "publish()", "type": "expression", "loc": [23, 23], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99605:FunctionDef_L19_C0", "vector": [8, 1, 0.2875, 0.0125, 1, 0.93, 1.0, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " og_pub.publish(og_new)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99605:FunctionDef_L26_C0", "label": "vis_occupancy_cb", "type": "function", "loc": [26, 29], "level": 0, "parent": null, "vector": [2, 0, 0.3438, 0.05, 0, 0.66, 0.9091, 391, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "vis_occupancy_cb", "arg_names": ["og", "param_list"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def vis_occupancy_cb(og, param_list):\n og3d = rog.og_msg_to_og3d(og, to_binary = False)\n param_list[0] = og3d\n param_list[1] = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99605:Assign_L27_C4", "label": "og3d = og_msg_to_og3d()", "type": "assigned_variable", "loc": [27, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99605:FunctionDef_L26_C0", "vector": [14, 1, 0.3375, 0.0125, 1, 0.22, 0.0, 114, 3, 2, 0, 0, 76, 10, 1], "semantic": {"name": "og3d", "arg_names": [], "import_names": [], "rhs_call_name": "og_msg_to_og3d", "annotation": ""}, "snippet": " og3d = rog.og_msg_to_og3d(og, to_binary = False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99605:Assign_L28_C4", "label": "assign", "type": "assigned_variable", "loc": [28, 28], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99605:FunctionDef_L26_C0", "vector": [14, 1, 0.35, 0.0125, 1, 0.22, 0.5, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " param_list[0] = og3d"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99605:Assign_L29_C4", "label": "assign", "type": "assigned_variable", "loc": [29, 29], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99605:FunctionDef_L26_C0", "vector": [14, 1, 0.3625, 0.0125, 1, 0.22, 1.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " param_list[1] = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99605:If_L32_C0", "label": "if", "type": "if", "loc": [32, 73], "level": 0, "parent": null, "vector": [4, 0, 0.6562, 0.525, 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\n og_pub = rospy.Publisher('relay_og_out', OccupancyGrid)\n rospy.Subscriber('relay_og_in', OccupancyGrid, relay_cb, og_pub)\n param_list = [None, False]\n\n rospy.init_node('og_sample_python')\n rospy.logout('Ready')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99605:Assign_L34_C4", "label": "og_pub = Publisher()", "type": "assigned_variable", "loc": [34, 34], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99605:If_L32_C0", "vector": [14, 1, 0.425, 0.0125, 1, 0.06, 0.0, 206, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "og_pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " og_pub = rospy.Publisher('relay_og_out', OccupancyGrid)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99605:Expr_L35_C4", "label": "Subscriber()", "type": "expression", "loc": [35, 35], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99605:If_L32_C0", "vector": [8, 1, 0.4375, 0.0125, 1, 0.06, 0.1429, 455, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "Subscriber", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " rospy.Subscriber('relay_og_in', OccupancyGrid, relay_cb, og_pub)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99605:Assign_L36_C4", "label": "param_list =", "type": "assigned_variable", "loc": [36, 36], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99605:If_L32_C0", "vector": [14, 1, 0.45, 0.0125, 1, 0.06, 0.2857, 459, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "param_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " param_list = [None, False]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99605:Expr_L38_C4", "label": "init_node()", "type": "expression", "loc": [38, 38], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99605:If_L32_C0", "vector": [8, 1, 0.475, 0.0125, 1, 0.06, 0.4286, 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('og_sample_python')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99605:Expr_L39_C4", "label": "logout()", "type": "expression", "loc": [39, 39], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99605:If_L32_C0", "vector": [8, 1, 0.4875, 0.0125, 1, 0.06, 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')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99605:Assign_L43_C4", "label": "mode =", "type": "assigned_variable", "loc": [43, 43], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99605:If_L32_C0", "vector": [14, 1, 0.5375, 0.0125, 1, 0.06, 0.7143, 991, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "mode", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mode = 'vis_occupancy'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99605:If_L45_C4", "label": "if", "type": "if", "loc": [45, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99605:If_L32_C0", "vector": [4, 1, 0.6438, 0.175, 1, 0.06, 0.8571, 0, 0, 0, 0, 0, 0, 0, 8], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if mode == 'mayavi':\n rospy.Subscriber('occupancy_grid', OccupancyGrid, mayavi_cb, param_list)\n while not rospy.is_shutdown():\n if param_list[1] == True:\n og3d = param_list[0]\n print('grid_shape:', og3d.grid.shape)\n pts = og3d.grid_to_points()\n print(pts.shape)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99605:Expr_L46_C8", "label": "Subscriber()", "type": "expression", "loc": [46, 46], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99605:If_L45_C4", "vector": [8, 2, 0.575, 0.0125, 2, 0.57, 0.0, 455, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "Subscriber", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " rospy.Subscriber('occupancy_grid', OccupancyGrid, mayavi_cb, param_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99605:While_L47_C8", "label": "while", "type": "while", "loc": [47, 55], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99605:If_L45_C4", "vector": [5, 2, 0.6375, 0.1125, 2, 0.57, 0.3333, 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 param_list[1] == True:\n og3d = param_list[0]\n print('grid_shape:', og3d.grid.shape)\n pts = og3d.grid_to_points()\n print(pts.shape)\n# param_list[1] = False\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99605:If_L48_C12", "label": "if", "type": "if", "loc": [48, 54], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99605:While_L47_C8", "vector": [4, 3, 0.6375, 0.0875, 3, 0.06, 0.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if param_list[1] == True:\n og3d = param_list[0]\n print('grid_shape:', og3d.grid.shape)\n pts = og3d.grid_to_points()\n print(pts.shape)\n# param_list[1] = False\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99605:Assign_L49_C16", "label": "og3d =", "type": "assigned_variable", "loc": [49, 49], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99605:If_L48_C12", "vector": [14, 4, 0.6125, 0.0125, 4, 0.49, 0.0, 114, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "og3d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " og3d = param_list[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99605:Expr_L50_C16", "label": "print()", "type": "expression", "loc": [50, 50], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99605:If_L48_C12", "vector": [8, 4, 0.625, 0.0125, 4, 0.49, 0.3333, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('grid_shape:', og3d.grid.shape)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99605:Assign_L51_C16", "label": "pts = grid_to_points()", "type": "assigned_variable", "loc": [51, 51], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99605:If_L48_C12", "vector": [14, 4, 0.6375, 0.0125, 4, 0.49, 0.6667, 195, 3, 0, 0, 0, 558, 10, 1], "semantic": {"name": "pts", "arg_names": [], "import_names": [], "rhs_call_name": "grid_to_points", "annotation": ""}, "snippet": " pts = og3d.grid_to_points()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99605:Expr_L52_C16", "label": "print()", "type": "expression", "loc": [52, 52], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99605:If_L48_C12", "vector": [8, 4, 0.65, 0.0125, 4, 0.49, 1.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(pts.shape)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99605:Expr_L55_C12", "label": "sleep()", "type": "expression", "loc": [55, 55], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99605:While_L47_C8", "vector": [8, 3, 0.6875, 0.0125, 3, 0.06, 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_99605:Expr_L57_C8", "label": "plot_points()", "type": "expression", "loc": [57, 57], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99605:If_L45_C4", "vector": [8, 2, 0.7125, 0.0125, 2, 0.57, 0.6667, 111, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "plot_points", "arg_names": [], "import_names": [], "rhs_call_name": "plot_points", "annotation": ""}, "snippet": " d3m.plot_points(pts)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99605:Expr_L58_C8", "label": "show()", "type": "expression", "loc": [58, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99605:If_L45_C4", "vector": [8, 2, 0.725, 0.0125, 2, 0.57, 1.0, 497, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "show", "arg_names": [], "import_names": [], "rhs_call_name": "show", "annotation": ""}, "snippet": " d3m.show()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99605:If_L60_C4", "label": "if", "type": "if", "loc": [60, 73], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99605:If_L32_C0", "vector": [4, 1, 0.8313, 0.175, 1, 0.06, 1.0, 0, 0, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if mode == 'vis_occupancy':\n rospy.Subscriber('occupancy_grid', OccupancyGrid, vis_occupancy_cb, param_list)\n import matplotlib_util.util as mpu\n while not rospy.is_shutdown():\n if param_list[1] == True:\n og3d = param_list[0]\n break\n rospy.sleep(0.1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99605:Expr_L61_C8", "label": "Subscriber()", "type": "expression", "loc": [61, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99605:If_L60_C4", "vector": [8, 2, 0.7625, 0.0125, 2, 0.37, 0.0, 455, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "Subscriber", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " rospy.Subscriber('occupancy_grid', OccupancyGrid, vis_occupancy_cb, param_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99605:Import_L62_C8", "label": "matplotlib_util.util import mpu", "type": "import", "loc": [62, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99605:If_L60_C4", "vector": [1, 2, 0.775, 0.0125, 2, 0.37, 0.1667, 781, 0, 1, 0, 0, 781, 0, 0], "semantic": {"name": "matplotlib_util.util", "arg_names": [], "import_names": ["mpu"], "rhs_call_name": "", "annotation": ""}, "snippet": " import matplotlib_util.util as mpu"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99605:While_L63_C8", "label": "while", "type": "while", "loc": [63, 67], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99605:If_L60_C4", "vector": [5, 2, 0.8125, 0.0625, 2, 0.37, 0.3333, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while not rospy.is_shutdown():\n if param_list[1] == True:\n og3d = param_list[0]\n break\n rospy.sleep(0.1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99605:If_L64_C12", "label": "if", "type": "if", "loc": [64, 66], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99605:While_L63_C8", "vector": [4, 3, 0.8125, 0.0375, 3, 0.64, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if param_list[1] == True:\n og3d = param_list[0]\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99605:Assign_L65_C16", "label": "og3d =", "type": "assigned_variable", "loc": [65, 65], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99605:If_L64_C12", "vector": [14, 4, 0.8125, 0.0125, 4, 0.91, 0.0, 114, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "og3d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " og3d = param_list[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99605:Expr_L67_C12", "label": "sleep()", "type": "expression", "loc": [67, 67], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99605:While_L63_C8", "vector": [8, 3, 0.8375, 0.0125, 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.1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99605:Assign_L68_C8", "label": "occ_array = flatten()", "type": "assigned_variable", "loc": [68, 68], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99605:If_L60_C4", "vector": [14, 2, 0.85, 0.0125, 2, 0.37, 0.5, 370, 3, 0, 0, 0, 893, 10, 1], "semantic": {"name": "occ_array", "arg_names": [], "import_names": [], "rhs_call_name": "flatten", "annotation": ""}, "snippet": " occ_array = og3d.grid.flatten()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99605:Expr_L69_C8", "label": "hist()", "type": "expression", "loc": [69, 69], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99605:If_L60_C4", "vector": [8, 2, 0.8625, 0.0125, 2, 0.37, 0.6667, 353, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "hist", "arg_names": [], "import_names": [], "rhs_call_name": "hist", "annotation": ""}, "snippet": " mpu.pl.hist(occ_array, 100)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99605:Expr_L71_C8", "label": "show()", "type": "expression", "loc": [71, 71], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99605:If_L60_C4", "vector": [8, 2, 0.8875, 0.0125, 2, 0.37, 0.8333, 497, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "show", "arg_names": [], "import_names": [], "rhs_call_name": "show", "annotation": ""}, "snippet": " mpu.show()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99605:If_L72_C4", "label": "if", "type": "if", "loc": [72, 73], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99605:If_L60_C4", "vector": [4, 2, 0.9062, 0.025, 2, 0.37, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif mode == 'relay':\n rospy.spin()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99605:Expr_L73_C8", "label": "spin()", "type": "expression", "loc": [73, 73], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99605:If_L72_C4", "vector": [8, 3, 0.9125, 0.0125, 3, 0.94, 0.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_99605:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99605:Assign_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99605:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99605:Assign_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99605:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99605:Assign_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99605:FunctionDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99605:Expr_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99605:FunctionDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99605:Assign_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99605:FunctionDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99605:Assign_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99605:FunctionDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99605:Expr_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99605:FunctionDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99605:Assign_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99605:FunctionDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99605:Assign_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99605:FunctionDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99605:Assign_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99605:If_L32_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99605:Assign_L34_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99605:If_L32_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99605:Expr_L35_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99605:If_L32_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99605:Assign_L36_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99605:If_L32_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99605:Expr_L38_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99605:If_L32_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99605:Expr_L39_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99605:If_L32_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99605:Assign_L43_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99605:If_L32_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99605:If_L45_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99605:If_L45_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99605:Expr_L46_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99605:If_L45_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99605:While_L47_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99605:While_L47_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99605:If_L48_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99605:If_L48_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99605:Assign_L49_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99605:If_L48_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99605:Expr_L50_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99605:If_L48_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99605:Assign_L51_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99605:If_L48_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99605:Expr_L52_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99605:While_L47_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99605:Expr_L55_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99605:If_L45_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99605:Expr_L57_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99605:If_L45_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99605:Expr_L58_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99605:If_L32_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99605:If_L60_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99605:If_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99605:Expr_L61_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99605:If_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99605:Import_L62_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99605:If_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99605:While_L63_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99605:While_L63_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99605:If_L64_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99605:If_L64_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99605:Assign_L65_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99605:While_L63_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99605:Expr_L67_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99605:If_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99605:Assign_L68_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99605:If_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99605:Expr_L69_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99605:If_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99605:Expr_L71_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99605:If_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99605:If_L72_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99605:If_L72_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99605:Expr_L73_C8"}]
#!/usr/bin/python import numpy as np, math import roslib; roslib.load_manifest('point_cloud_ros') import rospy import point_cloud_ros.ros_occupancy_grid as rog from point_cloud_ros.msg import OccupancyGrid from visualization_msgs.msg import Marker ## return a Marker message object # @param loc - (x,y,z) # @param scale - (x,y,z) # @param color - (r,g,b,a) # @param shape - 'sphere' # @param frame_id - string. def simple_viz_marker(loc, scale, color, shape, frame_id): marker = Marker() marker.header.frame_id = frame_id marker.header.stamp = rospy.rostime.get_rostime() marker.ns = 'basic_shapes' marker.id = 0 if shape == 'sphere': marker.type = Marker.SPHERE marker.action = Marker.ADD marker.pose.position.x = loc[0] marker.pose.position.y = loc[1] marker.pose.position.z = loc[2] marker.pose.orientation.x = 0.0 marker.pose.orientation.y = 0.0 marker.pose.orientation.z = 0.0 marker.pose.orientation.w = 1.0 marker.scale.x = scale[0] marker.scale.y = scale[1] marker.scale.z = scale[2] marker.color.r = color[0] marker.color.g = color[1] marker.color.b = color[2] marker.color.a = color[3] marker.lifetime = rospy.Duration() return marker if __name__ == '__main__': rospy.init_node('set_og_param_node') og_param_pub = rospy.Publisher('/og_params', OccupancyGrid) marker_pub = rospy.Publisher('/occupancy_grid_viz_marker', Marker) rospy.logout('Ready') center = np.matrix([0.8, 0., 0.8]).T # for single object bag file #center = np.matrix([0.6, 0., 0.75]).T size = np.matrix([0.4, 0.4, 0.4]).T #resolution = np.matrix([0.01, 0.01, 0.01]).T resolution = np.matrix([0.005, 0.005, 0.005]).T occupancy_threshold = 5 frame_id = 'base_link' scale = (0.02, 0.02, 0.02) color = (0., 1., 0., 1.) shape = 'sphere' marker = simple_viz_marker(center.A1, scale, color, shape, frame_id) og_param = rog.og_param_msg(center, size, resolution, occupancy_threshold, frame_id) r = rospy.Rate(2) while not rospy.is_shutdown(): marker_pub.publish(marker) og_param_pub.publish(og_param) r.sleep() rospy.spin()
ajibawa-2023/Python-Code-Large/train/row_99606
53
75
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99606:Import_L3_C0", "label": "numpy import np, math", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.04, 0.0133, 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_99606:Import_L5_C0", "label": "roslib import roslib", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0667, 0.0133, 0, 0.66, 0.125, 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('point_cloud_ros')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99606:Expr_L5_C15", "label": "load_manifest()", "type": "expression", "loc": [5, 5], "level": 0, "parent": null, "vector": [8, 0, 0.0667, 0.0133, 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": "import roslib; roslib.load_manifest('point_cloud_ros')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99606:Import_L6_C0", "label": "rospy import rospy", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.08, 0.0133, 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_99606:Import_L7_C0", "label": "point_cloud_ros.ros_occupancy_grid import rog", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.0933, 0.0133, 0, 0.66, 0.5, 0, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "point_cloud_ros.ros_occupancy_grid", "arg_names": [], "import_names": ["rog"], "rhs_call_name": "", "annotation": ""}, "snippet": "import point_cloud_ros.ros_occupancy_grid as rog"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99606:ImportFrom_L8_C0", "label": "from point_cloud_ros.msg import OccupancyGrid", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.1067, 0.0133, 0, 0.66, 0.625, 275, 0, 1, 0, 0, 275, 0, 0], "semantic": {"name": "point_cloud_ros.msg", "arg_names": [], "import_names": ["OccupancyGrid"], "rhs_call_name": "", "annotation": ""}, "snippet": "from point_cloud_ros.msg import OccupancyGrid"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99606:ImportFrom_L10_C0", "label": "from visualization_msgs.msg import Marker", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.1333, 0.0133, 0, 0.66, 0.75, 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_99606:FunctionDef_L18_C0", "label": "simple_viz_marker", "type": "function", "loc": [18, 43], "level": 0, "parent": null, "vector": [2, 0, 0.4067, 0.3467, 0, 0.66, 0.875, 345, 0, 5, 1, 0, 0, 0, 3], "semantic": {"name": "simple_viz_marker", "arg_names": ["loc", "scale", "color", "shape", "frame_id"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def simple_viz_marker(loc, scale, color, shape, frame_id):\n marker = Marker()\n marker.header.frame_id = frame_id\n marker.header.stamp = rospy.rostime.get_rostime()\n marker.ns = 'basic_shapes'\n marker.id = 0\n if shape == 'sphere':\n marker.type = Marker.SPHERE"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99606:Assign_L19_C4", "label": "marker = Marker()", "type": "assigned_variable", "loc": [19, 19], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99606:FunctionDef_L18_C0", "vector": [14, 1, 0.2533, 0.0133, 1, 0.47, 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_99606:Assign_L20_C4", "label": "marker.header.frame_id =", "type": "assigned_variable", "loc": [20, 20], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99606:FunctionDef_L18_C0", "vector": [14, 1, 0.2667, 0.0133, 1, 0.47, 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 = frame_id"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99606:Assign_L21_C4", "label": "marker.header.stamp = get_rostime()", "type": "assigned_variable", "loc": [21, 21], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99606:FunctionDef_L18_C0", "vector": [14, 1, 0.28, 0.0133, 1, 0.47, 0.0909, 625, 3, 0, 0, 0, 173, 10, 1], "semantic": {"name": "marker.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "get_rostime", "annotation": ""}, "snippet": " marker.header.stamp = rospy.rostime.get_rostime()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99606:Assign_L22_C4", "label": "marker.ns =", "type": "assigned_variable", "loc": [22, 22], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99606:FunctionDef_L18_C0", "vector": [14, 1, 0.2933, 0.0133, 1, 0.47, 0.1364, 748, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "marker.ns", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.ns = 'basic_shapes'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99606:Assign_L23_C4", "label": "marker.id =", "type": "assigned_variable", "loc": [23, 23], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99606:FunctionDef_L18_C0", "vector": [14, 1, 0.3067, 0.0133, 1, 0.47, 0.1818, 570, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "marker.id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.id = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99606:If_L24_C4", "label": "if", "type": "if", "loc": [24, 25], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99606:FunctionDef_L18_C0", "vector": [4, 1, 0.3267, 0.0267, 1, 0.47, 0.2273, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if shape == 'sphere':\n marker.type = Marker.SPHERE"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99606:Assign_L25_C8", "label": "marker.type =", "type": "assigned_variable", "loc": [25, 25], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99606:If_L24_C4", "vector": [14, 2, 0.3333, 0.0133, 2, 0.06, 0.0, 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_99606:Assign_L26_C4", "label": "marker.action =", "type": "assigned_variable", "loc": [26, 26], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99606:FunctionDef_L18_C0", "vector": [14, 1, 0.3467, 0.0133, 1, 0.47, 0.2727, 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_99606:Assign_L28_C4", "label": "marker.pose.position.x =", "type": "assigned_variable", "loc": [28, 28], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99606:FunctionDef_L18_C0", "vector": [14, 1, 0.3733, 0.0133, 1, 0.47, 0.3182, 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 = loc[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99606:Assign_L29_C4", "label": "marker.pose.position.y =", "type": "assigned_variable", "loc": [29, 29], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99606:FunctionDef_L18_C0", "vector": [14, 1, 0.3867, 0.0133, 1, 0.47, 0.3636, 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 = loc[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99606:Assign_L30_C4", "label": "marker.pose.position.z =", "type": "assigned_variable", "loc": [30, 30], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99606:FunctionDef_L18_C0", "vector": [14, 1, 0.4, 0.0133, 1, 0.47, 0.4091, 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 = loc[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99606:Assign_L31_C4", "label": "marker.pose.orientation.x =", "type": "assigned_variable", "loc": [31, 31], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99606:FunctionDef_L18_C0", "vector": [14, 1, 0.4133, 0.0133, 1, 0.47, 0.4545, 831, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "marker.pose.orientation.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.pose.orientation.x = 0.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99606:Assign_L32_C4", "label": "marker.pose.orientation.y =", "type": "assigned_variable", "loc": [32, 32], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99606:FunctionDef_L18_C0", "vector": [14, 1, 0.4267, 0.0133, 1, 0.47, 0.5, 626, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "marker.pose.orientation.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.pose.orientation.y = 0.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99606:Assign_L33_C4", "label": "marker.pose.orientation.z =", "type": "assigned_variable", "loc": [33, 33], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99606:FunctionDef_L18_C0", "vector": [14, 1, 0.44, 0.0133, 1, 0.47, 0.5455, 538, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "marker.pose.orientation.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.pose.orientation.z = 0.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99606:Assign_L34_C4", "label": "marker.pose.orientation.w =", "type": "assigned_variable", "loc": [34, 34], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99606:FunctionDef_L18_C0", "vector": [14, 1, 0.4533, 0.0133, 1, 0.47, 0.5909, 522, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "marker.pose.orientation.w", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.pose.orientation.w = 1.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99606:Assign_L35_C4", "label": "marker.scale.x =", "type": "assigned_variable", "loc": [35, 35], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99606:FunctionDef_L18_C0", "vector": [14, 1, 0.4667, 0.0133, 1, 0.47, 0.6364, 887, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "marker.scale.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.scale.x = scale[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99606:Assign_L36_C4", "label": "marker.scale.y =", "type": "assigned_variable", "loc": [36, 36], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99606:FunctionDef_L18_C0", "vector": [14, 1, 0.48, 0.0133, 1, 0.47, 0.6818, 730, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "marker.scale.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.scale.y = scale[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99606:Assign_L37_C4", "label": "marker.scale.z =", "type": "assigned_variable", "loc": [37, 37], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99606:FunctionDef_L18_C0", "vector": [14, 1, 0.4933, 0.0133, 1, 0.47, 0.7273, 969, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "marker.scale.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.scale.z = scale[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99606:Assign_L38_C4", "label": "marker.color.r =", "type": "assigned_variable", "loc": [38, 38], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99606:FunctionDef_L18_C0", "vector": [14, 1, 0.5067, 0.0133, 1, 0.47, 0.7727, 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_99606:Assign_L39_C4", "label": "marker.color.g =", "type": "assigned_variable", "loc": [39, 39], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99606:FunctionDef_L18_C0", "vector": [14, 1, 0.52, 0.0133, 1, 0.47, 0.8182, 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_99606:Assign_L40_C4", "label": "marker.color.b =", "type": "assigned_variable", "loc": [40, 40], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99606:FunctionDef_L18_C0", "vector": [14, 1, 0.5333, 0.0133, 1, 0.47, 0.8636, 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_99606:Assign_L41_C4", "label": "marker.color.a =", "type": "assigned_variable", "loc": [41, 41], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99606:FunctionDef_L18_C0", "vector": [14, 1, 0.5467, 0.0133, 1, 0.47, 0.9091, 240, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "marker.color.a", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.color.a = color[3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99606:Assign_L42_C4", "label": "marker.lifetime = Duration()", "type": "assigned_variable", "loc": [42, 42], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99606:FunctionDef_L18_C0", "vector": [14, 1, 0.56, 0.0133, 1, 0.47, 0.9545, 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_99606:Return_L43_C4", "label": "return", "type": "return", "loc": [43, 43], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99606:FunctionDef_L18_C0", "vector": [13, 1, 0.5733, 0.0133, 1, 0.47, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return marker"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99606:If_L45_C0", "label": "if", "type": "if", "loc": [45, 73], "level": 0, "parent": null, "vector": [4, 0, 0.7867, 0.3867, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 15], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n rospy.init_node('set_og_param_node')\n og_param_pub = rospy.Publisher('/og_params', OccupancyGrid)\n marker_pub = rospy.Publisher('/occupancy_grid_viz_marker', Marker)\n\n rospy.logout('Ready')\n\n center = np.matrix([0.8, 0., 0.8]).T # for single object bag file"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99606:Expr_L46_C4", "label": "init_node()", "type": "expression", "loc": [46, 46], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99606:If_L45_C0", "vector": [8, 1, 0.6133, 0.0133, 1, 0.0, 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('set_og_param_node')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99606:Assign_L47_C4", "label": "og_param_pub = Publisher()", "type": "assigned_variable", "loc": [47, 47], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99606:If_L45_C0", "vector": [14, 1, 0.6267, 0.0133, 1, 0.0, 0.0625, 626, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "og_param_pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " og_param_pub = rospy.Publisher('/og_params', OccupancyGrid)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99606:Assign_L48_C4", "label": "marker_pub = Publisher()", "type": "assigned_variable", "loc": [48, 48], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99606:If_L45_C0", "vector": [14, 1, 0.64, 0.0133, 1, 0.0, 0.125, 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('/occupancy_grid_viz_marker', Marker)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99606:Expr_L50_C4", "label": "logout()", "type": "expression", "loc": [50, 50], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99606:If_L45_C0", "vector": [8, 1, 0.6667, 0.0133, 1, 0.0, 0.1875, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout('Ready')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99606:Assign_L52_C4", "label": "center =", "type": "assigned_variable", "loc": [52, 52], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99606:If_L45_C0", "vector": [14, 1, 0.6933, 0.0133, 1, 0.0, 0.25, 546, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "center", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " center = np.matrix([0.8, 0., 0.8]).T # for single object bag file"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99606:Assign_L54_C4", "label": "size =", "type": "assigned_variable", "loc": [54, 54], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99606:If_L45_C0", "vector": [14, 1, 0.72, 0.0133, 1, 0.0, 0.3125, 714, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "size", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " size = np.matrix([0.4, 0.4, 0.4]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99606:Assign_L56_C4", "label": "resolution =", "type": "assigned_variable", "loc": [56, 56], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99606:If_L45_C0", "vector": [14, 1, 0.7467, 0.0133, 1, 0.0, 0.375, 615, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "resolution", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " resolution = np.matrix([0.005, 0.005, 0.005]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99606:Assign_L57_C4", "label": "occupancy_threshold =", "type": "assigned_variable", "loc": [57, 57], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99606:If_L45_C0", "vector": [14, 1, 0.76, 0.0133, 1, 0.0, 0.4375, 299, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "occupancy_threshold", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " occupancy_threshold = 5"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99606:Assign_L58_C4", "label": "frame_id =", "type": "assigned_variable", "loc": [58, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99606:If_L45_C0", "vector": [14, 1, 0.7733, 0.0133, 1, 0.0, 0.5, 487, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "frame_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " frame_id = 'base_link'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99606:Assign_L60_C4", "label": "scale =", "type": "assigned_variable", "loc": [60, 60], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99606:If_L45_C0", "vector": [14, 1, 0.8, 0.0133, 1, 0.0, 0.5625, 18, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "scale", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " scale = (0.02, 0.02, 0.02)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99606:Assign_L61_C4", "label": "color =", "type": "assigned_variable", "loc": [61, 61], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99606:If_L45_C0", "vector": [14, 1, 0.8133, 0.0133, 1, 0.0, 0.625, 776, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "color", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " color = (0., 1., 0., 1.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99606:Assign_L62_C4", "label": "shape =", "type": "assigned_variable", "loc": [62, 62], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99606:If_L45_C0", "vector": [14, 1, 0.8267, 0.0133, 1, 0.0, 0.6875, 381, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "shape", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " shape = 'sphere'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99606:Assign_L63_C4", "label": "marker = simple_viz_marker()", "type": "assigned_variable", "loc": [63, 63], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99606:If_L45_C0", "vector": [14, 1, 0.84, 0.0133, 1, 0.0, 0.75, 864, 3, 5, 0, 0, 345, 10, 1], "semantic": {"name": "marker", "arg_names": [], "import_names": [], "rhs_call_name": "simple_viz_marker", "annotation": ""}, "snippet": " marker = simple_viz_marker(center.A1, scale, color, shape, frame_id)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99606:Assign_L64_C4", "label": "og_param = og_param_msg()", "type": "assigned_variable", "loc": [64, 65], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99606:If_L45_C0", "vector": [14, 1, 0.86, 0.0267, 1, 0.0, 0.8125, 570, 3, 5, 0, 0, 361, 10, 1], "semantic": {"name": "og_param", "arg_names": [], "import_names": [], "rhs_call_name": "og_param_msg", "annotation": ""}, "snippet": " og_param = rog.og_param_msg(center, size, resolution,\n occupancy_threshold, frame_id)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99606:Assign_L67_C4", "label": "r = Rate()", "type": "assigned_variable", "loc": [67, 67], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99606:If_L45_C0", "vector": [14, 1, 0.8933, 0.0133, 1, 0.0, 0.875, 436, 3, 1, 0, 0, 543, 10, 1], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "Rate", "annotation": ""}, "snippet": " r = rospy.Rate(2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99606:While_L68_C4", "label": "while", "type": "while", "loc": [68, 71], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99606:If_L45_C0", "vector": [5, 1, 0.9267, 0.0533, 1, 0.0, 0.9375, 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 marker_pub.publish(marker)\n og_param_pub.publish(og_param)\n r.sleep()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99606:Expr_L69_C8", "label": "publish()", "type": "expression", "loc": [69, 69], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99606:While_L68_C4", "vector": [8, 2, 0.92, 0.0133, 2, 0.59, 0.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_99606:Expr_L70_C8", "label": "publish()", "type": "expression", "loc": [70, 70], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99606:While_L68_C4", "vector": [8, 2, 0.9333, 0.0133, 2, 0.59, 0.5, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " og_param_pub.publish(og_param)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99606:Expr_L71_C8", "label": "sleep()", "type": "expression", "loc": [71, 71], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99606:While_L68_C4", "vector": [8, 2, 0.9467, 0.0133, 2, 0.59, 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_99606:Expr_L73_C4", "label": "spin()", "type": "expression", "loc": [73, 73], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99606:If_L45_C0", "vector": [8, 1, 0.9733, 0.0133, 1, 0.0, 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_99606:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99606:Assign_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99606:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99606:Assign_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99606:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99606:Assign_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99606:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99606:Assign_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99606:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99606:Assign_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99606:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99606:If_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99606:If_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99606:Assign_L25_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99606:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99606:Assign_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99606:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99606:Assign_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99606:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99606:Assign_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99606:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99606:Assign_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99606:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99606:Assign_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99606:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99606:Assign_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99606:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99606:Assign_L33_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99606:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99606:Assign_L34_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99606:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99606:Assign_L35_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99606:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99606:Assign_L36_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99606:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99606:Assign_L37_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99606:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99606:Assign_L38_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99606:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99606:Assign_L39_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99606:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99606:Assign_L40_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99606:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99606:Assign_L41_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99606:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99606:Assign_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99606:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99606:Return_L43_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99606:If_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99606:Expr_L46_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99606:If_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99606:Assign_L47_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99606:If_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99606:Assign_L48_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99606:If_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99606:Expr_L50_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99606:If_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99606:Assign_L52_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99606:If_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99606:Assign_L54_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99606:If_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99606:Assign_L56_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99606:If_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99606:Assign_L57_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99606:If_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99606:Assign_L58_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99606:If_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99606:Assign_L60_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99606:If_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99606:Assign_L61_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99606:If_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99606:Assign_L62_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99606:If_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99606:Assign_L63_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99606:If_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99606:Assign_L64_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99606:If_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99606:Assign_L67_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99606:If_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99606:While_L68_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99606:While_L68_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99606:Expr_L69_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99606:While_L68_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99606:Expr_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99606:While_L68_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99606:Expr_L71_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99606:If_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99606:Expr_L73_C4"}]
# # Copyright (c) 2010, Georgia Tech Research Corporation # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # * Neither the name of the Georgia Tech Research Corporation nor the # names of its contributors may be used to endorse or promote products # derived from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY GEORGIA TECH RESEARCH CORPORATION ''AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL GEORGIA TECH BE LIABLE FOR ANY DIRECT, INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # # Author: Advait Jain (advait@cc.gatech.edu), Healthcare Robotics Lab, Georgia Tech import roslib; roslib.load_manifest('move_arm_tutorials') import rospy import actionlib import geometric_shapes_msgs from move_arm_msgs.msg import MoveArmAction from move_arm_msgs.msg import MoveArmGoal from motion_planning_msgs.msg import SimplePoseConstraint from motion_planning_msgs.msg import PositionConstraint from motion_planning_msgs.msg import OrientationConstraint from actionlib_msgs.msg import GoalStatus def pose_constraint_to_position_orientation_constraints(pose_constraint): position_constraint = PositionConstraint() orientation_constraint = OrientationConstraint() position_constraint.header = pose_constraint.header position_constraint.link_name = pose_constraint.link_name position_constraint.position = pose_constraint.pose.position position_constraint.constraint_region_shape.type = geometric_shapes_msgs.msg.Shape.BOX position_constraint.constraint_region_shape.dimensions.append(2*pose_constraint.absolute_position_tolerance.x) position_constraint.constraint_region_shape.dimensions.append(2*pose_constraint.absolute_position_tolerance.y) position_constraint.constraint_region_shape.dimensions.append(2*pose_constraint.absolute_position_tolerance.z) position_constraint.constraint_region_orientation.x = 0.0 position_constraint.constraint_region_orientation.y = 0.0 position_constraint.constraint_region_orientation.z = 0.0 position_constraint.constraint_region_orientation.w = 1.0 position_constraint.weight = 1.0 orientation_constraint.header = pose_constraint.header orientation_constraint.link_name = pose_constraint.link_name orientation_constraint.orientation = pose_constraint.pose.orientation orientation_constraint.type = pose_constraint.orientation_constraint_type orientation_constraint.absolute_roll_tolerance = pose_constraint.absolute_roll_tolerance orientation_constraint.absolute_pitch_tolerance = pose_constraint.absolute_pitch_tolerance orientation_constraint.absolute_yaw_tolerance = pose_constraint.absolute_yaw_tolerance orientation_constraint.weight = 1.0 return position_constraint, orientation_constraint def add_goal_constraint_to_move_arm_goal(pose_constraint, move_arm_goal): position_constraint, orientation_constraint = pose_constraint_to_position_orientation_constraints(pose_constraint) move_arm_goal.motion_plan_request.goal_constraints.position_constraints.append(position_constraint) move_arm_goal.motion_plan_request.goal_constraints.orientation_constraints.append(orientation_constraint) if __name__ == '__main__': rospy.init_node('move_arm_pose_goal_test') move_arm = actionlib.SimpleActionClient('move_right_arm', MoveArmAction) move_arm.wait_for_server() rospy.loginfo('Connected to server') goalA = MoveArmGoal() goalA.motion_plan_request.group_name = 'right_arm' goalA.motion_plan_request.num_planning_attempts = 1 goalA.motion_plan_request.planner_id = '' goalA.planner_service_name = 'ompl_planning/plan_kinematic_path' goalA.motion_plan_request.allowed_planning_time = rospy.Duration(5.0) desired_pose = SimplePoseConstraint() desired_pose.header.frame_id = 'torso_lift_link' desired_pose.link_name = 'r_gripper_l_fingertip_link' desired_pose.pose.position.x = 0.75 desired_pose.pose.position.y = -0.188 desired_pose.pose.position.z = 0 desired_pose.pose.orientation.x = 0.0 desired_pose.pose.orientation.y = 0.0 desired_pose.pose.orientation.z = 0.0 desired_pose.pose.orientation.w = 1.0 desired_pose.absolute_position_tolerance.x = 0.02 desired_pose.absolute_position_tolerance.y = 0.02 desired_pose.absolute_position_tolerance.z = 0.02 desired_pose.absolute_roll_tolerance = 0.04 desired_pose.absolute_pitch_tolerance = 0.04 desired_pose.absolute_yaw_tolerance = 0.04 add_goal_constraint_to_move_arm_goal(desired_pose, goalA) move_arm.send_goal(goalA) finished_within_time = move_arm.wait_for_result(rospy.Duration(200.0)) if not finished_within_time: move_arm.cancel_goal() rospy.loginfo("Timed out achieving goal A") else: state = move_arm.get_state() if state == GoalStatus.SUCCEEDED: rospy.loginfo('Action finished and was successful.') else: rospy.loginfo('Action failed: %d'%(state))
ajibawa-2023/Python-Code-Large/train/row_99607
76
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_99607:Import_L32_C0", "label": "roslib import roslib", "type": "import", "loc": [32, 32], "level": 0, "parent": null, "vector": [1, 0, 0.2353, 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; roslib.load_manifest('move_arm_tutorials')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99607:Expr_L32_C15", "label": "load_manifest()", "type": "expression", "loc": [32, 32], "level": 0, "parent": null, "vector": [8, 0, 0.2353, 0.0074, 0, 0.66, 0.0769, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('move_arm_tutorials')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99607:Import_L34_C0", "label": "rospy import rospy", "type": "import", "loc": [34, 34], "level": 0, "parent": null, "vector": [1, 0, 0.25, 0.0074, 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_99607:Import_L35_C0", "label": "actionlib import actionlib", "type": "import", "loc": [35, 35], "level": 0, "parent": null, "vector": [1, 0, 0.2574, 0.0074, 0, 0.66, 0.2308, 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_99607:Import_L37_C0", "label": "geometric_shapes_msgs import geometric_shapes_msgs", "type": "import", "loc": [37, 37], "level": 0, "parent": null, "vector": [1, 0, 0.2721, 0.0074, 0, 0.66, 0.3077, 588, 0, 1, 0, 0, 588, 0, 0], "semantic": {"name": "geometric_shapes_msgs", "arg_names": [], "import_names": ["geometric_shapes_msgs"], "rhs_call_name": "", "annotation": ""}, "snippet": "import geometric_shapes_msgs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99607:ImportFrom_L39_C0", "label": "from move_arm_msgs.msg import MoveArmAction", "type": "import", "loc": [39, 39], "level": 0, "parent": null, "vector": [1, 0, 0.2868, 0.0074, 0, 0.66, 0.3846, 649, 0, 1, 0, 0, 649, 0, 0], "semantic": {"name": "move_arm_msgs.msg", "arg_names": [], "import_names": ["MoveArmAction"], "rhs_call_name": "", "annotation": ""}, "snippet": "from move_arm_msgs.msg import MoveArmAction"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99607:ImportFrom_L40_C0", "label": "from move_arm_msgs.msg import MoveArmGoal", "type": "import", "loc": [40, 40], "level": 0, "parent": null, "vector": [1, 0, 0.2941, 0.0074, 0, 0.66, 0.4615, 649, 0, 1, 0, 0, 649, 0, 0], "semantic": {"name": "move_arm_msgs.msg", "arg_names": [], "import_names": ["MoveArmGoal"], "rhs_call_name": "", "annotation": ""}, "snippet": "from move_arm_msgs.msg import MoveArmGoal"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99607:ImportFrom_L41_C0", "label": "from motion_planning_msgs.msg import SimplePoseConstraint", "type": "import", "loc": [41, 41], "level": 0, "parent": null, "vector": [1, 0, 0.3015, 0.0074, 0, 0.66, 0.5385, 107, 0, 1, 0, 0, 107, 0, 0], "semantic": {"name": "motion_planning_msgs.msg", "arg_names": [], "import_names": ["SimplePoseConstraint"], "rhs_call_name": "", "annotation": ""}, "snippet": "from motion_planning_msgs.msg import SimplePoseConstraint"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99607:ImportFrom_L43_C0", "label": "from motion_planning_msgs.msg import PositionConstraint", "type": "import", "loc": [43, 43], "level": 0, "parent": null, "vector": [1, 0, 0.3162, 0.0074, 0, 0.66, 0.6154, 107, 0, 1, 0, 0, 107, 0, 0], "semantic": {"name": "motion_planning_msgs.msg", "arg_names": [], "import_names": ["PositionConstraint"], "rhs_call_name": "", "annotation": ""}, "snippet": "from motion_planning_msgs.msg import PositionConstraint"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99607:ImportFrom_L44_C0", "label": "from motion_planning_msgs.msg import OrientationConstraint", "type": "import", "loc": [44, 44], "level": 0, "parent": null, "vector": [1, 0, 0.3235, 0.0074, 0, 0.66, 0.6923, 107, 0, 1, 0, 0, 107, 0, 0], "semantic": {"name": "motion_planning_msgs.msg", "arg_names": [], "import_names": ["OrientationConstraint"], "rhs_call_name": "", "annotation": ""}, "snippet": "from motion_planning_msgs.msg import OrientationConstraint"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99607:ImportFrom_L46_C0", "label": "from actionlib_msgs.msg import GoalStatus", "type": "import", "loc": [46, 46], "level": 0, "parent": null, "vector": [1, 0, 0.3382, 0.0074, 0, 0.66, 0.7692, 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_99607:FunctionDef_L48_C0", "label": "pose_constraint_to_position_orientation_constraints", "type": "function", "loc": [48, 77], "level": 0, "parent": null, "vector": [2, 0, 0.4596, 0.2206, 0, 0.66, 0.8462, 991, 0, 1, 1, 0, 0, 0, 5], "semantic": {"name": "pose_constraint_to_position_orientation_constraints", "arg_names": ["pose_constraint"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def pose_constraint_to_position_orientation_constraints(pose_constraint):\n position_constraint = PositionConstraint()\n orientation_constraint = OrientationConstraint()\n position_constraint.header = pose_constraint.header\n position_constraint.link_name = pose_constraint.link_name\n position_constraint.position = pose_constraint.pose.position\n\n position_constraint.constraint_region_shape.type = geometric_shapes_msgs.msg.Shape.BOX"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99607:Assign_L49_C4", "label": "position_constraint = PositionConstraint()", "type": "assigned_variable", "loc": [49, 49], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99607:FunctionDef_L48_C0", "vector": [14, 1, 0.3603, 0.0074, 1, 0.17, 0.0, 327, 3, 0, 0, 0, 867, 10, 1], "semantic": {"name": "position_constraint", "arg_names": [], "import_names": [], "rhs_call_name": "PositionConstraint", "annotation": ""}, "snippet": " position_constraint = PositionConstraint()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99607:Assign_L50_C4", "label": "orientation_constraint = OrientationConstraint()", "type": "assigned_variable", "loc": [50, 50], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99607:FunctionDef_L48_C0", "vector": [14, 1, 0.3676, 0.0074, 1, 0.17, 0.0455, 24, 3, 0, 0, 0, 618, 10, 1], "semantic": {"name": "orientation_constraint", "arg_names": [], "import_names": [], "rhs_call_name": "OrientationConstraint", "annotation": ""}, "snippet": " orientation_constraint = OrientationConstraint()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99607:Assign_L51_C4", "label": "position_constraint.header =", "type": "assigned_variable", "loc": [51, 51], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99607:FunctionDef_L48_C0", "vector": [14, 1, 0.375, 0.0074, 1, 0.17, 0.0909, 529, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "position_constraint.header", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " position_constraint.header = pose_constraint.header"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99607:Assign_L52_C4", "label": "position_constraint.link_name =", "type": "assigned_variable", "loc": [52, 52], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99607:FunctionDef_L48_C0", "vector": [14, 1, 0.3824, 0.0074, 1, 0.17, 0.1364, 313, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "position_constraint.link_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " position_constraint.link_name = pose_constraint.link_name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99607:Assign_L53_C4", "label": "position_constraint.position =", "type": "assigned_variable", "loc": [53, 53], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99607:FunctionDef_L48_C0", "vector": [14, 1, 0.3897, 0.0074, 1, 0.17, 0.1818, 914, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "position_constraint.position", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " position_constraint.position = pose_constraint.pose.position"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99607:Assign_L55_C4", "label": "position_constraint.constraint_region_shape.type =", "type": "assigned_variable", "loc": [55, 55], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99607:FunctionDef_L48_C0", "vector": [14, 1, 0.4044, 0.0074, 1, 0.17, 0.2273, 93, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "position_constraint.constraint_region_shape.type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " position_constraint.constraint_region_shape.type = geometric_shapes_msgs.msg.Shape.BOX"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99607:Expr_L56_C4", "label": "append()", "type": "expression", "loc": [56, 56], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99607:FunctionDef_L48_C0", "vector": [8, 1, 0.4118, 0.0074, 1, 0.17, 0.2727, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " position_constraint.constraint_region_shape.dimensions.append(2*pose_constraint.absolute_position_tolerance.x)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99607:Expr_L57_C4", "label": "append()", "type": "expression", "loc": [57, 57], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99607:FunctionDef_L48_C0", "vector": [8, 1, 0.4191, 0.0074, 1, 0.17, 0.3182, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " position_constraint.constraint_region_shape.dimensions.append(2*pose_constraint.absolute_position_tolerance.y)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99607:Expr_L58_C4", "label": "append()", "type": "expression", "loc": [58, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99607:FunctionDef_L48_C0", "vector": [8, 1, 0.4265, 0.0074, 1, 0.17, 0.3636, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " position_constraint.constraint_region_shape.dimensions.append(2*pose_constraint.absolute_position_tolerance.z)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99607:Assign_L60_C4", "label": "position_constraint.constraint_region_orientation.x =", "type": "assigned_variable", "loc": [60, 60], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99607:FunctionDef_L48_C0", "vector": [14, 1, 0.4412, 0.0074, 1, 0.17, 0.4091, 790, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "position_constraint.constraint_region_orientation.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " position_constraint.constraint_region_orientation.x = 0.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99607:Assign_L61_C4", "label": "position_constraint.constraint_region_orientation.y =", "type": "assigned_variable", "loc": [61, 61], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99607:FunctionDef_L48_C0", "vector": [14, 1, 0.4485, 0.0074, 1, 0.17, 0.4545, 676, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "position_constraint.constraint_region_orientation.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " position_constraint.constraint_region_orientation.y = 0.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99607:Assign_L62_C4", "label": "position_constraint.constraint_region_orientation.z =", "type": "assigned_variable", "loc": [62, 62], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99607:FunctionDef_L48_C0", "vector": [14, 1, 0.4559, 0.0074, 1, 0.17, 0.5, 605, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "position_constraint.constraint_region_orientation.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " position_constraint.constraint_region_orientation.z = 0.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99607:Assign_L63_C4", "label": "position_constraint.constraint_region_orientation.w =", "type": "assigned_variable", "loc": [63, 63], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99607:FunctionDef_L48_C0", "vector": [14, 1, 0.4632, 0.0074, 1, 0.17, 0.5455, 223, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "position_constraint.constraint_region_orientation.w", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " position_constraint.constraint_region_orientation.w = 1.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99607:Assign_L65_C4", "label": "position_constraint.weight =", "type": "assigned_variable", "loc": [65, 65], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99607:FunctionDef_L48_C0", "vector": [14, 1, 0.4779, 0.0074, 1, 0.17, 0.5909, 237, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "position_constraint.weight", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " position_constraint.weight = 1.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99607:Assign_L67_C4", "label": "orientation_constraint.header =", "type": "assigned_variable", "loc": [67, 67], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99607:FunctionDef_L48_C0", "vector": [14, 1, 0.4926, 0.0074, 1, 0.17, 0.6364, 795, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "orientation_constraint.header", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " orientation_constraint.header = pose_constraint.header"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99607:Assign_L68_C4", "label": "orientation_constraint.link_name =", "type": "assigned_variable", "loc": [68, 68], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99607:FunctionDef_L48_C0", "vector": [14, 1, 0.5, 0.0074, 1, 0.17, 0.6818, 157, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "orientation_constraint.link_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " orientation_constraint.link_name = pose_constraint.link_name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99607:Assign_L69_C4", "label": "orientation_constraint.orientation =", "type": "assigned_variable", "loc": [69, 69], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99607:FunctionDef_L48_C0", "vector": [14, 1, 0.5074, 0.0074, 1, 0.17, 0.7273, 978, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "orientation_constraint.orientation", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " orientation_constraint.orientation = pose_constraint.pose.orientation"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99607:Assign_L70_C4", "label": "orientation_constraint.type =", "type": "assigned_variable", "loc": [70, 70], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99607:FunctionDef_L48_C0", "vector": [14, 1, 0.5147, 0.0074, 1, 0.17, 0.7727, 264, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "orientation_constraint.type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " orientation_constraint.type = pose_constraint.orientation_constraint_type"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99607:Assign_L72_C4", "label": "orientation_constraint.absolute_roll_tolerance =", "type": "assigned_variable", "loc": [72, 72], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99607:FunctionDef_L48_C0", "vector": [14, 1, 0.5294, 0.0074, 1, 0.17, 0.8182, 302, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "orientation_constraint.absolute_roll_tolerance", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " orientation_constraint.absolute_roll_tolerance = pose_constraint.absolute_roll_tolerance"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99607:Assign_L73_C4", "label": "orientation_constraint.absolute_pitch_tolerance =", "type": "assigned_variable", "loc": [73, 73], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99607:FunctionDef_L48_C0", "vector": [14, 1, 0.5368, 0.0074, 1, 0.17, 0.8636, 828, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "orientation_constraint.absolute_pitch_tolerance", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " orientation_constraint.absolute_pitch_tolerance = pose_constraint.absolute_pitch_tolerance"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99607:Assign_L74_C4", "label": "orientation_constraint.absolute_yaw_tolerance =", "type": "assigned_variable", "loc": [74, 74], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99607:FunctionDef_L48_C0", "vector": [14, 1, 0.5441, 0.0074, 1, 0.17, 0.9091, 878, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "orientation_constraint.absolute_yaw_tolerance", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " orientation_constraint.absolute_yaw_tolerance = pose_constraint.absolute_yaw_tolerance"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99607:Assign_L75_C4", "label": "orientation_constraint.weight =", "type": "assigned_variable", "loc": [75, 75], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99607:FunctionDef_L48_C0", "vector": [14, 1, 0.5515, 0.0074, 1, 0.17, 0.9545, 631, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "orientation_constraint.weight", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " orientation_constraint.weight = 1.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99607:Return_L77_C4", "label": "return", "type": "return", "loc": [77, 77], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99607:FunctionDef_L48_C0", "vector": [13, 1, 0.5662, 0.0074, 1, 0.17, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return position_constraint, orientation_constraint"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99607:FunctionDef_L79_C0", "label": "add_goal_constraint_to_move_arm_goal", "type": "function", "loc": [79, 82], "level": 0, "parent": null, "vector": [2, 0, 0.5919, 0.0294, 0, 0.66, 0.9231, 977, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "add_goal_constraint_to_move_arm_goal", "arg_names": ["pose_constraint", "move_arm_goal"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def add_goal_constraint_to_move_arm_goal(pose_constraint, move_arm_goal):\n position_constraint, orientation_constraint = pose_constraint_to_position_orientation_constraints(pose_constraint)\n move_arm_goal.motion_plan_request.goal_constraints.position_constraints.append(position_constraint)\n move_arm_goal.motion_plan_request.goal_constraints.orientation_constraints.append(orientation_constraint)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99607:Assign_L80_C4", "label": "position_constraint, orientation_constraint = pose_constraint_to_position_orientation_constraints()", "type": "assigned_variable", "loc": [80, 80], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99607:FunctionDef_L79_C0", "vector": [14, 1, 0.5882, 0.0074, 1, 0.44, 0.0, 258, 3, 1, 0, 0, 991, 10, 1], "semantic": {"name": "position_constraint, orientation_constraint", "arg_names": [], "import_names": [], "rhs_call_name": "pose_constraint_to_position_orientation_constraints", "annotation": ""}, "snippet": " position_constraint, orientation_constraint = pose_constraint_to_position_orientation_constraints(pose_constraint)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99607:Expr_L81_C4", "label": "append()", "type": "expression", "loc": [81, 81], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99607:FunctionDef_L79_C0", "vector": [8, 1, 0.5956, 0.0074, 1, 0.44, 0.5, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " move_arm_goal.motion_plan_request.goal_constraints.position_constraints.append(position_constraint)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99607:Expr_L82_C4", "label": "append()", "type": "expression", "loc": [82, 82], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99607:FunctionDef_L79_C0", "vector": [8, 1, 0.6029, 0.0074, 1, 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": " move_arm_goal.motion_plan_request.goal_constraints.orientation_constraints.append(orientation_constraint)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99607:If_L85_C0", "label": "if", "type": "if", "loc": [85, 133], "level": 0, "parent": null, "vector": [4, 0, 0.8015, 0.3603, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 16], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n rospy.init_node('move_arm_pose_goal_test')\n\n move_arm = actionlib.SimpleActionClient('move_right_arm', MoveArmAction)\n move_arm.wait_for_server()\n rospy.loginfo('Connected to server')\n\n goalA = MoveArmGoal()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99607:Expr_L86_C4", "label": "init_node()", "type": "expression", "loc": [86, 86], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99607:If_L85_C0", "vector": [8, 1, 0.6324, 0.0074, 1, 0.31, 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_arm_pose_goal_test')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99607:Assign_L88_C4", "label": "move_arm = SimpleActionClient()", "type": "assigned_variable", "loc": [88, 88], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99607:If_L85_C0", "vector": [14, 1, 0.6471, 0.0074, 1, 0.31, 0.0345, 236, 3, 2, 0, 0, 230, 10, 1], "semantic": {"name": "move_arm", "arg_names": [], "import_names": [], "rhs_call_name": "SimpleActionClient", "annotation": ""}, "snippet": " move_arm = actionlib.SimpleActionClient('move_right_arm', MoveArmAction)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99607:Expr_L89_C4", "label": "wait_for_server()", "type": "expression", "loc": [89, 89], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99607:If_L85_C0", "vector": [8, 1, 0.6544, 0.0074, 1, 0.31, 0.069, 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": " move_arm.wait_for_server()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99607:Expr_L90_C4", "label": "loginfo()", "type": "expression", "loc": [90, 90], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99607:If_L85_C0", "vector": [8, 1, 0.6618, 0.0074, 1, 0.31, 0.1034, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo('Connected to server')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99607:Assign_L92_C4", "label": "goalA = MoveArmGoal()", "type": "assigned_variable", "loc": [92, 92], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99607:If_L85_C0", "vector": [14, 1, 0.6765, 0.0074, 1, 0.31, 0.1379, 678, 3, 0, 0, 0, 620, 10, 1], "semantic": {"name": "goalA", "arg_names": [], "import_names": [], "rhs_call_name": "MoveArmGoal", "annotation": ""}, "snippet": " goalA = MoveArmGoal()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99607:Assign_L93_C4", "label": "goalA.motion_plan_request.group_name =", "type": "assigned_variable", "loc": [93, 93], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99607:If_L85_C0", "vector": [14, 1, 0.6838, 0.0074, 1, 0.31, 0.1724, 454, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "goalA.motion_plan_request.group_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " goalA.motion_plan_request.group_name = 'right_arm'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99607:Assign_L94_C4", "label": "goalA.motion_plan_request.num_planning_attempts =", "type": "assigned_variable", "loc": [94, 94], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99607:If_L85_C0", "vector": [14, 1, 0.6912, 0.0074, 1, 0.31, 0.2069, 761, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "goalA.motion_plan_request.num_planning_attempts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " goalA.motion_plan_request.num_planning_attempts = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99607:Assign_L95_C4", "label": "goalA.motion_plan_request.planner_id =", "type": "assigned_variable", "loc": [95, 95], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99607:If_L85_C0", "vector": [14, 1, 0.6985, 0.0074, 1, 0.31, 0.2414, 672, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "goalA.motion_plan_request.planner_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " goalA.motion_plan_request.planner_id = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99607:Assign_L96_C4", "label": "goalA.planner_service_name =", "type": "assigned_variable", "loc": [96, 96], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99607:If_L85_C0", "vector": [14, 1, 0.7059, 0.0074, 1, 0.31, 0.2759, 140, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "goalA.planner_service_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " goalA.planner_service_name = 'ompl_planning/plan_kinematic_path'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99607:Assign_L97_C4", "label": "goalA.motion_plan_request.allowed_planning_time = Duration()", "type": "assigned_variable", "loc": [97, 97], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99607:If_L85_C0", "vector": [14, 1, 0.7132, 0.0074, 1, 0.31, 0.3103, 371, 3, 1, 0, 0, 972, 10, 1], "semantic": {"name": "goalA.motion_plan_request.allowed_planning_time", "arg_names": [], "import_names": [], "rhs_call_name": "Duration", "annotation": ""}, "snippet": " goalA.motion_plan_request.allowed_planning_time = rospy.Duration(5.0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99607:Assign_L99_C4", "label": "desired_pose = SimplePoseConstraint()", "type": "assigned_variable", "loc": [99, 99], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99607:If_L85_C0", "vector": [14, 1, 0.7279, 0.0074, 1, 0.31, 0.3448, 430, 3, 0, 0, 0, 620, 10, 1], "semantic": {"name": "desired_pose", "arg_names": [], "import_names": [], "rhs_call_name": "SimplePoseConstraint", "annotation": ""}, "snippet": " desired_pose = SimplePoseConstraint()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99607:Assign_L100_C4", "label": "desired_pose.header.frame_id =", "type": "assigned_variable", "loc": [100, 100], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99607:If_L85_C0", "vector": [14, 1, 0.7353, 0.0074, 1, 0.31, 0.3793, 315, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "desired_pose.header.frame_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " desired_pose.header.frame_id = 'torso_lift_link'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99607:Assign_L101_C4", "label": "desired_pose.link_name =", "type": "assigned_variable", "loc": [101, 101], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99607:If_L85_C0", "vector": [14, 1, 0.7426, 0.0074, 1, 0.31, 0.4138, 806, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "desired_pose.link_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " desired_pose.link_name = 'r_gripper_l_fingertip_link'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99607:Assign_L102_C4", "label": "desired_pose.pose.position.x =", "type": "assigned_variable", "loc": [102, 102], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99607:If_L85_C0", "vector": [14, 1, 0.75, 0.0074, 1, 0.31, 0.4483, 519, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "desired_pose.pose.position.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " desired_pose.pose.position.x = 0.75"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99607:Assign_L103_C4", "label": "desired_pose.pose.position.y =", "type": "assigned_variable", "loc": [103, 103], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99607:If_L85_C0", "vector": [14, 1, 0.7574, 0.0074, 1, 0.31, 0.4828, 358, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "desired_pose.pose.position.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " desired_pose.pose.position.y = -0.188"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99607:Assign_L104_C4", "label": "desired_pose.pose.position.z =", "type": "assigned_variable", "loc": [104, 104], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99607:If_L85_C0", "vector": [14, 1, 0.7647, 0.0074, 1, 0.31, 0.5172, 489, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "desired_pose.pose.position.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " desired_pose.pose.position.z = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99607:Assign_L106_C4", "label": "desired_pose.pose.orientation.x =", "type": "assigned_variable", "loc": [106, 106], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99607:If_L85_C0", "vector": [14, 1, 0.7794, 0.0074, 1, 0.31, 0.5517, 317, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "desired_pose.pose.orientation.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " desired_pose.pose.orientation.x = 0.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99607:Assign_L107_C4", "label": "desired_pose.pose.orientation.y =", "type": "assigned_variable", "loc": [107, 107], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99607:If_L85_C0", "vector": [14, 1, 0.7868, 0.0074, 1, 0.31, 0.5862, 331, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "desired_pose.pose.orientation.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " desired_pose.pose.orientation.y = 0.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99607:Assign_L108_C4", "label": "desired_pose.pose.orientation.z =", "type": "assigned_variable", "loc": [108, 108], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99607:If_L85_C0", "vector": [14, 1, 0.7941, 0.0074, 1, 0.31, 0.6207, 787, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "desired_pose.pose.orientation.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " desired_pose.pose.orientation.z = 0.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99607:Assign_L109_C4", "label": "desired_pose.pose.orientation.w =", "type": "assigned_variable", "loc": [109, 109], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99607:If_L85_C0", "vector": [14, 1, 0.8015, 0.0074, 1, 0.31, 0.6552, 523, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "desired_pose.pose.orientation.w", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " desired_pose.pose.orientation.w = 1.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99607:Assign_L111_C4", "label": "desired_pose.absolute_position_tolerance.x =", "type": "assigned_variable", "loc": [111, 111], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99607:If_L85_C0", "vector": [14, 1, 0.8162, 0.0074, 1, 0.31, 0.6897, 442, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "desired_pose.absolute_position_tolerance.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " desired_pose.absolute_position_tolerance.x = 0.02"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99607:Assign_L112_C4", "label": "desired_pose.absolute_position_tolerance.y =", "type": "assigned_variable", "loc": [112, 112], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99607:If_L85_C0", "vector": [14, 1, 0.8235, 0.0074, 1, 0.31, 0.7241, 18, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "desired_pose.absolute_position_tolerance.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " desired_pose.absolute_position_tolerance.y = 0.02"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99607:Assign_L113_C4", "label": "desired_pose.absolute_position_tolerance.z =", "type": "assigned_variable", "loc": [113, 113], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99607:If_L85_C0", "vector": [14, 1, 0.8309, 0.0074, 1, 0.31, 0.7586, 931, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "desired_pose.absolute_position_tolerance.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " desired_pose.absolute_position_tolerance.z = 0.02"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99607:Assign_L115_C4", "label": "desired_pose.absolute_roll_tolerance =", "type": "assigned_variable", "loc": [115, 115], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99607:If_L85_C0", "vector": [14, 1, 0.8456, 0.0074, 1, 0.31, 0.7931, 183, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "desired_pose.absolute_roll_tolerance", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " desired_pose.absolute_roll_tolerance = 0.04"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99607:Assign_L116_C4", "label": "desired_pose.absolute_pitch_tolerance =", "type": "assigned_variable", "loc": [116, 116], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99607:If_L85_C0", "vector": [14, 1, 0.8529, 0.0074, 1, 0.31, 0.8276, 67, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "desired_pose.absolute_pitch_tolerance", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " desired_pose.absolute_pitch_tolerance = 0.04"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99607:Assign_L117_C4", "label": "desired_pose.absolute_yaw_tolerance =", "type": "assigned_variable", "loc": [117, 117], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99607:If_L85_C0", "vector": [14, 1, 0.8603, 0.0074, 1, 0.31, 0.8621, 838, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "desired_pose.absolute_yaw_tolerance", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " desired_pose.absolute_yaw_tolerance = 0.04"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99607:Expr_L119_C4", "label": "add_goal_constraint_to_move_arm_goal()", "type": "expression", "loc": [119, 119], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99607:If_L85_C0", "vector": [8, 1, 0.875, 0.0074, 1, 0.31, 0.8966, 977, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "add_goal_constraint_to_move_arm_goal", "arg_names": [], "import_names": [], "rhs_call_name": "add_goal_constraint_to_move_arm_goal", "annotation": ""}, "snippet": " add_goal_constraint_to_move_arm_goal(desired_pose, goalA)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99607:Expr_L121_C4", "label": "send_goal()", "type": "expression", "loc": [121, 121], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99607:If_L85_C0", "vector": [8, 1, 0.8897, 0.0074, 1, 0.31, 0.931, 184, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "send_goal", "arg_names": [], "import_names": [], "rhs_call_name": "send_goal", "annotation": ""}, "snippet": " move_arm.send_goal(goalA)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99607:Assign_L122_C4", "label": "finished_within_time = wait_for_result()", "type": "assigned_variable", "loc": [122, 122], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99607:If_L85_C0", "vector": [14, 1, 0.8971, 0.0074, 1, 0.31, 0.9655, 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 = move_arm.wait_for_result(rospy.Duration(200.0))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99607:If_L124_C4", "label": "if", "type": "if", "loc": [124, 133], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99607:If_L85_C0", "vector": [4, 1, 0.9449, 0.0735, 1, 0.31, 1.0, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not finished_within_time:\n move_arm.cancel_goal()\n rospy.loginfo(\"Timed out achieving goal A\")\n else:\n state = move_arm.get_state()\n\n if state == GoalStatus.SUCCEEDED:\n rospy.loginfo('Action finished and was successful.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99607:Expr_L125_C8", "label": "cancel_goal()", "type": "expression", "loc": [125, 125], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99607:If_L124_C4", "vector": [8, 2, 0.9191, 0.0074, 2, 0.66, 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": " move_arm.cancel_goal()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99607:Expr_L126_C8", "label": "loginfo()", "type": "expression", "loc": [126, 126], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99607:If_L124_C4", "vector": [8, 2, 0.9265, 0.0074, 2, 0.66, 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(\"Timed out achieving goal A\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99607:Assign_L128_C8", "label": "state = get_state()", "type": "assigned_variable", "loc": [128, 128], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99607:If_L124_C4", "vector": [14, 2, 0.9412, 0.0074, 2, 0.66, 0.6667, 688, 3, 0, 0, 0, 650, 10, 1], "semantic": {"name": "state", "arg_names": [], "import_names": [], "rhs_call_name": "get_state", "annotation": ""}, "snippet": " state = move_arm.get_state()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99607:If_L130_C8", "label": "if", "type": "if", "loc": [130, 133], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99607:If_L124_C4", "vector": [4, 2, 0.9669, 0.0294, 2, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if state == GoalStatus.SUCCEEDED:\n rospy.loginfo('Action finished and was successful.')\n else:\n rospy.loginfo('Action failed: %d'%(state))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99607:Expr_L131_C12", "label": "loginfo()", "type": "expression", "loc": [131, 131], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99607:If_L130_C8", "vector": [8, 3, 0.9632, 0.0074, 3, 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('Action finished and was successful.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99607:Expr_L133_C12", "label": "loginfo()", "type": "expression", "loc": [133, 133], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99607:If_L130_C8", "vector": [8, 3, 0.9779, 0.0074, 3, 0.35, 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('Action failed: %d'%(state))"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99607:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99607:Assign_L49_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99607:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99607:Assign_L50_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99607:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99607:Assign_L51_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99607:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99607:Assign_L52_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99607:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99607:Assign_L53_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99607:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99607:Assign_L55_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99607:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99607:Expr_L56_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99607:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99607:Expr_L57_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99607:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99607:Expr_L58_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99607:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99607:Assign_L60_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99607:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99607:Assign_L61_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99607:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99607:Assign_L62_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99607:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99607:Assign_L63_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99607:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99607:Assign_L65_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99607:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99607:Assign_L67_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99607:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99607:Assign_L68_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99607:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99607:Assign_L69_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99607:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99607:Assign_L70_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99607:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99607:Assign_L72_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99607:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99607:Assign_L73_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99607:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99607:Assign_L74_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99607:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99607:Assign_L75_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99607:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99607:Return_L77_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99607:FunctionDef_L79_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99607:Assign_L80_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99607:FunctionDef_L79_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99607:Expr_L81_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99607:FunctionDef_L79_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99607:Expr_L82_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99607:If_L85_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99607:Expr_L86_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99607:If_L85_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99607:Assign_L88_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99607:If_L85_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99607:Expr_L89_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99607:If_L85_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99607:Expr_L90_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99607:If_L85_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99607:Assign_L92_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99607:If_L85_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99607:Assign_L93_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99607:If_L85_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99607:Assign_L94_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99607:If_L85_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99607:Assign_L95_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99607:If_L85_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99607:Assign_L96_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99607:If_L85_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99607:Assign_L97_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99607:If_L85_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99607:Assign_L99_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99607:If_L85_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99607:Assign_L100_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99607:If_L85_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99607:Assign_L101_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99607:If_L85_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99607:Assign_L102_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99607:If_L85_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99607:Assign_L103_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99607:If_L85_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99607:Assign_L104_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99607:If_L85_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99607:Assign_L106_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99607:If_L85_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99607:Assign_L107_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99607:If_L85_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99607:Assign_L108_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99607:If_L85_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99607:Assign_L109_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99607:If_L85_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99607:Assign_L111_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99607:If_L85_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99607:Assign_L112_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99607:If_L85_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99607:Assign_L113_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99607:If_L85_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99607:Assign_L115_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99607:If_L85_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99607:Assign_L116_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99607:If_L85_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99607:Assign_L117_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99607:If_L85_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99607:Expr_L119_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99607:If_L85_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99607:Expr_L121_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99607:If_L85_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99607:Assign_L122_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99607:If_L85_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99607:If_L124_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99607:If_L124_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99607:Expr_L125_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99607:If_L124_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99607:Expr_L126_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99607:If_L124_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99607:Assign_L128_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99607:If_L124_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99607:If_L130_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99607:If_L130_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99607:Expr_L131_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99607:If_L130_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99607:Expr_L133_C12"}]
# # Copyright (c) 2010, Georgia Tech Research Corporation # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # * Neither the name of the Georgia Tech Research Corporation nor the # names of its contributors may be used to endorse or promote products # derived from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY GEORGIA TECH RESEARCH CORPORATION ''AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL GEORGIA TECH BE LIABLE FOR ANY DIRECT, INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # # Author: Advait Jain (advait@cc.gatech.edu), Healthcare Robotics Lab, Georgia Tech import roslib; roslib.load_manifest('move_arm_tutorials') import rospy import actionlib import geometric_shapes_msgs from move_arm_msgs.msg import MoveArmAction from move_arm_msgs.msg import MoveArmGoal from motion_planning_msgs.msg import JointConstraint from actionlib_msgs.msg import GoalStatus if __name__ == '__main__': import hrl_lib.transforms as tr rospy.init_node('move_arm_joint_goal_test') move_arm = actionlib.SimpleActionClient('move_right_arm', MoveArmAction) move_arm.wait_for_server() rospy.loginfo('Connected to server') goalB = MoveArmGoal() names = ['r_shoulder_pan_joint', 'r_shoulder_lift_joint', 'r_upper_arm_roll_joint', 'r_elbow_flex_joint', 'r_forearm_roll_joint', 'r_wrist_flex_joint', 'r_wrist_roll_joint'] goalB.motion_plan_request.group_name = 'right_arm' goalB.motion_plan_request.num_planning_attempts = 1 goalB.motion_plan_request.allowed_planning_time = rospy.Duration(5.0) goalB.motion_plan_request.planner_id = '' goalB.planner_service_name = 'ompl_planning/plan_kinematic_path' import roslib; roslib.load_manifest('darpa_m3') import sandbox_advait.pr2_arms as pa pr2_arms = pa.PR2Arms() raw_input('Move arm to goal location and hit ENTER') q = pr2_arms.get_joint_angles(0) raw_input('Move arm to start location and hit ENTER') q[6] = tr.angle_within_mod180(q[6]) q[4] = tr.angle_within_mod180(q[4]) for i in range(7): jc = JointConstraint() jc.joint_name = names[i] jc.position = q[i] jc.tolerance_below = 0.1 jc.tolerance_above = 0.1 goalB.motion_plan_request.goal_constraints.joint_constraints.append(jc) move_arm.send_goal(goalB) finished_within_time = move_arm.wait_for_result(rospy.Duration(200.0)) if not finished_within_time: move_arm.cancel_goal() rospy.loginfo("Timed out achieving goal A") else: state = move_arm.get_state() if state == GoalStatus.SUCCEEDED: rospy.loginfo('Action finished and was successful.') else: rospy.loginfo('Action failed: %d'%(state))
ajibawa-2023/Python-Code-Large/train/row_99608
47
102
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99608:Import_L32_C0", "label": "roslib import roslib", "type": "import", "loc": [32, 32], "level": 0, "parent": null, "vector": [1, 0, 0.3137, 0.0098, 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('move_arm_tutorials')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99608:Expr_L32_C15", "label": "load_manifest()", "type": "expression", "loc": [32, 32], "level": 0, "parent": null, "vector": [8, 0, 0.3137, 0.0098, 0, 0.66, 0.1111, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('move_arm_tutorials')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99608:Import_L34_C0", "label": "rospy import rospy", "type": "import", "loc": [34, 34], "level": 0, "parent": null, "vector": [1, 0, 0.3333, 0.0098, 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_99608:Import_L35_C0", "label": "actionlib import actionlib", "type": "import", "loc": [35, 35], "level": 0, "parent": null, "vector": [1, 0, 0.3431, 0.0098, 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_99608:Import_L37_C0", "label": "geometric_shapes_msgs import geometric_shapes_msgs", "type": "import", "loc": [37, 37], "level": 0, "parent": null, "vector": [1, 0, 0.3627, 0.0098, 0, 0.66, 0.4444, 588, 0, 1, 0, 0, 588, 0, 0], "semantic": {"name": "geometric_shapes_msgs", "arg_names": [], "import_names": ["geometric_shapes_msgs"], "rhs_call_name": "", "annotation": ""}, "snippet": "import geometric_shapes_msgs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99608:ImportFrom_L39_C0", "label": "from move_arm_msgs.msg import MoveArmAction", "type": "import", "loc": [39, 39], "level": 0, "parent": null, "vector": [1, 0, 0.3824, 0.0098, 0, 0.66, 0.5556, 649, 0, 1, 0, 0, 649, 0, 0], "semantic": {"name": "move_arm_msgs.msg", "arg_names": [], "import_names": ["MoveArmAction"], "rhs_call_name": "", "annotation": ""}, "snippet": "from move_arm_msgs.msg import MoveArmAction"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99608:ImportFrom_L40_C0", "label": "from move_arm_msgs.msg import MoveArmGoal", "type": "import", "loc": [40, 40], "level": 0, "parent": null, "vector": [1, 0, 0.3922, 0.0098, 0, 0.66, 0.6667, 649, 0, 1, 0, 0, 649, 0, 0], "semantic": {"name": "move_arm_msgs.msg", "arg_names": [], "import_names": ["MoveArmGoal"], "rhs_call_name": "", "annotation": ""}, "snippet": "from move_arm_msgs.msg import MoveArmGoal"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99608:ImportFrom_L42_C0", "label": "from motion_planning_msgs.msg import JointConstraint", "type": "import", "loc": [42, 42], "level": 0, "parent": null, "vector": [1, 0, 0.4118, 0.0098, 0, 0.66, 0.7778, 107, 0, 1, 0, 0, 107, 0, 0], "semantic": {"name": "motion_planning_msgs.msg", "arg_names": [], "import_names": ["JointConstraint"], "rhs_call_name": "", "annotation": ""}, "snippet": "from motion_planning_msgs.msg import JointConstraint"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99608:ImportFrom_L44_C0", "label": "from actionlib_msgs.msg import GoalStatus", "type": "import", "loc": [44, 44], "level": 0, "parent": null, "vector": [1, 0, 0.4314, 0.0098, 0, 0.66, 0.8889, 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_99608:If_L47_C0", "label": "if", "type": "if", "loc": [47, 100], "level": 0, "parent": null, "vector": [4, 0, 0.7206, 0.5294, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 24], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n import hrl_lib.transforms as tr\n\n rospy.init_node('move_arm_joint_goal_test')\n\n move_arm = actionlib.SimpleActionClient('move_right_arm', MoveArmAction)\n move_arm.wait_for_server()\n rospy.loginfo('Connected to server')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99608:Import_L48_C4", "label": "hrl_lib.transforms import tr", "type": "import", "loc": [48, 48], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99608:If_L47_C0", "vector": [1, 1, 0.4706, 0.0098, 1, 0.31, 0.0, 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_99608:Expr_L50_C4", "label": "init_node()", "type": "expression", "loc": [50, 50], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99608:If_L47_C0", "vector": [8, 1, 0.4902, 0.0098, 1, 0.31, 0.0417, 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_arm_joint_goal_test')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99608:Assign_L52_C4", "label": "move_arm = SimpleActionClient()", "type": "assigned_variable", "loc": [52, 52], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99608:If_L47_C0", "vector": [14, 1, 0.5098, 0.0098, 1, 0.31, 0.0833, 236, 3, 2, 0, 0, 230, 10, 1], "semantic": {"name": "move_arm", "arg_names": [], "import_names": [], "rhs_call_name": "SimpleActionClient", "annotation": ""}, "snippet": " move_arm = actionlib.SimpleActionClient('move_right_arm', MoveArmAction)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99608:Expr_L53_C4", "label": "wait_for_server()", "type": "expression", "loc": [53, 53], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99608:If_L47_C0", "vector": [8, 1, 0.5196, 0.0098, 1, 0.31, 0.125, 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": " move_arm.wait_for_server()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99608:Expr_L54_C4", "label": "loginfo()", "type": "expression", "loc": [54, 54], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99608:If_L47_C0", "vector": [8, 1, 0.5294, 0.0098, 1, 0.31, 0.1667, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo('Connected to server')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99608:Assign_L56_C4", "label": "goalB = MoveArmGoal()", "type": "assigned_variable", "loc": [56, 56], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99608:If_L47_C0", "vector": [14, 1, 0.549, 0.0098, 1, 0.31, 0.2083, 132, 3, 0, 0, 0, 620, 10, 1], "semantic": {"name": "goalB", "arg_names": [], "import_names": [], "rhs_call_name": "MoveArmGoal", "annotation": ""}, "snippet": " goalB = MoveArmGoal()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99608:Assign_L58_C4", "label": "names =", "type": "assigned_variable", "loc": [58, 61], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99608:If_L47_C0", "vector": [14, 1, 0.5833, 0.0392, 1, 0.31, 0.25, 382, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "names", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " names = ['r_shoulder_pan_joint', 'r_shoulder_lift_joint',\n 'r_upper_arm_roll_joint', 'r_elbow_flex_joint',\n 'r_forearm_roll_joint', 'r_wrist_flex_joint',\n 'r_wrist_roll_joint']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99608:Assign_L63_C4", "label": "goalB.motion_plan_request.group_name =", "type": "assigned_variable", "loc": [63, 63], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99608:If_L47_C0", "vector": [14, 1, 0.6176, 0.0098, 1, 0.31, 0.2917, 282, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "goalB.motion_plan_request.group_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " goalB.motion_plan_request.group_name = 'right_arm'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99608:Assign_L64_C4", "label": "goalB.motion_plan_request.num_planning_attempts =", "type": "assigned_variable", "loc": [64, 64], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99608:If_L47_C0", "vector": [14, 1, 0.6275, 0.0098, 1, 0.31, 0.3333, 643, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "goalB.motion_plan_request.num_planning_attempts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " goalB.motion_plan_request.num_planning_attempts = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99608:Assign_L65_C4", "label": "goalB.motion_plan_request.allowed_planning_time = Duration()", "type": "assigned_variable", "loc": [65, 65], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99608:If_L47_C0", "vector": [14, 1, 0.6373, 0.0098, 1, 0.31, 0.375, 794, 3, 1, 0, 0, 972, 10, 1], "semantic": {"name": "goalB.motion_plan_request.allowed_planning_time", "arg_names": [], "import_names": [], "rhs_call_name": "Duration", "annotation": ""}, "snippet": " goalB.motion_plan_request.allowed_planning_time = rospy.Duration(5.0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99608:Assign_L67_C4", "label": "goalB.motion_plan_request.planner_id =", "type": "assigned_variable", "loc": [67, 67], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99608:If_L47_C0", "vector": [14, 1, 0.6569, 0.0098, 1, 0.31, 0.4167, 78, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "goalB.motion_plan_request.planner_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " goalB.motion_plan_request.planner_id = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99608:Assign_L68_C4", "label": "goalB.planner_service_name =", "type": "assigned_variable", "loc": [68, 68], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99608:If_L47_C0", "vector": [14, 1, 0.6667, 0.0098, 1, 0.31, 0.4583, 980, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "goalB.planner_service_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " goalB.planner_service_name = 'ompl_planning/plan_kinematic_path'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99608:Import_L71_C4", "label": "roslib import roslib", "type": "import", "loc": [71, 71], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99608:If_L47_C0", "vector": [1, 1, 0.6961, 0.0098, 1, 0.31, 0.5, 796, 0, 1, 0, 0, 796, 0, 0], "semantic": {"name": "roslib", "arg_names": [], "import_names": ["roslib"], "rhs_call_name": "", "annotation": ""}, "snippet": " import roslib; roslib.load_manifest('darpa_m3')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99608:Expr_L71_C19", "label": "load_manifest()", "type": "expression", "loc": [71, 71], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99608:If_L47_C0", "vector": [8, 1, 0.6961, 0.0098, 1, 0.31, 0.5417, 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('darpa_m3')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99608:Import_L72_C4", "label": "sandbox_advait.pr2_arms import pa", "type": "import", "loc": [72, 72], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99608:If_L47_C0", "vector": [1, 1, 0.7059, 0.0098, 1, 0.31, 0.5833, 914, 0, 1, 0, 0, 914, 0, 0], "semantic": {"name": "sandbox_advait.pr2_arms", "arg_names": [], "import_names": ["pa"], "rhs_call_name": "", "annotation": ""}, "snippet": " import sandbox_advait.pr2_arms as pa"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99608:Assign_L73_C4", "label": "pr2_arms = PR2Arms()", "type": "assigned_variable", "loc": [73, 73], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99608:If_L47_C0", "vector": [14, 1, 0.7157, 0.0098, 1, 0.31, 0.625, 369, 3, 0, 0, 0, 694, 10, 1], "semantic": {"name": "pr2_arms", "arg_names": [], "import_names": [], "rhs_call_name": "PR2Arms", "annotation": ""}, "snippet": " pr2_arms = pa.PR2Arms()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99608:Expr_L74_C4", "label": "raw_input()", "type": "expression", "loc": [74, 74], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99608:If_L47_C0", "vector": [8, 1, 0.7255, 0.0098, 1, 0.31, 0.6667, 821, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "raw_input", "arg_names": [], "import_names": [], "rhs_call_name": "raw_input", "annotation": ""}, "snippet": " raw_input('Move arm to goal location and hit ENTER')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99608:Assign_L75_C4", "label": "q = get_joint_angles()", "type": "assigned_variable", "loc": [75, 75], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99608:If_L47_C0", "vector": [14, 1, 0.7353, 0.0098, 1, 0.31, 0.7083, 516, 3, 1, 0, 0, 820, 10, 1], "semantic": {"name": "q", "arg_names": [], "import_names": [], "rhs_call_name": "get_joint_angles", "annotation": ""}, "snippet": " q = pr2_arms.get_joint_angles(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99608:Expr_L76_C4", "label": "raw_input()", "type": "expression", "loc": [76, 76], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99608:If_L47_C0", "vector": [8, 1, 0.7451, 0.0098, 1, 0.31, 0.75, 821, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "raw_input", "arg_names": [], "import_names": [], "rhs_call_name": "raw_input", "annotation": ""}, "snippet": " raw_input('Move arm to start location and hit ENTER')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99608:Assign_L78_C4", "label": " = angle_within_mod180()", "type": "assigned_variable", "loc": [78, 78], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99608:If_L47_C0", "vector": [14, 1, 0.7647, 0.0098, 1, 0.31, 0.7917, 0, 3, 1, 0, 0, 694, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "angle_within_mod180", "annotation": ""}, "snippet": " q[6] = tr.angle_within_mod180(q[6])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99608:Assign_L79_C4", "label": " = angle_within_mod180()", "type": "assigned_variable", "loc": [79, 79], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99608:If_L47_C0", "vector": [14, 1, 0.7745, 0.0098, 1, 0.31, 0.8333, 0, 3, 1, 0, 0, 694, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "angle_within_mod180", "annotation": ""}, "snippet": " q[4] = tr.angle_within_mod180(q[4])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99608:For_L80_C4", "label": "for i", "type": "for", "loc": [80, 86], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99608:If_L47_C0", "vector": [6, 1, 0.8137, 0.0686, 1, 0.31, 0.875, 826, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(7):\n jc = JointConstraint()\n jc.joint_name = names[i]\n jc.position = q[i]\n jc.tolerance_below = 0.1\n jc.tolerance_above = 0.1\n goalB.motion_plan_request.goal_constraints.joint_constraints.append(jc)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99608:Assign_L81_C8", "label": "jc = JointConstraint()", "type": "assigned_variable", "loc": [81, 81], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99608:For_L80_C4", "vector": [14, 2, 0.7941, 0.0098, 2, 0.84, 0.0, 901, 3, 0, 0, 0, 290, 10, 1], "semantic": {"name": "jc", "arg_names": [], "import_names": [], "rhs_call_name": "JointConstraint", "annotation": ""}, "snippet": " jc = JointConstraint()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99608:Assign_L82_C8", "label": "jc.joint_name =", "type": "assigned_variable", "loc": [82, 82], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99608:For_L80_C4", "vector": [14, 2, 0.8039, 0.0098, 2, 0.84, 0.2, 948, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "jc.joint_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " jc.joint_name = names[i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99608:Assign_L83_C8", "label": "jc.position =", "type": "assigned_variable", "loc": [83, 83], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99608:For_L80_C4", "vector": [14, 2, 0.8137, 0.0098, 2, 0.84, 0.4, 695, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "jc.position", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " jc.position = q[i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99608:Assign_L84_C8", "label": "jc.tolerance_below =", "type": "assigned_variable", "loc": [84, 84], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99608:For_L80_C4", "vector": [14, 2, 0.8235, 0.0098, 2, 0.84, 0.6, 788, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "jc.tolerance_below", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " jc.tolerance_below = 0.1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99608:Assign_L85_C8", "label": "jc.tolerance_above =", "type": "assigned_variable", "loc": [85, 85], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99608:For_L80_C4", "vector": [14, 2, 0.8333, 0.0098, 2, 0.84, 0.8, 613, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "jc.tolerance_above", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " jc.tolerance_above = 0.1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99608:Expr_L86_C8", "label": "append()", "type": "expression", "loc": [86, 86], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99608:For_L80_C4", "vector": [8, 2, 0.8431, 0.0098, 2, 0.84, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " goalB.motion_plan_request.goal_constraints.joint_constraints.append(jc)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99608:Expr_L88_C4", "label": "send_goal()", "type": "expression", "loc": [88, 88], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99608:If_L47_C0", "vector": [8, 1, 0.8627, 0.0098, 1, 0.31, 0.9167, 184, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "send_goal", "arg_names": [], "import_names": [], "rhs_call_name": "send_goal", "annotation": ""}, "snippet": " move_arm.send_goal(goalB)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99608:Assign_L89_C4", "label": "finished_within_time = wait_for_result()", "type": "assigned_variable", "loc": [89, 89], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99608:If_L47_C0", "vector": [14, 1, 0.8725, 0.0098, 1, 0.31, 0.9583, 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 = move_arm.wait_for_result(rospy.Duration(200.0))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99608:If_L91_C4", "label": "if", "type": "if", "loc": [91, 100], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99608:If_L47_C0", "vector": [4, 1, 0.9363, 0.098, 1, 0.31, 1.0, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not finished_within_time:\n move_arm.cancel_goal()\n rospy.loginfo(\"Timed out achieving goal A\")\n else:\n state = move_arm.get_state()\n\n if state == GoalStatus.SUCCEEDED:\n rospy.loginfo('Action finished and was successful.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99608:Expr_L92_C8", "label": "cancel_goal()", "type": "expression", "loc": [92, 92], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99608:If_L91_C4", "vector": [8, 2, 0.902, 0.0098, 2, 0.8, 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": " move_arm.cancel_goal()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99608:Expr_L93_C8", "label": "loginfo()", "type": "expression", "loc": [93, 93], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99608:If_L91_C4", "vector": [8, 2, 0.9118, 0.0098, 2, 0.8, 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(\"Timed out achieving goal A\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99608:Assign_L95_C8", "label": "state = get_state()", "type": "assigned_variable", "loc": [95, 95], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99608:If_L91_C4", "vector": [14, 2, 0.9314, 0.0098, 2, 0.8, 0.6667, 688, 3, 0, 0, 0, 650, 10, 1], "semantic": {"name": "state", "arg_names": [], "import_names": [], "rhs_call_name": "get_state", "annotation": ""}, "snippet": " state = move_arm.get_state()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99608:If_L97_C8", "label": "if", "type": "if", "loc": [97, 100], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99608:If_L91_C4", "vector": [4, 2, 0.9657, 0.0392, 2, 0.8, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if state == GoalStatus.SUCCEEDED:\n rospy.loginfo('Action finished and was successful.')\n else:\n rospy.loginfo('Action failed: %d'%(state))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99608:Expr_L98_C12", "label": "loginfo()", "type": "expression", "loc": [98, 98], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99608:If_L97_C8", "vector": [8, 3, 0.9608, 0.0098, 3, 0.39, 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('Action finished and was successful.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99608:Expr_L100_C12", "label": "loginfo()", "type": "expression", "loc": [100, 100], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99608:If_L97_C8", "vector": [8, 3, 0.9804, 0.0098, 3, 0.39, 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('Action failed: %d'%(state))"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99608:If_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99608:Import_L48_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99608:If_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99608:Expr_L50_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99608:If_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99608:Assign_L52_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99608:If_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99608:Expr_L53_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99608:If_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99608:Expr_L54_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99608:If_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99608:Assign_L56_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99608:If_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99608:Assign_L58_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99608:If_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99608:Assign_L63_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99608:If_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99608:Assign_L64_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99608:If_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99608:Assign_L65_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99608:If_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99608:Assign_L67_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99608:If_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99608:Assign_L68_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99608:If_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99608:Import_L71_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99608:If_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99608:Expr_L71_C19"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99608:If_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99608:Import_L72_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99608:If_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99608:Assign_L73_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99608:If_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99608:Expr_L74_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99608:If_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99608:Assign_L75_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99608:If_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99608:Expr_L76_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99608:If_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99608:Assign_L78_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99608:If_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99608:Assign_L79_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99608:If_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99608:For_L80_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99608:For_L80_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99608:Assign_L81_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99608:For_L80_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99608:Assign_L82_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99608:For_L80_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99608:Assign_L83_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99608:For_L80_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99608:Assign_L84_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99608:For_L80_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99608:Assign_L85_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99608:For_L80_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99608:Expr_L86_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99608:If_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99608:Expr_L88_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99608:If_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99608:Assign_L89_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99608:If_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99608:If_L91_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99608:If_L91_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99608:Expr_L92_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99608:If_L91_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99608:Expr_L93_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99608:If_L91_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99608:Assign_L95_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99608:If_L91_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99608:If_L97_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99608:If_L97_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99608:Expr_L98_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99608:If_L97_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99608:Expr_L100_C12"}]
import roslib; roslib.load_manifest('hrl_pr2_kinematics_tutorials') import rospy import numpy as np, math ## 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): self.robot = robot ## # @param equi_pt_generator: function that returns stop, ea where ea: equilibrium angles and stop: string which is '' for epc motion to continue # @param rapid_call_func: called in the time between calls to the equi_pt_generator can be used for logging, safety etc. returns string which is '' for epc motion to continue # @param time_step: time between successive calls to equi_pt_generator # @param arg_list - list of arguments to be passed to the equi_pt_generator # @return stop (the string which has the reason why the epc # motion stopped.), ea (last commanded equilibrium angles) def epc_motion(self, equi_pt_generator, time_step, arm, arg_list, rapid_call_func=None, control_function=None): stop, ea = equi_pt_generator(*arg_list) t_end = rospy.get_time() while stop == '': t_end += time_step #self.robot.set_jointangles(arm, ea) #import pdb; pdb.set_trace() control_function(arm, *ea) # self.robot.step() this should be within the rapid_call_func for the meka arms. t1 = rospy.get_time() while t1<t_end: if rapid_call_func != None: stop = rapid_call_func(arm) if stop != '': break # self.robot.step() this should be within the rapid_call_func for the meka arms. t1 = rospy.get_time() stop, ea = equi_pt_generator(*arg_list) if stop == 'reset timing': stop = '' t_end = rospy.get_time() return stop, ea ## Pull back along a straight line (-ve x direction) # @param arm - 'right_arm' or 'left_arm' # @param ea - starting equilibrium angle. # @param rot_mat - rotation matrix defining end effector pose # @param distance - how far back to pull. def pull_back(self, arm, ea, rot_mat, distance): self.cep = self.robot.FK(arm, ea) self.dist_left = distance self.ea = ea def eq_gen_pull_back(robot, arm, rot_mat): if self.dist_left <= 0.: return 'done', None step_size = 0.01 self.cep[0,0] -= step_size self.dist_left -= step_size ea = robot.IK(arm, self.cep, rot_mat, self.ea) self.ea = ea if ea == None: return 'IK fail', ea return '', [ea,] arg_list = [self.robot, arm, rot_mat] stop, ea = self.epc_motion(eq_gen_pull_back, 0.1, arm, arg_list, control_function = self.robot.set_jointangles) print stop, ea ## Pull back along a straight line (-ve x direction) # @param arm - 'right_arm' or 'left_arm' # @param ea - starting cep. # @param rot_mat - rotation matrix defining end effector pose # @param distance - how far back to pull. def pull_back_cartesian_control(self, arm, cep, rot_mat, distance): self.cep = cep self.dist_left = distance def eq_gen_pull_back(robot, arm, rot_mat): if self.dist_left <= 0.: return 'done', None step_size = 0.01 self.cep[0,0] -= step_size self.dist_left -= step_size if self.cep[0,0] < 0.4: return 'very close to the body: %.3f'%self.cep[0,0], None return '', (self.cep, rot_mat) arg_list = [self.robot, arm, rot_mat] stop, ea = self.epc_motion(eq_gen_pull_back, 0.1, arm, arg_list, control_function = self.robot.set_cartesian) print stop, ea if __name__ == '__main__': import hrl_pr2 import hrl_lib.transforms as tr rospy.init_node('epc_pr2', anonymous = True) rospy.logout('epc_pr2: ready') pr2 = hrl_pr2.HRL_PR2() epc = EPC(pr2) arm = 'right_arm' if False: ea = [0, 0, 0, 0, 0, 0, 0] ea = epc.robot.get_joint_angles(arm) rospy.logout('Going to starting position') epc.robot.set_jointangles(arm, ea, duration=4.0) raw_input('Hit ENTER to pull') epc.pull_back(arm, ea, tr.Rx(0), 0.2) if True: p = np.matrix([0.9, -0.3, -0.15]).T rot = tr.Rx(0.) rot = tr.Rx(math.radians(90.)) rospy.logout('Going to starting position') # epc.robot.open_gripper(arm) epc.robot.set_cartesian(arm, p, rot) # raw_input('Hit ENTER to close the gripper') # epc.robot.close_gripper(arm) raw_input('Hit ENTER to pull') epc.pull_back_cartesian_control(arm, p, rot, 0.4)
ajibawa-2023/Python-Code-Large/train/row_99609
75
138
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99609:Import_L2_C0", "label": "roslib import roslib", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0145, 0.0072, 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_pr2_kinematics_tutorials')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99609:Expr_L2_C15", "label": "load_manifest()", "type": "expression", "loc": [2, 2], "level": 0, "parent": null, "vector": [8, 0, 0.0145, 0.0072, 0, 0.66, 0.2, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('hrl_pr2_kinematics_tutorials')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99609:Import_L3_C0", "label": "rospy import rospy", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0217, 0.0072, 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_99609:Import_L5_C0", "label": "numpy import np, math", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0362, 0.0072, 0, 0.66, 0.6, 954, 0, 2, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np", "math"], "rhs_call_name": "", "annotation": ""}, "snippet": "import numpy as np, math"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99609:ClassDef_L10_C0", "label": "EPC", "type": "class", "loc": [10, 100], "level": 0, "parent": null, "vector": [3, 0, 0.3986, 0.6594, 0, 0.66, 0.8, 417, 0, 6, 0, 0, 0, 0, 14], "semantic": {"name": "EPC", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class EPC():\n def __init__(self, robot):\n self.robot = robot\n\n ##\n # @param equi_pt_generator: function that returns stop, ea where ea: equilibrium angles and stop: string which is '' for epc motion to continue\n # @param rapid_call_func: called in the time between calls to the equi_pt_generator can be used for logging, safety etc. returns string which is '' for epc motion to continue\n # @param time_step: time between successive calls to equi_pt_generator"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99609:FunctionDef_L11_C4", "label": "__init__", "type": "function", "loc": [11, 12], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99609:ClassDef_L10_C0", "vector": [2, 1, 0.0833, 0.0145, 1, 0.5, 0.0, 555, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "robot"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, robot):\n self.robot = robot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99609:Assign_L12_C8", "label": "self.robot =", "type": "assigned_variable", "loc": [12, 12], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99609:FunctionDef_L11_C4", "vector": [14, 2, 0.087, 0.0072, 2, 0.57, 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_99609:FunctionDef_L21_C4", "label": "epc_motion", "type": "function", "loc": [21, 48], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99609:ClassDef_L10_C0", "vector": [2, 1, 0.25, 0.2029, 1, 0.5, 0.3333, 938, 0, 7, 1, 0, 0, 0, 8], "semantic": {"name": "epc_motion", "arg_names": ["self", "equi_pt_generator", "time_step", "arm", "arg_list", "rapid_call_func", "control_function"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def epc_motion(self, equi_pt_generator, time_step, arm, arg_list,\n rapid_call_func=None, control_function=None):\n\n stop, ea = equi_pt_generator(*arg_list)\n t_end = rospy.get_time()\n while stop == '':\n t_end += time_step\n #self.robot.set_jointangles(arm, ea)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99609:Assign_L24_C8", "label": "stop, ea = equi_pt_generator()", "type": "assigned_variable", "loc": [24, 24], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99609:FunctionDef_L21_C4", "vector": [14, 2, 0.1739, 0.0072, 2, 0.29, 0.0, 665, 3, 1, 0, 0, 648, 10, 1], "semantic": {"name": "stop, ea", "arg_names": [], "import_names": [], "rhs_call_name": "equi_pt_generator", "annotation": ""}, "snippet": " stop, ea = equi_pt_generator(*arg_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99609:Assign_L25_C8", "label": "t_end = get_time()", "type": "assigned_variable", "loc": [25, 25], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99609:FunctionDef_L21_C4", "vector": [14, 2, 0.1812, 0.0072, 2, 0.29, 0.3333, 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_99609:While_L26_C8", "label": "while", "type": "while", "loc": [26, 46], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99609:FunctionDef_L21_C4", "vector": [5, 2, 0.2609, 0.1522, 2, 0.29, 0.6667, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while stop == '':\n t_end += time_step\n #self.robot.set_jointangles(arm, ea)\n #import pdb; pdb.set_trace()\n control_function(arm, *ea)\n\n # self.robot.step() this should be within the rapid_call_func for the meka arms.\n t1 = rospy.get_time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99609:Expr_L30_C12", "label": "control_function()", "type": "expression", "loc": [30, 30], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99609:While_L26_C8", "vector": [8, 3, 0.2174, 0.0072, 3, 0.28, 0.0, 736, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "control_function", "arg_names": [], "import_names": [], "rhs_call_name": "control_function", "annotation": ""}, "snippet": " control_function(arm, *ea)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99609:Assign_L33_C12", "label": "t1 = get_time()", "type": "assigned_variable", "loc": [33, 33], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99609:While_L26_C8", "vector": [14, 3, 0.2391, 0.0072, 3, 0.28, 0.25, 329, 3, 0, 0, 0, 164, 10, 1], "semantic": {"name": "t1", "arg_names": [], "import_names": [], "rhs_call_name": "get_time", "annotation": ""}, "snippet": " t1 = rospy.get_time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99609:While_L34_C12", "label": "while", "type": "while", "loc": [34, 40], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99609:While_L26_C8", "vector": [5, 3, 0.2681, 0.0507, 3, 0.28, 0.5, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while t1<t_end:\n if rapid_call_func != None:\n stop = rapid_call_func(arm)\n if stop != '':\n break\n # self.robot.step() this should be within the rapid_call_func for the meka arms.\n t1 = rospy.get_time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99609:If_L35_C16", "label": "if", "type": "if", "loc": [35, 38], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99609:While_L34_C12", "vector": [4, 4, 0.2645, 0.029, 4, 0.35, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if rapid_call_func != None:\n stop = rapid_call_func(arm)\n if stop != '':\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99609:Assign_L36_C20", "label": "stop = rapid_call_func()", "type": "assigned_variable", "loc": [36, 36], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99609:If_L35_C16", "vector": [14, 5, 0.2609, 0.0072, 5, 0.5, 0.0, 343, 3, 1, 0, 0, 571, 10, 1], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "rapid_call_func", "annotation": ""}, "snippet": " stop = rapid_call_func(arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99609:If_L37_C20", "label": "if", "type": "if", "loc": [37, 38], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99609:If_L35_C16", "vector": [4, 5, 0.2717, 0.0145, 5, 0.5, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if stop != '':\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99609:Assign_L40_C16", "label": "t1 = get_time()", "type": "assigned_variable", "loc": [40, 40], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99609:While_L34_C12", "vector": [14, 4, 0.2899, 0.0072, 4, 0.35, 1.0, 329, 3, 0, 0, 0, 164, 10, 1], "semantic": {"name": "t1", "arg_names": [], "import_names": [], "rhs_call_name": "get_time", "annotation": ""}, "snippet": " t1 = rospy.get_time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99609:Assign_L42_C12", "label": "stop, ea = equi_pt_generator()", "type": "assigned_variable", "loc": [42, 42], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99609:While_L26_C8", "vector": [14, 3, 0.3043, 0.0072, 3, 0.28, 0.75, 665, 3, 1, 0, 0, 648, 10, 1], "semantic": {"name": "stop, ea", "arg_names": [], "import_names": [], "rhs_call_name": "equi_pt_generator", "annotation": ""}, "snippet": " stop, ea = equi_pt_generator(*arg_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99609:If_L44_C12", "label": "if", "type": "if", "loc": [44, 46], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99609:While_L26_C8", "vector": [4, 3, 0.3261, 0.0217, 3, 0.28, 1.0, 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_99609:Assign_L45_C16", "label": "stop =", "type": "assigned_variable", "loc": [45, 45], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99609:If_L44_C12", "vector": [14, 4, 0.3261, 0.0072, 4, 0.91, 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_99609:Assign_L46_C16", "label": "t_end = get_time()", "type": "assigned_variable", "loc": [46, 46], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99609:If_L44_C12", "vector": [14, 4, 0.3333, 0.0072, 4, 0.91, 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_99609:Return_L48_C8", "label": "return", "type": "return", "loc": [48, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99609:FunctionDef_L21_C4", "vector": [13, 2, 0.3478, 0.0072, 2, 0.29, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return stop, ea"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99609:FunctionDef_L55_C4", "label": "pull_back", "type": "function", "loc": [55, 75], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99609:ClassDef_L10_C0", "vector": [2, 1, 0.471, 0.1522, 1, 0.5, 0.6667, 382, 0, 5, 1, 0, 0, 0, 4], "semantic": {"name": "pull_back", "arg_names": ["self", "arm", "ea", "rot_mat", "distance"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def pull_back(self, arm, ea, rot_mat, distance):\n self.cep = self.robot.FK(arm, ea)\n self.dist_left = distance\n self.ea = ea\n\n def eq_gen_pull_back(robot, arm, rot_mat):\n if self.dist_left <= 0.:\n return 'done', None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99609:Assign_L56_C8", "label": "self.cep = FK()", "type": "assigned_variable", "loc": [56, 56], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99609:FunctionDef_L55_C4", "vector": [14, 2, 0.4058, 0.0072, 2, 0.94, 0.0, 694, 3, 2, 0, 0, 252, 10, 1], "semantic": {"name": "self.cep", "arg_names": [], "import_names": [], "rhs_call_name": "FK", "annotation": ""}, "snippet": " self.cep = self.robot.FK(arm, ea)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99609:Assign_L57_C8", "label": "self.dist_left =", "type": "assigned_variable", "loc": [57, 57], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99609:FunctionDef_L55_C4", "vector": [14, 2, 0.413, 0.0072, 2, 0.94, 0.1667, 539, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.dist_left", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.dist_left = distance"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99609:Assign_L58_C8", "label": "self.ea =", "type": "assigned_variable", "loc": [58, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99609:FunctionDef_L55_C4", "vector": [14, 2, 0.4203, 0.0072, 2, 0.94, 0.3333, 448, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.ea", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.ea = ea"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99609:FunctionDef_L60_C8", "label": "eq_gen_pull_back", "type": "function", "loc": [60, 70], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99609:FunctionDef_L55_C4", "vector": [2, 2, 0.471, 0.0797, 2, 0.94, 0.5, 336, 0, 3, 1, 0, 0, 0, 1], "semantic": {"name": "eq_gen_pull_back", "arg_names": ["robot", "arm", "rot_mat"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def eq_gen_pull_back(robot, arm, rot_mat):\n if self.dist_left <= 0.:\n return 'done', None\n step_size = 0.01\n self.cep[0,0] -= step_size\n self.dist_left -= step_size\n ea = robot.IK(arm, self.cep, rot_mat, self.ea)\n self.ea = ea"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99609:If_L61_C12", "label": "if", "type": "if", "loc": [61, 62], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99609:FunctionDef_L60_C8", "vector": [4, 3, 0.4457, 0.0145, 3, 0.39, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.dist_left <= 0.:\n return 'done', None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99609:Return_L62_C16", "label": "return", "type": "return", "loc": [62, 62], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99609:If_L61_C12", "vector": [13, 4, 0.4493, 0.0072, 4, 0.8, 0.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'done', None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99609:Assign_L63_C12", "label": "step_size =", "type": "assigned_variable", "loc": [63, 63], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99609:FunctionDef_L60_C8", "vector": [14, 3, 0.4565, 0.0072, 3, 0.39, 0.2, 764, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "step_size", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " step_size = 0.01"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99609:Assign_L66_C12", "label": "ea = IK()", "type": "assigned_variable", "loc": [66, 66], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99609:FunctionDef_L60_C8", "vector": [14, 3, 0.4783, 0.0072, 3, 0.39, 0.4, 883, 3, 4, 0, 0, 719, 10, 1], "semantic": {"name": "ea", "arg_names": [], "import_names": [], "rhs_call_name": "IK", "annotation": ""}, "snippet": " ea = robot.IK(arm, self.cep, rot_mat, self.ea)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99609:Assign_L67_C12", "label": "self.ea =", "type": "assigned_variable", "loc": [67, 67], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99609:FunctionDef_L60_C8", "vector": [14, 3, 0.4855, 0.0072, 3, 0.39, 0.6, 448, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.ea", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.ea = ea"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99609:If_L68_C12", "label": "if", "type": "if", "loc": [68, 69], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99609:FunctionDef_L60_C8", "vector": [4, 3, 0.4964, 0.0145, 3, 0.39, 0.8, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if ea == None:\n return 'IK fail', ea"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99609:Return_L69_C16", "label": "return", "type": "return", "loc": [69, 69], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99609:If_L68_C12", "vector": [13, 4, 0.5, 0.0072, 4, 0.29, 0.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'IK fail', ea"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99609:Return_L70_C12", "label": "return", "type": "return", "loc": [70, 70], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99609:FunctionDef_L60_C8", "vector": [13, 3, 0.5072, 0.0072, 3, 0.39, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return '', [ea,]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99609:Assign_L72_C8", "label": "arg_list =", "type": "assigned_variable", "loc": [72, 72], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99609:FunctionDef_L55_C4", "vector": [14, 2, 0.5217, 0.0072, 2, 0.94, 0.6667, 873, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "arg_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " arg_list = [self.robot, arm, rot_mat]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99609:Assign_L73_C8", "label": "stop, ea = epc_motion()", "type": "assigned_variable", "loc": [73, 74], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99609:FunctionDef_L55_C4", "vector": [14, 2, 0.5326, 0.0145, 2, 0.94, 0.8333, 665, 3, 5, 0, 0, 938, 10, 1], "semantic": {"name": "stop, ea", "arg_names": [], "import_names": [], "rhs_call_name": "epc_motion", "annotation": ""}, "snippet": " stop, ea = self.epc_motion(eq_gen_pull_back, 0.1, arm, arg_list,\n control_function = self.robot.set_jointangles)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99609:Expr_L75_C8", "label": "print()", "type": "expression", "loc": [75, 75], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99609:FunctionDef_L55_C4", "vector": [8, 2, 0.5435, 0.0072, 2, 0.94, 1.0, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(stop, ea)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99609:FunctionDef_L82_C4", "label": "pull_back_cartesian_control", "type": "function", "loc": [82, 100], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99609:ClassDef_L10_C0", "vector": [2, 1, 0.6594, 0.1377, 1, 0.5, 1.0, 632, 0, 5, 1, 0, 0, 0, 2], "semantic": {"name": "pull_back_cartesian_control", "arg_names": ["self", "arm", "cep", "rot_mat", "distance"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def pull_back_cartesian_control(self, arm, cep, rot_mat, distance):\n self.cep = cep\n self.dist_left = distance\n\n def eq_gen_pull_back(robot, arm, rot_mat):\n if self.dist_left <= 0.:\n return 'done', None\n step_size = 0.01"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99609:Assign_L83_C8", "label": "self.cep =", "type": "assigned_variable", "loc": [83, 83], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99609:FunctionDef_L82_C4", "vector": [14, 2, 0.6014, 0.0072, 2, 0.16, 0.0, 694, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.cep", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.cep = cep"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99609:Assign_L84_C8", "label": "self.dist_left =", "type": "assigned_variable", "loc": [84, 84], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99609:FunctionDef_L82_C4", "vector": [14, 2, 0.6087, 0.0072, 2, 0.16, 0.2, 539, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.dist_left", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.dist_left = distance"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99609:FunctionDef_L86_C8", "label": "eq_gen_pull_back", "type": "function", "loc": [86, 95], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99609:FunctionDef_L82_C4", "vector": [2, 2, 0.6558, 0.0725, 2, 0.16, 0.4, 336, 0, 3, 1, 0, 0, 0, 0], "semantic": {"name": "eq_gen_pull_back", "arg_names": ["robot", "arm", "rot_mat"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def eq_gen_pull_back(robot, arm, rot_mat):\n if self.dist_left <= 0.:\n return 'done', None\n step_size = 0.01\n self.cep[0,0] -= step_size\n self.dist_left -= step_size\n if self.cep[0,0] < 0.4:\n return 'very close to the body: %.3f'%self.cep[0,0], None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99609:If_L87_C12", "label": "if", "type": "if", "loc": [87, 88], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99609:FunctionDef_L86_C8", "vector": [4, 3, 0.6341, 0.0145, 3, 0.93, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.dist_left <= 0.:\n return 'done', None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99609:Return_L88_C16", "label": "return", "type": "return", "loc": [88, 88], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99609:If_L87_C12", "vector": [13, 4, 0.6377, 0.0072, 4, 0.85, 0.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'done', None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99609:Assign_L89_C12", "label": "step_size =", "type": "assigned_variable", "loc": [89, 89], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99609:FunctionDef_L86_C8", "vector": [14, 3, 0.6449, 0.0072, 3, 0.93, 0.3333, 764, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "step_size", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " step_size = 0.01"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99609:If_L92_C12", "label": "if", "type": "if", "loc": [92, 93], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99609:FunctionDef_L86_C8", "vector": [4, 3, 0.6703, 0.0145, 3, 0.93, 0.6667, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.cep[0,0] < 0.4:\n return 'very close to the body: %.3f'%self.cep[0,0], None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99609:Return_L93_C16", "label": "return", "type": "return", "loc": [93, 93], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99609:If_L92_C12", "vector": [13, 4, 0.6739, 0.0072, 4, 0.89, 0.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'very close to the body: %.3f'%self.cep[0,0], None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99609:Return_L95_C12", "label": "return", "type": "return", "loc": [95, 95], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99609:FunctionDef_L86_C8", "vector": [13, 3, 0.6884, 0.0072, 3, 0.93, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return '', (self.cep, rot_mat)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99609:Assign_L97_C8", "label": "arg_list =", "type": "assigned_variable", "loc": [97, 97], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99609:FunctionDef_L82_C4", "vector": [14, 2, 0.7029, 0.0072, 2, 0.16, 0.6, 873, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "arg_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " arg_list = [self.robot, arm, rot_mat]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99609:Assign_L98_C8", "label": "stop, ea = epc_motion()", "type": "assigned_variable", "loc": [98, 99], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99609:FunctionDef_L82_C4", "vector": [14, 2, 0.7138, 0.0145, 2, 0.16, 0.8, 665, 3, 5, 0, 0, 938, 10, 1], "semantic": {"name": "stop, ea", "arg_names": [], "import_names": [], "rhs_call_name": "epc_motion", "annotation": ""}, "snippet": " stop, ea = self.epc_motion(eq_gen_pull_back, 0.1, arm, arg_list,\n control_function = self.robot.set_cartesian)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99609:Expr_L100_C8", "label": "print()", "type": "expression", "loc": [100, 100], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99609:FunctionDef_L82_C4", "vector": [8, 2, 0.7246, 0.0072, 2, 0.16, 1.0, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(stop, ea)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99609:If_L103_C0", "label": "if", "type": "if", "loc": [103, 134], "level": 0, "parent": null, "vector": [4, 0, 0.8587, 0.2319, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 18], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n import hrl_pr2\n import hrl_lib.transforms as tr\n\n rospy.init_node('epc_pr2', anonymous = True)\n rospy.logout('epc_pr2: ready')\n\n pr2 = hrl_pr2.HRL_PR2()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99609:Import_L104_C4", "label": "hrl_pr2 import hrl_pr2", "type": "import", "loc": [104, 104], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99609:If_L103_C0", "vector": [1, 1, 0.7536, 0.0072, 1, 0.27, 0.0, 174, 0, 1, 0, 0, 174, 0, 0], "semantic": {"name": "hrl_pr2", "arg_names": [], "import_names": ["hrl_pr2"], "rhs_call_name": "", "annotation": ""}, "snippet": " import hrl_pr2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99609:Import_L105_C4", "label": "hrl_lib.transforms import tr", "type": "import", "loc": [105, 105], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99609:If_L103_C0", "vector": [1, 1, 0.7609, 0.0072, 1, 0.27, 0.125, 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_99609:Expr_L107_C4", "label": "init_node()", "type": "expression", "loc": [107, 107], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99609:If_L103_C0", "vector": [8, 1, 0.7754, 0.0072, 1, 0.27, 0.25, 463, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "init_node", "arg_names": [], "import_names": [], "rhs_call_name": "init_node", "annotation": ""}, "snippet": " rospy.init_node('epc_pr2', anonymous = True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99609:Expr_L108_C4", "label": "logout()", "type": "expression", "loc": [108, 108], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99609:If_L103_C0", "vector": [8, 1, 0.7826, 0.0072, 1, 0.27, 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('epc_pr2: ready')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99609:Assign_L110_C4", "label": "pr2 = HRL_PR2()", "type": "assigned_variable", "loc": [110, 110], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99609:If_L103_C0", "vector": [14, 1, 0.7971, 0.0072, 1, 0.27, 0.5, 244, 3, 0, 0, 0, 142, 10, 1], "semantic": {"name": "pr2", "arg_names": [], "import_names": [], "rhs_call_name": "HRL_PR2", "annotation": ""}, "snippet": " pr2 = hrl_pr2.HRL_PR2()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99609:Assign_L111_C4", "label": "epc = EPC()", "type": "assigned_variable", "loc": [111, 111], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99609:If_L103_C0", "vector": [14, 1, 0.8043, 0.0072, 1, 0.27, 0.625, 304, 3, 1, 0, 0, 417, 10, 1], "semantic": {"name": "epc", "arg_names": [], "import_names": [], "rhs_call_name": "EPC", "annotation": ""}, "snippet": " epc = EPC(pr2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99609:Assign_L113_C4", "label": "arm =", "type": "assigned_variable", "loc": [113, 113], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99609:If_L103_C0", "vector": [14, 1, 0.8188, 0.0072, 1, 0.27, 0.75, 413, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "arm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " arm = 'right_arm'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99609:If_L115_C4", "label": "if", "type": "if", "loc": [115, 121], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99609:If_L103_C0", "vector": [4, 1, 0.8551, 0.0507, 1, 0.27, 0.875, 0, 1, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if False:\n ea = [0, 0, 0, 0, 0, 0, 0]\n ea = epc.robot.get_joint_angles(arm)\n rospy.logout('Going to starting position')\n epc.robot.set_jointangles(arm, ea, duration=4.0)\n raw_input('Hit ENTER to pull')\n epc.pull_back(arm, ea, tr.Rx(0), 0.2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99609:Assign_L116_C8", "label": "ea =", "type": "assigned_variable", "loc": [116, 116], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99609:If_L115_C4", "vector": [14, 2, 0.8406, 0.0072, 2, 0.63, 0.0, 883, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "ea", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ea = [0, 0, 0, 0, 0, 0, 0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99609:Assign_L117_C8", "label": "ea = get_joint_angles()", "type": "assigned_variable", "loc": [117, 117], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99609:If_L115_C4", "vector": [14, 2, 0.8478, 0.0072, 2, 0.63, 0.2, 883, 3, 1, 0, 0, 820, 10, 1], "semantic": {"name": "ea", "arg_names": [], "import_names": [], "rhs_call_name": "get_joint_angles", "annotation": ""}, "snippet": " ea = epc.robot.get_joint_angles(arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99609:Expr_L118_C8", "label": "logout()", "type": "expression", "loc": [118, 118], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99609:If_L115_C4", "vector": [8, 2, 0.8551, 0.0072, 2, 0.63, 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('Going to starting position')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99609:Expr_L119_C8", "label": "set_jointangles()", "type": "expression", "loc": [119, 119], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99609:If_L115_C4", "vector": [8, 2, 0.8623, 0.0072, 2, 0.63, 0.6, 240, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "set_jointangles", "arg_names": [], "import_names": [], "rhs_call_name": "set_jointangles", "annotation": ""}, "snippet": " epc.robot.set_jointangles(arm, ea, duration=4.0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99609:Expr_L120_C8", "label": "raw_input()", "type": "expression", "loc": [120, 120], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99609:If_L115_C4", "vector": [8, 2, 0.8696, 0.0072, 2, 0.63, 0.8, 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 pull')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99609:Expr_L121_C8", "label": "pull_back()", "type": "expression", "loc": [121, 121], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99609:If_L115_C4", "vector": [8, 2, 0.8768, 0.0072, 2, 0.63, 1.0, 382, 3, 4, 0, 0, 0, 0, 2], "semantic": {"name": "pull_back", "arg_names": [], "import_names": [], "rhs_call_name": "pull_back", "annotation": ""}, "snippet": " epc.pull_back(arm, ea, tr.Rx(0), 0.2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99609:If_L123_C4", "label": "if", "type": "if", "loc": [123, 134], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99609:If_L103_C0", "vector": [4, 1, 0.9312, 0.087, 1, 0.27, 1.0, 0, 1, 0, 0, 0, 0, 0, 8], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if True:\n p = np.matrix([0.9, -0.3, -0.15]).T\n rot = tr.Rx(0.)\n rot = tr.Rx(math.radians(90.))\n\n rospy.logout('Going to starting position')\n # epc.robot.open_gripper(arm)\n epc.robot.set_cartesian(arm, p, rot)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99609:Assign_L124_C8", "label": "p =", "type": "assigned_variable", "loc": [124, 124], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99609:If_L123_C4", "vector": [14, 2, 0.8986, 0.0072, 2, 0.43, 0.0, 491, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p = np.matrix([0.9, -0.3, -0.15]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99609:Assign_L125_C8", "label": "rot = Rx()", "type": "assigned_variable", "loc": [125, 125], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99609:If_L123_C4", "vector": [14, 2, 0.9058, 0.0072, 2, 0.43, 0.1667, 812, 3, 1, 0, 0, 820, 10, 1], "semantic": {"name": "rot", "arg_names": [], "import_names": [], "rhs_call_name": "Rx", "annotation": ""}, "snippet": " rot = tr.Rx(0.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99609:Assign_L126_C8", "label": "rot = Rx()", "type": "assigned_variable", "loc": [126, 126], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99609:If_L123_C4", "vector": [14, 2, 0.913, 0.0072, 2, 0.43, 0.3333, 812, 3, 1, 0, 0, 820, 10, 2], "semantic": {"name": "rot", "arg_names": [], "import_names": [], "rhs_call_name": "Rx", "annotation": ""}, "snippet": " rot = tr.Rx(math.radians(90.))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99609:Expr_L128_C8", "label": "logout()", "type": "expression", "loc": [128, 128], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99609:If_L123_C4", "vector": [8, 2, 0.9275, 0.0072, 2, 0.43, 0.5, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout('Going to starting position')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99609:Expr_L130_C8", "label": "set_cartesian()", "type": "expression", "loc": [130, 130], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99609:If_L123_C4", "vector": [8, 2, 0.942, 0.0072, 2, 0.43, 0.6667, 203, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "set_cartesian", "arg_names": [], "import_names": [], "rhs_call_name": "set_cartesian", "annotation": ""}, "snippet": " epc.robot.set_cartesian(arm, p, rot)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99609:Expr_L133_C8", "label": "raw_input()", "type": "expression", "loc": [133, 133], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99609:If_L123_C4", "vector": [8, 2, 0.9638, 0.0072, 2, 0.43, 0.8333, 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 pull')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99609:Expr_L134_C8", "label": "pull_back_cartesian_control()", "type": "expression", "loc": [134, 134], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99609:If_L123_C4", "vector": [8, 2, 0.971, 0.0072, 2, 0.43, 1.0, 632, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "pull_back_cartesian_control", "arg_names": [], "import_names": [], "rhs_call_name": "pull_back_cartesian_control", "annotation": ""}, "snippet": " epc.pull_back_cartesian_control(arm, p, rot, 0.4)"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99609:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99609:FunctionDef_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99609:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99609:Assign_L12_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99609:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99609:FunctionDef_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99609:FunctionDef_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99609:Assign_L24_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99609:FunctionDef_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99609:Assign_L25_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99609:FunctionDef_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99609:While_L26_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99609:While_L26_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99609:Expr_L30_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99609:While_L26_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99609:Assign_L33_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99609:While_L26_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99609:While_L34_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99609:While_L34_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99609:If_L35_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99609:If_L35_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99609:Assign_L36_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99609:If_L35_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99609:If_L37_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99609:While_L34_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99609:Assign_L40_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99609:While_L26_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99609:Assign_L42_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99609:While_L26_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99609:If_L44_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99609:If_L44_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99609:Assign_L45_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99609:If_L44_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99609:Assign_L46_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99609:FunctionDef_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99609:Return_L48_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99609:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99609:FunctionDef_L55_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99609:FunctionDef_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99609:Assign_L56_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99609:FunctionDef_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99609:Assign_L57_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99609:FunctionDef_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99609:Assign_L58_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99609:FunctionDef_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99609:FunctionDef_L60_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99609:FunctionDef_L60_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99609:If_L61_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99609:If_L61_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99609:Return_L62_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99609:FunctionDef_L60_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99609:Assign_L63_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99609:FunctionDef_L60_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99609:Assign_L66_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99609:FunctionDef_L60_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99609:Assign_L67_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99609:FunctionDef_L60_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99609:If_L68_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99609:If_L68_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99609:Return_L69_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99609:FunctionDef_L60_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99609:Return_L70_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99609:FunctionDef_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99609:Assign_L72_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99609:FunctionDef_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99609:Assign_L73_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99609:FunctionDef_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99609:Expr_L75_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99609:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99609:FunctionDef_L82_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99609:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99609:Assign_L83_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99609:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99609:Assign_L84_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99609:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99609:FunctionDef_L86_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99609:FunctionDef_L86_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99609:If_L87_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99609:If_L87_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99609:Return_L88_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99609:FunctionDef_L86_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99609:Assign_L89_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99609:FunctionDef_L86_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99609:If_L92_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99609:If_L92_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99609:Return_L93_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99609:FunctionDef_L86_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99609:Return_L95_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99609:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99609:Assign_L97_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99609:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99609:Assign_L98_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99609:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99609:Expr_L100_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99609:If_L103_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99609:Import_L104_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99609:If_L103_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99609:Import_L105_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99609:If_L103_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99609:Expr_L107_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99609:If_L103_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99609:Expr_L108_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99609:If_L103_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99609:Assign_L110_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99609:If_L103_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99609:Assign_L111_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99609:If_L103_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99609:Assign_L113_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99609:If_L103_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99609:If_L115_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99609:If_L115_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99609:Assign_L116_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99609:If_L115_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99609:Assign_L117_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99609:If_L115_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99609:Expr_L118_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99609:If_L115_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99609:Expr_L119_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99609:If_L115_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99609:Expr_L120_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99609:If_L115_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99609:Expr_L121_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99609:If_L103_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99609:If_L123_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99609:If_L123_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99609:Assign_L124_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99609:If_L123_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99609:Assign_L125_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99609:If_L123_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99609:Assign_L126_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99609:If_L123_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99609:Expr_L128_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99609:If_L123_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99609:Expr_L130_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99609:If_L123_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99609:Expr_L133_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99609:If_L123_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99609:Expr_L134_C8"}]
import numpy as np, math from threading import RLock import roslib; roslib.load_manifest('hrl_pr2_kinematics_tutorials') import rospy import actionlib from kinematics_msgs.srv import GetPositionFK, GetPositionFKRequest, GetPositionFKResponse from kinematics_msgs.srv import GetPositionIK, GetPositionIKRequest, GetPositionIKResponse from pr2_controllers_msgs.msg import JointTrajectoryAction, JointTrajectoryGoal, JointTrajectoryControllerState from pr2_controllers_msgs.msg import Pr2GripperCommandGoal, Pr2GripperCommandAction, Pr2GripperCommand from trajectory_msgs.msg import JointTrajectoryPoint from geometry_msgs.msg import PoseStamped from std_msgs.msg import Float64 from sensor_msgs.msg import JointState import hrl_lib.transforms as tr import time class HRL_PR2(): def __init__(self): self.joint_names_list = ['r_shoulder_pan_joint', 'r_shoulder_lift_joint', 'r_upper_arm_roll_joint', 'r_elbow_flex_joint', 'r_forearm_roll_joint', 'r_wrist_flex_joint', 'r_wrist_roll_joint'] rospy.wait_for_service('pr2_right_arm_kinematics/get_fk'); rospy.wait_for_service('pr2_right_arm_kinematics/get_ik'); self.fk_srv = rospy.ServiceProxy('pr2_right_arm_kinematics/get_fk', GetPositionFK) self.ik_srv = rospy.ServiceProxy('pr2_right_arm_kinematics/get_ik', GetPositionIK) self.joint_action_client = actionlib.SimpleActionClient('r_arm_controller/joint_trajectory_action', JointTrajectoryAction) self.gripper_action_client = actionlib.SimpleActionClient('r_gripper_controller/gripper_action', Pr2GripperCommandAction) self.joint_action_client.wait_for_server() self.gripper_action_client.wait_for_server() self.arm_state_lock = RLock() #rospy.Subscriber('/r_arm_controller/state', JointTrajectoryControllerState, self.r_arm_state_cb) rospy.Subscriber('/joint_states', JointState, self.joint_states_cb) self.r_arm_cart_pub = rospy.Publisher('/r_cart/command_pose', PoseStamped) self.r_arm_pub_l = [] self.joint_nm_list = ['shoulder_pan', 'shoulder_lift', 'upper_arm_roll', 'elbow_flex', 'forearm_roll', 'wrist_flex', 'wrist_roll'] self.r_arm_angles = None self.r_arm_efforts = None for nm in self.joint_nm_list: self.r_arm_pub_l.append(rospy.Publisher('r_'+nm+'_controller/command', Float64)) rospy.sleep(1.) def joint_states_cb(self, data): r_arm_angles = [] r_arm_efforts = [] r_jt_idx_list = [17, 18, 16, 20, 19, 21, 22] for i,nm in enumerate(self.joint_nm_list): idx = r_jt_idx_list[i] if data.name[idx] != 'r_'+nm+'_joint': raise RuntimeError('joint angle name does not match. Expected: %s, Actual: %s i: %d'%('r_'+nm+'_joint', data.name[idx], i)) r_arm_angles.append(data.position[idx]) r_arm_efforts.append(data.effort[idx]) self.arm_state_lock.acquire() self.r_arm_angles = r_arm_angles self.r_arm_efforts = r_arm_efforts self.arm_state_lock.release() ## go to a joint configuration. # @param q - list of 7 joint angles in RADIANS. # @param duration - how long (SECONDS) before reaching the joint angles. def set_jointangles(self, arm, q, duration=0.15): rospy.logwarn('Currently ignoring the arm parameter.') # for i,p in enumerate(self.r_arm_pub_l): # p.publish(q[i]) jtg = JointTrajectoryGoal() jtg.trajectory.joint_names = self.joint_names_list jtp = JointTrajectoryPoint() jtp.positions = q jtp.velocities = [0 for i in range(len(q))] jtp.accelerations = [0 for i in range(len(q))] jtp.time_from_start = rospy.Duration(duration) jtg.trajectory.points.append(jtp) self.joint_action_client.send_goal(jtg) def FK(self, arm, q): rospy.logwarn('Currently ignoring the arm parameter.') fk_req = GetPositionFKRequest() fk_req.header.frame_id = 'torso_lift_link' fk_req.fk_link_names.append('r_wrist_roll_link') fk_req.robot_state.joint_state.name = self.joint_names_list fk_req.robot_state.joint_state.position = q fk_resp = GetPositionFKResponse() fk_resp = self.fk_srv.call(fk_req) if fk_resp.error_code.val == fk_resp.error_code.SUCCESS: x = fk_resp.pose_stamped[0].pose.position.x y = fk_resp.pose_stamped[0].pose.position.y z = fk_resp.pose_stamped[0].pose.position.z ret = np.matrix([x,y,z]).T else: rospy.logerr('Forward kinematics failed') ret = None return ret def IK(self, arm, p, rot, q_guess): rospy.logwarn('Currently ignoring the arm parameter.') ik_req = GetPositionIKRequest() ik_req.timeout = rospy.Duration(5.) ik_req.ik_request.ik_link_name = 'r_wrist_roll_link' ik_req.ik_request.pose_stamped.header.frame_id = 'torso_lift_link' ik_req.ik_request.pose_stamped.pose.position.x = p[0,0] ik_req.ik_request.pose_stamped.pose.position.y = p[1,0] ik_req.ik_request.pose_stamped.pose.position.z = p[2,0] quat = tr.matrix_to_quaternion(rot) ik_req.ik_request.pose_stamped.pose.orientation.x = quat[0] ik_req.ik_request.pose_stamped.pose.orientation.y = quat[1] ik_req.ik_request.pose_stamped.pose.orientation.z = quat[2] ik_req.ik_request.pose_stamped.pose.orientation.w = quat[3] ik_req.ik_request.ik_seed_state.joint_state.position = q_guess ik_req.ik_request.ik_seed_state.joint_state.name = self.joint_names_list ik_resp = self.ik_srv.call(ik_req) if ik_resp.error_code.val == ik_resp.error_code.SUCCESS: ret = ik_resp.solution.joint_state.position else: rospy.logerr('Inverse kinematics failed') ret = None return ret # for compatibility with Meka arms on Cody. Need to figure out a # good way to have a common interface to different arms. def step(self): return def end_effector_pos(self, arm): q = self.get_joint_angles(arm) return self.FK(arm, q) def get_joint_angles(self, arm): rospy.logwarn('Currently ignoring the arm parameter.') self.arm_state_lock.acquire() q = self.r_arm_angles self.arm_state_lock.release() return q # need for search and hook def go_cartesian(self, arm): rospy.logerr('Need to implement this function.') raise RuntimeError('Unimplemented function') def get_wrist_force(self, arm, bias = True, base_frame = False): rospy.logerr('Need to implement this function.') raise RuntimeError('Unimplemented function') def set_cartesian(self, arm, p, rot): rospy.logwarn('Currently ignoring the arm parameter.') ps = PoseStamped() ps.header.stamp = rospy.rostime.get_rostime() ps.header.frame_id = 'torso_lift_link' ps.pose.position.x = p[0,0] ps.pose.position.y = p[1,0] ps.pose.position.z = p[2,0] quat = tr.matrix_to_quaternion(rot) ps.pose.orientation.x = quat[0] ps.pose.orientation.y = quat[1] ps.pose.orientation.z = quat[2] ps.pose.orientation.w = quat[3] self.r_arm_cart_pub.publish(ps) def open_gripper(self, arm): self.gripper_action_client.send_goal(Pr2GripperCommandGoal(Pr2GripperCommand(position=0.08, max_effort = -1))) ## close the gripper # @param effort - supposed to be in Newtons. (-ve number => max effort) def close_gripper(self, arm, effort = 15): self.gripper_action_client.send_goal(Pr2GripperCommandGoal(Pr2GripperCommand(position=0.0, max_effort = effort))) def get_wrist_force(self, arm): pass if __name__ == '__main__': rospy.init_node('hrl_pr2', anonymous = True) rospy.logout('hrl_pr2: ready') hrl_pr2 = HRL_PR2() if False: q = [0, 0, 0, 0, 0, 0, 0] hrl_pr2.set_jointangles('right_arm', q) ee_pos = hrl_pr2.FK('right_arm', q) print 'FK result:', ee_pos.A1 ee_pos[0,0] -= 0.1 q_ik = hrl_pr2.IK('right_arm', ee_pos, tr.Rx(0.), q) print 'q_ik:', [math.degrees(a) for a in q_ik] rospy.spin() if False: p = np.matrix([0.9, -0.3, -0.15]).T #rot = tr.Rx(0.) rot = tr.Rx(math.radians(90.)) hrl_pr2.set_cartesian('right_arm', p, rot) hrl_pr2.open_gripper('right_arm') raw_input('Hit ENTER to close') hrl_pr2.close_gripper('right_arm', effort = 15)
ajibawa-2023/Python-Code-Large/train/row_99610
153
225
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Import_L2_C0", "label": "numpy import np, math", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0089, 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_99610:ImportFrom_L3_C0", "label": "from threading import RLock", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0133, 0.0044, 0, 0.66, 0.0588, 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_99610:Import_L5_C0", "label": "roslib import roslib", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0222, 0.0044, 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('hrl_pr2_kinematics_tutorials')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Expr_L5_C15", "label": "load_manifest()", "type": "expression", "loc": [5, 5], "level": 0, "parent": null, "vector": [8, 0, 0.0222, 0.0044, 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('hrl_pr2_kinematics_tutorials')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Import_L6_C0", "label": "rospy import rospy", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0267, 0.0044, 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_99610:Import_L8_C0", "label": "actionlib import actionlib", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.0356, 0.0044, 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_99610:ImportFrom_L10_C0", "label": "from kinematics_msgs.srv import GetPositionFK, GetPositionFKRequest, GetPositionFKResponse", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.0444, 0.0044, 0, 0.66, 0.3529, 247, 0, 3, 0, 0, 247, 0, 0], "semantic": {"name": "kinematics_msgs.srv", "arg_names": [], "import_names": ["GetPositionFK", "GetPositionFKRequest", "GetPositionFKResponse"], "rhs_call_name": "", "annotation": ""}, "snippet": "from kinematics_msgs.srv import GetPositionFK, GetPositionFKRequest, GetPositionFKResponse"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:ImportFrom_L11_C0", "label": "from kinematics_msgs.srv import GetPositionIK, GetPositionIKRequest, GetPositionIKResponse", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.0489, 0.0044, 0, 0.66, 0.4118, 247, 0, 3, 0, 0, 247, 0, 0], "semantic": {"name": "kinematics_msgs.srv", "arg_names": [], "import_names": ["GetPositionIK", "GetPositionIKRequest", "GetPositionIKResponse"], "rhs_call_name": "", "annotation": ""}, "snippet": "from kinematics_msgs.srv import GetPositionIK, GetPositionIKRequest, GetPositionIKResponse"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:ImportFrom_L12_C0", "label": "from pr2_controllers_msgs.msg import JointTrajectoryAction, JointTrajectoryGoal, JointTrajectoryControllerState", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.0533, 0.0044, 0, 0.66, 0.4706, 457, 0, 3, 0, 0, 457, 0, 0], "semantic": {"name": "pr2_controllers_msgs.msg", "arg_names": [], "import_names": ["JointTrajectoryAction", "JointTrajectoryGoal", "JointTrajectoryControllerState"], "rhs_call_name": "", "annotation": ""}, "snippet": "from pr2_controllers_msgs.msg import JointTrajectoryAction, JointTrajectoryGoal, JointTrajectoryControllerState"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:ImportFrom_L13_C0", "label": "from pr2_controllers_msgs.msg import Pr2GripperCommandGoal, Pr2GripperCommandAction, Pr2GripperCommand", "type": "import", "loc": [13, 13], "level": 0, "parent": null, "vector": [1, 0, 0.0578, 0.0044, 0, 0.66, 0.5294, 457, 0, 3, 0, 0, 457, 0, 0], "semantic": {"name": "pr2_controllers_msgs.msg", "arg_names": [], "import_names": ["Pr2GripperCommandGoal", "Pr2GripperCommandAction", "Pr2GripperCommand"], "rhs_call_name": "", "annotation": ""}, "snippet": "from pr2_controllers_msgs.msg import Pr2GripperCommandGoal, Pr2GripperCommandAction, Pr2GripperCommand"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:ImportFrom_L14_C0", "label": "from trajectory_msgs.msg import JointTrajectoryPoint", "type": "import", "loc": [14, 14], "level": 0, "parent": null, "vector": [1, 0, 0.0622, 0.0044, 0, 0.66, 0.5882, 485, 0, 1, 0, 0, 485, 0, 0], "semantic": {"name": "trajectory_msgs.msg", "arg_names": [], "import_names": ["JointTrajectoryPoint"], "rhs_call_name": "", "annotation": ""}, "snippet": "from trajectory_msgs.msg import JointTrajectoryPoint"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:ImportFrom_L15_C0", "label": "from geometry_msgs.msg import PoseStamped", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.0667, 0.0044, 0, 0.66, 0.6471, 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_99610:ImportFrom_L17_C0", "label": "from std_msgs.msg import Float64", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.0756, 0.0044, 0, 0.66, 0.7059, 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_99610:ImportFrom_L18_C0", "label": "from sensor_msgs.msg import JointState", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.08, 0.0044, 0, 0.66, 0.7647, 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_99610:Import_L20_C0", "label": "hrl_lib.transforms import tr", "type": "import", "loc": [20, 20], "level": 0, "parent": null, "vector": [1, 0, 0.0889, 0.0044, 0, 0.66, 0.8235, 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_99610:Import_L21_C0", "label": "time import time", "type": "import", "loc": [21, 21], "level": 0, "parent": null, "vector": [1, 0, 0.0933, 0.0044, 0, 0.66, 0.8824, 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_99610:ClassDef_L23_C0", "label": "HRL_PR2", "type": "class", "loc": [23, 193], "level": 0, "parent": null, "vector": [3, 0, 0.48, 0.76, 0, 0.66, 0.9412, 142, 0, 14, 0, 0, 0, 0, 63], "semantic": {"name": "HRL_PR2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class HRL_PR2():\n def __init__(self):\n self.joint_names_list = ['r_shoulder_pan_joint',\n 'r_shoulder_lift_joint', 'r_upper_arm_roll_joint',\n 'r_elbow_flex_joint', 'r_forearm_roll_joint',\n 'r_wrist_flex_joint', 'r_wrist_roll_joint']\n\n rospy.wait_for_service('pr2_right_arm_kinematics/get_fk');"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L24_C4", "label": "__init__", "type": "function", "loc": [24, 57], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:ClassDef_L23_C0", "vector": [2, 1, 0.18, 0.1511, 1, 0.62, 0.0, 555, 0, 1, 0, 0, 0, 0, 14], "semantic": {"name": "__init__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self):\n self.joint_names_list = ['r_shoulder_pan_joint',\n 'r_shoulder_lift_joint', 'r_upper_arm_roll_joint',\n 'r_elbow_flex_joint', 'r_forearm_roll_joint',\n 'r_wrist_flex_joint', 'r_wrist_roll_joint']\n\n rospy.wait_for_service('pr2_right_arm_kinematics/get_fk');\n rospy.wait_for_service('pr2_right_arm_kinematics/get_ik');"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L25_C8", "label": "self.joint_names_list =", "type": "assigned_variable", "loc": [25, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L24_C4", "vector": [14, 2, 0.1178, 0.0178, 2, 0.55, 0.0, 515, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.joint_names_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.joint_names_list = ['r_shoulder_pan_joint',\n 'r_shoulder_lift_joint', 'r_upper_arm_roll_joint',\n 'r_elbow_flex_joint', 'r_forearm_roll_joint',\n 'r_wrist_flex_joint', 'r_wrist_roll_joint']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Expr_L30_C8", "label": "wait_for_service()", "type": "expression", "loc": [30, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L24_C4", "vector": [8, 2, 0.1333, 0.0044, 2, 0.55, 0.0588, 617, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "wait_for_service", "arg_names": [], "import_names": [], "rhs_call_name": "wait_for_service", "annotation": ""}, "snippet": " rospy.wait_for_service('pr2_right_arm_kinematics/get_fk');"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Expr_L31_C8", "label": "wait_for_service()", "type": "expression", "loc": [31, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L24_C4", "vector": [8, 2, 0.1378, 0.0044, 2, 0.55, 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('pr2_right_arm_kinematics/get_ik');"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L33_C8", "label": "self.fk_srv = ServiceProxy()", "type": "assigned_variable", "loc": [33, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L24_C4", "vector": [14, 2, 0.1467, 0.0044, 2, 0.55, 0.1765, 245, 3, 2, 0, 0, 915, 10, 1], "semantic": {"name": "self.fk_srv", "arg_names": [], "import_names": [], "rhs_call_name": "ServiceProxy", "annotation": ""}, "snippet": " self.fk_srv = rospy.ServiceProxy('pr2_right_arm_kinematics/get_fk', GetPositionFK)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L34_C8", "label": "self.ik_srv = ServiceProxy()", "type": "assigned_variable", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L24_C4", "vector": [14, 2, 0.1511, 0.0044, 2, 0.55, 0.2353, 144, 3, 2, 0, 0, 915, 10, 1], "semantic": {"name": "self.ik_srv", "arg_names": [], "import_names": [], "rhs_call_name": "ServiceProxy", "annotation": ""}, "snippet": " self.ik_srv = rospy.ServiceProxy('pr2_right_arm_kinematics/get_ik', GetPositionIK)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L36_C8", "label": "self.joint_action_client = SimpleActionClient()", "type": "assigned_variable", "loc": [36, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L24_C4", "vector": [14, 2, 0.16, 0.0044, 2, 0.55, 0.2941, 369, 3, 2, 0, 0, 230, 10, 1], "semantic": {"name": "self.joint_action_client", "arg_names": [], "import_names": [], "rhs_call_name": "SimpleActionClient", "annotation": ""}, "snippet": " self.joint_action_client = actionlib.SimpleActionClient('r_arm_controller/joint_trajectory_action', JointTrajectoryAction)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L37_C8", "label": "self.gripper_action_client = SimpleActionClient()", "type": "assigned_variable", "loc": [37, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L24_C4", "vector": [14, 2, 0.1644, 0.0044, 2, 0.55, 0.3529, 87, 3, 2, 0, 0, 230, 10, 1], "semantic": {"name": "self.gripper_action_client", "arg_names": [], "import_names": [], "rhs_call_name": "SimpleActionClient", "annotation": ""}, "snippet": " self.gripper_action_client = actionlib.SimpleActionClient('r_gripper_controller/gripper_action', Pr2GripperCommandAction)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Expr_L38_C8", "label": "wait_for_server()", "type": "expression", "loc": [38, 38], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L24_C4", "vector": [8, 2, 0.1689, 0.0044, 2, 0.55, 0.4118, 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.joint_action_client.wait_for_server()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Expr_L39_C8", "label": "wait_for_server()", "type": "expression", "loc": [39, 39], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L24_C4", "vector": [8, 2, 0.1733, 0.0044, 2, 0.55, 0.4706, 784, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "wait_for_server", "arg_names": [], "import_names": [], "rhs_call_name": "wait_for_server", "annotation": ""}, "snippet": " self.gripper_action_client.wait_for_server()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L41_C8", "label": "self.arm_state_lock = RLock()", "type": "assigned_variable", "loc": [41, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L24_C4", "vector": [14, 2, 0.1822, 0.0044, 2, 0.55, 0.5294, 845, 3, 0, 0, 0, 207, 10, 1], "semantic": {"name": "self.arm_state_lock", "arg_names": [], "import_names": [], "rhs_call_name": "RLock", "annotation": ""}, "snippet": " self.arm_state_lock = RLock()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Expr_L43_C8", "label": "Subscriber()", "type": "expression", "loc": [43, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L24_C4", "vector": [8, 2, 0.1911, 0.0044, 2, 0.55, 0.5882, 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_99610:Assign_L44_C8", "label": "self.r_arm_cart_pub = Publisher()", "type": "assigned_variable", "loc": [44, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L24_C4", "vector": [14, 2, 0.1956, 0.0044, 2, 0.55, 0.6471, 7, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "self.r_arm_cart_pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " self.r_arm_cart_pub = rospy.Publisher('/r_cart/command_pose', PoseStamped)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L46_C8", "label": "self.r_arm_pub_l =", "type": "assigned_variable", "loc": [46, 46], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L24_C4", "vector": [14, 2, 0.2044, 0.0044, 2, 0.55, 0.7059, 965, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.r_arm_pub_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.r_arm_pub_l = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L47_C8", "label": "self.joint_nm_list =", "type": "assigned_variable", "loc": [47, 49], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L24_C4", "vector": [14, 2, 0.2133, 0.0133, 2, 0.55, 0.7647, 916, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.joint_nm_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.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_99610:Assign_L51_C8", "label": "self.r_arm_angles =", "type": "assigned_variable", "loc": [51, 51], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L24_C4", "vector": [14, 2, 0.2267, 0.0044, 2, 0.55, 0.8235, 788, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.r_arm_angles", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.r_arm_angles = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L52_C8", "label": "self.r_arm_efforts =", "type": "assigned_variable", "loc": [52, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L24_C4", "vector": [14, 2, 0.2311, 0.0044, 2, 0.55, 0.8824, 456, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.r_arm_efforts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.r_arm_efforts = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:For_L54_C8", "label": "for nm", "type": "for", "loc": [54, 55], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L24_C4", "vector": [6, 2, 0.2422, 0.0089, 2, 0.55, 0.9412, 931, 7, 0, 0, 0, 0, 0, 2], "semantic": {"name": "nm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for nm in self.joint_nm_list:\n self.r_arm_pub_l.append(rospy.Publisher('r_'+nm+'_controller/command', Float64))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Expr_L55_C12", "label": "append()", "type": "expression", "loc": [55, 55], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:For_L54_C8", "vector": [8, 3, 0.2444, 0.0044, 3, 0.34, 0.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.r_arm_pub_l.append(rospy.Publisher('r_'+nm+'_controller/command', Float64))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Expr_L57_C8", "label": "sleep()", "type": "expression", "loc": [57, 57], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L24_C4", "vector": [8, 2, 0.2533, 0.0044, 2, 0.55, 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_99610:FunctionDef_L59_C4", "label": "joint_states_cb", "type": "function", "loc": [59, 73], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:ClassDef_L23_C0", "vector": [2, 1, 0.2933, 0.0667, 1, 0.62, 0.0769, 800, 0, 2, 0, 0, 0, 0, 6], "semantic": {"name": "joint_states_cb", "arg_names": ["self", "data"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def joint_states_cb(self, data):\n r_arm_angles = []\n r_arm_efforts = []\n r_jt_idx_list = [17, 18, 16, 20, 19, 21, 22]\n for i,nm in enumerate(self.joint_nm_list):\n idx = r_jt_idx_list[i]\n if data.name[idx] != 'r_'+nm+'_joint':\n raise RuntimeError('joint angle name does not match. Expected: %s, Actual: %s i: %d'%('r_'+nm+'_joint', data.name[idx], i))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L60_C8", "label": "r_arm_angles =", "type": "assigned_variable", "loc": [60, 60], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L59_C4", "vector": [14, 2, 0.2667, 0.0044, 2, 0.25, 0.0, 269, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "r_arm_angles", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " r_arm_angles = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L61_C8", "label": "r_arm_efforts =", "type": "assigned_variable", "loc": [61, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L59_C4", "vector": [14, 2, 0.2711, 0.0044, 2, 0.25, 0.1429, 412, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "r_arm_efforts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " r_arm_efforts = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L62_C8", "label": "r_jt_idx_list =", "type": "assigned_variable", "loc": [62, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L59_C4", "vector": [14, 2, 0.2756, 0.0044, 2, 0.25, 0.2857, 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_99610:For_L63_C8", "label": "for i, nm", "type": "for", "loc": [63, 68], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L59_C4", "vector": [6, 2, 0.2911, 0.0267, 2, 0.25, 0.4286, 422, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "i, nm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i,nm in enumerate(self.joint_nm_list):\n idx = r_jt_idx_list[i]\n if data.name[idx] != 'r_'+nm+'_joint':\n raise RuntimeError('joint angle name does not match. Expected: %s, Actual: %s i: %d'%('r_'+nm+'_joint', data.name[idx], i))\n r_arm_angles.append(data.position[idx])\n r_arm_efforts.append(data.effort[idx])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L64_C12", "label": "idx =", "type": "assigned_variable", "loc": [64, 64], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:For_L63_C8", "vector": [14, 3, 0.2844, 0.0044, 3, 0.56, 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_99610:If_L65_C12", "label": "if", "type": "if", "loc": [65, 66], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:For_L63_C8", "vector": [4, 3, 0.2911, 0.0089, 3, 0.56, 0.3333, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if data.name[idx] != 'r_'+nm+'_joint':\n raise RuntimeError('joint angle name does not match. Expected: %s, Actual: %s i: %d'%('r_'+nm+'_joint', data.name[idx], i))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Expr_L67_C12", "label": "append()", "type": "expression", "loc": [67, 67], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:For_L63_C8", "vector": [8, 3, 0.2978, 0.0044, 3, 0.56, 0.6667, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " r_arm_angles.append(data.position[idx])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Expr_L68_C12", "label": "append()", "type": "expression", "loc": [68, 68], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:For_L63_C8", "vector": [8, 3, 0.3022, 0.0044, 3, 0.56, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " r_arm_efforts.append(data.effort[idx])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Expr_L70_C8", "label": "acquire()", "type": "expression", "loc": [70, 70], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L59_C4", "vector": [8, 2, 0.3111, 0.0044, 2, 0.25, 0.5714, 229, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "acquire", "arg_names": [], "import_names": [], "rhs_call_name": "acquire", "annotation": ""}, "snippet": " self.arm_state_lock.acquire()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L71_C8", "label": "self.r_arm_angles =", "type": "assigned_variable", "loc": [71, 71], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L59_C4", "vector": [14, 2, 0.3156, 0.0044, 2, 0.25, 0.7143, 788, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.r_arm_angles", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.r_arm_angles = r_arm_angles"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L72_C8", "label": "self.r_arm_efforts =", "type": "assigned_variable", "loc": [72, 72], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L59_C4", "vector": [14, 2, 0.32, 0.0044, 2, 0.25, 0.8571, 456, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.r_arm_efforts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.r_arm_efforts = r_arm_efforts"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Expr_L73_C8", "label": "release()", "type": "expression", "loc": [73, 73], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L59_C4", "vector": [8, 2, 0.3244, 0.0044, 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.arm_state_lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L78_C4", "label": "set_jointangles", "type": "function", "loc": [78, 90], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:ClassDef_L23_C0", "vector": [2, 1, 0.3733, 0.0578, 1, 0.62, 0.1538, 240, 0, 4, 0, 0, 0, 0, 10], "semantic": {"name": "set_jointangles", "arg_names": ["self", "arm", "q", "duration"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def set_jointangles(self, arm, q, duration=0.15):\n rospy.logwarn('Currently ignoring the arm parameter.')\n# for i,p in enumerate(self.r_arm_pub_l):\n# p.publish(q[i])\n jtg = JointTrajectoryGoal()\n jtg.trajectory.joint_names = self.joint_names_list\n jtp = JointTrajectoryPoint()\n jtp.positions = q"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Expr_L79_C8", "label": "logwarn()", "type": "expression", "loc": [79, 79], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L78_C4", "vector": [8, 2, 0.3511, 0.0044, 2, 0.54, 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('Currently ignoring the arm parameter.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L82_C8", "label": "jtg = JointTrajectoryGoal()", "type": "assigned_variable", "loc": [82, 82], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L78_C4", "vector": [14, 2, 0.3644, 0.0044, 2, 0.54, 0.1111, 511, 3, 0, 0, 0, 970, 10, 1], "semantic": {"name": "jtg", "arg_names": [], "import_names": [], "rhs_call_name": "JointTrajectoryGoal", "annotation": ""}, "snippet": " jtg = JointTrajectoryGoal()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L83_C8", "label": "jtg.trajectory.joint_names =", "type": "assigned_variable", "loc": [83, 83], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L78_C4", "vector": [14, 2, 0.3689, 0.0044, 2, 0.54, 0.2222, 747, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "jtg.trajectory.joint_names", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " jtg.trajectory.joint_names = self.joint_names_list"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L84_C8", "label": "jtp = JointTrajectoryPoint()", "type": "assigned_variable", "loc": [84, 84], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L78_C4", "vector": [14, 2, 0.3733, 0.0044, 2, 0.54, 0.3333, 952, 3, 0, 0, 0, 302, 10, 1], "semantic": {"name": "jtp", "arg_names": [], "import_names": [], "rhs_call_name": "JointTrajectoryPoint", "annotation": ""}, "snippet": " jtp = JointTrajectoryPoint()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L85_C8", "label": "jtp.positions =", "type": "assigned_variable", "loc": [85, 85], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L78_C4", "vector": [14, 2, 0.3778, 0.0044, 2, 0.54, 0.4444, 984, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "jtp.positions", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " jtp.positions = q"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L86_C8", "label": "jtp.velocities =", "type": "assigned_variable", "loc": [86, 86], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L78_C4", "vector": [14, 2, 0.3822, 0.0044, 2, 0.54, 0.5556, 380, 5, 0, 0, 0, 0, 0, 2], "semantic": {"name": "jtp.velocities", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " jtp.velocities = [0 for i in range(len(q))]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L87_C8", "label": "jtp.accelerations =", "type": "assigned_variable", "loc": [87, 87], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L78_C4", "vector": [14, 2, 0.3867, 0.0044, 2, 0.54, 0.6667, 656, 5, 0, 0, 0, 0, 0, 2], "semantic": {"name": "jtp.accelerations", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " jtp.accelerations = [0 for i in range(len(q))]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L88_C8", "label": "jtp.time_from_start = Duration()", "type": "assigned_variable", "loc": [88, 88], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L78_C4", "vector": [14, 2, 0.3911, 0.0044, 2, 0.54, 0.7778, 272, 3, 1, 0, 0, 972, 10, 1], "semantic": {"name": "jtp.time_from_start", "arg_names": [], "import_names": [], "rhs_call_name": "Duration", "annotation": ""}, "snippet": " jtp.time_from_start = rospy.Duration(duration)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Expr_L89_C8", "label": "append()", "type": "expression", "loc": [89, 89], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L78_C4", "vector": [8, 2, 0.3956, 0.0044, 2, 0.54, 0.8889, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " jtg.trajectory.points.append(jtp)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Expr_L90_C8", "label": "send_goal()", "type": "expression", "loc": [90, 90], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L78_C4", "vector": [8, 2, 0.4, 0.0044, 2, 0.54, 1.0, 184, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "send_goal", "arg_names": [], "import_names": [], "rhs_call_name": "send_goal", "annotation": ""}, "snippet": " self.joint_action_client.send_goal(jtg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L92_C4", "label": "FK", "type": "function", "loc": [92, 111], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:ClassDef_L23_C0", "vector": [2, 1, 0.4511, 0.0889, 1, 0.62, 0.2308, 252, 0, 3, 1, 0, 0, 0, 7], "semantic": {"name": "FK", "arg_names": ["self", "arm", "q"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def FK(self, arm, q):\n rospy.logwarn('Currently ignoring the arm parameter.')\n fk_req = GetPositionFKRequest()\n fk_req.header.frame_id = 'torso_lift_link'\n fk_req.fk_link_names.append('r_wrist_roll_link')\n fk_req.robot_state.joint_state.name = self.joint_names_list\n fk_req.robot_state.joint_state.position = q\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Expr_L93_C8", "label": "logwarn()", "type": "expression", "loc": [93, 93], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L92_C4", "vector": [8, 2, 0.4133, 0.0044, 2, 0.93, 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('Currently ignoring the arm parameter.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L94_C8", "label": "fk_req = GetPositionFKRequest()", "type": "assigned_variable", "loc": [94, 94], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L92_C4", "vector": [14, 2, 0.4178, 0.0044, 2, 0.93, 0.1111, 192, 3, 0, 0, 0, 7, 10, 1], "semantic": {"name": "fk_req", "arg_names": [], "import_names": [], "rhs_call_name": "GetPositionFKRequest", "annotation": ""}, "snippet": " fk_req = GetPositionFKRequest()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L95_C8", "label": "fk_req.header.frame_id =", "type": "assigned_variable", "loc": [95, 95], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L92_C4", "vector": [14, 2, 0.4222, 0.0044, 2, 0.93, 0.2222, 144, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "fk_req.header.frame_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " fk_req.header.frame_id = 'torso_lift_link'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Expr_L96_C8", "label": "append()", "type": "expression", "loc": [96, 96], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L92_C4", "vector": [8, 2, 0.4267, 0.0044, 2, 0.93, 0.3333, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " fk_req.fk_link_names.append('r_wrist_roll_link')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L97_C8", "label": "fk_req.robot_state.joint_state.name =", "type": "assigned_variable", "loc": [97, 97], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L92_C4", "vector": [14, 2, 0.4311, 0.0044, 2, 0.93, 0.4444, 345, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "fk_req.robot_state.joint_state.name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " fk_req.robot_state.joint_state.name = self.joint_names_list"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L98_C8", "label": "fk_req.robot_state.joint_state.position =", "type": "assigned_variable", "loc": [98, 98], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L92_C4", "vector": [14, 2, 0.4356, 0.0044, 2, 0.93, 0.5556, 514, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "fk_req.robot_state.joint_state.position", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " fk_req.robot_state.joint_state.position = q"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L100_C8", "label": "fk_resp = GetPositionFKResponse()", "type": "assigned_variable", "loc": [100, 100], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L92_C4", "vector": [14, 2, 0.4444, 0.0044, 2, 0.93, 0.6667, 178, 3, 0, 0, 0, 373, 10, 1], "semantic": {"name": "fk_resp", "arg_names": [], "import_names": [], "rhs_call_name": "GetPositionFKResponse", "annotation": ""}, "snippet": " fk_resp = GetPositionFKResponse()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L101_C8", "label": "fk_resp = call()", "type": "assigned_variable", "loc": [101, 101], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L92_C4", "vector": [14, 2, 0.4489, 0.0044, 2, 0.93, 0.7778, 178, 3, 1, 0, 0, 832, 10, 1], "semantic": {"name": "fk_resp", "arg_names": [], "import_names": [], "rhs_call_name": "call", "annotation": ""}, "snippet": " fk_resp = self.fk_srv.call(fk_req)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:If_L102_C8", "label": "if", "type": "if", "loc": [102, 109], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L92_C4", "vector": [4, 2, 0.4689, 0.0356, 2, 0.93, 0.8889, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if fk_resp.error_code.val == fk_resp.error_code.SUCCESS:\n x = fk_resp.pose_stamped[0].pose.position.x\n y = fk_resp.pose_stamped[0].pose.position.y\n z = fk_resp.pose_stamped[0].pose.position.z\n ret = np.matrix([x,y,z]).T\n else:\n rospy.logerr('Forward kinematics failed')\n ret = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L103_C12", "label": "x =", "type": "assigned_variable", "loc": [103, 103], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:If_L102_C8", "vector": [14, 3, 0.4578, 0.0044, 3, 0.51, 0.0, 190, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " x = fk_resp.pose_stamped[0].pose.position.x"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L104_C12", "label": "y =", "type": "assigned_variable", "loc": [104, 104], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:If_L102_C8", "vector": [14, 3, 0.4622, 0.0044, 3, 0.51, 0.2, 304, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " y = fk_resp.pose_stamped[0].pose.position.y"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L105_C12", "label": "z =", "type": "assigned_variable", "loc": [105, 105], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:If_L102_C8", "vector": [14, 3, 0.4667, 0.0044, 3, 0.51, 0.4, 859, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " z = fk_resp.pose_stamped[0].pose.position.z"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L106_C12", "label": "ret =", "type": "assigned_variable", "loc": [106, 106], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:If_L102_C8", "vector": [14, 3, 0.4711, 0.0044, 3, 0.51, 0.6, 501, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "ret", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ret = np.matrix([x,y,z]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Expr_L108_C12", "label": "logerr()", "type": "expression", "loc": [108, 108], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:If_L102_C8", "vector": [8, 3, 0.48, 0.0044, 3, 0.51, 0.8, 747, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logerr", "arg_names": [], "import_names": [], "rhs_call_name": "logerr", "annotation": ""}, "snippet": " rospy.logerr('Forward kinematics failed')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L109_C12", "label": "ret =", "type": "assigned_variable", "loc": [109, 109], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:If_L102_C8", "vector": [14, 3, 0.4844, 0.0044, 3, 0.51, 1.0, 501, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "ret", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ret = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Return_L111_C8", "label": "return", "type": "return", "loc": [111, 111], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L92_C4", "vector": [13, 2, 0.4933, 0.0044, 2, 0.93, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ret"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L113_C4", "label": "IK", "type": "function", "loc": [113, 140], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:ClassDef_L23_C0", "vector": [2, 1, 0.5622, 0.1244, 1, 0.62, 0.3077, 719, 0, 5, 1, 0, 0, 0, 6], "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):\n rospy.logwarn('Currently ignoring the arm parameter.')\n ik_req = GetPositionIKRequest()\n ik_req.timeout = rospy.Duration(5.)\n ik_req.ik_request.ik_link_name = 'r_wrist_roll_link'\n ik_req.ik_request.pose_stamped.header.frame_id = 'torso_lift_link'\n\n ik_req.ik_request.pose_stamped.pose.position.x = p[0,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Expr_L114_C8", "label": "logwarn()", "type": "expression", "loc": [114, 114], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L113_C4", "vector": [8, 2, 0.5067, 0.0044, 2, 0.59, 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('Currently ignoring the arm parameter.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L115_C8", "label": "ik_req = GetPositionIKRequest()", "type": "assigned_variable", "loc": [115, 115], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L113_C4", "vector": [14, 2, 0.5111, 0.0044, 2, 0.59, 0.0588, 578, 3, 0, 0, 0, 258, 10, 1], "semantic": {"name": "ik_req", "arg_names": [], "import_names": [], "rhs_call_name": "GetPositionIKRequest", "annotation": ""}, "snippet": " ik_req = GetPositionIKRequest()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L116_C8", "label": "ik_req.timeout = Duration()", "type": "assigned_variable", "loc": [116, 116], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L113_C4", "vector": [14, 2, 0.5156, 0.0044, 2, 0.59, 0.1176, 460, 3, 1, 0, 0, 972, 10, 1], "semantic": {"name": "ik_req.timeout", "arg_names": [], "import_names": [], "rhs_call_name": "Duration", "annotation": ""}, "snippet": " ik_req.timeout = rospy.Duration(5.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L117_C8", "label": "ik_req.ik_request.ik_link_name =", "type": "assigned_variable", "loc": [117, 117], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L113_C4", "vector": [14, 2, 0.52, 0.0044, 2, 0.59, 0.1765, 946, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "ik_req.ik_request.ik_link_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ik_req.ik_request.ik_link_name = 'r_wrist_roll_link'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L118_C8", "label": "ik_req.ik_request.pose_stamped.header.frame_id =", "type": "assigned_variable", "loc": [118, 118], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L113_C4", "vector": [14, 2, 0.5244, 0.0044, 2, 0.59, 0.2353, 10, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "ik_req.ik_request.pose_stamped.header.frame_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ik_req.ik_request.pose_stamped.header.frame_id = 'torso_lift_link'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L120_C8", "label": "ik_req.ik_request.pose_stamped.pose.position.x =", "type": "assigned_variable", "loc": [120, 120], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L113_C4", "vector": [14, 2, 0.5333, 0.0044, 2, 0.59, 0.2941, 232, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ik_req.ik_request.pose_stamped.pose.position.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ik_req.ik_request.pose_stamped.pose.position.x = p[0,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L121_C8", "label": "ik_req.ik_request.pose_stamped.pose.position.y =", "type": "assigned_variable", "loc": [121, 121], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L113_C4", "vector": [14, 2, 0.5378, 0.0044, 2, 0.59, 0.3529, 833, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ik_req.ik_request.pose_stamped.pose.position.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ik_req.ik_request.pose_stamped.pose.position.y = p[1,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L122_C8", "label": "ik_req.ik_request.pose_stamped.pose.position.z =", "type": "assigned_variable", "loc": [122, 122], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L113_C4", "vector": [14, 2, 0.5422, 0.0044, 2, 0.59, 0.4118, 394, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ik_req.ik_request.pose_stamped.pose.position.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ik_req.ik_request.pose_stamped.pose.position.z = p[2,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L124_C8", "label": "quat = matrix_to_quaternion()", "type": "assigned_variable", "loc": [124, 124], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L113_C4", "vector": [14, 2, 0.5511, 0.0044, 2, 0.59, 0.4706, 367, 3, 1, 0, 0, 615, 10, 1], "semantic": {"name": "quat", "arg_names": [], "import_names": [], "rhs_call_name": "matrix_to_quaternion", "annotation": ""}, "snippet": " quat = tr.matrix_to_quaternion(rot)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L125_C8", "label": "ik_req.ik_request.pose_stamped.pose.orientation.x =", "type": "assigned_variable", "loc": [125, 125], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L113_C4", "vector": [14, 2, 0.5556, 0.0044, 2, 0.59, 0.5294, 735, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ik_req.ik_request.pose_stamped.pose.orientation.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ik_req.ik_request.pose_stamped.pose.orientation.x = quat[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L126_C8", "label": "ik_req.ik_request.pose_stamped.pose.orientation.y =", "type": "assigned_variable", "loc": [126, 126], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L113_C4", "vector": [14, 2, 0.56, 0.0044, 2, 0.59, 0.5882, 92, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ik_req.ik_request.pose_stamped.pose.orientation.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ik_req.ik_request.pose_stamped.pose.orientation.y = quat[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L127_C8", "label": "ik_req.ik_request.pose_stamped.pose.orientation.z =", "type": "assigned_variable", "loc": [127, 127], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L113_C4", "vector": [14, 2, 0.5644, 0.0044, 2, 0.59, 0.6471, 123, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ik_req.ik_request.pose_stamped.pose.orientation.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ik_req.ik_request.pose_stamped.pose.orientation.z = quat[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L128_C8", "label": "ik_req.ik_request.pose_stamped.pose.orientation.w =", "type": "assigned_variable", "loc": [128, 128], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L113_C4", "vector": [14, 2, 0.5689, 0.0044, 2, 0.59, 0.7059, 445, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ik_req.ik_request.pose_stamped.pose.orientation.w", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ik_req.ik_request.pose_stamped.pose.orientation.w = quat[3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L130_C8", "label": "ik_req.ik_request.ik_seed_state.joint_state.position =", "type": "assigned_variable", "loc": [130, 130], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L113_C4", "vector": [14, 2, 0.5778, 0.0044, 2, 0.59, 0.7647, 864, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ik_req.ik_request.ik_seed_state.joint_state.position", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ik_req.ik_request.ik_seed_state.joint_state.position = q_guess"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L131_C8", "label": "ik_req.ik_request.ik_seed_state.joint_state.name =", "type": "assigned_variable", "loc": [131, 131], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L113_C4", "vector": [14, 2, 0.5822, 0.0044, 2, 0.59, 0.8235, 736, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ik_req.ik_request.ik_seed_state.joint_state.name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ik_req.ik_request.ik_seed_state.joint_state.name = self.joint_names_list"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L133_C8", "label": "ik_resp = call()", "type": "assigned_variable", "loc": [133, 133], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L113_C4", "vector": [14, 2, 0.5911, 0.0044, 2, 0.59, 0.8824, 598, 3, 1, 0, 0, 832, 10, 1], "semantic": {"name": "ik_resp", "arg_names": [], "import_names": [], "rhs_call_name": "call", "annotation": ""}, "snippet": " ik_resp = self.ik_srv.call(ik_req)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:If_L134_C8", "label": "if", "type": "if", "loc": [134, 138], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L113_C4", "vector": [4, 2, 0.6044, 0.0222, 2, 0.59, 0.9412, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if ik_resp.error_code.val == ik_resp.error_code.SUCCESS:\n ret = ik_resp.solution.joint_state.position\n else:\n rospy.logerr('Inverse kinematics failed')\n ret = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L135_C12", "label": "ret =", "type": "assigned_variable", "loc": [135, 135], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:If_L134_C8", "vector": [14, 3, 0.6, 0.0044, 3, 0.53, 0.0, 501, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ret", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ret = ik_resp.solution.joint_state.position"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Expr_L137_C12", "label": "logerr()", "type": "expression", "loc": [137, 137], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:If_L134_C8", "vector": [8, 3, 0.6089, 0.0044, 3, 0.53, 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('Inverse kinematics failed')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L138_C12", "label": "ret =", "type": "assigned_variable", "loc": [138, 138], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:If_L134_C8", "vector": [14, 3, 0.6133, 0.0044, 3, 0.53, 1.0, 501, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "ret", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ret = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Return_L140_C8", "label": "return", "type": "return", "loc": [140, 140], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L113_C4", "vector": [13, 2, 0.6222, 0.0044, 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 ret"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L144_C4", "label": "step", "type": "function", "loc": [144, 145], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:ClassDef_L23_C0", "vector": [2, 1, 0.6422, 0.0089, 1, 0.62, 0.3846, 880, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "step", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def step(self):\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Return_L145_C8", "label": "return", "type": "return", "loc": [145, 145], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L144_C4", "vector": [13, 2, 0.6444, 0.0044, 2, 0.27, 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_99610:FunctionDef_L147_C4", "label": "end_effector_pos", "type": "function", "loc": [147, 149], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:ClassDef_L23_C0", "vector": [2, 1, 0.6578, 0.0133, 1, 0.62, 0.4615, 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.FK(arm, q)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L148_C8", "label": "q = get_joint_angles()", "type": "assigned_variable", "loc": [148, 148], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L147_C4", "vector": [14, 2, 0.6578, 0.0044, 2, 0.27, 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_99610:Return_L149_C8", "label": "return", "type": "return", "loc": [149, 149], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L147_C4", "vector": [13, 2, 0.6622, 0.0044, 2, 0.27, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.FK(arm, q)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L151_C4", "label": "get_joint_angles", "type": "function", "loc": [151, 156], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:ClassDef_L23_C0", "vector": [2, 1, 0.6822, 0.0267, 1, 0.62, 0.5385, 820, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "get_joint_angles", "arg_names": ["self", "arm"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_joint_angles(self, arm):\n rospy.logwarn('Currently ignoring the arm parameter.')\n self.arm_state_lock.acquire()\n q = self.r_arm_angles\n self.arm_state_lock.release()\n return q"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Expr_L152_C8", "label": "logwarn()", "type": "expression", "loc": [152, 152], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L151_C4", "vector": [8, 2, 0.6756, 0.0044, 2, 0.63, 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('Currently ignoring the arm parameter.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Expr_L153_C8", "label": "acquire()", "type": "expression", "loc": [153, 153], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L151_C4", "vector": [8, 2, 0.68, 0.0044, 2, 0.63, 0.25, 229, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "acquire", "arg_names": [], "import_names": [], "rhs_call_name": "acquire", "annotation": ""}, "snippet": " self.arm_state_lock.acquire()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L154_C8", "label": "q =", "type": "assigned_variable", "loc": [154, 154], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L151_C4", "vector": [14, 2, 0.6844, 0.0044, 2, 0.63, 0.5, 516, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "q", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " q = self.r_arm_angles"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Expr_L155_C8", "label": "release()", "type": "expression", "loc": [155, 155], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L151_C4", "vector": [8, 2, 0.6889, 0.0044, 2, 0.63, 0.75, 784, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "release", "arg_names": [], "import_names": [], "rhs_call_name": "release", "annotation": ""}, "snippet": " self.arm_state_lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Return_L156_C8", "label": "return", "type": "return", "loc": [156, 156], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L151_C4", "vector": [13, 2, 0.6933, 0.0044, 2, 0.63, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return q"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L159_C4", "label": "go_cartesian", "type": "function", "loc": [159, 161], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:ClassDef_L23_C0", "vector": [2, 1, 0.7111, 0.0133, 1, 0.62, 0.6154, 840, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "go_cartesian", "arg_names": ["self", "arm"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def go_cartesian(self, arm):\n rospy.logerr('Need to implement this function.')\n raise RuntimeError('Unimplemented function')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Expr_L160_C8", "label": "logerr()", "type": "expression", "loc": [160, 160], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L159_C4", "vector": [8, 2, 0.7111, 0.0044, 2, 0.88, 0.0, 747, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logerr", "arg_names": [], "import_names": [], "rhs_call_name": "logerr", "annotation": ""}, "snippet": " rospy.logerr('Need to implement this function.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L163_C4", "label": "get_wrist_force", "type": "function", "loc": [163, 165], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:ClassDef_L23_C0", "vector": [2, 1, 0.7289, 0.0133, 1, 0.62, 0.6923, 854, 0, 4, 0, 0, 0, 0, 2], "semantic": {"name": "get_wrist_force", "arg_names": ["self", "arm", "bias", "base_frame"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_wrist_force(self, arm, bias = True, base_frame = False):\n rospy.logerr('Need to implement this function.')\n raise RuntimeError('Unimplemented function')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Expr_L164_C8", "label": "logerr()", "type": "expression", "loc": [164, 164], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L163_C4", "vector": [8, 2, 0.7289, 0.0044, 2, 0.03, 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 function.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L167_C4", "label": "set_cartesian", "type": "function", "loc": [167, 182], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:ClassDef_L23_C0", "vector": [2, 1, 0.7756, 0.0711, 1, 0.62, 0.7692, 203, 0, 4, 0, 0, 0, 0, 5], "semantic": {"name": "set_cartesian", "arg_names": ["self", "arm", "p", "rot"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def set_cartesian(self, arm, p, rot):\n rospy.logwarn('Currently ignoring the arm parameter.')\n ps = PoseStamped()\n ps.header.stamp = rospy.rostime.get_rostime()\n ps.header.frame_id = 'torso_lift_link'\n\n ps.pose.position.x = p[0,0]\n ps.pose.position.y = p[1,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Expr_L168_C8", "label": "logwarn()", "type": "expression", "loc": [168, 168], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L167_C4", "vector": [8, 2, 0.7467, 0.0044, 2, 0.24, 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('Currently ignoring the arm parameter.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L169_C8", "label": "ps = PoseStamped()", "type": "assigned_variable", "loc": [169, 169], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L167_C4", "vector": [14, 2, 0.7511, 0.0044, 2, 0.24, 0.0833, 232, 3, 0, 0, 0, 226, 10, 1], "semantic": {"name": "ps", "arg_names": [], "import_names": [], "rhs_call_name": "PoseStamped", "annotation": ""}, "snippet": " ps = PoseStamped()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L170_C8", "label": "ps.header.stamp = get_rostime()", "type": "assigned_variable", "loc": [170, 170], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L167_C4", "vector": [14, 2, 0.7556, 0.0044, 2, 0.24, 0.1667, 161, 3, 0, 0, 0, 173, 10, 1], "semantic": {"name": "ps.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "get_rostime", "annotation": ""}, "snippet": " ps.header.stamp = rospy.rostime.get_rostime()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L171_C8", "label": "ps.header.frame_id =", "type": "assigned_variable", "loc": [171, 171], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L167_C4", "vector": [14, 2, 0.76, 0.0044, 2, 0.24, 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 = 'torso_lift_link'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L173_C8", "label": "ps.pose.position.x =", "type": "assigned_variable", "loc": [173, 173], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L167_C4", "vector": [14, 2, 0.7689, 0.0044, 2, 0.24, 0.3333, 782, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ps.pose.position.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ps.pose.position.x = p[0,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L174_C8", "label": "ps.pose.position.y =", "type": "assigned_variable", "loc": [174, 174], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L167_C4", "vector": [14, 2, 0.7733, 0.0044, 2, 0.24, 0.4167, 661, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ps.pose.position.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ps.pose.position.y = p[1,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L175_C8", "label": "ps.pose.position.z =", "type": "assigned_variable", "loc": [175, 175], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L167_C4", "vector": [14, 2, 0.7778, 0.0044, 2, 0.24, 0.5, 771, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ps.pose.position.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ps.pose.position.z = p[2,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L177_C8", "label": "quat = matrix_to_quaternion()", "type": "assigned_variable", "loc": [177, 177], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L167_C4", "vector": [14, 2, 0.7867, 0.0044, 2, 0.24, 0.5833, 367, 3, 1, 0, 0, 615, 10, 1], "semantic": {"name": "quat", "arg_names": [], "import_names": [], "rhs_call_name": "matrix_to_quaternion", "annotation": ""}, "snippet": " quat = tr.matrix_to_quaternion(rot)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L178_C8", "label": "ps.pose.orientation.x =", "type": "assigned_variable", "loc": [178, 178], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L167_C4", "vector": [14, 2, 0.7911, 0.0044, 2, 0.24, 0.6667, 628, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ps.pose.orientation.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ps.pose.orientation.x = quat[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L179_C8", "label": "ps.pose.orientation.y =", "type": "assigned_variable", "loc": [179, 179], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L167_C4", "vector": [14, 2, 0.7956, 0.0044, 2, 0.24, 0.75, 848, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ps.pose.orientation.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ps.pose.orientation.y = quat[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L180_C8", "label": "ps.pose.orientation.z =", "type": "assigned_variable", "loc": [180, 180], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L167_C4", "vector": [14, 2, 0.8, 0.0044, 2, 0.24, 0.8333, 126, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ps.pose.orientation.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ps.pose.orientation.z = quat[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L181_C8", "label": "ps.pose.orientation.w =", "type": "assigned_variable", "loc": [181, 181], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L167_C4", "vector": [14, 2, 0.8044, 0.0044, 2, 0.24, 0.9167, 163, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ps.pose.orientation.w", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ps.pose.orientation.w = quat[3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Expr_L182_C8", "label": "publish()", "type": "expression", "loc": [182, 182], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L167_C4", "vector": [8, 2, 0.8089, 0.0044, 2, 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": " self.r_arm_cart_pub.publish(ps)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L184_C4", "label": "open_gripper", "type": "function", "loc": [184, 185], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:ClassDef_L23_C0", "vector": [2, 1, 0.82, 0.0089, 1, 0.62, 0.8462, 833, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "open_gripper", "arg_names": ["self", "arm"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def open_gripper(self, arm):\n self.gripper_action_client.send_goal(Pr2GripperCommandGoal(Pr2GripperCommand(position=0.08, max_effort = -1)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Expr_L185_C8", "label": "send_goal()", "type": "expression", "loc": [185, 185], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L184_C4", "vector": [8, 2, 0.8222, 0.0044, 2, 0.8, 0.0, 184, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "send_goal", "arg_names": [], "import_names": [], "rhs_call_name": "send_goal", "annotation": ""}, "snippet": " self.gripper_action_client.send_goal(Pr2GripperCommandGoal(Pr2GripperCommand(position=0.08, max_effort = -1)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L189_C4", "label": "close_gripper", "type": "function", "loc": [189, 190], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:ClassDef_L23_C0", "vector": [2, 1, 0.8422, 0.0089, 1, 0.62, 0.9231, 807, 0, 3, 0, 0, 0, 0, 3], "semantic": {"name": "close_gripper", "arg_names": ["self", "arm", "effort"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def close_gripper(self, arm, effort = 15):\n self.gripper_action_client.send_goal(Pr2GripperCommandGoal(Pr2GripperCommand(position=0.0, max_effort = effort)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Expr_L190_C8", "label": "send_goal()", "type": "expression", "loc": [190, 190], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L189_C4", "vector": [8, 2, 0.8444, 0.0044, 2, 0.84, 0.0, 184, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "send_goal", "arg_names": [], "import_names": [], "rhs_call_name": "send_goal", "annotation": ""}, "snippet": " self.gripper_action_client.send_goal(Pr2GripperCommandGoal(Pr2GripperCommand(position=0.0, max_effort = effort)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L192_C4", "label": "get_wrist_force", "type": "function", "loc": [192, 193], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:ClassDef_L23_C0", "vector": [2, 1, 0.8556, 0.0089, 1, 0.62, 1.0, 854, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "get_wrist_force", "arg_names": ["self", "arm"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_wrist_force(self, arm):\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:If_L196_C0", "label": "if", "type": "if", "loc": [196, 222], "level": 0, "parent": null, "vector": [4, 0, 0.9289, 0.12, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 18], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n rospy.init_node('hrl_pr2', anonymous = True)\n rospy.logout('hrl_pr2: ready')\n\n hrl_pr2 = HRL_PR2()\n\n if False:\n q = [0, 0, 0, 0, 0, 0, 0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Expr_L197_C4", "label": "init_node()", "type": "expression", "loc": [197, 197], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:If_L196_C0", "vector": [8, 1, 0.8756, 0.0044, 1, 0.15, 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('hrl_pr2', anonymous = True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Expr_L198_C4", "label": "logout()", "type": "expression", "loc": [198, 198], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:If_L196_C0", "vector": [8, 1, 0.88, 0.0044, 1, 0.15, 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('hrl_pr2: ready')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L200_C4", "label": "hrl_pr2 = HRL_PR2()", "type": "assigned_variable", "loc": [200, 200], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:If_L196_C0", "vector": [14, 1, 0.8889, 0.0044, 1, 0.15, 0.2857, 174, 3, 0, 0, 0, 142, 10, 1], "semantic": {"name": "hrl_pr2", "arg_names": [], "import_names": [], "rhs_call_name": "HRL_PR2", "annotation": ""}, "snippet": " hrl_pr2 = HRL_PR2()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:If_L202_C4", "label": "if", "type": "if", "loc": [202, 212], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:If_L196_C0", "vector": [4, 1, 0.92, 0.0489, 1, 0.15, 0.4286, 0, 1, 0, 0, 0, 0, 0, 8], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if False:\n q = [0, 0, 0, 0, 0, 0, 0]\n hrl_pr2.set_jointangles('right_arm', q)\n ee_pos = hrl_pr2.FK('right_arm', q)\n print('FK result:', ee_pos.A1)\n\n ee_pos[0,0] -= 0.1\n q_ik = hrl_pr2.IK('right_arm', ee_pos, tr.Rx(0.), q)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L203_C8", "label": "q =", "type": "assigned_variable", "loc": [203, 203], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:If_L202_C4", "vector": [14, 2, 0.9022, 0.0044, 2, 0.48, 0.0, 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_99610:Expr_L204_C8", "label": "set_jointangles()", "type": "expression", "loc": [204, 204], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:If_L202_C4", "vector": [8, 2, 0.9067, 0.0044, 2, 0.48, 0.1667, 240, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "set_jointangles", "arg_names": [], "import_names": [], "rhs_call_name": "set_jointangles", "annotation": ""}, "snippet": " hrl_pr2.set_jointangles('right_arm', q)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L205_C8", "label": "ee_pos = FK()", "type": "assigned_variable", "loc": [205, 205], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:If_L202_C4", "vector": [14, 2, 0.9111, 0.0044, 2, 0.48, 0.3333, 354, 3, 2, 0, 0, 252, 10, 1], "semantic": {"name": "ee_pos", "arg_names": [], "import_names": [], "rhs_call_name": "FK", "annotation": ""}, "snippet": " ee_pos = hrl_pr2.FK('right_arm', q)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Expr_L206_C8", "label": "print()", "type": "expression", "loc": [206, 206], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:If_L202_C4", "vector": [8, 2, 0.9156, 0.0044, 2, 0.48, 0.5, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('FK result:', ee_pos.A1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L209_C8", "label": "q_ik = IK()", "type": "assigned_variable", "loc": [209, 209], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:If_L202_C4", "vector": [14, 2, 0.9289, 0.0044, 2, 0.48, 0.6667, 859, 3, 4, 0, 0, 719, 10, 2], "semantic": {"name": "q_ik", "arg_names": [], "import_names": [], "rhs_call_name": "IK", "annotation": ""}, "snippet": " q_ik = hrl_pr2.IK('right_arm', ee_pos, tr.Rx(0.), q)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Expr_L210_C8", "label": "print()", "type": "expression", "loc": [210, 210], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:If_L202_C4", "vector": [8, 2, 0.9333, 0.0044, 2, 0.48, 0.8333, 535, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('q_ik:', [math.degrees(a) for a in q_ik])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Expr_L212_C8", "label": "spin()", "type": "expression", "loc": [212, 212], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:If_L202_C4", "vector": [8, 2, 0.9422, 0.0044, 2, 0.48, 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_99610:If_L214_C4", "label": "if", "type": "if", "loc": [214, 218], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:If_L196_C0", "vector": [4, 1, 0.96, 0.0222, 1, 0.15, 0.5714, 0, 1, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if False:\n p = np.matrix([0.9, -0.3, -0.15]).T\n #rot = tr.Rx(0.)\n rot = tr.Rx(math.radians(90.))\n hrl_pr2.set_cartesian('right_arm', p, rot)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L215_C8", "label": "p =", "type": "assigned_variable", "loc": [215, 215], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:If_L214_C4", "vector": [14, 2, 0.9556, 0.0044, 2, 0.58, 0.0, 491, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p = np.matrix([0.9, -0.3, -0.15]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L217_C8", "label": "rot = Rx()", "type": "assigned_variable", "loc": [217, 217], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:If_L214_C4", "vector": [14, 2, 0.9644, 0.0044, 2, 0.58, 0.5, 812, 3, 1, 0, 0, 820, 10, 2], "semantic": {"name": "rot", "arg_names": [], "import_names": [], "rhs_call_name": "Rx", "annotation": ""}, "snippet": " rot = tr.Rx(math.radians(90.))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Expr_L218_C8", "label": "set_cartesian()", "type": "expression", "loc": [218, 218], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:If_L214_C4", "vector": [8, 2, 0.9689, 0.0044, 2, 0.58, 1.0, 203, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "set_cartesian", "arg_names": [], "import_names": [], "rhs_call_name": "set_cartesian", "annotation": ""}, "snippet": " hrl_pr2.set_cartesian('right_arm', p, rot)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Expr_L220_C4", "label": "open_gripper()", "type": "expression", "loc": [220, 220], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:If_L196_C0", "vector": [8, 1, 0.9778, 0.0044, 1, 0.15, 0.7143, 833, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "open_gripper", "arg_names": [], "import_names": [], "rhs_call_name": "open_gripper", "annotation": ""}, "snippet": " hrl_pr2.open_gripper('right_arm')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Expr_L221_C4", "label": "raw_input()", "type": "expression", "loc": [221, 221], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:If_L196_C0", "vector": [8, 1, 0.9822, 0.0044, 1, 0.15, 0.8571, 821, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "raw_input", "arg_names": [], "import_names": [], "rhs_call_name": "raw_input", "annotation": ""}, "snippet": " raw_input('Hit ENTER to close')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99610:Expr_L222_C4", "label": "close_gripper()", "type": "expression", "loc": [222, 222], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99610:If_L196_C0", "vector": [8, 1, 0.9867, 0.0044, 1, 0.15, 1.0, 807, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "close_gripper", "arg_names": [], "import_names": [], "rhs_call_name": "close_gripper", "annotation": ""}, "snippet": " hrl_pr2.close_gripper('right_arm', effort = 15)"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99610:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L25_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Expr_L30_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Expr_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L33_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L36_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L37_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Expr_L38_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Expr_L39_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L41_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Expr_L43_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L44_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L46_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L47_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L51_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L52_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:For_L54_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:For_L54_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Expr_L55_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Expr_L57_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L59_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L60_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L61_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L62_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:For_L63_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:For_L63_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L64_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:For_L63_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:If_L65_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:For_L63_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Expr_L67_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:For_L63_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Expr_L68_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Expr_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L71_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L72_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Expr_L73_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L78_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Expr_L79_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L82_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L83_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L84_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L85_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L86_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L87_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L88_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Expr_L89_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Expr_L90_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L92_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L92_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Expr_L93_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L92_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L94_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L92_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L95_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L92_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Expr_L96_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L92_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L97_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L92_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L98_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L92_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L100_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L92_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L101_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L92_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:If_L102_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:If_L102_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L103_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:If_L102_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L104_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:If_L102_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L105_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:If_L102_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L106_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:If_L102_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Expr_L108_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:If_L102_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L109_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L92_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Return_L111_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L113_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L113_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Expr_L114_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L113_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L115_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L113_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L116_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L113_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L117_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L113_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L118_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L113_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L120_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L113_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L121_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L113_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L122_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L113_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L124_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L113_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L125_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L113_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L126_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L113_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L127_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L113_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L128_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L113_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L130_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L113_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L131_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L113_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L133_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L113_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:If_L134_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:If_L134_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L135_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:If_L134_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Expr_L137_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:If_L134_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L138_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L113_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Return_L140_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L144_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L144_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Return_L145_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L147_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L148_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Return_L149_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L151_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L151_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Expr_L152_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L151_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Expr_L153_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L151_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L154_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L151_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Expr_L155_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L151_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Return_L156_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L159_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L159_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Expr_L160_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L163_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L163_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Expr_L164_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L167_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L167_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Expr_L168_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L167_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L169_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L167_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L170_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L167_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L171_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L167_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L173_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L167_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L174_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L167_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L175_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L167_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L177_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L167_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L178_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L167_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L179_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L167_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L180_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L167_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L181_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L167_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Expr_L182_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L184_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L184_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Expr_L185_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L189_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L189_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Expr_L190_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:FunctionDef_L192_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:If_L196_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Expr_L197_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:If_L196_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Expr_L198_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:If_L196_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L200_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:If_L196_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:If_L202_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:If_L202_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L203_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:If_L202_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Expr_L204_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:If_L202_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L205_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:If_L202_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Expr_L206_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:If_L202_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L209_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:If_L202_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Expr_L210_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:If_L202_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Expr_L212_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:If_L196_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:If_L214_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:If_L214_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L215_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:If_L214_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Assign_L217_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:If_L214_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Expr_L218_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:If_L196_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Expr_L220_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:If_L196_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Expr_L221_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99610:If_L196_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99610:Expr_L222_C4"}]
import roslib; roslib.load_manifest('pr2_doors_epc') import rospy import hrl_lib.transforms as tr import force_torque.FTClient as ftc import math, numpy as np from rviz_marker_test import * from hrl_msgs.msg import FloatArray if __name__ == '__main__': ft_client = ftc.FTClient('force_torque_ft2') ft_client.bias() marker_pub = rospy.Publisher('/test_marker', Marker) ati_pub = rospy.Publisher('/ati_ft', FloatArray) p_st = np.matrix([0.,0.,0.]).T force_frame_id = 'r_wrist_roll_link' while not rospy.is_shutdown(): ft = ft_client.read(fresh = True) rmat = tr.Rx(math.radians(180.)) * tr.Ry(math.radians(-90.)) * tr.Rz(math.radians(30.)) force = rmat * ft[0:3,:] print 'Force:', force.A1 # force is now in the 'robot' coordinate frame. force_scale = 0.1 p_end = p_st + force * force_scale marker = get_marker_arrow(p_st, p_end, force_frame_id) marker_pub.publish(marker) farr = FloatArray() farr.header.stamp = rospy.rostime.get_rostime() farr.header.frame_id = force_frame_id farr.data = (-force).A1.tolist() ati_pub.publish(farr) # rospy.sleep(0.1)
ajibawa-2023/Python-Code-Large/train/row_99611
29
38
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99611:Import_L2_C0", "label": "roslib import roslib", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0526, 0.0263, 0, 0.66, 0.0, 796, 0, 1, 0, 0, 796, 0, 0], "semantic": {"name": "roslib", "arg_names": [], "import_names": ["roslib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('pr2_doors_epc')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99611:Expr_L2_C15", "label": "load_manifest()", "type": "expression", "loc": [2, 2], "level": 0, "parent": null, "vector": [8, 0, 0.0526, 0.0263, 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('pr2_doors_epc')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99611:Import_L3_C0", "label": "rospy import rospy", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0789, 0.0263, 0, 0.66, 0.25, 164, 0, 1, 0, 0, 164, 0, 0], "semantic": {"name": "rospy", "arg_names": [], "import_names": ["rospy"], "rhs_call_name": "", "annotation": ""}, "snippet": "import rospy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99611:Import_L4_C0", "label": "hrl_lib.transforms import tr", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.1053, 0.0263, 0, 0.66, 0.375, 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_99611:Import_L5_C0", "label": "force_torque.FTClient import ftc", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.1316, 0.0263, 0, 0.66, 0.5, 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_99611:Import_L6_C0", "label": "math import math, np", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.1579, 0.0263, 0, 0.66, 0.625, 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_99611:ImportFrom_L8_C0", "label": "from rviz_marker_test import *", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.2105, 0.0263, 0, 0.66, 0.75, 861, 0, 1, 0, 0, 861, 0, 0], "semantic": {"name": "rviz_marker_test", "arg_names": [], "import_names": ["*"], "rhs_call_name": "", "annotation": ""}, "snippet": "from rviz_marker_test import *"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99611:ImportFrom_L9_C0", "label": "from hrl_msgs.msg import FloatArray", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.2368, 0.0263, 0, 0.66, 0.875, 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_99611:If_L11_C0", "label": "if", "type": "if", "loc": [11, 35], "level": 0, "parent": null, "vector": [4, 0, 0.6053, 0.6579, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 20], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n ft_client = ftc.FTClient('force_torque_ft2')\n ft_client.bias()\n marker_pub = rospy.Publisher('/test_marker', Marker)\n ati_pub = rospy.Publisher('/ati_ft', FloatArray)\n\n p_st = np.matrix([0.,0.,0.]).T\n force_frame_id = 'r_wrist_roll_link'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99611:Assign_L12_C4", "label": "ft_client = FTClient()", "type": "assigned_variable", "loc": [12, 12], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99611:If_L11_C0", "vector": [14, 1, 0.3158, 0.0263, 1, 0.62, 0.0, 415, 3, 1, 0, 0, 78, 10, 1], "semantic": {"name": "ft_client", "arg_names": [], "import_names": [], "rhs_call_name": "FTClient", "annotation": ""}, "snippet": " ft_client = ftc.FTClient('force_torque_ft2')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99611:Expr_L13_C4", "label": "bias()", "type": "expression", "loc": [13, 13], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99611:If_L11_C0", "vector": [8, 1, 0.3421, 0.0263, 1, 0.62, 0.1667, 354, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "bias", "arg_names": [], "import_names": [], "rhs_call_name": "bias", "annotation": ""}, "snippet": " ft_client.bias()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99611:Assign_L14_C4", "label": "marker_pub = Publisher()", "type": "assigned_variable", "loc": [14, 14], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99611:If_L11_C0", "vector": [14, 1, 0.3684, 0.0263, 1, 0.62, 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('/test_marker', Marker)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99611:Assign_L15_C4", "label": "ati_pub = Publisher()", "type": "assigned_variable", "loc": [15, 15], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99611:If_L11_C0", "vector": [14, 1, 0.3947, 0.0263, 1, 0.62, 0.5, 679, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "ati_pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " ati_pub = rospy.Publisher('/ati_ft', FloatArray)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99611:Assign_L17_C4", "label": "p_st =", "type": "assigned_variable", "loc": [17, 17], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99611:If_L11_C0", "vector": [14, 1, 0.4474, 0.0263, 1, 0.62, 0.6667, 111, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "p_st", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p_st = np.matrix([0.,0.,0.]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99611:Assign_L18_C4", "label": "force_frame_id =", "type": "assigned_variable", "loc": [18, 18], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99611:If_L11_C0", "vector": [14, 1, 0.4737, 0.0263, 1, 0.62, 0.8333, 528, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "force_frame_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " force_frame_id = 'r_wrist_roll_link'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99611:While_L19_C4", "label": "while", "type": "while", "loc": [19, 35], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99611:If_L11_C0", "vector": [5, 1, 0.7105, 0.4474, 1, 0.62, 1.0, 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 ft = ft_client.read(fresh = True)\n rmat = tr.Rx(math.radians(180.)) * tr.Ry(math.radians(-90.)) * tr.Rz(math.radians(30.))\n force = rmat * ft[0:3,:]\n print('Force:', force.A1)\n # force is now in the 'robot' coordinate frame.\n \n force_scale = 0.1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99611:Assign_L20_C8", "label": "ft = read()", "type": "assigned_variable", "loc": [20, 20], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99611:While_L19_C4", "vector": [14, 2, 0.5263, 0.0263, 2, 0.31, 0.0, 505, 3, 1, 0, 0, 453, 10, 1], "semantic": {"name": "ft", "arg_names": [], "import_names": [], "rhs_call_name": "read", "annotation": ""}, "snippet": " ft = ft_client.read(fresh = True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99611:Assign_L21_C8", "label": "rmat =", "type": "assigned_variable", "loc": [21, 21], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99611:While_L19_C4", "vector": [14, 2, 0.5526, 0.0263, 2, 0.31, 0.0833, 674, 4, 0, 0, 0, 0, 0, 6], "semantic": {"name": "rmat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rmat = tr.Rx(math.radians(180.)) * tr.Ry(math.radians(-90.)) * tr.Rz(math.radians(30.))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99611:Assign_L22_C8", "label": "force =", "type": "assigned_variable", "loc": [22, 22], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99611:While_L19_C4", "vector": [14, 2, 0.5789, 0.0263, 2, 0.31, 0.1667, 77, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "force", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " force = rmat * ft[0:3,:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99611:Expr_L23_C8", "label": "print()", "type": "expression", "loc": [23, 23], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99611:While_L19_C4", "vector": [8, 2, 0.6053, 0.0263, 2, 0.31, 0.25, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Force:', force.A1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99611:Assign_L26_C8", "label": "force_scale =", "type": "assigned_variable", "loc": [26, 26], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99611:While_L19_C4", "vector": [14, 2, 0.6842, 0.0263, 2, 0.31, 0.3333, 465, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "force_scale", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " force_scale = 0.1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99611:Assign_L27_C8", "label": "p_end =", "type": "assigned_variable", "loc": [27, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99611:While_L19_C4", "vector": [14, 2, 0.7105, 0.0263, 2, 0.31, 0.4167, 579, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "p_end", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p_end = p_st + force * force_scale"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99611:Assign_L28_C8", "label": "marker = get_marker_arrow()", "type": "assigned_variable", "loc": [28, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99611:While_L19_C4", "vector": [14, 2, 0.7368, 0.0263, 2, 0.31, 0.5, 864, 3, 3, 0, 0, 977, 10, 1], "semantic": {"name": "marker", "arg_names": [], "import_names": [], "rhs_call_name": "get_marker_arrow", "annotation": ""}, "snippet": " marker = get_marker_arrow(p_st, p_end, force_frame_id)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99611:Expr_L29_C8", "label": "publish()", "type": "expression", "loc": [29, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99611:While_L19_C4", "vector": [8, 2, 0.7632, 0.0263, 2, 0.31, 0.5833, 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_99611:Assign_L31_C8", "label": "farr = FloatArray()", "type": "assigned_variable", "loc": [31, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99611:While_L19_C4", "vector": [14, 2, 0.8158, 0.0263, 2, 0.31, 0.6667, 559, 3, 0, 0, 0, 755, 10, 1], "semantic": {"name": "farr", "arg_names": [], "import_names": [], "rhs_call_name": "FloatArray", "annotation": ""}, "snippet": " farr = FloatArray()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99611:Assign_L32_C8", "label": "farr.header.stamp = get_rostime()", "type": "assigned_variable", "loc": [32, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99611:While_L19_C4", "vector": [14, 2, 0.8421, 0.0263, 2, 0.31, 0.75, 835, 3, 0, 0, 0, 173, 10, 1], "semantic": {"name": "farr.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "get_rostime", "annotation": ""}, "snippet": " farr.header.stamp = rospy.rostime.get_rostime()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99611:Assign_L33_C8", "label": "farr.header.frame_id =", "type": "assigned_variable", "loc": [33, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99611:While_L19_C4", "vector": [14, 2, 0.8684, 0.0263, 2, 0.31, 0.8333, 544, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "farr.header.frame_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " farr.header.frame_id = force_frame_id"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99611:Assign_L34_C8", "label": "farr.data = tolist()", "type": "assigned_variable", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99611:While_L19_C4", "vector": [14, 2, 0.8947, 0.0263, 2, 0.31, 0.9167, 867, 3, 0, 0, 0, 185, 10, 1], "semantic": {"name": "farr.data", "arg_names": [], "import_names": [], "rhs_call_name": "tolist", "annotation": ""}, "snippet": " farr.data = (-force).A1.tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99611:Expr_L35_C8", "label": "publish()", "type": "expression", "loc": [35, 35], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99611:While_L19_C4", "vector": [8, 2, 0.9211, 0.0263, 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": " ati_pub.publish(farr)"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99611:If_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99611:Assign_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99611:If_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99611:Expr_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99611:If_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99611:Assign_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99611:If_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99611:Assign_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99611:If_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99611:Assign_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99611:If_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99611:Assign_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99611:If_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99611:While_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99611:While_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99611:Assign_L20_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99611:While_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99611:Assign_L21_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99611:While_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99611:Assign_L22_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99611:While_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99611:Expr_L23_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99611:While_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99611:Assign_L26_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99611:While_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99611:Assign_L27_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99611:While_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99611:Assign_L28_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99611:While_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99611:Expr_L29_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99611:While_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99611:Assign_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99611:While_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99611:Assign_L32_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99611:While_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99611:Assign_L33_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99611:While_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99611:Assign_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99611:While_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99611:Expr_L35_C8"}]
import roslib; roslib.load_manifest('hrl_pr2_kinematics') import rospy from equilibrium_point_control.msg import MechanismKinematicsRot from equilibrium_point_control.msg import MechanismKinematicsJac import epc from threading import RLock ## # compute the end effector rotation matrix. # @param hook - hook angle. RADIANS(0, -90, 90) (hor, up, down) # @param angle - angle between robot and surface normal. # Angle about the Z axis through which the robot must turn to face # the surface. def rot_mat_from_angles(hook, surface): rot_mat = tr.Rz(hook) * tr.Rx(surface) return rot_mat class Door_EPC(epc.EPC): def __init__(self, robot): epc.EPC.__init__(self, robot) self.mech_kinematics_lock = RLock() self.fit_circle_lock = RLock() rospy.Subscriber('mechanism_kinematics_rot', MechanismKinematicsRot, self.mechanism_kinematics_rot_cb) rospy.Subscriber('mechanism_kinematics_jac', MechanismKinematicsJac, self.mechanism_kinematics_jac_cb) self.mech_traj_pub = rospy.Publisher('mechanism_trajectory', Point32) self.eq_pt_not_moving_counter = 0 ## log the joint angles, equi pt joint angles and forces. def log_state(self, arm): t_now = rospy.get_time() q_now = self.robot.get_joint_angles(arm) self.pull_trajectory.q_list.append(q_now) self.pull_trajectory.time_list.append(t_now) self.eq_pt_trajectory.q_list.append(self.q_guess) # see equi_pt_generator - q_guess is the config for the eq point. self.eq_pt_trajectory.time_list.append(t_now) wrist_force = self.robot.get_wrist_force(arm, base_frame=True) self.force_trajectory.f_list.append(wrist_force.A1.tolist()) self.force_trajectory.time_list.append(t_now) return '' # log_state also used as a rapid_call_func ## # @param arm - 'right_arm' or 'left_arm' # @param motion vec is in tl frame. # @param step_size - distance (meters) through which CEP should move # @param rot_mat - rotation matrix for IK # @return JEP def update_eq_point(self, arm, motion_vec, step_size, rot_mat): self.eq_pt_cartesian = self.eq_pt_cartesian_ts next_pt = self.eq_pt_cartesian + step_size * motion_vec q_eq = self.robot.IK(arm, next_pt, rot_mat, self.q_guess) self.eq_pt_cartesian = next_pt self.eq_pt_cartesian_ts = self.eq_pt_cartesian self.q_guess = q_eq return q_eq def common_stopping_conditions(self): stop = '' if self.q_guess == None: stop = 'IK fail' wrist_force = self.robot.get_wrist_force('right_arm',base_frame=True) mag = np.linalg.norm(wrist_force) print 'force magnitude:', mag if mag > self.eq_force_threshold: stop = 'force exceed' if mag < 1.2 and self.hooked_location_moved: if (self.prev_force_mag - mag) > 30.: stop = 'slip: force step decrease and below thresold.' #stop = '' else: self.slip_count += 1 else: self.slip_count = 0 if self.slip_count == 10: stop = 'slip: force below threshold for too long.' return stop ## constantly update the estimate of the kinematics and move the # equilibrium point along the tangent of the estimated arc, and # try to keep the radial force constant. # @param h_force_possible - True (hook side) or False (hook up). # @param v_force_possible - False (hook side) or True (hook up). # Is maintaining a radial force possible or not (based on hook # geometry and orientation) # @param cep_vel - tangential velocity of the cep in m/s def eqpt_gen_control_radial_force(self, arm, rot_mat, h_force_possible, v_force_possible, cep_vel): self.log_state(arm) step_size = 0.1 * cep_vel # 0.1 is the time interval between calls to the equi_generator function (see pull) q_eq = self.update_eq_point(arm, self.eq_motion_vec, step_size, rot_mat) stop = self.common_stopping_conditions() wrist_force = self.robot.get_wrist_force(arm, base_frame=True) mag = np.linalg.norm(wrist_force) curr_pos = self.robot.FK(arm,self.pull_trajectory.q_list[-1]) if len(self.pull_trajectory.q_list)>1: start_pos = np.matrix(self.cartesian_pts_list[0]).T else: start_pos = curr_pos #mechanism kinematics. self.mech_traj_pub.publish(Point32(curr_pos[0,0], curr_pos[1,0], curr_pos[2,0])) if self.use_jacobian: self.mech_kinematics_lock.acquire() self.cartesian_pts_list.append(curr_pos.A1.tolist()) tangential_vec_ts = self.tangential_vec_ts force_vec_ts = self.constraint_vec_1_ts + self.constraint_vec_2_ts # this is specifically for the right arm, and lots of # other assumptions about the hook etc. (Advait, Feb 28, 2010) if h_force_possible: force_vec_ts[2,0] = 0. if v_force_possible: force_vec_ts[1,0] = 0. force_vec_ts = force_vec_ts / np.linalg.norm(force_vec_ts) if force_vec_ts[2,0] < 0.: # only allowing upward force. force_vec_ts = -force_vec_ts if force_vec_ts[1,0] < 0.: # only allowing force to the left force_vec_ts = -force_vec_ts self.mech_kinematics_lock.release() force_vec = force_vec_ts tangential_vec = tangential_vec_ts if self.use_rotation_center: self.fit_circle_lock.acquire() self.cartesian_pts_list.append(curr_pos.A1.tolist()) rad = self.rad cx_start, cy_start = self.cx_start, self.cy_start cz_start = self.cz_start self.fit_circle_lock.release() cx, cy = cx_start, cy_start cz = cz_start radial_vec = curr_pos_tl-np.matrix([cx,cy,cz]).T radial_vec = radial_vec/np.linalg.norm(radial_vec) if cy_start<start_pos[1,0]: tan_x,tan_y = -radial_vec[1,0],radial_vec[0,0] else: tan_x,tan_y = radial_vec[1,0],-radial_vec[0,0] if tan_x > 0. and (start_pos[0,0]-curr_pos[0,0]) < 0.09: tan_x = -tan_x tan_y = -tan_y if cy_start > start_pos[1,0]: radial_vec = -radial_vec # axis to the left, want force in # anti-radial direction. rv = radial_vec force_vec = np.matrix([rv[0,0], rv[1,0], 0.]).T tangential_vec = np.matrix([tan_x, tan_y, 0.]).T tangential_vec_ts = tangential_vec radial_vec_ts = radial_vec force_vec_ts = force_vec f_vec = -1*np.array([wrist_force[0,0], wrist_force[1,0], wrist_force[2,0]]) f_rad_mag = np.dot(f_vec, force_vec.A1) err = f_rad_mag-5. if err>0.: kp = -0.1 else: kp = -0.2 radial_motion_mag = kp * err # radial_motion_mag in cm (depends on eq_motion step size) if self.use_rotation_center: if h_force_possible == False and parallel_to_floor: radial_motion_mag = 0. if v_force_possible == False and parallel_to_floor == False: radial_motion_mag = 0. radial_motion_vec = force_vec * radial_motion_mag self.eq_motion_vec = copy.copy(tangential_vec) self.eq_motion_vec += radial_motion_vec self.prev_force_mag = mag if self.init_tangent_vector == None: self.init_tangent_vector = copy.copy(tangential_vec_ts) c = np.dot(tangential_vec_ts.A1, self.init_tangent_vector.A1) ang = np.arccos(c) dist_moved = np.dot((curr_pos - start_pos).A1, self.tangential_vec_ts.A1) ftan = abs(np.dot(wrist_force.A1, tangential_vec.A1)) if abs(dist_moved) > 0.09 and self.hooked_location_moved == False: # change the force threshold once the hook has started pulling. self.hooked_location_moved = True self.eq_force_threshold = ut.bound(mag+30.,20.,80.) self.ftan_threshold = self.ftan_threshold + max(10., 1.5*ftan) if self.hooked_location_moved: if abs(tangential_vec_ts[2,0]) < 0.2 and ftan > self.ftan_threshold: stop = 'ftan threshold exceed: %f'%ftan else: self.ftan_threshold = max(self.ftan_threshold, ftan) if self.hooked_location_moved and ang > math.radians(90.): print 'Angle:', math.degrees(ang) self.open_ang_exceed_count += 1 if self.open_ang_exceed_count > 2: stop = 'opened mechanism through large angle: %.1f'%(math.degrees(ang)) else: self.open_ang_exceed_count = 0 self.mech_time_list.append(time.time()) self.mech_x_list.append(ang) self.f_rad_list.append(f_rad_mag) self.f_tan_list.append(np.dot(f_vec, tangential_vec.A1)) self.tan_vec_list.append(tangential_vec_ts.A1.tolist()) self.rad_vec_list.append(force_vec_ts.A1.tolist()) return stop, q_eq def pull(self, arm, hook_angle, force_threshold, ea, kinematics_estimation = 'rotation_center', pull_left = False): self.init_tangent_vector = None self.open_ang_exceed_count = 0. if kinematics_estimation == 'rotation_center': self.use_rotation_center = True else: self.use_rotation_center = False if kinematics_estimation == 'jacobian': self.use_jacobian = True else: self.use_jacobian = False #rot_mat = tr.Rz(hook_angle)*tr.Ry(math.radians(-90)) rot_mat = rot_mat_from_angles(hook_angle, surface_angle) time_dict = {} time_dict['before_pull'] = time.time() self.pull_trajectory = at.JointTrajectory() self.eq_pt_trajectory = at.JointTrajectory() self.force_trajectory = at.ForceTrajectory() self.robot.step() start_config = self.robot.get_joint_angles(arm) self.eq_force_threshold = force_threshold self.ftan_threshold = 2. self.hooked_location_moved = False # flag to indicate when the hooking location started moving. self.prev_force_mag = np.linalg.norm(self.robot.get_wrist_force(arm)) self.eq_motion_vec = np.matrix([-1.,0.,0.]).T # might want to change this to account for the surface_angle. self.slip_count = 0 self.eq_pt_cartesian = self.robot.FK(arm, ea) self.eq_pt_cartesian_ts = self.robot.FK(arm, ea) self.start_pos = copy.copy(self.eq_pt_cartesian) self.q_guess = ea if not pull_left: self.tangential_vec_ts = np.matrix([-1.,0.,0.]).T self.constraint_vec_2_ts = np.matrix([0.,0.,1.]).T self.constraint_vec_1_ts = np.matrix([0.,1.,0.]).T else: self.tangential_vec_ts = np.matrix([0.,1.,0.]).T self.constraint_vec_2_ts = np.matrix([0.,0.,1.]).T self.constraint_vec_1_ts = np.matrix([1.,0.,0.]).T self.mech_time_list = [] self.mech_x_list = [] self.f_rad_list = [] self.f_tan_list = [] self.tan_vec_list = [] self.rad_vec_list = [] self.cartesian_pts_list = [] ee_pos = self.robot.end_effector_pos(arm) if self.use_rotation_center: # this might have to change depending on left and right # arm? or maybe not since the right arm can open both # doors. self.cx_start = ee_pos[0,0] self.cy_start = ee_pos[1,0]-1.0 self.cz_start = ee_pos[2,0] self.rad = 5.0 h_force_possible = abs(hook_angle) < math.radians(30.) v_force_possible = abs(hook_angle) > math.radians(60.) arg_list = [arm, rot_mat, h_force_possible, v_force_possible, cep_vel] result, jep = self.epc_motion(self.eqpt_gen_control_radial_force, 0.1, arm, arg_list, self.log_state) print 'EPC motion result:', result print 'Original force threshold:', force_threshold print 'Adapted force threshold:', self.eq_force_threshold print 'Adapted ftan threshold:', self.ftan_threshold time_dict['after_pull'] = time.time() d = {'actual': self.pull_trajectory, 'eq_pt': self.eq_pt_trajectory, 'force': self.force_trajectory, 'torque': self.jt_torque_trajectory, 'info': info_string, 'force_threshold': force_threshold, 'eq_force_threshold': self.eq_force_threshold, 'hook_angle':hook_angle, 'result':result, 'time_dict':time_dict, 'cep_vel': cep_vel, 'ftan_threshold': self.ftan_threshold} self.robot.step() ut.save_pickle(d,'pull_trajectories_'+d['info']+'_'+ut.formatted_time()+'.pkl') dd = {'mechanism_x': self.mech_x_list, 'mechanism_time': self.mech_time_list, 'force_rad_list': self.f_rad_list, 'force_tan_list': self.f_tan_list, 'tan_vec_list': self.tan_vec_list, 'rad_vec_list': self.rad_vec_list } ut.save_pickle(dd,'mechanism_trajectories_robot_'+d['info']+'_'+ut.formatted_time()+'.pkl') ## behavior to search around the hook_loc to try and get a good # hooking grasp # @param arm - 'right_arm' or 'left_arm' # @param hook_angle - radians(0,-90,90) side,up,down # @param hook_loc - 3x1 np matrix # @param angle - angle between torso x axis and surface normal. # @return s, jep (stopping string and last commanded JEP) def search_and_hook(self, arm, hook_angle, hook_loc, angle, hooking_force_threshold = 5.): rot_mat = rot_mat_from_angles(hook_angle, angle) if arm == 'right_arm': hook_dir = np.matrix([0.,1.,0.]).T # hook direc in home position elif arm == 'left_arm': hook_dir = np.matrix([0.,-1.,0.]).T # hook direc in home position else: raise RuntimeError('Unknown arm: %s', arm) start_loc = hook_loc + rot_mat.T * hook_dir * -0.03 # 3cm direc opposite to hook. # vector normal to surface and pointing into the surface. normal_tl = tr.Rz(-angle) * np.matrix([1.0,0.,0.]).T pt1 = start_loc - normal_tl * 0.1 pt1[2,0] -= 0.02 # funny error in meka control code? or is it gravity comp? self.robot.go_cartesian(arm, pt1, rot_mat, speed=0.2) vec = normal_tl * 0.2 s, jep = self.firenze.move_till_hit(arm, vec=vec, force_threshold=2.0, rot=rot_mat, speed=0.07) self.eq_pt_cartesian = self.firenze.FK(arm, jep) self.eq_pt_cartesian_ts = self.firenze.FK(arm, jep) self.start_pos = copy.copy(self.eq_pt_cartesian) self.q_guess = jep move_dir = rot_mat.T * hook_dir arg_list = [arm, move_dir, rot_mat, hooking_force_threshold] s, jep = self.compliant_motion(self.equi_generator_surface_follow, 0.05, arm, arg_list) return s, jep if __name__ == '__main__': print 'Hello World'
ajibawa-2023/Python-Code-Large/train/row_99612
232
386
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Import_L2_C0", "label": "roslib import roslib", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0052, 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; roslib.load_manifest('hrl_pr2_kinematics')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Expr_L2_C15", "label": "load_manifest()", "type": "expression", "loc": [2, 2], "level": 0, "parent": null, "vector": [8, 0, 0.0052, 0.0026, 0, 0.66, 0.1111, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('hrl_pr2_kinematics')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Import_L3_C0", "label": "rospy import rospy", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0078, 0.0026, 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_99612:ImportFrom_L5_C0", "label": "from equilibrium_point_control.msg import MechanismKinematicsRot", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.013, 0.0026, 0, 0.66, 0.3333, 178, 0, 1, 0, 0, 178, 0, 0], "semantic": {"name": "equilibrium_point_control.msg", "arg_names": [], "import_names": ["MechanismKinematicsRot"], "rhs_call_name": "", "annotation": ""}, "snippet": "from equilibrium_point_control.msg import MechanismKinematicsRot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:ImportFrom_L6_C0", "label": "from equilibrium_point_control.msg import MechanismKinematicsJac", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0155, 0.0026, 0, 0.66, 0.4444, 178, 0, 1, 0, 0, 178, 0, 0], "semantic": {"name": "equilibrium_point_control.msg", "arg_names": [], "import_names": ["MechanismKinematicsJac"], "rhs_call_name": "", "annotation": ""}, "snippet": "from equilibrium_point_control.msg import MechanismKinematicsJac"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Import_L8_C0", "label": "epc import epc", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.0207, 0.0026, 0, 0.66, 0.5556, 304, 0, 1, 0, 0, 304, 0, 0], "semantic": {"name": "epc", "arg_names": [], "import_names": ["epc"], "rhs_call_name": "", "annotation": ""}, "snippet": "import epc"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:ImportFrom_L9_C0", "label": "from threading import RLock", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.0233, 0.0026, 0, 0.66, 0.6667, 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_99612:FunctionDef_L18_C0", "label": "rot_mat_from_angles", "type": "function", "loc": [18, 20], "level": 0, "parent": null, "vector": [2, 0, 0.0492, 0.0078, 0, 0.66, 0.7778, 428, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "rot_mat_from_angles", "arg_names": ["hook", "surface"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def rot_mat_from_angles(hook, surface):\n rot_mat = tr.Rz(hook) * tr.Rx(surface)\n return rot_mat"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L19_C4", "label": "rot_mat =", "type": "assigned_variable", "loc": [19, 19], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L18_C0", "vector": [14, 1, 0.0492, 0.0026, 1, 0.77, 0.0, 968, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "rot_mat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rot_mat = tr.Rz(hook) * tr.Rx(surface)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Return_L20_C4", "label": "return", "type": "return", "loc": [20, 20], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L18_C0", "vector": [13, 1, 0.0518, 0.0026, 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 rot_mat"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:ClassDef_L24_C0", "label": "Door_EPC", "type": "class", "loc": [24, 379], "level": 0, "parent": null, "vector": [3, 0, 0.522, 0.9223, 0, 0.66, 0.8889, 468, 0, 7, 0, 0, 62, 0, 99], "semantic": {"name": "Door_EPC", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Door_EPC(epc.EPC):\n def __init__(self, robot):\n epc.EPC.__init__(self, robot)\n\n self.mech_kinematics_lock = RLock()\n self.fit_circle_lock = RLock()\n\n rospy.Subscriber('mechanism_kinematics_rot',"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L25_C4", "label": "__init__", "type": "function", "loc": [25, 38], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:ClassDef_L24_C0", "vector": [2, 1, 0.0816, 0.0363, 1, 0.29, 0.0, 555, 0, 2, 0, 0, 0, 0, 6], "semantic": {"name": "__init__", "arg_names": ["self", "robot"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, robot):\n epc.EPC.__init__(self, robot)\n\n self.mech_kinematics_lock = RLock()\n self.fit_circle_lock = RLock()\n\n rospy.Subscriber('mechanism_kinematics_rot',\n MechanismKinematicsRot,"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Expr_L26_C8", "label": "__init__()", "type": "expression", "loc": [26, 26], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L25_C4", "vector": [8, 2, 0.0674, 0.0026, 2, 0.77, 0.0, 555, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " epc.EPC.__init__(self, robot)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L28_C8", "label": "self.mech_kinematics_lock = RLock()", "type": "assigned_variable", "loc": [28, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L25_C4", "vector": [14, 2, 0.0725, 0.0026, 2, 0.77, 0.1667, 542, 3, 0, 0, 0, 207, 10, 1], "semantic": {"name": "self.mech_kinematics_lock", "arg_names": [], "import_names": [], "rhs_call_name": "RLock", "annotation": ""}, "snippet": " self.mech_kinematics_lock = RLock()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L29_C8", "label": "self.fit_circle_lock = RLock()", "type": "assigned_variable", "loc": [29, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L25_C4", "vector": [14, 2, 0.0751, 0.0026, 2, 0.77, 0.3333, 336, 3, 0, 0, 0, 207, 10, 1], "semantic": {"name": "self.fit_circle_lock", "arg_names": [], "import_names": [], "rhs_call_name": "RLock", "annotation": ""}, "snippet": " self.fit_circle_lock = RLock()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Expr_L31_C8", "label": "Subscriber()", "type": "expression", "loc": [31, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L25_C4", "vector": [8, 2, 0.0829, 0.0078, 2, 0.77, 0.5, 455, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "Subscriber", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " rospy.Subscriber('mechanism_kinematics_rot',\n MechanismKinematicsRot,\n self.mechanism_kinematics_rot_cb)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Expr_L34_C8", "label": "Subscriber()", "type": "expression", "loc": [34, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L25_C4", "vector": [8, 2, 0.0907, 0.0078, 2, 0.77, 0.6667, 455, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "Subscriber", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " rospy.Subscriber('mechanism_kinematics_jac',\n MechanismKinematicsJac,\n self.mechanism_kinematics_jac_cb)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L37_C8", "label": "self.mech_traj_pub = Publisher()", "type": "assigned_variable", "loc": [37, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L25_C4", "vector": [14, 2, 0.0959, 0.0026, 2, 0.77, 0.8333, 690, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "self.mech_traj_pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " self.mech_traj_pub = rospy.Publisher('mechanism_trajectory', Point32)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L38_C8", "label": "self.eq_pt_not_moving_counter =", "type": "assigned_variable", "loc": [38, 38], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L25_C4", "vector": [14, 2, 0.0984, 0.0026, 2, 0.77, 1.0, 123, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.eq_pt_not_moving_counter", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.eq_pt_not_moving_counter = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L41_C4", "label": "log_state", "type": "function", "loc": [41, 54], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:ClassDef_L24_C0", "vector": [2, 1, 0.1231, 0.0363, 1, 0.29, 0.1667, 805, 0, 2, 1, 0, 0, 0, 10], "semantic": {"name": "log_state", "arg_names": ["self", "arm"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def log_state(self, arm):\n t_now = rospy.get_time()\n q_now = self.robot.get_joint_angles(arm)\n\n self.pull_trajectory.q_list.append(q_now)\n self.pull_trajectory.time_list.append(t_now)\n\n self.eq_pt_trajectory.q_list.append(self.q_guess) # see equi_pt_generator - q_guess is the config for the eq point."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L42_C8", "label": "t_now = get_time()", "type": "assigned_variable", "loc": [42, 42], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L41_C4", "vector": [14, 2, 0.1088, 0.0026, 2, 0.44, 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_99612:Assign_L43_C8", "label": "q_now = get_joint_angles()", "type": "assigned_variable", "loc": [43, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L41_C4", "vector": [14, 2, 0.1114, 0.0026, 2, 0.44, 0.1111, 353, 3, 1, 0, 0, 820, 10, 1], "semantic": {"name": "q_now", "arg_names": [], "import_names": [], "rhs_call_name": "get_joint_angles", "annotation": ""}, "snippet": " q_now = self.robot.get_joint_angles(arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Expr_L45_C8", "label": "append()", "type": "expression", "loc": [45, 45], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L41_C4", "vector": [8, 2, 0.1166, 0.0026, 2, 0.44, 0.2222, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.pull_trajectory.q_list.append(q_now)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Expr_L46_C8", "label": "append()", "type": "expression", "loc": [46, 46], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L41_C4", "vector": [8, 2, 0.1192, 0.0026, 2, 0.44, 0.3333, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.pull_trajectory.time_list.append(t_now)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Expr_L48_C8", "label": "append()", "type": "expression", "loc": [48, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L41_C4", "vector": [8, 2, 0.1244, 0.0026, 2, 0.44, 0.4444, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.eq_pt_trajectory.q_list.append(self.q_guess) # see equi_pt_generator - q_guess is the config for the eq point."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Expr_L49_C8", "label": "append()", "type": "expression", "loc": [49, 49], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L41_C4", "vector": [8, 2, 0.1269, 0.0026, 2, 0.44, 0.5556, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.eq_pt_trajectory.time_list.append(t_now)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L51_C8", "label": "wrist_force = get_wrist_force()", "type": "assigned_variable", "loc": [51, 51], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L41_C4", "vector": [14, 2, 0.1321, 0.0026, 2, 0.44, 0.6667, 483, 3, 2, 0, 0, 854, 10, 1], "semantic": {"name": "wrist_force", "arg_names": [], "import_names": [], "rhs_call_name": "get_wrist_force", "annotation": ""}, "snippet": " wrist_force = self.robot.get_wrist_force(arm, base_frame=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Expr_L52_C8", "label": "append()", "type": "expression", "loc": [52, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L41_C4", "vector": [8, 2, 0.1347, 0.0026, 2, 0.44, 0.7778, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.force_trajectory.f_list.append(wrist_force.A1.tolist())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Expr_L53_C8", "label": "append()", "type": "expression", "loc": [53, 53], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L41_C4", "vector": [8, 2, 0.1373, 0.0026, 2, 0.44, 0.8889, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.force_trajectory.time_list.append(t_now)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Return_L54_C8", "label": "return", "type": "return", "loc": [54, 54], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L41_C4", "vector": [13, 2, 0.1399, 0.0026, 2, 0.44, 1.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return '' # log_state also used as a rapid_call_func"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L62_C4", "label": "update_eq_point", "type": "function", "loc": [62, 69], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:ClassDef_L24_C0", "vector": [2, 1, 0.1697, 0.0207, 1, 0.29, 0.3333, 20, 0, 5, 1, 0, 0, 0, 1], "semantic": {"name": "update_eq_point", "arg_names": ["self", "arm", "motion_vec", "step_size", "rot_mat"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def update_eq_point(self, arm, motion_vec, step_size, rot_mat):\n self.eq_pt_cartesian = self.eq_pt_cartesian_ts\n next_pt = self.eq_pt_cartesian + step_size * motion_vec\n q_eq = self.robot.IK(arm, next_pt, rot_mat, self.q_guess)\n self.eq_pt_cartesian = next_pt\n self.eq_pt_cartesian_ts = self.eq_pt_cartesian\n self.q_guess = q_eq\n return q_eq"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L63_C8", "label": "self.eq_pt_cartesian =", "type": "assigned_variable", "loc": [63, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L62_C4", "vector": [14, 2, 0.1632, 0.0026, 2, 0.06, 0.0, 13, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.eq_pt_cartesian", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.eq_pt_cartesian = self.eq_pt_cartesian_ts"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L64_C8", "label": "next_pt =", "type": "assigned_variable", "loc": [64, 64], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L62_C4", "vector": [14, 2, 0.1658, 0.0026, 2, 0.06, 0.1667, 46, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "next_pt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " next_pt = self.eq_pt_cartesian + step_size * motion_vec"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L65_C8", "label": "q_eq = IK()", "type": "assigned_variable", "loc": [65, 65], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L62_C4", "vector": [14, 2, 0.1684, 0.0026, 2, 0.06, 0.3333, 498, 3, 4, 0, 0, 719, 10, 1], "semantic": {"name": "q_eq", "arg_names": [], "import_names": [], "rhs_call_name": "IK", "annotation": ""}, "snippet": " q_eq = self.robot.IK(arm, next_pt, rot_mat, self.q_guess)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L66_C8", "label": "self.eq_pt_cartesian =", "type": "assigned_variable", "loc": [66, 66], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L62_C4", "vector": [14, 2, 0.171, 0.0026, 2, 0.06, 0.5, 13, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.eq_pt_cartesian", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.eq_pt_cartesian = next_pt"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L67_C8", "label": "self.eq_pt_cartesian_ts =", "type": "assigned_variable", "loc": [67, 67], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L62_C4", "vector": [14, 2, 0.1736, 0.0026, 2, 0.06, 0.6667, 892, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.eq_pt_cartesian_ts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.eq_pt_cartesian_ts = self.eq_pt_cartesian"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L68_C8", "label": "self.q_guess =", "type": "assigned_variable", "loc": [68, 68], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L62_C4", "vector": [14, 2, 0.1762, 0.0026, 2, 0.06, 0.8333, 495, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.q_guess", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.q_guess = q_eq"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Return_L69_C8", "label": "return", "type": "return", "loc": [69, 69], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L62_C4", "vector": [13, 2, 0.1788, 0.0026, 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 q_eq"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L71_C4", "label": "common_stopping_conditions", "type": "function", "loc": [71, 93], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:ClassDef_L24_C0", "vector": [2, 1, 0.2124, 0.0596, 1, 0.29, 0.5, 763, 0, 1, 1, 0, 0, 0, 3], "semantic": {"name": "common_stopping_conditions", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def common_stopping_conditions(self):\n stop = ''\n if self.q_guess == None:\n stop = 'IK fail'\n\n wrist_force = self.robot.get_wrist_force('right_arm',base_frame=True)\n mag = np.linalg.norm(wrist_force)\n print('force magnitude:', mag)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L72_C8", "label": "stop =", "type": "assigned_variable", "loc": [72, 72], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L71_C4", "vector": [14, 2, 0.1865, 0.0026, 2, 0.35, 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_99612:If_L73_C8", "label": "if", "type": "if", "loc": [73, 74], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L71_C4", "vector": [4, 2, 0.1904, 0.0052, 2, 0.35, 0.125, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.q_guess == None:\n stop = 'IK fail'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L74_C12", "label": "stop =", "type": "assigned_variable", "loc": [74, 74], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L73_C8", "vector": [14, 3, 0.1917, 0.0026, 3, 0.88, 0.0, 343, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " stop = 'IK fail'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L76_C8", "label": "wrist_force = get_wrist_force()", "type": "assigned_variable", "loc": [76, 76], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L71_C4", "vector": [14, 2, 0.1969, 0.0026, 2, 0.35, 0.25, 483, 3, 2, 0, 0, 854, 10, 1], "semantic": {"name": "wrist_force", "arg_names": [], "import_names": [], "rhs_call_name": "get_wrist_force", "annotation": ""}, "snippet": " wrist_force = self.robot.get_wrist_force('right_arm',base_frame=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L77_C8", "label": "mag = norm()", "type": "assigned_variable", "loc": [77, 77], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L71_C4", "vector": [14, 2, 0.1995, 0.0026, 2, 0.35, 0.375, 533, 3, 1, 0, 0, 902, 10, 1], "semantic": {"name": "mag", "arg_names": [], "import_names": [], "rhs_call_name": "norm", "annotation": ""}, "snippet": " mag = np.linalg.norm(wrist_force)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Expr_L78_C8", "label": "print()", "type": "expression", "loc": [78, 78], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L71_C4", "vector": [8, 2, 0.2021, 0.0026, 2, 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('force magnitude:', mag)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L79_C8", "label": "if", "type": "if", "loc": [79, 80], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L71_C4", "vector": [4, 2, 0.206, 0.0052, 2, 0.35, 0.625, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if mag > self.eq_force_threshold:\n stop = 'force exceed'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L80_C12", "label": "stop =", "type": "assigned_variable", "loc": [80, 80], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L79_C8", "vector": [14, 3, 0.2073, 0.0026, 3, 0.78, 0.0, 343, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " stop = 'force exceed'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L82_C8", "label": "if", "type": "if", "loc": [82, 89], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L71_C4", "vector": [4, 2, 0.2215, 0.0207, 2, 0.35, 0.75, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if mag < 1.2 and self.hooked_location_moved:\n if (self.prev_force_mag - mag) > 30.:\n stop = 'slip: force step decrease and below thresold.'\n #stop = ''\n else:\n self.slip_count += 1\n else:\n self.slip_count = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L83_C12", "label": "if", "type": "if", "loc": [83, 87], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L82_C8", "vector": [4, 3, 0.2202, 0.013, 3, 0.75, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (self.prev_force_mag - mag) > 30.:\n stop = 'slip: force step decrease and below thresold.'\n #stop = ''\n else:\n self.slip_count += 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L84_C16", "label": "stop =", "type": "assigned_variable", "loc": [84, 84], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L83_C12", "vector": [14, 4, 0.2176, 0.0026, 4, 0.49, 0.0, 343, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " stop = 'slip: force step decrease and below thresold.'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L89_C12", "label": "self.slip_count =", "type": "assigned_variable", "loc": [89, 89], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L82_C8", "vector": [14, 3, 0.2306, 0.0026, 3, 0.75, 1.0, 338, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.slip_count", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.slip_count = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L91_C8", "label": "if", "type": "if", "loc": [91, 92], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L71_C4", "vector": [4, 2, 0.237, 0.0052, 2, 0.35, 0.875, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.slip_count == 10:\n stop = 'slip: force below threshold for too long.'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L92_C12", "label": "stop =", "type": "assigned_variable", "loc": [92, 92], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L91_C8", "vector": [14, 3, 0.2383, 0.0026, 3, 0.16, 0.0, 343, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " stop = 'slip: force below threshold for too long.'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Return_L93_C8", "label": "return", "type": "return", "loc": [93, 93], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L71_C4", "vector": [13, 2, 0.2409, 0.0026, 2, 0.35, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return stop"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L103_C4", "label": "eqpt_gen_control_radial_force", "type": "function", "loc": [103, 236], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:ClassDef_L24_C0", "vector": [2, 1, 0.4391, 0.3472, 1, 0.29, 0.6667, 689, 0, 6, 1, 0, 0, 0, 51], "semantic": {"name": "eqpt_gen_control_radial_force", "arg_names": ["self", "arm", "rot_mat", "h_force_possible", "v_force_possible", "cep_vel"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def eqpt_gen_control_radial_force(self, arm, rot_mat,\n h_force_possible, v_force_possible, cep_vel):\n self.log_state(arm)\n step_size = 0.1 * cep_vel # 0.1 is the time interval between calls to the equi_generator function (see pull)\n q_eq = self.update_eq_point(arm, self.eq_motion_vec, step_size,\n rot_mat)\n stop = self.common_stopping_conditions()\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Expr_L105_C8", "label": "log_state()", "type": "expression", "loc": [105, 105], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L103_C4", "vector": [8, 2, 0.272, 0.0026, 2, 0.14, 0.0, 805, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "log_state", "arg_names": [], "import_names": [], "rhs_call_name": "log_state", "annotation": ""}, "snippet": " self.log_state(arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L106_C8", "label": "step_size =", "type": "assigned_variable", "loc": [106, 106], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L103_C4", "vector": [14, 2, 0.2746, 0.0026, 2, 0.14, 0.0294, 764, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "step_size", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " step_size = 0.1 * cep_vel # 0.1 is the time interval between calls to the equi_generator function (see pull)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L107_C8", "label": "q_eq = update_eq_point()", "type": "assigned_variable", "loc": [107, 108], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L103_C4", "vector": [14, 2, 0.2785, 0.0052, 2, 0.14, 0.0588, 498, 3, 4, 0, 0, 20, 10, 1], "semantic": {"name": "q_eq", "arg_names": [], "import_names": [], "rhs_call_name": "update_eq_point", "annotation": ""}, "snippet": " q_eq = self.update_eq_point(arm, self.eq_motion_vec, step_size,\n rot_mat)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L109_C8", "label": "stop = common_stopping_conditions()", "type": "assigned_variable", "loc": [109, 109], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L103_C4", "vector": [14, 2, 0.2824, 0.0026, 2, 0.14, 0.0882, 343, 3, 0, 0, 0, 763, 10, 1], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "common_stopping_conditions", "annotation": ""}, "snippet": " stop = self.common_stopping_conditions()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L111_C8", "label": "wrist_force = get_wrist_force()", "type": "assigned_variable", "loc": [111, 111], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L103_C4", "vector": [14, 2, 0.2876, 0.0026, 2, 0.14, 0.1176, 483, 3, 2, 0, 0, 854, 10, 1], "semantic": {"name": "wrist_force", "arg_names": [], "import_names": [], "rhs_call_name": "get_wrist_force", "annotation": ""}, "snippet": " wrist_force = self.robot.get_wrist_force(arm, base_frame=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L112_C8", "label": "mag = norm()", "type": "assigned_variable", "loc": [112, 112], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L103_C4", "vector": [14, 2, 0.2902, 0.0026, 2, 0.14, 0.1471, 533, 3, 1, 0, 0, 902, 10, 1], "semantic": {"name": "mag", "arg_names": [], "import_names": [], "rhs_call_name": "norm", "annotation": ""}, "snippet": " mag = np.linalg.norm(wrist_force)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L114_C8", "label": "curr_pos = FK()", "type": "assigned_variable", "loc": [114, 114], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L103_C4", "vector": [14, 2, 0.2953, 0.0026, 2, 0.14, 0.1765, 909, 3, 2, 0, 0, 252, 10, 1], "semantic": {"name": "curr_pos", "arg_names": [], "import_names": [], "rhs_call_name": "FK", "annotation": ""}, "snippet": " curr_pos = self.robot.FK(arm,self.pull_trajectory.q_list[-1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L115_C8", "label": "if", "type": "if", "loc": [115, 118], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L103_C4", "vector": [4, 2, 0.3018, 0.0104, 2, 0.14, 0.2059, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(self.pull_trajectory.q_list)>1:\n start_pos = np.matrix(self.cartesian_pts_list[0]).T\n else:\n start_pos = curr_pos"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L116_C12", "label": "start_pos =", "type": "assigned_variable", "loc": [116, 116], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L115_C8", "vector": [14, 3, 0.3005, 0.0026, 3, 0.02, 0.0, 12, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "start_pos", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " start_pos = np.matrix(self.cartesian_pts_list[0]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L118_C12", "label": "start_pos =", "type": "assigned_variable", "loc": [118, 118], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L115_C8", "vector": [14, 3, 0.3057, 0.0026, 3, 0.02, 1.0, 12, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "start_pos", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " start_pos = curr_pos"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Expr_L121_C8", "label": "publish()", "type": "expression", "loc": [121, 122], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L103_C4", "vector": [8, 2, 0.3148, 0.0052, 2, 0.14, 0.2353, 102, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.mech_traj_pub.publish(Point32(curr_pos[0,0],\n curr_pos[1,0], curr_pos[2,0]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L124_C8", "label": "if", "type": "if", "loc": [124, 146], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L103_C4", "vector": [4, 2, 0.3497, 0.0596, 2, 0.14, 0.2647, 0, 7, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.use_jacobian:\n self.mech_kinematics_lock.acquire()\n\n self.cartesian_pts_list.append(curr_pos.A1.tolist())\n tangential_vec_ts = self.tangential_vec_ts\n force_vec_ts = self.constraint_vec_1_ts + self.constraint_vec_2_ts\n\n # this is specifically for the right arm, and lots of"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Expr_L125_C12", "label": "acquire()", "type": "expression", "loc": [125, 125], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L124_C8", "vector": [8, 3, 0.3238, 0.0026, 3, 0.22, 0.0, 229, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "acquire", "arg_names": [], "import_names": [], "rhs_call_name": "acquire", "annotation": ""}, "snippet": " self.mech_kinematics_lock.acquire()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Expr_L127_C12", "label": "append()", "type": "expression", "loc": [127, 127], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L124_C8", "vector": [8, 3, 0.329, 0.0026, 3, 0.22, 0.0909, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.cartesian_pts_list.append(curr_pos.A1.tolist())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L128_C12", "label": "tangential_vec_ts =", "type": "assigned_variable", "loc": [128, 128], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L124_C8", "vector": [14, 3, 0.3316, 0.0026, 3, 0.22, 0.1818, 833, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "tangential_vec_ts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tangential_vec_ts = self.tangential_vec_ts"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L129_C12", "label": "force_vec_ts =", "type": "assigned_variable", "loc": [129, 129], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L124_C8", "vector": [14, 3, 0.3342, 0.0026, 3, 0.22, 0.2727, 900, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "force_vec_ts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " force_vec_ts = self.constraint_vec_1_ts + self.constraint_vec_2_ts"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L133_C12", "label": "if", "type": "if", "loc": [133, 134], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L124_C8", "vector": [4, 3, 0.3459, 0.0052, 3, 0.22, 0.3636, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if h_force_possible:\n force_vec_ts[2,0] = 0."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L134_C16", "label": "assign", "type": "assigned_variable", "loc": [134, 134], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L133_C12", "vector": [14, 4, 0.3472, 0.0026, 4, 0.25, 0.0, 0, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " force_vec_ts[2,0] = 0."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L135_C12", "label": "if", "type": "if", "loc": [135, 136], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L124_C8", "vector": [4, 3, 0.351, 0.0052, 3, 0.22, 0.4545, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if v_force_possible:\n force_vec_ts[1,0] = 0."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L136_C16", "label": "assign", "type": "assigned_variable", "loc": [136, 136], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L135_C12", "vector": [14, 4, 0.3523, 0.0026, 4, 0.81, 0.0, 0, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " force_vec_ts[1,0] = 0."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L137_C12", "label": "force_vec_ts =", "type": "assigned_variable", "loc": [137, 137], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L124_C8", "vector": [14, 3, 0.3549, 0.0026, 3, 0.22, 0.5455, 900, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "force_vec_ts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " force_vec_ts = force_vec_ts / np.linalg.norm(force_vec_ts)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L138_C12", "label": "if", "type": "if", "loc": [138, 139], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L124_C8", "vector": [4, 3, 0.3588, 0.0052, 3, 0.22, 0.6364, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if force_vec_ts[2,0] < 0.: # only allowing upward force.\n force_vec_ts = -force_vec_ts"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L139_C16", "label": "force_vec_ts =", "type": "assigned_variable", "loc": [139, 139], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L138_C12", "vector": [14, 4, 0.3601, 0.0026, 4, 0.14, 0.0, 900, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "force_vec_ts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " force_vec_ts = -force_vec_ts"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L140_C12", "label": "if", "type": "if", "loc": [140, 141], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L124_C8", "vector": [4, 3, 0.364, 0.0052, 3, 0.22, 0.7273, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if force_vec_ts[1,0] < 0.: # only allowing force to the left\n force_vec_ts = -force_vec_ts"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L141_C16", "label": "force_vec_ts =", "type": "assigned_variable", "loc": [141, 141], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L140_C12", "vector": [14, 4, 0.3653, 0.0026, 4, 0.35, 0.0, 900, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "force_vec_ts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " force_vec_ts = -force_vec_ts"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Expr_L143_C12", "label": "release()", "type": "expression", "loc": [143, 143], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L124_C8", "vector": [8, 3, 0.3705, 0.0026, 3, 0.22, 0.8182, 784, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "release", "arg_names": [], "import_names": [], "rhs_call_name": "release", "annotation": ""}, "snippet": " self.mech_kinematics_lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L145_C12", "label": "force_vec =", "type": "assigned_variable", "loc": [145, 145], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L124_C8", "vector": [14, 3, 0.3756, 0.0026, 3, 0.22, 0.9091, 819, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "force_vec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " force_vec = force_vec_ts"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L146_C12", "label": "tangential_vec =", "type": "assigned_variable", "loc": [146, 146], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L124_C8", "vector": [14, 3, 0.3782, 0.0026, 3, 0.22, 1.0, 367, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "tangential_vec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tangential_vec = tangential_vec_ts"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L148_C8", "label": "if", "type": "if", "loc": [148, 178], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L103_C4", "vector": [4, 2, 0.4223, 0.0803, 2, 0.14, 0.2941, 0, 7, 0, 0, 0, 0, 0, 8], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.use_rotation_center:\n self.fit_circle_lock.acquire()\n self.cartesian_pts_list.append(curr_pos.A1.tolist())\n rad = self.rad\n cx_start, cy_start = self.cx_start, self.cy_start\n cz_start = self.cz_start\n self.fit_circle_lock.release()\n cx, cy = cx_start, cy_start"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Expr_L149_C12", "label": "acquire()", "type": "expression", "loc": [149, 149], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L148_C8", "vector": [8, 3, 0.386, 0.0026, 3, 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.fit_circle_lock.acquire()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Expr_L150_C12", "label": "append()", "type": "expression", "loc": [150, 150], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L148_C8", "vector": [8, 3, 0.3886, 0.0026, 3, 0.02, 0.0556, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.cartesian_pts_list.append(curr_pos.A1.tolist())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L151_C12", "label": "rad =", "type": "assigned_variable", "loc": [151, 151], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L148_C8", "vector": [14, 3, 0.3912, 0.0026, 3, 0.02, 0.1111, 439, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "rad", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rad = self.rad"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L152_C12", "label": "cx_start, cy_start =", "type": "assigned_variable", "loc": [152, 152], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L148_C8", "vector": [14, 3, 0.3938, 0.0026, 3, 0.02, 0.1667, 372, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "cx_start, cy_start", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cx_start, cy_start = self.cx_start, self.cy_start"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L153_C12", "label": "cz_start =", "type": "assigned_variable", "loc": [153, 153], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L148_C8", "vector": [14, 3, 0.3964, 0.0026, 3, 0.02, 0.2222, 322, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "cz_start", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cz_start = self.cz_start"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Expr_L154_C12", "label": "release()", "type": "expression", "loc": [154, 154], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L148_C8", "vector": [8, 3, 0.399, 0.0026, 3, 0.02, 0.2778, 784, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "release", "arg_names": [], "import_names": [], "rhs_call_name": "release", "annotation": ""}, "snippet": " self.fit_circle_lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L155_C12", "label": "cx, cy =", "type": "assigned_variable", "loc": [155, 155], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L148_C8", "vector": [14, 3, 0.4016, 0.0026, 3, 0.02, 0.3333, 959, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "cx, cy", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cx, cy = cx_start, cy_start"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L156_C12", "label": "cz =", "type": "assigned_variable", "loc": [156, 156], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L148_C8", "vector": [14, 3, 0.4041, 0.0026, 3, 0.02, 0.3889, 330, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "cz", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cz = cz_start"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L158_C12", "label": "radial_vec =", "type": "assigned_variable", "loc": [158, 158], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L148_C8", "vector": [14, 3, 0.4093, 0.0026, 3, 0.02, 0.4444, 253, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "radial_vec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " radial_vec = curr_pos_tl-np.matrix([cx,cy,cz]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L159_C12", "label": "radial_vec =", "type": "assigned_variable", "loc": [159, 159], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L148_C8", "vector": [14, 3, 0.4119, 0.0026, 3, 0.02, 0.5, 253, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "radial_vec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " radial_vec = radial_vec/np.linalg.norm(radial_vec)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L160_C12", "label": "if", "type": "if", "loc": [160, 163], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L148_C8", "vector": [4, 3, 0.4184, 0.0104, 3, 0.02, 0.5556, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if cy_start<start_pos[1,0]:\n tan_x,tan_y = -radial_vec[1,0],radial_vec[0,0]\n else:\n tan_x,tan_y = radial_vec[1,0],-radial_vec[0,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L161_C16", "label": "tan_x, tan_y =", "type": "assigned_variable", "loc": [161, 161], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L160_C12", "vector": [14, 4, 0.4171, 0.0026, 4, 0.2, 0.0, 33, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "tan_x, tan_y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tan_x,tan_y = -radial_vec[1,0],radial_vec[0,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L163_C16", "label": "tan_x, tan_y =", "type": "assigned_variable", "loc": [163, 163], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L160_C12", "vector": [14, 4, 0.4223, 0.0026, 4, 0.2, 1.0, 33, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "tan_x, tan_y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tan_x,tan_y = radial_vec[1,0],-radial_vec[0,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L165_C12", "label": "if", "type": "if", "loc": [165, 167], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L148_C8", "vector": [4, 3, 0.4301, 0.0078, 3, 0.02, 0.6111, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if tan_x > 0. and (start_pos[0,0]-curr_pos[0,0]) < 0.09:\n tan_x = -tan_x\n tan_y = -tan_y"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L166_C16", "label": "tan_x =", "type": "assigned_variable", "loc": [166, 166], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L165_C12", "vector": [14, 4, 0.4301, 0.0026, 4, 0.04, 0.0, 718, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "tan_x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tan_x = -tan_x"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L167_C16", "label": "tan_y =", "type": "assigned_variable", "loc": [167, 167], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L165_C12", "vector": [14, 4, 0.4326, 0.0026, 4, 0.04, 1.0, 936, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "tan_y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tan_y = -tan_y"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L169_C12", "label": "if", "type": "if", "loc": [169, 170], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L148_C8", "vector": [4, 3, 0.4391, 0.0052, 3, 0.02, 0.6667, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if cy_start > start_pos[1,0]:\n radial_vec = -radial_vec # axis to the left, want force in"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L170_C16", "label": "radial_vec =", "type": "assigned_variable", "loc": [170, 170], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L169_C12", "vector": [14, 4, 0.4404, 0.0026, 4, 0.04, 0.0, 253, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "radial_vec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " radial_vec = -radial_vec # axis to the left, want force in"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L172_C12", "label": "rv =", "type": "assigned_variable", "loc": [172, 172], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L148_C8", "vector": [14, 3, 0.4456, 0.0026, 3, 0.02, 0.7222, 222, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "rv", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rv = radial_vec"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L173_C12", "label": "force_vec =", "type": "assigned_variable", "loc": [173, 173], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L148_C8", "vector": [14, 3, 0.4482, 0.0026, 3, 0.02, 0.7778, 819, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "force_vec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " force_vec = np.matrix([rv[0,0], rv[1,0], 0.]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L174_C12", "label": "tangential_vec =", "type": "assigned_variable", "loc": [174, 174], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L148_C8", "vector": [14, 3, 0.4508, 0.0026, 3, 0.02, 0.8333, 367, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "tangential_vec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tangential_vec = np.matrix([tan_x, tan_y, 0.]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L176_C12", "label": "tangential_vec_ts =", "type": "assigned_variable", "loc": [176, 176], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L148_C8", "vector": [14, 3, 0.456, 0.0026, 3, 0.02, 0.8889, 833, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "tangential_vec_ts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tangential_vec_ts = tangential_vec"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L177_C12", "label": "radial_vec_ts =", "type": "assigned_variable", "loc": [177, 177], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L148_C8", "vector": [14, 3, 0.4585, 0.0026, 3, 0.02, 0.9444, 149, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "radial_vec_ts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " radial_vec_ts = radial_vec"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L178_C12", "label": "force_vec_ts =", "type": "assigned_variable", "loc": [178, 178], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L148_C8", "vector": [14, 3, 0.4611, 0.0026, 3, 0.02, 1.0, 900, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "force_vec_ts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " force_vec_ts = force_vec"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L180_C8", "label": "f_vec =", "type": "assigned_variable", "loc": [180, 181], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L103_C4", "vector": [14, 2, 0.4676, 0.0052, 2, 0.14, 0.3235, 231, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "f_vec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " f_vec = -1*np.array([wrist_force[0,0], wrist_force[1,0],\n wrist_force[2,0]])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L182_C8", "label": "f_rad_mag = dot()", "type": "assigned_variable", "loc": [182, 182], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L103_C4", "vector": [14, 2, 0.4715, 0.0026, 2, 0.14, 0.3529, 421, 3, 2, 0, 0, 310, 10, 1], "semantic": {"name": "f_rad_mag", "arg_names": [], "import_names": [], "rhs_call_name": "dot", "annotation": ""}, "snippet": " f_rad_mag = np.dot(f_vec, force_vec.A1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L183_C8", "label": "err =", "type": "assigned_variable", "loc": [183, 183], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L103_C4", "vector": [14, 2, 0.4741, 0.0026, 2, 0.14, 0.3824, 541, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "err", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " err = f_rad_mag-5."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L184_C8", "label": "if", "type": "if", "loc": [184, 187], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L103_C4", "vector": [4, 2, 0.4806, 0.0104, 2, 0.14, 0.4118, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if err>0.:\n kp = -0.1\n else:\n kp = -0.2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L185_C12", "label": "kp =", "type": "assigned_variable", "loc": [185, 185], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L184_C8", "vector": [14, 3, 0.4793, 0.0026, 3, 0.96, 0.0, 93, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "kp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " kp = -0.1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L187_C12", "label": "kp =", "type": "assigned_variable", "loc": [187, 187], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L184_C8", "vector": [14, 3, 0.4845, 0.0026, 3, 0.96, 1.0, 93, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "kp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " kp = -0.2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L188_C8", "label": "radial_motion_mag =", "type": "assigned_variable", "loc": [188, 188], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L103_C4", "vector": [14, 2, 0.487, 0.0026, 2, 0.14, 0.4412, 633, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "radial_motion_mag", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " radial_motion_mag = kp * err # radial_motion_mag in cm (depends on eq_motion step size)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L190_C8", "label": "if", "type": "if", "loc": [190, 194], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L103_C4", "vector": [4, 2, 0.4974, 0.013, 2, 0.14, 0.4706, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.use_rotation_center:\n if h_force_possible == False and parallel_to_floor:\n radial_motion_mag = 0.\n if v_force_possible == False and parallel_to_floor == False:\n radial_motion_mag = 0."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L191_C12", "label": "if", "type": "if", "loc": [191, 192], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L190_C8", "vector": [4, 3, 0.4961, 0.0052, 3, 0.24, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if h_force_possible == False and parallel_to_floor:\n radial_motion_mag = 0."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L192_C16", "label": "radial_motion_mag =", "type": "assigned_variable", "loc": [192, 192], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L191_C12", "vector": [14, 4, 0.4974, 0.0026, 4, 0.67, 0.0, 633, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "radial_motion_mag", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " radial_motion_mag = 0."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L193_C12", "label": "if", "type": "if", "loc": [193, 194], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L190_C8", "vector": [4, 3, 0.5013, 0.0052, 3, 0.24, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if v_force_possible == False and parallel_to_floor == False:\n radial_motion_mag = 0."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L194_C16", "label": "radial_motion_mag =", "type": "assigned_variable", "loc": [194, 194], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L193_C12", "vector": [14, 4, 0.5026, 0.0026, 4, 0.85, 0.0, 633, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "radial_motion_mag", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " radial_motion_mag = 0."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L196_C8", "label": "radial_motion_vec =", "type": "assigned_variable", "loc": [196, 196], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L103_C4", "vector": [14, 2, 0.5078, 0.0026, 2, 0.14, 0.5, 721, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "radial_motion_vec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " radial_motion_vec = force_vec * radial_motion_mag"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L197_C8", "label": "self.eq_motion_vec = copy()", "type": "assigned_variable", "loc": [197, 197], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L103_C4", "vector": [14, 2, 0.5104, 0.0026, 2, 0.14, 0.5294, 232, 3, 1, 0, 0, 739, 10, 1], "semantic": {"name": "self.eq_motion_vec", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " self.eq_motion_vec = copy.copy(tangential_vec)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L200_C8", "label": "self.prev_force_mag =", "type": "assigned_variable", "loc": [200, 200], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L103_C4", "vector": [14, 2, 0.5181, 0.0026, 2, 0.14, 0.5588, 497, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.prev_force_mag", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.prev_force_mag = mag"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L202_C8", "label": "if", "type": "if", "loc": [202, 203], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L103_C4", "vector": [4, 2, 0.5246, 0.0052, 2, 0.14, 0.5882, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.init_tangent_vector == None:\n self.init_tangent_vector = copy.copy(tangential_vec_ts)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L203_C12", "label": "self.init_tangent_vector = copy()", "type": "assigned_variable", "loc": [203, 203], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L202_C8", "vector": [14, 3, 0.5259, 0.0026, 3, 0.05, 0.0, 965, 3, 1, 0, 0, 739, 10, 1], "semantic": {"name": "self.init_tangent_vector", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " self.init_tangent_vector = copy.copy(tangential_vec_ts)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L204_C8", "label": "c = dot()", "type": "assigned_variable", "loc": [204, 204], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L103_C4", "vector": [14, 2, 0.5285, 0.0026, 2, 0.14, 0.6176, 411, 3, 2, 0, 0, 310, 10, 1], "semantic": {"name": "c", "arg_names": [], "import_names": [], "rhs_call_name": "dot", "annotation": ""}, "snippet": " c = np.dot(tangential_vec_ts.A1, self.init_tangent_vector.A1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L205_C8", "label": "ang = arccos()", "type": "assigned_variable", "loc": [205, 205], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L103_C4", "vector": [14, 2, 0.5311, 0.0026, 2, 0.14, 0.6471, 762, 3, 1, 0, 0, 793, 10, 1], "semantic": {"name": "ang", "arg_names": [], "import_names": [], "rhs_call_name": "arccos", "annotation": ""}, "snippet": " ang = np.arccos(c)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L207_C8", "label": "dist_moved = dot()", "type": "assigned_variable", "loc": [207, 207], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L103_C4", "vector": [14, 2, 0.5363, 0.0026, 2, 0.14, 0.6765, 696, 3, 2, 0, 0, 310, 10, 1], "semantic": {"name": "dist_moved", "arg_names": [], "import_names": [], "rhs_call_name": "dot", "annotation": ""}, "snippet": " dist_moved = np.dot((curr_pos - start_pos).A1, self.tangential_vec_ts.A1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L208_C8", "label": "ftan = abs()", "type": "assigned_variable", "loc": [208, 208], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L103_C4", "vector": [14, 2, 0.5389, 0.0026, 2, 0.14, 0.7059, 771, 3, 1, 0, 0, 799, 10, 2], "semantic": {"name": "ftan", "arg_names": [], "import_names": [], "rhs_call_name": "abs", "annotation": ""}, "snippet": " ftan = abs(np.dot(wrist_force.A1, tangential_vec.A1))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L209_C8", "label": "if", "type": "if", "loc": [209, 213], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L103_C4", "vector": [4, 2, 0.5466, 0.013, 2, 0.14, 0.7353, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if abs(dist_moved) > 0.09 and self.hooked_location_moved == False:\n # change the force threshold once the hook has started pulling.\n self.hooked_location_moved = True\n self.eq_force_threshold = ut.bound(mag+30.,20.,80.)\n self.ftan_threshold = self.ftan_threshold + max(10., 1.5*ftan)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L211_C12", "label": "self.hooked_location_moved =", "type": "assigned_variable", "loc": [211, 211], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L209_C8", "vector": [14, 3, 0.5466, 0.0026, 3, 0.62, 0.0, 183, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.hooked_location_moved", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.hooked_location_moved = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L212_C12", "label": "self.eq_force_threshold = bound()", "type": "assigned_variable", "loc": [212, 212], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L209_C8", "vector": [14, 3, 0.5492, 0.0026, 3, 0.62, 0.5, 675, 3, 3, 0, 0, 996, 10, 1], "semantic": {"name": "self.eq_force_threshold", "arg_names": [], "import_names": [], "rhs_call_name": "bound", "annotation": ""}, "snippet": " self.eq_force_threshold = ut.bound(mag+30.,20.,80.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L213_C12", "label": "self.ftan_threshold =", "type": "assigned_variable", "loc": [213, 213], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L209_C8", "vector": [14, 3, 0.5518, 0.0026, 3, 0.62, 1.0, 667, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.ftan_threshold", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.ftan_threshold = self.ftan_threshold + max(10., 1.5*ftan)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L214_C8", "label": "if", "type": "if", "loc": [214, 218], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L103_C4", "vector": [4, 2, 0.5596, 0.013, 2, 0.14, 0.7647, 0, 7, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.hooked_location_moved:\n if abs(tangential_vec_ts[2,0]) < 0.2 and ftan > self.ftan_threshold:\n stop = 'ftan threshold exceed: %f'%ftan\n else:\n self.ftan_threshold = max(self.ftan_threshold, ftan)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L215_C12", "label": "if", "type": "if", "loc": [215, 216], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L214_C8", "vector": [4, 3, 0.5583, 0.0052, 3, 0.16, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if abs(tangential_vec_ts[2,0]) < 0.2 and ftan > self.ftan_threshold:\n stop = 'ftan threshold exceed: %f'%ftan"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L216_C16", "label": "stop =", "type": "assigned_variable", "loc": [216, 216], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L215_C12", "vector": [14, 4, 0.5596, 0.0026, 4, 0.74, 0.0, 343, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " stop = 'ftan threshold exceed: %f'%ftan"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L218_C12", "label": "self.ftan_threshold = max()", "type": "assigned_variable", "loc": [218, 218], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L214_C8", "vector": [14, 3, 0.5648, 0.0026, 3, 0.16, 1.0, 667, 3, 2, 0, 0, 442, 10, 1], "semantic": {"name": "self.ftan_threshold", "arg_names": [], "import_names": [], "rhs_call_name": "max", "annotation": ""}, "snippet": " self.ftan_threshold = max(self.ftan_threshold, ftan)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L221_C8", "label": "if", "type": "if", "loc": [221, 227], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L103_C4", "vector": [4, 2, 0.5803, 0.0181, 2, 0.14, 0.7941, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.hooked_location_moved and ang > math.radians(90.):\n print('Angle:', math.degrees(ang))\n self.open_ang_exceed_count += 1\n if self.open_ang_exceed_count > 2:\n stop = 'opened mechanism through large angle: %.1f'%(math.degrees(ang))\n else:\n self.open_ang_exceed_count = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Expr_L222_C12", "label": "print()", "type": "expression", "loc": [222, 222], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L221_C8", "vector": [8, 3, 0.5751, 0.0026, 3, 0.64, 0.0, 535, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Angle:', math.degrees(ang))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L224_C12", "label": "if", "type": "if", "loc": [224, 225], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L221_C8", "vector": [4, 3, 0.5816, 0.0052, 3, 0.64, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.open_ang_exceed_count > 2:\n stop = 'opened mechanism through large angle: %.1f'%(math.degrees(ang))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L225_C16", "label": "stop =", "type": "assigned_variable", "loc": [225, 225], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L224_C12", "vector": [14, 4, 0.5829, 0.0026, 4, 0.38, 0.0, 343, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " stop = 'opened mechanism through large angle: %.1f'%(math.degrees(ang))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L227_C12", "label": "self.open_ang_exceed_count =", "type": "assigned_variable", "loc": [227, 227], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L221_C8", "vector": [14, 3, 0.5881, 0.0026, 3, 0.64, 1.0, 172, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.open_ang_exceed_count", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.open_ang_exceed_count = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Expr_L229_C8", "label": "append()", "type": "expression", "loc": [229, 229], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L103_C4", "vector": [8, 2, 0.5933, 0.0026, 2, 0.14, 0.8235, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.mech_time_list.append(time.time())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Expr_L230_C8", "label": "append()", "type": "expression", "loc": [230, 230], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L103_C4", "vector": [8, 2, 0.5959, 0.0026, 2, 0.14, 0.8529, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.mech_x_list.append(ang)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Expr_L231_C8", "label": "append()", "type": "expression", "loc": [231, 231], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L103_C4", "vector": [8, 2, 0.5984, 0.0026, 2, 0.14, 0.8824, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.f_rad_list.append(f_rad_mag)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Expr_L232_C8", "label": "append()", "type": "expression", "loc": [232, 232], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L103_C4", "vector": [8, 2, 0.601, 0.0026, 2, 0.14, 0.9118, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.f_tan_list.append(np.dot(f_vec, tangential_vec.A1))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Expr_L233_C8", "label": "append()", "type": "expression", "loc": [233, 233], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L103_C4", "vector": [8, 2, 0.6036, 0.0026, 2, 0.14, 0.9412, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.tan_vec_list.append(tangential_vec_ts.A1.tolist())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Expr_L234_C8", "label": "append()", "type": "expression", "loc": [234, 234], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L103_C4", "vector": [8, 2, 0.6062, 0.0026, 2, 0.14, 0.9706, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.rad_vec_list.append(force_vec_ts.A1.tolist())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Return_L236_C8", "label": "return", "type": "return", "loc": [236, 236], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L103_C4", "vector": [13, 2, 0.6114, 0.0026, 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 stop, q_eq"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L238_C4", "label": "pull", "type": "function", "loc": [238, 338], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:ClassDef_L24_C0", "vector": [2, 1, 0.7461, 0.2617, 1, 0.29, 0.8333, 964, 0, 7, 0, 0, 0, 0, 35], "semantic": {"name": "pull", "arg_names": ["self", "arm", "hook_angle", "force_threshold", "ea", "kinematics_estimation", "pull_left"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def pull(self, arm, hook_angle, force_threshold, ea,\n kinematics_estimation = 'rotation_center', pull_left = False):\n\n self.init_tangent_vector = None\n self.open_ang_exceed_count = 0.\n if kinematics_estimation == 'rotation_center':\n self.use_rotation_center = True\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L241_C8", "label": "self.init_tangent_vector =", "type": "assigned_variable", "loc": [241, 241], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L238_C4", "vector": [14, 2, 0.6244, 0.0026, 2, 0.85, 0.0, 965, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.init_tangent_vector", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.init_tangent_vector = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L242_C8", "label": "self.open_ang_exceed_count =", "type": "assigned_variable", "loc": [242, 242], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L238_C4", "vector": [14, 2, 0.6269, 0.0026, 2, 0.85, 0.0222, 172, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "self.open_ang_exceed_count", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.open_ang_exceed_count = 0."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L243_C8", "label": "if", "type": "if", "loc": [243, 246], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L238_C4", "vector": [4, 2, 0.6334, 0.0104, 2, 0.85, 0.0444, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if kinematics_estimation == 'rotation_center':\n self.use_rotation_center = True\n else:\n self.use_rotation_center = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L244_C12", "label": "self.use_rotation_center =", "type": "assigned_variable", "loc": [244, 244], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L243_C8", "vector": [14, 3, 0.6321, 0.0026, 3, 0.57, 0.0, 815, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.use_rotation_center", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.use_rotation_center = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L246_C12", "label": "self.use_rotation_center =", "type": "assigned_variable", "loc": [246, 246], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L243_C8", "vector": [14, 3, 0.6373, 0.0026, 3, 0.57, 1.0, 815, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.use_rotation_center", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.use_rotation_center = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L248_C8", "label": "if", "type": "if", "loc": [248, 251], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L238_C4", "vector": [4, 2, 0.6464, 0.0104, 2, 0.85, 0.0667, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if kinematics_estimation == 'jacobian':\n self.use_jacobian = True\n else:\n self.use_jacobian = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L249_C12", "label": "self.use_jacobian =", "type": "assigned_variable", "loc": [249, 249], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L248_C8", "vector": [14, 3, 0.6451, 0.0026, 3, 0.0, 0.0, 708, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.use_jacobian", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.use_jacobian = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L251_C12", "label": "self.use_jacobian =", "type": "assigned_variable", "loc": [251, 251], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L248_C8", "vector": [14, 3, 0.6503, 0.0026, 3, 0.0, 1.0, 708, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.use_jacobian", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.use_jacobian = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L254_C8", "label": "rot_mat = rot_mat_from_angles()", "type": "assigned_variable", "loc": [254, 254], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L238_C4", "vector": [14, 2, 0.658, 0.0026, 2, 0.85, 0.0889, 968, 3, 2, 0, 0, 428, 10, 1], "semantic": {"name": "rot_mat", "arg_names": [], "import_names": [], "rhs_call_name": "rot_mat_from_angles", "annotation": ""}, "snippet": " rot_mat = rot_mat_from_angles(hook_angle, surface_angle)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L256_C8", "label": "time_dict =", "type": "assigned_variable", "loc": [256, 256], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L238_C4", "vector": [14, 2, 0.6632, 0.0026, 2, 0.85, 0.1111, 361, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "time_dict", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " time_dict = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L257_C8", "label": " = time()", "type": "assigned_variable", "loc": [257, 257], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L238_C4", "vector": [14, 2, 0.6658, 0.0026, 2, 0.85, 0.1333, 0, 3, 0, 0, 0, 654, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "time", "annotation": ""}, "snippet": " time_dict['before_pull'] = time.time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L259_C8", "label": "self.pull_trajectory = JointTrajectory()", "type": "assigned_variable", "loc": [259, 259], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L238_C4", "vector": [14, 2, 0.671, 0.0026, 2, 0.85, 0.1556, 663, 3, 0, 0, 0, 302, 10, 1], "semantic": {"name": "self.pull_trajectory", "arg_names": [], "import_names": [], "rhs_call_name": "JointTrajectory", "annotation": ""}, "snippet": " self.pull_trajectory = at.JointTrajectory()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L260_C8", "label": "self.eq_pt_trajectory = JointTrajectory()", "type": "assigned_variable", "loc": [260, 260], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L238_C4", "vector": [14, 2, 0.6736, 0.0026, 2, 0.85, 0.1778, 70, 3, 0, 0, 0, 302, 10, 1], "semantic": {"name": "self.eq_pt_trajectory", "arg_names": [], "import_names": [], "rhs_call_name": "JointTrajectory", "annotation": ""}, "snippet": " self.eq_pt_trajectory = at.JointTrajectory()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L261_C8", "label": "self.force_trajectory = ForceTrajectory()", "type": "assigned_variable", "loc": [261, 261], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L238_C4", "vector": [14, 2, 0.6762, 0.0026, 2, 0.85, 0.2, 198, 3, 0, 0, 0, 306, 10, 1], "semantic": {"name": "self.force_trajectory", "arg_names": [], "import_names": [], "rhs_call_name": "ForceTrajectory", "annotation": ""}, "snippet": " self.force_trajectory = at.ForceTrajectory()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Expr_L263_C8", "label": "step()", "type": "expression", "loc": [263, 263], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L238_C4", "vector": [8, 2, 0.6813, 0.0026, 2, 0.85, 0.2222, 880, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "step", "arg_names": [], "import_names": [], "rhs_call_name": "step", "annotation": ""}, "snippet": " self.robot.step()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L264_C8", "label": "start_config = get_joint_angles()", "type": "assigned_variable", "loc": [264, 264], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L238_C4", "vector": [14, 2, 0.6839, 0.0026, 2, 0.85, 0.2444, 689, 3, 1, 0, 0, 820, 10, 1], "semantic": {"name": "start_config", "arg_names": [], "import_names": [], "rhs_call_name": "get_joint_angles", "annotation": ""}, "snippet": " start_config = self.robot.get_joint_angles(arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L266_C8", "label": "self.eq_force_threshold =", "type": "assigned_variable", "loc": [266, 266], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L238_C4", "vector": [14, 2, 0.6891, 0.0026, 2, 0.85, 0.2667, 675, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.eq_force_threshold", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.eq_force_threshold = force_threshold"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L267_C8", "label": "self.ftan_threshold =", "type": "assigned_variable", "loc": [267, 267], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L238_C4", "vector": [14, 2, 0.6917, 0.0026, 2, 0.85, 0.2889, 667, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "self.ftan_threshold", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.ftan_threshold = 2."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L268_C8", "label": "self.hooked_location_moved =", "type": "assigned_variable", "loc": [268, 268], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L238_C4", "vector": [14, 2, 0.6943, 0.0026, 2, 0.85, 0.3111, 183, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.hooked_location_moved", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.hooked_location_moved = False # flag to indicate when the hooking location started moving."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L269_C8", "label": "self.prev_force_mag = norm()", "type": "assigned_variable", "loc": [269, 269], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L238_C4", "vector": [14, 2, 0.6969, 0.0026, 2, 0.85, 0.3333, 497, 3, 1, 0, 0, 902, 10, 2], "semantic": {"name": "self.prev_force_mag", "arg_names": [], "import_names": [], "rhs_call_name": "norm", "annotation": ""}, "snippet": " self.prev_force_mag = np.linalg.norm(self.robot.get_wrist_force(arm))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L270_C8", "label": "self.eq_motion_vec =", "type": "assigned_variable", "loc": [270, 270], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L238_C4", "vector": [14, 2, 0.6995, 0.0026, 2, 0.85, 0.3556, 232, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.eq_motion_vec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.eq_motion_vec = np.matrix([-1.,0.,0.]).T # might want to change this to account for the surface_angle."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L271_C8", "label": "self.slip_count =", "type": "assigned_variable", "loc": [271, 271], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L238_C4", "vector": [14, 2, 0.7021, 0.0026, 2, 0.85, 0.3778, 338, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.slip_count", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.slip_count = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L273_C8", "label": "self.eq_pt_cartesian = FK()", "type": "assigned_variable", "loc": [273, 273], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L238_C4", "vector": [14, 2, 0.7073, 0.0026, 2, 0.85, 0.4, 13, 3, 2, 0, 0, 252, 10, 1], "semantic": {"name": "self.eq_pt_cartesian", "arg_names": [], "import_names": [], "rhs_call_name": "FK", "annotation": ""}, "snippet": " self.eq_pt_cartesian = self.robot.FK(arm, ea)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L274_C8", "label": "self.eq_pt_cartesian_ts = FK()", "type": "assigned_variable", "loc": [274, 274], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L238_C4", "vector": [14, 2, 0.7098, 0.0026, 2, 0.85, 0.4222, 892, 3, 2, 0, 0, 252, 10, 1], "semantic": {"name": "self.eq_pt_cartesian_ts", "arg_names": [], "import_names": [], "rhs_call_name": "FK", "annotation": ""}, "snippet": " self.eq_pt_cartesian_ts = self.robot.FK(arm, ea)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L275_C8", "label": "self.start_pos = copy()", "type": "assigned_variable", "loc": [275, 275], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L238_C4", "vector": [14, 2, 0.7124, 0.0026, 2, 0.85, 0.4444, 90, 3, 1, 0, 0, 739, 10, 1], "semantic": {"name": "self.start_pos", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " self.start_pos = copy.copy(self.eq_pt_cartesian)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L276_C8", "label": "self.q_guess =", "type": "assigned_variable", "loc": [276, 276], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L238_C4", "vector": [14, 2, 0.715, 0.0026, 2, 0.85, 0.4667, 495, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.q_guess", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.q_guess = ea"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L278_C8", "label": "if", "type": "if", "loc": [278, 285], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L238_C4", "vector": [4, 2, 0.7293, 0.0207, 2, 0.85, 0.4889, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not pull_left:\n self.tangential_vec_ts = np.matrix([-1.,0.,0.]).T\n self.constraint_vec_2_ts = np.matrix([0.,0.,1.]).T\n self.constraint_vec_1_ts = np.matrix([0.,1.,0.]).T\n else:\n self.tangential_vec_ts = np.matrix([0.,1.,0.]).T\n self.constraint_vec_2_ts = np.matrix([0.,0.,1.]).T\n self.constraint_vec_1_ts = np.matrix([1.,0.,0.]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L279_C12", "label": "self.tangential_vec_ts =", "type": "assigned_variable", "loc": [279, 279], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L278_C8", "vector": [14, 3, 0.7228, 0.0026, 3, 0.58, 0.0, 691, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.tangential_vec_ts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.tangential_vec_ts = np.matrix([-1.,0.,0.]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L280_C12", "label": "self.constraint_vec_2_ts =", "type": "assigned_variable", "loc": [280, 280], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L278_C8", "vector": [14, 3, 0.7254, 0.0026, 3, 0.58, 0.2, 313, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.constraint_vec_2_ts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.constraint_vec_2_ts = np.matrix([0.,0.,1.]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L281_C12", "label": "self.constraint_vec_1_ts =", "type": "assigned_variable", "loc": [281, 281], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L278_C8", "vector": [14, 3, 0.728, 0.0026, 3, 0.58, 0.4, 356, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.constraint_vec_1_ts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.constraint_vec_1_ts = np.matrix([0.,1.,0.]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L283_C12", "label": "self.tangential_vec_ts =", "type": "assigned_variable", "loc": [283, 283], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L278_C8", "vector": [14, 3, 0.7332, 0.0026, 3, 0.58, 0.6, 691, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.tangential_vec_ts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.tangential_vec_ts = np.matrix([0.,1.,0.]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L284_C12", "label": "self.constraint_vec_2_ts =", "type": "assigned_variable", "loc": [284, 284], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L278_C8", "vector": [14, 3, 0.7358, 0.0026, 3, 0.58, 0.8, 313, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.constraint_vec_2_ts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.constraint_vec_2_ts = np.matrix([0.,0.,1.]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L285_C12", "label": "self.constraint_vec_1_ts =", "type": "assigned_variable", "loc": [285, 285], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L278_C8", "vector": [14, 3, 0.7383, 0.0026, 3, 0.58, 1.0, 356, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.constraint_vec_1_ts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.constraint_vec_1_ts = np.matrix([1.,0.,0.]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L287_C8", "label": "self.mech_time_list =", "type": "assigned_variable", "loc": [287, 287], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L238_C4", "vector": [14, 2, 0.7435, 0.0026, 2, 0.85, 0.5111, 543, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.mech_time_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.mech_time_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L288_C8", "label": "self.mech_x_list =", "type": "assigned_variable", "loc": [288, 288], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L238_C4", "vector": [14, 2, 0.7461, 0.0026, 2, 0.85, 0.5333, 121, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.mech_x_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.mech_x_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L289_C8", "label": "self.f_rad_list =", "type": "assigned_variable", "loc": [289, 289], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L238_C4", "vector": [14, 2, 0.7487, 0.0026, 2, 0.85, 0.5556, 834, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.f_rad_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.f_rad_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L290_C8", "label": "self.f_tan_list =", "type": "assigned_variable", "loc": [290, 290], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L238_C4", "vector": [14, 2, 0.7513, 0.0026, 2, 0.85, 0.5778, 945, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.f_tan_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.f_tan_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L291_C8", "label": "self.tan_vec_list =", "type": "assigned_variable", "loc": [291, 291], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L238_C4", "vector": [14, 2, 0.7539, 0.0026, 2, 0.85, 0.6, 243, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.tan_vec_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.tan_vec_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L292_C8", "label": "self.rad_vec_list =", "type": "assigned_variable", "loc": [292, 292], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L238_C4", "vector": [14, 2, 0.7565, 0.0026, 2, 0.85, 0.6222, 596, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.rad_vec_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.rad_vec_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L294_C8", "label": "self.cartesian_pts_list =", "type": "assigned_variable", "loc": [294, 294], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L238_C4", "vector": [14, 2, 0.7617, 0.0026, 2, 0.85, 0.6444, 692, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.cartesian_pts_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.cartesian_pts_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L295_C8", "label": "ee_pos = end_effector_pos()", "type": "assigned_variable", "loc": [295, 295], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L238_C4", "vector": [14, 2, 0.7642, 0.0026, 2, 0.85, 0.6667, 354, 3, 1, 0, 0, 889, 10, 1], "semantic": {"name": "ee_pos", "arg_names": [], "import_names": [], "rhs_call_name": "end_effector_pos", "annotation": ""}, "snippet": " ee_pos = self.robot.end_effector_pos(arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L297_C8", "label": "if", "type": "if", "loc": [297, 304], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L238_C4", "vector": [4, 2, 0.7785, 0.0207, 2, 0.85, 0.6889, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.use_rotation_center:\n # this might have to change depending on left and right\n # arm? or maybe not since the right arm can open both\n # doors.\n self.cx_start = ee_pos[0,0]\n self.cy_start = ee_pos[1,0]-1.0\n self.cz_start = ee_pos[2,0]\n self.rad = 5.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L301_C12", "label": "self.cx_start =", "type": "assigned_variable", "loc": [301, 301], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L297_C8", "vector": [14, 3, 0.7798, 0.0026, 3, 0.16, 0.0, 939, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.cx_start", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.cx_start = ee_pos[0,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L302_C12", "label": "self.cy_start =", "type": "assigned_variable", "loc": [302, 302], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L297_C8", "vector": [14, 3, 0.7824, 0.0026, 3, 0.16, 0.3333, 418, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.cy_start", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.cy_start = ee_pos[1,0]-1.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L303_C12", "label": "self.cz_start =", "type": "assigned_variable", "loc": [303, 303], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L297_C8", "vector": [14, 3, 0.785, 0.0026, 3, 0.16, 0.6667, 113, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.cz_start", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.cz_start = ee_pos[2,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L304_C12", "label": "self.rad =", "type": "assigned_variable", "loc": [304, 304], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L297_C8", "vector": [14, 3, 0.7876, 0.0026, 3, 0.16, 1.0, 240, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "self.rad", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.rad = 5.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L306_C8", "label": "h_force_possible =", "type": "assigned_variable", "loc": [306, 306], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L238_C4", "vector": [14, 2, 0.7927, 0.0026, 2, 0.85, 0.7111, 834, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "h_force_possible", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " h_force_possible = abs(hook_angle) < math.radians(30.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L307_C8", "label": "v_force_possible =", "type": "assigned_variable", "loc": [307, 307], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L238_C4", "vector": [14, 2, 0.7953, 0.0026, 2, 0.85, 0.7333, 61, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "v_force_possible", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " v_force_possible = abs(hook_angle) > math.radians(60.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L308_C8", "label": "arg_list =", "type": "assigned_variable", "loc": [308, 308], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L238_C4", "vector": [14, 2, 0.7979, 0.0026, 2, 0.85, 0.7556, 873, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "arg_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " arg_list = [arm, rot_mat, h_force_possible, v_force_possible, cep_vel]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L309_C8", "label": "result, jep = epc_motion()", "type": "assigned_variable", "loc": [309, 310], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L238_C4", "vector": [14, 2, 0.8018, 0.0052, 2, 0.85, 0.7778, 719, 3, 5, 0, 0, 938, 10, 1], "semantic": {"name": "result, jep", "arg_names": [], "import_names": [], "rhs_call_name": "epc_motion", "annotation": ""}, "snippet": " result, jep = self.epc_motion(self.eqpt_gen_control_radial_force,\n 0.1, arm, arg_list, self.log_state)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Expr_L312_C8", "label": "print()", "type": "expression", "loc": [312, 312], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L238_C4", "vector": [8, 2, 0.8083, 0.0026, 2, 0.85, 0.8, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('EPC motion result:', result)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Expr_L313_C8", "label": "print()", "type": "expression", "loc": [313, 313], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L238_C4", "vector": [8, 2, 0.8109, 0.0026, 2, 0.85, 0.8222, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Original force threshold:', force_threshold)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Expr_L314_C8", "label": "print()", "type": "expression", "loc": [314, 314], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L238_C4", "vector": [8, 2, 0.8135, 0.0026, 2, 0.85, 0.8444, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Adapted force threshold:', self.eq_force_threshold)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Expr_L315_C8", "label": "print()", "type": "expression", "loc": [315, 315], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L238_C4", "vector": [8, 2, 0.8161, 0.0026, 2, 0.85, 0.8667, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Adapted ftan threshold:', self.ftan_threshold)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L317_C8", "label": " = time()", "type": "assigned_variable", "loc": [317, 317], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L238_C4", "vector": [14, 2, 0.8212, 0.0026, 2, 0.85, 0.8889, 0, 3, 0, 0, 0, 654, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "time", "annotation": ""}, "snippet": " time_dict['after_pull'] = time.time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L319_C8", "label": "d =", "type": "assigned_variable", "loc": [319, 325], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L238_C4", "vector": [14, 2, 0.8342, 0.0181, 2, 0.85, 0.9111, 355, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " d = {'actual': self.pull_trajectory, 'eq_pt': self.eq_pt_trajectory,\n 'force': self.force_trajectory, 'torque': self.jt_torque_trajectory,\n 'info': info_string, 'force_threshold': force_threshold,\n 'eq_force_threshold': self.eq_force_threshold, 'hook_angle':hook_angle,\n 'result':result, 'time_dict':time_dict,\n 'cep_vel': cep_vel,\n 'ftan_threshold': self.ftan_threshold}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Expr_L327_C8", "label": "step()", "type": "expression", "loc": [327, 327], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L238_C4", "vector": [8, 2, 0.8472, 0.0026, 2, 0.85, 0.9333, 880, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "step", "arg_names": [], "import_names": [], "rhs_call_name": "step", "annotation": ""}, "snippet": " self.robot.step()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Expr_L329_C8", "label": "save_pickle()", "type": "expression", "loc": [329, 329], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L238_C4", "vector": [8, 2, 0.8523, 0.0026, 2, 0.85, 0.9556, 390, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "save_pickle", "arg_names": [], "import_names": [], "rhs_call_name": "save_pickle", "annotation": ""}, "snippet": " ut.save_pickle(d,'pull_trajectories_'+d['info']+'_'+ut.formatted_time()+'.pkl')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L331_C8", "label": "dd =", "type": "assigned_variable", "loc": [331, 337], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L238_C4", "vector": [14, 2, 0.8653, 0.0181, 2, 0.85, 0.9778, 119, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "dd", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " dd = {'mechanism_x': self.mech_x_list,\n 'mechanism_time': self.mech_time_list,\n 'force_rad_list': self.f_rad_list,\n 'force_tan_list': self.f_tan_list,\n 'tan_vec_list': self.tan_vec_list,\n 'rad_vec_list': self.rad_vec_list\n }"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Expr_L338_C8", "label": "save_pickle()", "type": "expression", "loc": [338, 338], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L238_C4", "vector": [8, 2, 0.8756, 0.0026, 2, 0.85, 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(dd,'mechanism_trajectories_robot_'+d['info']+'_'+ut.formatted_time()+'.pkl')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L347_C4", "label": "search_and_hook", "type": "function", "loc": [347, 379], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:ClassDef_L24_C0", "vector": [2, 1, 0.9404, 0.0855, 1, 0.29, 1.0, 913, 0, 6, 1, 0, 0, 0, 12], "semantic": {"name": "search_and_hook", "arg_names": ["self", "arm", "hook_angle", "hook_loc", "angle", "hooking_force_threshold"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def search_and_hook(self, arm, hook_angle, hook_loc, angle,\n hooking_force_threshold = 5.):\n\n rot_mat = rot_mat_from_angles(hook_angle, angle)\n if arm == 'right_arm':\n hook_dir = np.matrix([0.,1.,0.]).T # hook direc in home position\n elif arm == 'left_arm':\n hook_dir = np.matrix([0.,-1.,0.]).T # hook direc in home position"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L350_C8", "label": "rot_mat = rot_mat_from_angles()", "type": "assigned_variable", "loc": [350, 350], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L347_C4", "vector": [14, 2, 0.9067, 0.0026, 2, 0.16, 0.0, 968, 3, 2, 0, 0, 428, 10, 1], "semantic": {"name": "rot_mat", "arg_names": [], "import_names": [], "rhs_call_name": "rot_mat_from_angles", "annotation": ""}, "snippet": " rot_mat = rot_mat_from_angles(hook_angle, angle)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L351_C8", "label": "if", "type": "if", "loc": [351, 356], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L347_C4", "vector": [4, 2, 0.9158, 0.0155, 2, 0.16, 0.0667, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if arm == 'right_arm':\n hook_dir = np.matrix([0.,1.,0.]).T # hook direc in home position\n elif arm == 'left_arm':\n hook_dir = np.matrix([0.,-1.,0.]).T # hook direc in home position\n else:\n raise RuntimeError('Unknown arm: %s', arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L352_C12", "label": "hook_dir =", "type": "assigned_variable", "loc": [352, 352], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L351_C8", "vector": [14, 3, 0.9119, 0.0026, 3, 0.94, 0.0, 95, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "hook_dir", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " hook_dir = np.matrix([0.,1.,0.]).T # hook direc in home position"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L353_C8", "label": "if", "type": "if", "loc": [353, 356], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L351_C8", "vector": [4, 3, 0.9184, 0.0104, 3, 0.94, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif arm == 'left_arm':\n hook_dir = np.matrix([0.,-1.,0.]).T # hook direc in home position\n else:\n raise RuntimeError('Unknown arm: %s', arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L354_C12", "label": "hook_dir =", "type": "assigned_variable", "loc": [354, 354], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L353_C8", "vector": [14, 4, 0.9171, 0.0026, 4, 0.14, 0.0, 95, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "hook_dir", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " hook_dir = np.matrix([0.,-1.,0.]).T # hook direc in home position"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L357_C8", "label": "start_loc =", "type": "assigned_variable", "loc": [357, 357], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L347_C4", "vector": [14, 2, 0.9249, 0.0026, 2, 0.16, 0.1333, 912, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "start_loc", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " start_loc = hook_loc + rot_mat.T * hook_dir * -0.03 # 3cm direc opposite to hook."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L360_C8", "label": "normal_tl =", "type": "assigned_variable", "loc": [360, 360], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L347_C4", "vector": [14, 2, 0.9326, 0.0026, 2, 0.16, 0.2, 601, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "normal_tl", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " normal_tl = tr.Rz(-angle) * np.matrix([1.0,0.,0.]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L362_C8", "label": "pt1 =", "type": "assigned_variable", "loc": [362, 362], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L347_C4", "vector": [14, 2, 0.9378, 0.0026, 2, 0.16, 0.2667, 211, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pt1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pt1 = start_loc - normal_tl * 0.1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Expr_L364_C8", "label": "go_cartesian()", "type": "expression", "loc": [364, 364], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L347_C4", "vector": [8, 2, 0.943, 0.0026, 2, 0.16, 0.3333, 840, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "go_cartesian", "arg_names": [], "import_names": [], "rhs_call_name": "go_cartesian", "annotation": ""}, "snippet": " self.robot.go_cartesian(arm, pt1, rot_mat, speed=0.2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L366_C8", "label": "vec =", "type": "assigned_variable", "loc": [366, 366], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L347_C4", "vector": [14, 2, 0.9482, 0.0026, 2, 0.16, 0.4, 132, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "vec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " vec = normal_tl * 0.2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L367_C8", "label": "s, jep = move_till_hit()", "type": "assigned_variable", "loc": [367, 368], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L347_C4", "vector": [14, 2, 0.9521, 0.0052, 2, 0.16, 0.4667, 962, 3, 5, 0, 0, 163, 10, 1], "semantic": {"name": "s, jep", "arg_names": [], "import_names": [], "rhs_call_name": "move_till_hit", "annotation": ""}, "snippet": " s, jep = self.firenze.move_till_hit(arm, vec=vec, force_threshold=2.0,\n rot=rot_mat, speed=0.07)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L370_C8", "label": "self.eq_pt_cartesian = FK()", "type": "assigned_variable", "loc": [370, 370], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L347_C4", "vector": [14, 2, 0.9585, 0.0026, 2, 0.16, 0.5333, 13, 3, 2, 0, 0, 252, 10, 1], "semantic": {"name": "self.eq_pt_cartesian", "arg_names": [], "import_names": [], "rhs_call_name": "FK", "annotation": ""}, "snippet": " self.eq_pt_cartesian = self.firenze.FK(arm, jep)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L371_C8", "label": "self.eq_pt_cartesian_ts = FK()", "type": "assigned_variable", "loc": [371, 371], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L347_C4", "vector": [14, 2, 0.9611, 0.0026, 2, 0.16, 0.6, 892, 3, 2, 0, 0, 252, 10, 1], "semantic": {"name": "self.eq_pt_cartesian_ts", "arg_names": [], "import_names": [], "rhs_call_name": "FK", "annotation": ""}, "snippet": " self.eq_pt_cartesian_ts = self.firenze.FK(arm, jep)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L372_C8", "label": "self.start_pos = copy()", "type": "assigned_variable", "loc": [372, 372], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L347_C4", "vector": [14, 2, 0.9637, 0.0026, 2, 0.16, 0.6667, 90, 3, 1, 0, 0, 739, 10, 1], "semantic": {"name": "self.start_pos", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " self.start_pos = copy.copy(self.eq_pt_cartesian)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L373_C8", "label": "self.q_guess =", "type": "assigned_variable", "loc": [373, 373], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L347_C4", "vector": [14, 2, 0.9663, 0.0026, 2, 0.16, 0.7333, 495, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.q_guess", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.q_guess = jep"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L374_C8", "label": "move_dir =", "type": "assigned_variable", "loc": [374, 374], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L347_C4", "vector": [14, 2, 0.9689, 0.0026, 2, 0.16, 0.8, 21, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "move_dir", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " move_dir = rot_mat.T * hook_dir"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L376_C8", "label": "arg_list =", "type": "assigned_variable", "loc": [376, 376], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L347_C4", "vector": [14, 2, 0.9741, 0.0026, 2, 0.16, 0.8667, 873, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "arg_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " arg_list = [arm, move_dir, rot_mat, hooking_force_threshold]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L377_C8", "label": "s, jep = compliant_motion()", "type": "assigned_variable", "loc": [377, 378], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L347_C4", "vector": [14, 2, 0.978, 0.0052, 2, 0.16, 0.9333, 962, 3, 4, 0, 0, 584, 10, 1], "semantic": {"name": "s, jep", "arg_names": [], "import_names": [], "rhs_call_name": "compliant_motion", "annotation": ""}, "snippet": " s, jep = self.compliant_motion(self.equi_generator_surface_follow, 0.05,\n arm, arg_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Return_L379_C8", "label": "return", "type": "return", "loc": [379, 379], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L347_C4", "vector": [13, 2, 0.9819, 0.0026, 2, 0.16, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return s, jep"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L382_C0", "label": "if", "type": "if", "loc": [382, 384], "level": 0, "parent": null, "vector": [4, 0, 0.9922, 0.0078, 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\n print('Hello World')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99612:Expr_L384_C4", "label": "print()", "type": "expression", "loc": [384, 384], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L382_C0", "vector": [8, 1, 0.9948, 0.0026, 1, 0.62, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Hello World')"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Return_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L25_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Expr_L26_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L25_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L28_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L25_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L29_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L25_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Expr_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L25_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Expr_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L25_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L37_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L25_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L38_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L41_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L42_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L43_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Expr_L45_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Expr_L46_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Expr_L48_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Expr_L49_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L51_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Expr_L52_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Expr_L53_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Return_L54_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L62_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L63_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L64_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L65_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L66_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L67_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L68_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Return_L69_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L71_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L71_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L72_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L71_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L73_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L73_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L74_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L71_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L76_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L71_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L77_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L71_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Expr_L78_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L71_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L79_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L79_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L80_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L71_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L82_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L82_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L83_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L83_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L84_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L82_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L89_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L71_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L91_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L91_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L92_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L71_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Return_L93_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L103_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L103_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Expr_L105_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L103_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L106_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L103_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L107_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L103_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L109_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L103_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L111_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L103_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L112_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L103_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L114_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L103_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L115_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L115_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L116_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L115_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L118_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L103_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Expr_L121_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L103_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L124_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L124_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Expr_L125_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L124_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Expr_L127_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L124_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L128_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L124_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L129_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L124_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L133_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L133_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L134_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L124_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L135_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L135_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L136_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L124_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L137_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L124_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L138_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L138_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L139_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L124_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L140_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L140_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L141_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L124_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Expr_L143_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L124_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L145_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L124_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L146_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L103_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L148_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L148_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Expr_L149_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L148_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Expr_L150_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L148_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L151_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L148_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L152_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L148_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L153_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L148_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Expr_L154_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L148_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L155_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L148_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L156_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L148_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L158_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L148_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L159_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L148_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L160_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L160_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L161_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L160_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L163_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L148_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L165_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L165_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L166_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L165_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L167_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L148_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L169_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L169_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L170_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L148_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L172_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L148_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L173_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L148_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L174_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L148_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L176_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L148_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L177_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L148_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L178_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L103_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L180_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L103_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L182_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L103_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L183_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L103_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L184_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L184_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L185_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L184_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L187_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L103_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L188_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L103_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L190_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L190_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L191_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L191_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L192_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L190_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L193_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L193_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L194_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L103_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L196_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L103_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L197_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L103_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L200_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L103_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L202_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L202_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L203_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L103_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L204_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L103_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L205_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L103_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L207_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L103_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L208_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L103_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L209_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L209_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L211_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L209_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L212_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L209_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L213_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L103_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L214_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L214_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L215_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L215_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L216_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L214_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L218_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L103_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L221_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L221_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Expr_L222_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L221_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L224_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L224_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L225_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L221_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L227_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L103_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Expr_L229_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L103_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Expr_L230_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L103_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Expr_L231_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L103_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Expr_L232_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L103_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Expr_L233_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L103_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Expr_L234_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L103_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Return_L236_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L238_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L238_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L241_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L238_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L242_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L238_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L243_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L243_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L244_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L243_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L246_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L238_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L248_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L248_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L249_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L248_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L251_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L238_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L254_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L238_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L256_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L238_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L257_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L238_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L259_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L238_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L260_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L238_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L261_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L238_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Expr_L263_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L238_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L264_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L238_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L266_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L238_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L267_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L238_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L268_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L238_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L269_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L238_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L270_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L238_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L271_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L238_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L273_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L238_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L274_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L238_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L275_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L238_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L276_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L238_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L278_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L278_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L279_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L278_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L280_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L278_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L281_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L278_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L283_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L278_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L284_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L278_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L285_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L238_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L287_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L238_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L288_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L238_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L289_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L238_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L290_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L238_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L291_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L238_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L292_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L238_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L294_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L238_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L295_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L238_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L297_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L297_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L301_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L297_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L302_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L297_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L303_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L297_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L304_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L238_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L306_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L238_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L307_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L238_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L308_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L238_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L309_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L238_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Expr_L312_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L238_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Expr_L313_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L238_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Expr_L314_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L238_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Expr_L315_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L238_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L317_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L238_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L319_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L238_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Expr_L327_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L238_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Expr_L329_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L238_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L331_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L238_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Expr_L338_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L347_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L347_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L350_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L347_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L351_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L351_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L352_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L351_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L353_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L353_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L354_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L347_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L357_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L347_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L360_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L347_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L362_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L347_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Expr_L364_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L347_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L366_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L347_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L367_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L347_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L370_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L347_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L371_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L347_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L372_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L347_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L373_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L347_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L374_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L347_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L376_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L347_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Assign_L377_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:FunctionDef_L347_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Return_L379_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99612:If_L382_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99612:Expr_L384_C4"}]
__all__ = [ 'door_epc', 'epc', 'hrl_pr2', ]
ajibawa-2023/Python-Code-Large/train/row_99613
1
8
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99613:Assign_L3_C0", "label": "__all__ =", "type": "assigned_variable", "loc": [3, 7], "level": 0, "parent": null, "vector": [14, 0, 0.625, 0.625, 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'door_epc',\n'epc',\n'hrl_pr2',\n]"}]
[]
import roslib; roslib.load_manifest('hrl_pr2_kinematics_tutorials') import rospy from visualization_msgs.msg import Marker from geometry_msgs.msg import Point import hrl_lib.transforms as tr import math, numpy as np def get_marker_arrow(p_st, p_end, frame_id): m = Marker() m.header.stamp = rospy.rostime.get_rostime() m.header.frame_id = frame_id m.ns = 'basic_shapes' m.id = 0 m.type = Marker.ARROW m.action = Marker.ADD pt1 = Point(p_st[0,0], p_st[1,0], p_st[2,0]) pt2 = Point(p_end[0,0], p_end[1,0], p_end[2,0]) m.points.append(pt1) m.points.append(pt2) m.scale.x = 0.02; m.scale.y = 0.05; m.scale.z = 0.1; m.color.r = 1.0; m.color.g = 0.0; m.color.b = 0.0; m.color.a = 1.0; m.lifetime = rospy.Duration(); return m if __name__ == '__main__': rospy.init_node('marker_test', anonymous = True) marker_pub = rospy.Publisher('/test_marker', Marker) p1 = np.matrix([0.,0.,0.]).T p2 = np.matrix([0.,1.,0.]).T while not rospy.is_shutdown(): marker = get_marker_arrow(p1, p2, 'base_link') marker_pub.publish(marker) rospy.sleep(0.1)
ajibawa-2023/Python-Code-Large/train/row_99614
37
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_99614:Import_L2_C0", "label": "roslib import roslib", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0408, 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; roslib.load_manifest('hrl_pr2_kinematics_tutorials')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99614:Expr_L2_C15", "label": "load_manifest()", "type": "expression", "loc": [2, 2], "level": 0, "parent": null, "vector": [8, 0, 0.0408, 0.0204, 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_pr2_kinematics_tutorials')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99614:Import_L3_C0", "label": "rospy import rospy", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0612, 0.0204, 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_99614:ImportFrom_L4_C0", "label": "from visualization_msgs.msg import Marker", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0816, 0.0204, 0, 0.66, 0.375, 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_99614:ImportFrom_L5_C0", "label": "from geometry_msgs.msg import Point", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.102, 0.0204, 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_99614:Import_L7_C0", "label": "hrl_lib.transforms import tr", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.1429, 0.0204, 0, 0.66, 0.625, 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_99614:Import_L8_C0", "label": "math import math, np", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.1633, 0.0204, 0, 0.66, 0.75, 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_99614:FunctionDef_L10_C0", "label": "get_marker_arrow", "type": "function", "loc": [10, 33], "level": 0, "parent": null, "vector": [2, 0, 0.4388, 0.4898, 0, 0.66, 0.875, 977, 0, 3, 1, 0, 0, 0, 7], "semantic": {"name": "get_marker_arrow", "arg_names": ["p_st", "p_end", "frame_id"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def get_marker_arrow(p_st, p_end, frame_id):\n m = Marker()\n m.header.stamp = rospy.rostime.get_rostime()\n m.header.frame_id = frame_id\n\n m.ns = 'basic_shapes'\n m.id = 0\n m.type = Marker.ARROW"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99614:Assign_L11_C4", "label": "m = Marker()", "type": "assigned_variable", "loc": [11, 11], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99614:FunctionDef_L10_C0", "vector": [14, 1, 0.2245, 0.0204, 1, 0.67, 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_99614:Assign_L12_C4", "label": "m.header.stamp = get_rostime()", "type": "assigned_variable", "loc": [12, 12], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99614:FunctionDef_L10_C0", "vector": [14, 1, 0.2449, 0.0204, 1, 0.67, 0.0526, 726, 3, 0, 0, 0, 173, 10, 1], "semantic": {"name": "m.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "get_rostime", "annotation": ""}, "snippet": " m.header.stamp = rospy.rostime.get_rostime()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99614:Assign_L13_C4", "label": "m.header.frame_id =", "type": "assigned_variable", "loc": [13, 13], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99614:FunctionDef_L10_C0", "vector": [14, 1, 0.2653, 0.0204, 1, 0.67, 0.1053, 636, 2, 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 = frame_id"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99614:Assign_L15_C4", "label": "m.ns =", "type": "assigned_variable", "loc": [15, 15], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99614:FunctionDef_L10_C0", "vector": [14, 1, 0.3061, 0.0204, 1, 0.67, 0.1579, 889, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "m.ns", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " m.ns = 'basic_shapes'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99614:Assign_L16_C4", "label": "m.id =", "type": "assigned_variable", "loc": [16, 16], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99614:FunctionDef_L10_C0", "vector": [14, 1, 0.3265, 0.0204, 1, 0.67, 0.2105, 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_99614:Assign_L17_C4", "label": "m.type =", "type": "assigned_variable", "loc": [17, 17], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99614:FunctionDef_L10_C0", "vector": [14, 1, 0.3469, 0.0204, 1, 0.67, 0.2632, 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_99614:Assign_L18_C4", "label": "m.action =", "type": "assigned_variable", "loc": [18, 18], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99614:FunctionDef_L10_C0", "vector": [14, 1, 0.3673, 0.0204, 1, 0.67, 0.3158, 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_99614:Assign_L20_C4", "label": "pt1 = Point()", "type": "assigned_variable", "loc": [20, 20], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99614:FunctionDef_L10_C0", "vector": [14, 1, 0.4082, 0.0204, 1, 0.67, 0.3684, 211, 3, 3, 0, 0, 652, 10, 1], "semantic": {"name": "pt1", "arg_names": [], "import_names": [], "rhs_call_name": "Point", "annotation": ""}, "snippet": " pt1 = Point(p_st[0,0], p_st[1,0], p_st[2,0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99614:Assign_L21_C4", "label": "pt2 = Point()", "type": "assigned_variable", "loc": [21, 21], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99614:FunctionDef_L10_C0", "vector": [14, 1, 0.4286, 0.0204, 1, 0.67, 0.4211, 351, 3, 3, 0, 0, 652, 10, 1], "semantic": {"name": "pt2", "arg_names": [], "import_names": [], "rhs_call_name": "Point", "annotation": ""}, "snippet": " pt2 = Point(p_end[0,0], p_end[1,0], p_end[2,0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99614:Expr_L22_C4", "label": "append()", "type": "expression", "loc": [22, 22], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99614:FunctionDef_L10_C0", "vector": [8, 1, 0.449, 0.0204, 1, 0.67, 0.4737, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " m.points.append(pt1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99614:Expr_L23_C4", "label": "append()", "type": "expression", "loc": [23, 23], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99614:FunctionDef_L10_C0", "vector": [8, 1, 0.4694, 0.0204, 1, 0.67, 0.5263, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " m.points.append(pt2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99614:Assign_L25_C4", "label": "m.scale.x =", "type": "assigned_variable", "loc": [25, 25], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99614:FunctionDef_L10_C0", "vector": [14, 1, 0.5102, 0.0204, 1, 0.67, 0.5789, 918, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "m.scale.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " m.scale.x = 0.02;"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99614:Assign_L26_C4", "label": "m.scale.y =", "type": "assigned_variable", "loc": [26, 26], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99614:FunctionDef_L10_C0", "vector": [14, 1, 0.5306, 0.0204, 1, 0.67, 0.6316, 433, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "m.scale.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " m.scale.y = 0.05;"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99614:Assign_L27_C4", "label": "m.scale.z =", "type": "assigned_variable", "loc": [27, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99614:FunctionDef_L10_C0", "vector": [14, 1, 0.551, 0.0204, 1, 0.67, 0.6842, 61, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "m.scale.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " m.scale.z = 0.1;"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99614:Assign_L28_C4", "label": "m.color.r =", "type": "assigned_variable", "loc": [28, 28], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99614:FunctionDef_L10_C0", "vector": [14, 1, 0.5714, 0.0204, 1, 0.67, 0.7368, 600, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "m.color.r", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " m.color.r = 1.0;"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99614:Assign_L29_C4", "label": "m.color.g =", "type": "assigned_variable", "loc": [29, 29], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99614:FunctionDef_L10_C0", "vector": [14, 1, 0.5918, 0.0204, 1, 0.67, 0.7895, 934, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "m.color.g", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " m.color.g = 0.0;"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99614:Assign_L30_C4", "label": "m.color.b =", "type": "assigned_variable", "loc": [30, 30], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99614:FunctionDef_L10_C0", "vector": [14, 1, 0.6122, 0.0204, 1, 0.67, 0.8421, 404, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "m.color.b", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " m.color.b = 0.0;"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99614:Assign_L31_C4", "label": "m.color.a =", "type": "assigned_variable", "loc": [31, 31], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99614:FunctionDef_L10_C0", "vector": [14, 1, 0.6327, 0.0204, 1, 0.67, 0.8947, 410, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "m.color.a", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " m.color.a = 1.0;"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99614:Assign_L32_C4", "label": "m.lifetime = Duration()", "type": "assigned_variable", "loc": [32, 32], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99614:FunctionDef_L10_C0", "vector": [14, 1, 0.6531, 0.0204, 1, 0.67, 0.9474, 448, 3, 0, 0, 0, 972, 10, 1], "semantic": {"name": "m.lifetime", "arg_names": [], "import_names": [], "rhs_call_name": "Duration", "annotation": ""}, "snippet": " m.lifetime = rospy.Duration();"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99614:Return_L33_C4", "label": "return", "type": "return", "loc": [33, 33], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99614:FunctionDef_L10_C0", "vector": [13, 1, 0.6735, 0.0204, 1, 0.67, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return m"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99614:If_L36_C0", "label": "if", "type": "if", "loc": [36, 45], "level": 0, "parent": null, "vector": [4, 0, 0.8265, 0.2041, 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('marker_test', anonymous = True)\n marker_pub = rospy.Publisher('/test_marker', Marker)\n\n p1 = np.matrix([0.,0.,0.]).T\n p2 = np.matrix([0.,1.,0.]).T\n while not rospy.is_shutdown():\n marker = get_marker_arrow(p1, p2, 'base_link')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99614:Expr_L37_C4", "label": "init_node()", "type": "expression", "loc": [37, 37], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99614:If_L36_C0", "vector": [8, 1, 0.7551, 0.0204, 1, 0.65, 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('marker_test', anonymous = True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99614:Assign_L38_C4", "label": "marker_pub = Publisher()", "type": "assigned_variable", "loc": [38, 38], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99614:If_L36_C0", "vector": [14, 1, 0.7755, 0.0204, 1, 0.65, 0.25, 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('/test_marker', Marker)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99614:Assign_L40_C4", "label": "p1 =", "type": "assigned_variable", "loc": [40, 40], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99614:If_L36_C0", "vector": [14, 1, 0.8163, 0.0204, 1, 0.65, 0.5, 87, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "p1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p1 = np.matrix([0.,0.,0.]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99614:Assign_L41_C4", "label": "p2 =", "type": "assigned_variable", "loc": [41, 41], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99614:If_L36_C0", "vector": [14, 1, 0.8367, 0.0204, 1, 0.65, 0.75, 843, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "p2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p2 = np.matrix([0.,1.,0.]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99614:While_L42_C4", "label": "while", "type": "while", "loc": [42, 45], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99614:If_L36_C0", "vector": [5, 1, 0.8878, 0.0816, 1, 0.65, 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 marker = get_marker_arrow(p1, p2, 'base_link')\n marker_pub.publish(marker)\n rospy.sleep(0.1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99614:Assign_L43_C8", "label": "marker = get_marker_arrow()", "type": "assigned_variable", "loc": [43, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99614:While_L42_C4", "vector": [14, 2, 0.8776, 0.0204, 2, 0.33, 0.0, 864, 3, 3, 0, 0, 977, 10, 1], "semantic": {"name": "marker", "arg_names": [], "import_names": [], "rhs_call_name": "get_marker_arrow", "annotation": ""}, "snippet": " marker = get_marker_arrow(p1, p2, 'base_link')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99614:Expr_L44_C8", "label": "publish()", "type": "expression", "loc": [44, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99614:While_L42_C4", "vector": [8, 2, 0.898, 0.0204, 2, 0.33, 0.5, 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_99614:Expr_L45_C8", "label": "sleep()", "type": "expression", "loc": [45, 45], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99614:While_L42_C4", "vector": [8, 2, 0.9184, 0.0204, 2, 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": " rospy.sleep(0.1)"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99614:FunctionDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99614:Assign_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99614:FunctionDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99614:Assign_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99614:FunctionDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99614:Assign_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99614:FunctionDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99614:Assign_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99614:FunctionDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99614:Assign_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99614:FunctionDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99614:Assign_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99614:FunctionDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99614:Assign_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99614:FunctionDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99614:Assign_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99614:FunctionDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99614:Assign_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99614:FunctionDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99614:Expr_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99614:FunctionDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99614:Expr_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99614:FunctionDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99614:Assign_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99614:FunctionDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99614:Assign_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99614:FunctionDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99614:Assign_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99614:FunctionDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99614:Assign_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99614:FunctionDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99614:Assign_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99614:FunctionDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99614:Assign_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99614:FunctionDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99614:Assign_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99614:FunctionDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99614:Assign_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99614:FunctionDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99614:Return_L33_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99614:If_L36_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99614:Expr_L37_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99614:If_L36_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99614:Assign_L38_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99614:If_L36_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99614:Assign_L40_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99614:If_L36_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99614:Assign_L41_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99614:If_L36_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99614:While_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99614:While_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99614:Assign_L43_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99614:While_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99614:Expr_L44_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99614:While_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99614:Expr_L45_C8"}]
# # # Copyright (c) 2010, Georgia Tech Research Corporation # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # * Neither the name of the Georgia Tech Research Corporation nor the # names of its contributors may be used to endorse or promote products # derived from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY GEORGIA TECH RESEARCH CORPORATION ''AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL GEORGIA TECH BE LIABLE FOR ANY DIRECT, INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # \author Advait Jain (Healthcare Robotics Lab, Georgia Tech.) import roslib roslib.load_manifest('hrl_simple_arm_goals') import rospy import actionlib from move_arm_msgs.msg import MoveArmGoal from move_arm_msgs.msg import MoveArmAction from motion_planning_msgs.msg import PositionConstraint from motion_planning_msgs.msg import OrientationConstraint from geometric_shapes_msgs.msg import Shape from actionlib_msgs.msg import GoalStatus if __name__ == '__main__': rospy.init_node('arm_cartesian_goal_sender') move_arm = actionlib.SimpleActionClient('move_right_arm', MoveArmAction) move_arm.wait_for_server() rospy.logout('Connected to server') goalA = MoveArmGoal() goalA.motion_plan_request.group_name = 'right_arm' goalA.motion_plan_request.num_planning_attempts = 1 goalA.motion_plan_request.planner_id = '' goalA.planner_service_name = 'ompl_planning/plan_kinematic_path' goalA.motion_plan_request.allowed_planning_time = rospy.Duration(5.) pc = PositionConstraint() pc.header.stamp = rospy.Time.now() pc.header.frame_id = 'torso_lift_link' pc.link_name = 'r_wrist_roll_link' pc.position.x = 0.75 pc.position.y = -0.188 pc.position.z = 0 pc.constraint_region_shape.type = Shape.BOX pc.constraint_region_shape.dimensions = [0.02, 0.02, 0.02] pc.constraint_region_orientation.w = 1.0 goalA.motion_plan_request.goal_constraints.position_constraints.append(pc) oc = OrientationConstraint() oc.header.stamp = rospy.Time.now() oc.header.frame_id = 'torso_lift_link' oc.link_name = 'r_wrist_roll_link' oc.orientation.x = 0. oc.orientation.y = 0. oc.orientation.z = 0. oc.orientation.w = 1. oc.absolute_roll_tolerance = 0.04 oc.absolute_pitch_tolerance = 0.04 oc.absolute_yaw_tolerance = 0.04 oc.weight = 1. goalA.motion_plan_request.goal_constraints.orientation_constraints.append(oc) move_arm.send_goal(goalA) finished_within_time = move_arm.wait_for_result() if not finished_within_time: move_arm.cancel_goal() rospy.logout('Timed out achieving goal A') else: state = move_arm.get_state() if state == GoalStatus.SUCCEEDED: rospy.logout('Action finished with SUCCESS') else: rospy.logout('Action failed')
ajibawa-2023/Python-Code-Large/train/row_99615
54
105
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99615:Import_L32_C0", "label": "roslib import roslib", "type": "import", "loc": [32, 32], "level": 0, "parent": null, "vector": [1, 0, 0.3048, 0.0095, 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_99615:Expr_L33_C0", "label": "load_manifest()", "type": "expression", "loc": [33, 33], "level": 0, "parent": null, "vector": [8, 0, 0.3143, 0.0095, 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('hrl_simple_arm_goals')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99615:Import_L35_C0", "label": "rospy import rospy", "type": "import", "loc": [35, 35], "level": 0, "parent": null, "vector": [1, 0, 0.3333, 0.0095, 0, 0.66, 0.2, 164, 0, 1, 0, 0, 164, 0, 0], "semantic": {"name": "rospy", "arg_names": [], "import_names": ["rospy"], "rhs_call_name": "", "annotation": ""}, "snippet": "import rospy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99615:Import_L36_C0", "label": "actionlib import actionlib", "type": "import", "loc": [36, 36], "level": 0, "parent": null, "vector": [1, 0, 0.3429, 0.0095, 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_99615:ImportFrom_L38_C0", "label": "from move_arm_msgs.msg import MoveArmGoal", "type": "import", "loc": [38, 38], "level": 0, "parent": null, "vector": [1, 0, 0.3619, 0.0095, 0, 0.66, 0.4, 649, 0, 1, 0, 0, 649, 0, 0], "semantic": {"name": "move_arm_msgs.msg", "arg_names": [], "import_names": ["MoveArmGoal"], "rhs_call_name": "", "annotation": ""}, "snippet": "from move_arm_msgs.msg import MoveArmGoal"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99615:ImportFrom_L39_C0", "label": "from move_arm_msgs.msg import MoveArmAction", "type": "import", "loc": [39, 39], "level": 0, "parent": null, "vector": [1, 0, 0.3714, 0.0095, 0, 0.66, 0.5, 649, 0, 1, 0, 0, 649, 0, 0], "semantic": {"name": "move_arm_msgs.msg", "arg_names": [], "import_names": ["MoveArmAction"], "rhs_call_name": "", "annotation": ""}, "snippet": "from move_arm_msgs.msg import MoveArmAction"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99615:ImportFrom_L40_C0", "label": "from motion_planning_msgs.msg import PositionConstraint", "type": "import", "loc": [40, 40], "level": 0, "parent": null, "vector": [1, 0, 0.381, 0.0095, 0, 0.66, 0.6, 107, 0, 1, 0, 0, 107, 0, 0], "semantic": {"name": "motion_planning_msgs.msg", "arg_names": [], "import_names": ["PositionConstraint"], "rhs_call_name": "", "annotation": ""}, "snippet": "from motion_planning_msgs.msg import PositionConstraint"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99615:ImportFrom_L41_C0", "label": "from motion_planning_msgs.msg import OrientationConstraint", "type": "import", "loc": [41, 41], "level": 0, "parent": null, "vector": [1, 0, 0.3905, 0.0095, 0, 0.66, 0.7, 107, 0, 1, 0, 0, 107, 0, 0], "semantic": {"name": "motion_planning_msgs.msg", "arg_names": [], "import_names": ["OrientationConstraint"], "rhs_call_name": "", "annotation": ""}, "snippet": "from motion_planning_msgs.msg import OrientationConstraint"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99615:ImportFrom_L42_C0", "label": "from geometric_shapes_msgs.msg import Shape", "type": "import", "loc": [42, 42], "level": 0, "parent": null, "vector": [1, 0, 0.4, 0.0095, 0, 0.66, 0.8, 299, 0, 1, 0, 0, 299, 0, 0], "semantic": {"name": "geometric_shapes_msgs.msg", "arg_names": [], "import_names": ["Shape"], "rhs_call_name": "", "annotation": ""}, "snippet": "from geometric_shapes_msgs.msg import Shape"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99615:ImportFrom_L43_C0", "label": "from actionlib_msgs.msg import GoalStatus", "type": "import", "loc": [43, 43], "level": 0, "parent": null, "vector": [1, 0, 0.4095, 0.0095, 0, 0.66, 0.9, 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_99615:If_L46_C0", "label": "if", "type": "if", "loc": [46, 102], "level": 0, "parent": null, "vector": [4, 0, 0.7048, 0.5429, 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\n rospy.init_node('arm_cartesian_goal_sender')\n\n move_arm = actionlib.SimpleActionClient('move_right_arm', MoveArmAction)\n move_arm.wait_for_server()\n rospy.logout('Connected to server')\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99615:Expr_L48_C4", "label": "init_node()", "type": "expression", "loc": [48, 48], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99615:If_L46_C0", "vector": [8, 1, 0.4571, 0.0095, 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('arm_cartesian_goal_sender')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99615:Assign_L50_C4", "label": "move_arm = SimpleActionClient()", "type": "assigned_variable", "loc": [50, 50], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99615:If_L46_C0", "vector": [14, 1, 0.4762, 0.0095, 1, 0.97, 0.0278, 236, 3, 2, 0, 0, 230, 10, 1], "semantic": {"name": "move_arm", "arg_names": [], "import_names": [], "rhs_call_name": "SimpleActionClient", "annotation": ""}, "snippet": " move_arm = actionlib.SimpleActionClient('move_right_arm', MoveArmAction)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99615:Expr_L51_C4", "label": "wait_for_server()", "type": "expression", "loc": [51, 51], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99615:If_L46_C0", "vector": [8, 1, 0.4857, 0.0095, 1, 0.97, 0.0556, 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": " move_arm.wait_for_server()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99615:Expr_L52_C4", "label": "logout()", "type": "expression", "loc": [52, 52], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99615:If_L46_C0", "vector": [8, 1, 0.4952, 0.0095, 1, 0.97, 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('Connected to server')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99615:Assign_L54_C4", "label": "goalA = MoveArmGoal()", "type": "assigned_variable", "loc": [54, 54], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99615:If_L46_C0", "vector": [14, 1, 0.5143, 0.0095, 1, 0.97, 0.1111, 678, 3, 0, 0, 0, 620, 10, 1], "semantic": {"name": "goalA", "arg_names": [], "import_names": [], "rhs_call_name": "MoveArmGoal", "annotation": ""}, "snippet": " goalA = MoveArmGoal()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99615:Assign_L55_C4", "label": "goalA.motion_plan_request.group_name =", "type": "assigned_variable", "loc": [55, 55], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99615:If_L46_C0", "vector": [14, 1, 0.5238, 0.0095, 1, 0.97, 0.1389, 454, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "goalA.motion_plan_request.group_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " goalA.motion_plan_request.group_name = 'right_arm'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99615:Assign_L56_C4", "label": "goalA.motion_plan_request.num_planning_attempts =", "type": "assigned_variable", "loc": [56, 56], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99615:If_L46_C0", "vector": [14, 1, 0.5333, 0.0095, 1, 0.97, 0.1667, 761, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "goalA.motion_plan_request.num_planning_attempts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " goalA.motion_plan_request.num_planning_attempts = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99615:Assign_L57_C4", "label": "goalA.motion_plan_request.planner_id =", "type": "assigned_variable", "loc": [57, 57], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99615:If_L46_C0", "vector": [14, 1, 0.5429, 0.0095, 1, 0.97, 0.1944, 672, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "goalA.motion_plan_request.planner_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " goalA.motion_plan_request.planner_id = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99615:Assign_L58_C4", "label": "goalA.planner_service_name =", "type": "assigned_variable", "loc": [58, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99615:If_L46_C0", "vector": [14, 1, 0.5524, 0.0095, 1, 0.97, 0.2222, 140, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "goalA.planner_service_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " goalA.planner_service_name = 'ompl_planning/plan_kinematic_path'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99615:Assign_L59_C4", "label": "goalA.motion_plan_request.allowed_planning_time = Duration()", "type": "assigned_variable", "loc": [59, 59], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99615:If_L46_C0", "vector": [14, 1, 0.5619, 0.0095, 1, 0.97, 0.25, 371, 3, 1, 0, 0, 972, 10, 1], "semantic": {"name": "goalA.motion_plan_request.allowed_planning_time", "arg_names": [], "import_names": [], "rhs_call_name": "Duration", "annotation": ""}, "snippet": " goalA.motion_plan_request.allowed_planning_time = rospy.Duration(5.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99615:Assign_L62_C4", "label": "pc = PositionConstraint()", "type": "assigned_variable", "loc": [62, 62], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99615:If_L46_C0", "vector": [14, 1, 0.5905, 0.0095, 1, 0.97, 0.2778, 876, 3, 0, 0, 0, 867, 10, 1], "semantic": {"name": "pc", "arg_names": [], "import_names": [], "rhs_call_name": "PositionConstraint", "annotation": ""}, "snippet": " pc = PositionConstraint()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99615:Assign_L63_C4", "label": "pc.header.stamp = now()", "type": "assigned_variable", "loc": [63, 63], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99615:If_L46_C0", "vector": [14, 1, 0.6, 0.0095, 1, 0.97, 0.3056, 600, 3, 0, 0, 0, 894, 10, 1], "semantic": {"name": "pc.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "now", "annotation": ""}, "snippet": " pc.header.stamp = rospy.Time.now()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99615:Assign_L64_C4", "label": "pc.header.frame_id =", "type": "assigned_variable", "loc": [64, 64], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99615:If_L46_C0", "vector": [14, 1, 0.6095, 0.0095, 1, 0.97, 0.3333, 62, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "pc.header.frame_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pc.header.frame_id = 'torso_lift_link'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99615:Assign_L65_C4", "label": "pc.link_name =", "type": "assigned_variable", "loc": [65, 65], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99615:If_L46_C0", "vector": [14, 1, 0.619, 0.0095, 1, 0.97, 0.3611, 788, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "pc.link_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pc.link_name = 'r_wrist_roll_link'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99615:Assign_L66_C4", "label": "pc.position.x =", "type": "assigned_variable", "loc": [66, 66], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99615:If_L46_C0", "vector": [14, 1, 0.6286, 0.0095, 1, 0.97, 0.3889, 488, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "pc.position.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pc.position.x = 0.75"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99615:Assign_L67_C4", "label": "pc.position.y =", "type": "assigned_variable", "loc": [67, 67], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99615:If_L46_C0", "vector": [14, 1, 0.6381, 0.0095, 1, 0.97, 0.4167, 904, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pc.position.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pc.position.y = -0.188"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99615:Assign_L68_C4", "label": "pc.position.z =", "type": "assigned_variable", "loc": [68, 68], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99615:If_L46_C0", "vector": [14, 1, 0.6476, 0.0095, 1, 0.97, 0.4444, 707, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "pc.position.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pc.position.z = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99615:Assign_L70_C4", "label": "pc.constraint_region_shape.type =", "type": "assigned_variable", "loc": [70, 70], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99615:If_L46_C0", "vector": [14, 1, 0.6667, 0.0095, 1, 0.97, 0.4722, 394, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pc.constraint_region_shape.type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pc.constraint_region_shape.type = Shape.BOX"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99615:Assign_L71_C4", "label": "pc.constraint_region_shape.dimensions =", "type": "assigned_variable", "loc": [71, 71], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99615:If_L46_C0", "vector": [14, 1, 0.6762, 0.0095, 1, 0.97, 0.5, 253, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "pc.constraint_region_shape.dimensions", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pc.constraint_region_shape.dimensions = [0.02, 0.02, 0.02]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99615:Assign_L72_C4", "label": "pc.constraint_region_orientation.w =", "type": "assigned_variable", "loc": [72, 72], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99615:If_L46_C0", "vector": [14, 1, 0.6857, 0.0095, 1, 0.97, 0.5278, 185, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "pc.constraint_region_orientation.w", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pc.constraint_region_orientation.w = 1.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99615:Expr_L74_C4", "label": "append()", "type": "expression", "loc": [74, 74], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99615:If_L46_C0", "vector": [8, 1, 0.7048, 0.0095, 1, 0.97, 0.5556, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " goalA.motion_plan_request.goal_constraints.position_constraints.append(pc)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99615:Assign_L76_C4", "label": "oc = OrientationConstraint()", "type": "assigned_variable", "loc": [76, 76], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99615:If_L46_C0", "vector": [14, 1, 0.7238, 0.0095, 1, 0.97, 0.5833, 309, 3, 0, 0, 0, 618, 10, 1], "semantic": {"name": "oc", "arg_names": [], "import_names": [], "rhs_call_name": "OrientationConstraint", "annotation": ""}, "snippet": " oc = OrientationConstraint()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99615:Assign_L77_C4", "label": "oc.header.stamp = now()", "type": "assigned_variable", "loc": [77, 77], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99615:If_L46_C0", "vector": [14, 1, 0.7333, 0.0095, 1, 0.97, 0.6111, 157, 3, 0, 0, 0, 894, 10, 1], "semantic": {"name": "oc.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "now", "annotation": ""}, "snippet": " oc.header.stamp = rospy.Time.now()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99615:Assign_L78_C4", "label": "oc.header.frame_id =", "type": "assigned_variable", "loc": [78, 78], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99615:If_L46_C0", "vector": [14, 1, 0.7429, 0.0095, 1, 0.97, 0.6389, 528, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "oc.header.frame_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " oc.header.frame_id = 'torso_lift_link'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99615:Assign_L79_C4", "label": "oc.link_name =", "type": "assigned_variable", "loc": [79, 79], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99615:If_L46_C0", "vector": [14, 1, 0.7524, 0.0095, 1, 0.97, 0.6667, 963, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "oc.link_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " oc.link_name = 'r_wrist_roll_link'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99615:Assign_L80_C4", "label": "oc.orientation.x =", "type": "assigned_variable", "loc": [80, 80], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99615:If_L46_C0", "vector": [14, 1, 0.7619, 0.0095, 1, 0.97, 0.6944, 977, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "oc.orientation.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " oc.orientation.x = 0."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99615:Assign_L81_C4", "label": "oc.orientation.y =", "type": "assigned_variable", "loc": [81, 81], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99615:If_L46_C0", "vector": [14, 1, 0.7714, 0.0095, 1, 0.97, 0.7222, 831, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "oc.orientation.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " oc.orientation.y = 0."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99615:Assign_L82_C4", "label": "oc.orientation.z =", "type": "assigned_variable", "loc": [82, 82], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99615:If_L46_C0", "vector": [14, 1, 0.781, 0.0095, 1, 0.97, 0.75, 155, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "oc.orientation.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " oc.orientation.z = 0."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99615:Assign_L83_C4", "label": "oc.orientation.w =", "type": "assigned_variable", "loc": [83, 83], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99615:If_L46_C0", "vector": [14, 1, 0.7905, 0.0095, 1, 0.97, 0.7778, 444, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "oc.orientation.w", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " oc.orientation.w = 1."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99615:Assign_L85_C4", "label": "oc.absolute_roll_tolerance =", "type": "assigned_variable", "loc": [85, 85], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99615:If_L46_C0", "vector": [14, 1, 0.8095, 0.0095, 1, 0.97, 0.8056, 979, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "oc.absolute_roll_tolerance", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " oc.absolute_roll_tolerance = 0.04"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99615:Assign_L86_C4", "label": "oc.absolute_pitch_tolerance =", "type": "assigned_variable", "loc": [86, 86], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99615:If_L46_C0", "vector": [14, 1, 0.819, 0.0095, 1, 0.97, 0.8333, 782, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "oc.absolute_pitch_tolerance", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " oc.absolute_pitch_tolerance = 0.04"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99615:Assign_L87_C4", "label": "oc.absolute_yaw_tolerance =", "type": "assigned_variable", "loc": [87, 87], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99615:If_L46_C0", "vector": [14, 1, 0.8286, 0.0095, 1, 0.97, 0.8611, 247, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "oc.absolute_yaw_tolerance", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " oc.absolute_yaw_tolerance = 0.04"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99615:Assign_L88_C4", "label": "oc.weight =", "type": "assigned_variable", "loc": [88, 88], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99615:If_L46_C0", "vector": [14, 1, 0.8381, 0.0095, 1, 0.97, 0.8889, 258, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "oc.weight", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " oc.weight = 1."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99615:Expr_L90_C4", "label": "append()", "type": "expression", "loc": [90, 90], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99615:If_L46_C0", "vector": [8, 1, 0.8571, 0.0095, 1, 0.97, 0.9167, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " goalA.motion_plan_request.goal_constraints.orientation_constraints.append(oc)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99615:Expr_L92_C4", "label": "send_goal()", "type": "expression", "loc": [92, 92], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99615:If_L46_C0", "vector": [8, 1, 0.8762, 0.0095, 1, 0.97, 0.9444, 184, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "send_goal", "arg_names": [], "import_names": [], "rhs_call_name": "send_goal", "annotation": ""}, "snippet": " move_arm.send_goal(goalA)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99615:Assign_L93_C4", "label": "finished_within_time = wait_for_result()", "type": "assigned_variable", "loc": [93, 93], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99615:If_L46_C0", "vector": [14, 1, 0.8857, 0.0095, 1, 0.97, 0.9722, 778, 3, 0, 0, 0, 328, 10, 1], "semantic": {"name": "finished_within_time", "arg_names": [], "import_names": [], "rhs_call_name": "wait_for_result", "annotation": ""}, "snippet": " finished_within_time = move_arm.wait_for_result()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99615:If_L94_C4", "label": "if", "type": "if", "loc": [94, 102], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99615:If_L46_C0", "vector": [4, 1, 0.9333, 0.0857, 1, 0.97, 1.0, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not finished_within_time:\n move_arm.cancel_goal()\n rospy.logout('Timed out achieving goal A')\n else:\n state = move_arm.get_state()\n if state == GoalStatus.SUCCEEDED:\n rospy.logout('Action finished with SUCCESS')\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99615:Expr_L95_C8", "label": "cancel_goal()", "type": "expression", "loc": [95, 95], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99615:If_L94_C4", "vector": [8, 2, 0.9048, 0.0095, 2, 0.71, 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": " move_arm.cancel_goal()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99615:Expr_L96_C8", "label": "logout()", "type": "expression", "loc": [96, 96], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99615:If_L94_C4", "vector": [8, 2, 0.9143, 0.0095, 2, 0.71, 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('Timed out achieving goal A')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99615:Assign_L98_C8", "label": "state = get_state()", "type": "assigned_variable", "loc": [98, 98], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99615:If_L94_C4", "vector": [14, 2, 0.9333, 0.0095, 2, 0.71, 0.6667, 688, 3, 0, 0, 0, 650, 10, 1], "semantic": {"name": "state", "arg_names": [], "import_names": [], "rhs_call_name": "get_state", "annotation": ""}, "snippet": " state = move_arm.get_state()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99615:If_L99_C8", "label": "if", "type": "if", "loc": [99, 102], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99615:If_L94_C4", "vector": [4, 2, 0.9571, 0.0381, 2, 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 == GoalStatus.SUCCEEDED:\n rospy.logout('Action finished with SUCCESS')\n else:\n rospy.logout('Action failed')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99615:Expr_L100_C12", "label": "logout()", "type": "expression", "loc": [100, 100], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99615:If_L99_C8", "vector": [8, 3, 0.9524, 0.0095, 3, 0.34, 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('Action finished with SUCCESS')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99615:Expr_L102_C12", "label": "logout()", "type": "expression", "loc": [102, 102], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99615:If_L99_C8", "vector": [8, 3, 0.9714, 0.0095, 3, 0.34, 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 failed')"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99615:If_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99615:Expr_L48_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99615:If_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99615:Assign_L50_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99615:If_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99615:Expr_L51_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99615:If_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99615:Expr_L52_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99615:If_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99615:Assign_L54_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99615:If_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99615:Assign_L55_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99615:If_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99615:Assign_L56_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99615:If_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99615:Assign_L57_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99615:If_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99615:Assign_L58_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99615:If_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99615:Assign_L59_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99615:If_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99615:Assign_L62_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99615:If_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99615:Assign_L63_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99615:If_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99615:Assign_L64_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99615:If_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99615:Assign_L65_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99615:If_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99615:Assign_L66_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99615:If_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99615:Assign_L67_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99615:If_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99615:Assign_L68_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99615:If_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99615:Assign_L70_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99615:If_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99615:Assign_L71_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99615:If_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99615:Assign_L72_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99615:If_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99615:Expr_L74_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99615:If_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99615:Assign_L76_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99615:If_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99615:Assign_L77_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99615:If_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99615:Assign_L78_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99615:If_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99615:Assign_L79_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99615:If_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99615:Assign_L80_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99615:If_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99615:Assign_L81_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99615:If_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99615:Assign_L82_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99615:If_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99615:Assign_L83_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99615:If_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99615:Assign_L85_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99615:If_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99615:Assign_L86_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99615:If_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99615:Assign_L87_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99615:If_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99615:Assign_L88_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99615:If_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99615:Expr_L90_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99615:If_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99615:Expr_L92_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99615:If_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99615:Assign_L93_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99615:If_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99615:If_L94_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99615:If_L94_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99615:Expr_L95_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99615:If_L94_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99615:Expr_L96_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99615:If_L94_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99615:Assign_L98_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99615:If_L94_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99615:If_L99_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99615:If_L99_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99615:Expr_L100_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99615:If_L99_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99615:Expr_L102_C12"}]
import matplotlib.pyplot as pp import numpy as np import roslib; roslib.load_manifest('hrl_pr2_door_opening') roslib.load_manifest('equilibrium_point_control') import hrl_lib.util as ut import equilibrium_point_control.arm_trajectories_ram as atr d = ut.load_pickle('pkls/ikea_cabinet_log.pkl') #d = ut.load_pickle('pkls/ikea_cabinet_2.pkl') #d = ut.load_pickle('pkls/lab_cabinet_log.pkl') typ = 'rotary' pr2_log = True d['f_list'] = d['f_list_estimate'] h_config, h_ftan_estimate = atr.force_trajectory_in_hindsight(d, typ, pr2_log) pp.plot(np.degrees(h_config), h_ftan_estimate, 'ro-', mew=0, ms=0, label='estimate') if 'f_list_torques' in d: d['f_list'] = d['f_list_torques'] h_config, h_ftan_torques = atr.force_trajectory_in_hindsight(d, typ, pr2_log) pp.plot(np.degrees(h_config), h_ftan_torques, 'go-', mew=0, ms=0, label='torques') d['f_list'] = d['f_list_ati'] h_config, h_ftan_ati = atr.force_trajectory_in_hindsight(d, typ, pr2_log) pp.plot(np.degrees(h_config), h_ftan_ati, 'bo-', mew=0, ms=0, label='ATI') pp.legend() pp.show()
ajibawa-2023/Python-Code-Large/train/row_99616
22
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_99616:Import_L2_C0", "label": "matplotlib.pyplot import pp", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0513, 0.0256, 0, 0.66, 0.0, 596, 0, 1, 0, 0, 596, 0, 0], "semantic": {"name": "matplotlib.pyplot", "arg_names": [], "import_names": ["pp"], "rhs_call_name": "", "annotation": ""}, "snippet": "import matplotlib.pyplot as pp"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99616:Import_L3_C0", "label": "numpy import np", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0769, 0.0256, 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_99616:Import_L5_C0", "label": "roslib import roslib", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.1282, 0.0256, 0, 0.66, 0.1111, 796, 0, 1, 0, 0, 796, 0, 0], "semantic": {"name": "roslib", "arg_names": [], "import_names": ["roslib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('hrl_pr2_door_opening')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99616:Expr_L5_C15", "label": "load_manifest()", "type": "expression", "loc": [5, 5], "level": 0, "parent": null, "vector": [8, 0, 0.1282, 0.0256, 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_pr2_door_opening')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99616:Expr_L6_C0", "label": "load_manifest()", "type": "expression", "loc": [6, 6], "level": 0, "parent": null, "vector": [8, 0, 0.1538, 0.0256, 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('equilibrium_point_control')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99616:Import_L8_C0", "label": "hrl_lib.util import ut", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.2051, 0.0256, 0, 0.66, 0.2778, 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_99616:Import_L9_C0", "label": "equilibrium_point_control.arm_trajectories_ram import atr", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.2308, 0.0256, 0, 0.66, 0.3333, 600, 0, 1, 0, 0, 600, 0, 0], "semantic": {"name": "equilibrium_point_control.arm_trajectories_ram", "arg_names": [], "import_names": ["atr"], "rhs_call_name": "", "annotation": ""}, "snippet": "import equilibrium_point_control.arm_trajectories_ram as atr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99616:Assign_L11_C0", "label": "d = load_pickle()", "type": "assigned_variable", "loc": [11, 11], "level": 0, "parent": null, "vector": [14, 0, 0.2821, 0.0256, 0, 0.66, 0.3889, 355, 3, 1, 0, 0, 65, 10, 1], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "load_pickle", "annotation": ""}, "snippet": "d = ut.load_pickle('pkls/ikea_cabinet_log.pkl')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99616:Assign_L15_C0", "label": "typ =", "type": "assigned_variable", "loc": [15, 15], "level": 0, "parent": null, "vector": [14, 0, 0.3846, 0.0256, 0, 0.66, 0.4444, 722, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "typ", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "typ = 'rotary'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99616:Assign_L16_C0", "label": "pr2_log =", "type": "assigned_variable", "loc": [16, 16], "level": 0, "parent": null, "vector": [14, 0, 0.4103, 0.0256, 0, 0.66, 0.5, 601, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "pr2_log", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "pr2_log = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99616:Assign_L18_C0", "label": "assign", "type": "assigned_variable", "loc": [18, 18], "level": 0, "parent": null, "vector": [14, 0, 0.4615, 0.0256, 0, 0.66, 0.5556, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "d['f_list'] = d['f_list_estimate']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99616:Assign_L19_C0", "label": "h_config, h_ftan_estimate = force_trajectory_in_hindsight()", "type": "assigned_variable", "loc": [19, 19], "level": 0, "parent": null, "vector": [14, 0, 0.4872, 0.0256, 0, 0.66, 0.6111, 799, 3, 3, 0, 0, 814, 10, 1], "semantic": {"name": "h_config, h_ftan_estimate", "arg_names": [], "import_names": [], "rhs_call_name": "force_trajectory_in_hindsight", "annotation": ""}, "snippet": "h_config, h_ftan_estimate = atr.force_trajectory_in_hindsight(d, typ, pr2_log)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99616:Expr_L20_C0", "label": "plot()", "type": "expression", "loc": [20, 21], "level": 0, "parent": null, "vector": [8, 0, 0.5256, 0.0513, 0, 0.66, 0.6667, 929, 3, 6, 0, 0, 0, 0, 2], "semantic": {"name": "plot", "arg_names": [], "import_names": [], "rhs_call_name": "plot", "annotation": ""}, "snippet": "pp.plot(np.degrees(h_config), h_ftan_estimate, 'ro-', mew=0, ms=0,\n label='estimate')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99616:If_L23_C0", "label": "if", "type": "if", "loc": [23, 28], "level": 0, "parent": null, "vector": [4, 0, 0.6538, 0.1538, 0, 0.66, 0.7222, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if 'f_list_torques' in d:\n d['f_list'] = d['f_list_torques']\n h_config, h_ftan_torques = atr.force_trajectory_in_hindsight(d, typ,\n pr2_log)\n pp.plot(np.degrees(h_config), h_ftan_torques, 'go-', mew=0, ms=0,\n label='torques')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99616:Assign_L24_C4", "label": "assign", "type": "assigned_variable", "loc": [24, 24], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99616:If_L23_C0", "vector": [14, 1, 0.6154, 0.0256, 1, 0.9, 0.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " d['f_list'] = d['f_list_torques']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99616:Assign_L25_C4", "label": "h_config, h_ftan_torques = force_trajectory_in_hindsight()", "type": "assigned_variable", "loc": [25, 26], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99616:If_L23_C0", "vector": [14, 1, 0.6538, 0.0513, 1, 0.9, 0.5, 671, 3, 3, 0, 0, 814, 10, 1], "semantic": {"name": "h_config, h_ftan_torques", "arg_names": [], "import_names": [], "rhs_call_name": "force_trajectory_in_hindsight", "annotation": ""}, "snippet": " h_config, h_ftan_torques = atr.force_trajectory_in_hindsight(d, typ,\n pr2_log)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99616:Expr_L27_C4", "label": "plot()", "type": "expression", "loc": [27, 28], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99616:If_L23_C0", "vector": [8, 1, 0.7051, 0.0513, 1, 0.9, 1.0, 929, 3, 6, 0, 0, 0, 0, 2], "semantic": {"name": "plot", "arg_names": [], "import_names": [], "rhs_call_name": "plot", "annotation": ""}, "snippet": " pp.plot(np.degrees(h_config), h_ftan_torques, 'go-', mew=0, ms=0,\n label='torques')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99616:Assign_L30_C0", "label": "assign", "type": "assigned_variable", "loc": [30, 30], "level": 0, "parent": null, "vector": [14, 0, 0.7692, 0.0256, 0, 0.66, 0.7778, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "d['f_list'] = d['f_list_ati']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99616:Assign_L31_C0", "label": "h_config, h_ftan_ati = force_trajectory_in_hindsight()", "type": "assigned_variable", "loc": [31, 31], "level": 0, "parent": null, "vector": [14, 0, 0.7949, 0.0256, 0, 0.66, 0.8333, 635, 3, 3, 0, 0, 814, 10, 1], "semantic": {"name": "h_config, h_ftan_ati", "arg_names": [], "import_names": [], "rhs_call_name": "force_trajectory_in_hindsight", "annotation": ""}, "snippet": "h_config, h_ftan_ati = atr.force_trajectory_in_hindsight(d, typ, pr2_log)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99616:Expr_L32_C0", "label": "plot()", "type": "expression", "loc": [32, 33], "level": 0, "parent": null, "vector": [8, 0, 0.8333, 0.0513, 0, 0.66, 0.8889, 929, 3, 6, 0, 0, 0, 0, 2], "semantic": {"name": "plot", "arg_names": [], "import_names": [], "rhs_call_name": "plot", "annotation": ""}, "snippet": "pp.plot(np.degrees(h_config), h_ftan_ati, 'bo-', mew=0, ms=0,\n label='ATI')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99616:Expr_L35_C0", "label": "legend()", "type": "expression", "loc": [35, 35], "level": 0, "parent": null, "vector": [8, 0, 0.8974, 0.0256, 0, 0.66, 0.9444, 880, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "legend", "arg_names": [], "import_names": [], "rhs_call_name": "legend", "annotation": ""}, "snippet": "pp.legend()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99616:Expr_L36_C0", "label": "show()", "type": "expression", "loc": [36, 36], "level": 0, "parent": null, "vector": [8, 0, 0.9231, 0.0256, 0, 0.66, 1.0, 497, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "show", "arg_names": [], "import_names": [], "rhs_call_name": "show", "annotation": ""}, "snippet": "pp.show()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99616:If_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99616:Assign_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99616:If_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99616:Assign_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99616:If_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99616:Expr_L27_C4"}]
import numpy as np, math from threading import RLock, Timer import sys, copy import roslib; roslib.load_manifest('hrl_pr2_lib') roslib.load_manifest('force_torque') # hack by Advait import force_torque.FTClient as ftc import tf import hrl_lib.transforms as tr import hrl_lib.viz as hv import rospy import PyKDL as kdl import actionlib from actionlib_msgs.msg import GoalStatus from kinematics_msgs.srv import GetPositionIK, GetPositionIKRequest, GetPositionIKResponse from pr2_controllers_msgs.msg import JointTrajectoryAction, JointTrajectoryGoal, JointTrajectoryControllerState from pr2_controllers_msgs.msg import Pr2GripperCommandGoal, Pr2GripperCommandAction, Pr2GripperCommand from trajectory_msgs.msg import JointTrajectoryPoint from geometry_msgs.msg import PoseStamped from teleop_controllers.msg import JTTeleopControllerState from std_msgs.msg import Float64 from sensor_msgs.msg import JointState import hrl_lib.transforms as tr import hrl_lib.kdl_utils as ku import time from visualization_msgs.msg import Marker node_name = "pr2_arms" def log(str): rospy.loginfo(node_name + ": " + str) ## # Convert arrays, lists, matricies to column format. # # @param x the unknown format # @return a column matrix def make_column(x): if (type(x) == type([]) or (type(x) == np.ndarray and x.ndim == 1) or type(x) == type(())): return np.matrix(x).T if type(x) == np.ndarray: x = np.matrix(x) if x.shape[0] == 1: return x.T return x class PR2Arms(object): def __init__(self, primary_ft_sensor): log("Loading PR2Arms") self.arms = PR2Arms_kdl() # KDL chain. self.joint_names_list = [['r_shoulder_pan_joint', 'r_shoulder_lift_joint', 'r_upper_arm_roll_joint', 'r_elbow_flex_joint', 'r_forearm_roll_joint', 'r_wrist_flex_joint', 'r_wrist_roll_joint'], ['l_shoulder_pan_joint', 'l_shoulder_lift_joint', 'l_upper_arm_roll_joint', 'l_elbow_flex_joint', 'l_forearm_roll_joint', 'l_wrist_flex_joint', 'l_wrist_roll_joint']] self.arm_state_lock = [RLock(), RLock()] self.jep = [None, None] self.arm_angles = [None, None] self.torso_position = None self.arm_efforts = [None, None] self.r_arm_cart_pub = rospy.Publisher('/r_cart/command_pose', PoseStamped) self.l_arm_cart_pub = rospy.Publisher('/l_cart/command_pose', PoseStamped) rospy.Subscriber('/r_cart/state', JTTeleopControllerState, self.r_cart_state_cb) rospy.Subscriber('/l_cart/state', JTTeleopControllerState, self.l_cart_state_cb) rospy.Subscriber('/joint_states', JointState, self.joint_states_cb, queue_size=2) self.marker_pub = rospy.Publisher('/pr2_arms/viz_markers', Marker) self.cep_marker_id = 1 self.r_arm_ftc = ftc.FTClient('force_torque_ft2') self.r_arm_ftc_estimate = ftc.FTClient('force_torque_ft2_estimate') self.tf_lstnr = tf.TransformListener() if primary_ft_sensor == 'ati': self.get_wrist_force = self.get_wrist_force_ati if primary_ft_sensor == 'estimate': self.get_wrist_force = self.get_wrist_force_estimate r_action_client = actionlib.SimpleActionClient('r_arm_controller/joint_trajectory_action', JointTrajectoryAction) l_action_client = actionlib.SimpleActionClient('l_arm_controller/joint_trajectory_action', JointTrajectoryAction) self.joint_action_client = [r_action_client, l_action_client] r_gripper_client = actionlib.SimpleActionClient('r_gripper_controller/gripper_action', Pr2GripperCommandAction) l_gripper_client = actionlib.SimpleActionClient('l_gripper_controller/gripper_action', Pr2GripperCommandAction) self.gripper_action_client = [r_gripper_client, l_gripper_client] rospy.sleep(2.) # self.joint_action_client[0].wait_for_server() # self.joint_action_client[1].wait_for_server() self.gripper_action_client[0].wait_for_server() self.gripper_action_client[1].wait_for_server() log("Finished loading SimpleArmManger") ## # Callback for /joint_states topic. Updates current joint # angles and efforts for the arms constantly # @param data JointState message recieved from the /joint_states topic def joint_states_cb(self, data): arm_angles = [[], []] arm_efforts = [[], []] r_jt_idx_list = [0]*7 l_jt_idx_list = [0]*7 for i, jt_nm in enumerate(self.joint_names_list[0]): r_jt_idx_list[i] = data.name.index(jt_nm) for i, jt_nm in enumerate(self.joint_names_list[1]): l_jt_idx_list[i] = data.name.index(jt_nm) for i in range(7): idx = r_jt_idx_list[i] if data.name[idx] != self.joint_names_list[0][i]: raise RuntimeError('joint angle name does not match. Expected: %s, Actual: %s i: %d'%('r_'+nm+'_joint', data.name[idx], i)) arm_angles[0].append(data.position[idx]) arm_efforts[0].append(data.effort[idx]) idx = l_jt_idx_list[i] if data.name[idx] != self.joint_names_list[1][i]: raise RuntimeError('joint angle name does not match. Expected: %s, Actual: %s i: %d'%('r_'+nm+'_joint', data.name[idx], i)) #ang = tr.angle_within_mod180(data.position[idx]) ang = data.position[idx] arm_angles[1] += [ang] arm_efforts[1] += [data.effort[idx]] self.arm_state_lock[0].acquire() self.arm_angles[0] = arm_angles[0] self.arm_efforts[0] = arm_efforts[0] torso_idx = data.name.index('torso_lift_joint') self.torso_position = data.position[torso_idx] self.arm_state_lock[0].release() self.arm_state_lock[1].acquire() self.arm_angles[1] = arm_angles[1] self.arm_efforts[1] = arm_efforts[1] self.arm_state_lock[1].release() def r_cart_state_cb(self, msg): trans, quat = self.tf_lstnr.lookupTransform('/torso_lift_link', 'r_gripper_tool_frame', rospy.Time(0)) rot = tr.quaternion_to_matrix(quat) tip = np.matrix([0.12, 0., 0.]).T self.r_ee_pos = rot*tip + np.matrix(trans).T self.r_ee_rot = rot marker = Marker() marker.header.frame_id = 'torso_lift_link' time_stamp = rospy.Time.now() marker.header.stamp = time_stamp marker.ns = 'aloha land' marker.type = Marker.SPHERE marker.action = Marker.ADD marker.pose.position.x = self.r_ee_pos[0,0] marker.pose.position.y = self.r_ee_pos[1,0] marker.pose.position.z = self.r_ee_pos[2,0] size = 0.02 marker.scale.x = size marker.scale.y = size marker.scale.z = size marker.lifetime = rospy.Duration() marker.id = 71 marker.pose.orientation.x = 0 marker.pose.orientation.y = 0 marker.pose.orientation.z = 0 marker.pose.orientation.w = 1 color = (0.5, 0., 0.0) marker.color.r = color[0] marker.color.g = color[1] marker.color.b = color[2] marker.color.a = 1. self.marker_pub.publish(marker) ros_pt = msg.x_desi_filtered.pose.position x, y, z = ros_pt.x, ros_pt.y, ros_pt.z self.r_cep_pos = np.matrix([x, y, z]).T pt = rot.T * (np.matrix([x,y,z]).T - np.matrix(trans).T) pt = pt + tip self.r_cep_pos_hooktip = rot*pt + np.matrix(trans).T ros_quat = msg.x_desi_filtered.pose.orientation quat = (ros_quat.x, ros_quat.y, ros_quat.z, ros_quat.w) self.r_cep_rot = tr.quaternion_to_matrix(quat) def l_cart_state_cb(self, msg): ros_pt = msg.x_desi_filtered.pose.position self.l_cep_pos = np.matrix([ros_pt.x, ros_pt.y, ros_pt.z]).T ros_quat = msg.x_desi_filtered.pose.orientation quat = (ros_quat.x, ros_quat.y, ros_quat.z, ros_quat.w) self.l_cep_rot = tr.quaternion_to_matrix(quat) ## Returns the current position, rotation of the arm. # @param arm 0 for right, 1 for left # @return rotation, position def end_effector_pos(self, arm): q = self.get_joint_angles(arm) return self.arms.FK_all(arm, q) ## Returns the list of 7 joint angles # @param arm 0 for right, 1 for left # @return list of 7 joint angles def get_joint_angles(self, arm): if arm != 1: arm = 0 self.arm_state_lock[arm].acquire() q = self.arm_angles[arm] self.arm_state_lock[arm].release() return q def set_jep(self, arm, q, duration=0.15): self.arm_state_lock[arm].acquire() jtg = JointTrajectoryGoal() jtg.trajectory.joint_names = self.joint_names_list[arm] jtp = JointTrajectoryPoint() jtp.positions = q #jtp.velocities = [0 for i in range(len(q))] #jtp.accelerations = [0 for i in range(len(q))] jtp.time_from_start = rospy.Duration(duration) jtg.trajectory.points.append(jtp) self.joint_action_client[arm].send_goal(jtg) self.jep[arm] = q cep, r = self.arms.FK_all(arm, q) self.arm_state_lock[arm].release() o = np.matrix([0.,0.,0.,1.]).T cep_marker = hv.single_marker(cep, o, 'sphere', '/torso_lift_link', color=(0., 0., 1., 1.), scale = (0.02, 0.02, 0.02), m_id = self.cep_marker_id) cep_marker.header.stamp = rospy.Time.now() self.marker_pub.publish(cep_marker) def get_jep(self, arm): self.arm_state_lock[arm].acquire() jep = copy.copy(self.jep[arm]) self.arm_state_lock[arm].release() return jep def get_ee_jtt(self, arm): if arm == 0: return self.r_ee_pos, self.r_ee_rot else: return self.l_ee_pos, self.l_ee_rot def get_cep_jtt(self, arm, hook_tip = False): if arm == 0: if hook_tip: return self.r_cep_pos_hooktip, self.r_cep_rot else: return self.r_cep_pos, self.r_cep_rot else: return self.l_cep_pos, self.l_cep_rot # set a cep using the Jacobian Transpose controller. def set_cep_jtt(self, arm, p, rot=None): if arm != 1: arm = 0 ps = PoseStamped() ps.header.stamp = rospy.rostime.get_rostime() ps.header.frame_id = 'torso_lift_link' ps.pose.position.x = p[0,0] ps.pose.position.y = p[1,0] ps.pose.position.z = p[2,0] if rot == None: if arm == 0: rot = self.r_cep_rot else: rot = self.l_cep_rot quat = tr.matrix_to_quaternion(rot) ps.pose.orientation.x = quat[0] ps.pose.orientation.y = quat[1] ps.pose.orientation.z = quat[2] ps.pose.orientation.w = quat[3] if arm == 0: self.r_arm_cart_pub.publish(ps) else: self.l_arm_cart_pub.publish(ps) # rotational interpolation unimplemented. def go_cep_jtt(self, arm, p): step_size = 0.01 sleep_time = 0.1 cep_p, cep_rot = self.get_cep_jtt(arm) unit_vec = (p-cep_p) unit_vec = unit_vec / np.linalg.norm(unit_vec) while np.linalg.norm(p-cep_p) > step_size: cep_p += unit_vec * step_size self.set_cep_jtt(arm, cep_p) rospy.sleep(sleep_time) self.set_cep_jtt(arm, p) rospy.sleep(sleep_time) #----------- forces ------------ # force that is being applied on the wrist. (estimate as returned # by the cartesian controller) def get_wrist_force_estimate(self, arm, bias = True, base_frame = False): if arm != 0: rospy.logerr('Unsupported arm: %d'%arm) raise RuntimeError('Unimplemented function') f = self.r_arm_ftc_estimate.read(without_bias = not bias) f = f[0:3, :] if base_frame: trans, quat = self.tf_lstnr.lookupTransform('/torso_lift_link', '/ft2_estimate', rospy.Time(0)) rot = tr.quaternion_to_matrix(quat) f = rot * f return -f # the negative is intentional (Advait, Nov 24. 2010.) # force that is being applied on the wrist. def get_wrist_force_ati(self, arm, bias = True, base_frame = False): if arm != 0: rospy.logerr('Unsupported arm: %d'%arm) raise RuntimeError('Unimplemented function') f = self.r_arm_ftc.read(without_bias = not bias) f = f[0:3, :] if base_frame: trans, quat = self.tf_lstnr.lookupTransform('/torso_lift_link', '/ft2', rospy.Time(0)) rot = tr.quaternion_to_matrix(quat) f = rot * f return -f # the negative is intentional (Advait, Nov 24. 2010.) ## Returns the list of 7 joint angles # @param arm 0 for right, 1 for left # @return list of 7 joint angles def get_force_from_torques(self, arm): if arm != 1: arm = 0 self.arm_state_lock[arm].acquire() q = self.arm_angles[arm] tau = self.arm_efforts[arm] self.arm_state_lock[arm].release() p, _ = self.arms.FK_all(arm, q) J = self.arms.Jacobian(arm, q, p) f = np.linalg.pinv(J.T) * np.matrix(tau).T f = f[0:3,:] return -f def bias_wrist_ft(self, arm): if arm != 0: rospy.logerr('Unsupported arm: %d'%arm) raise RuntimeError('Unimplemented function') self.r_arm_ftc.bias() self.r_arm_ftc_estimate.bias() #-------- gripper functions ------------ def move_gripper(self, arm, amount=0.08, effort = 15): self.gripper_action_client[arm].send_goal(Pr2GripperCommandGoal(Pr2GripperCommand(position=amount, max_effort = effort))) ## Open the gripper # @param arm 0 for right, 1 for left def open_gripper(self, arm): self.move_gripper(arm, 0.08, -1) ## Close the gripper # @param arm 0 for right, 1 for left def close_gripper(self, arm, effort = 15): self.move_gripper(arm, 0.0, effort) ## # using KDL for pr2 arm kinematics. class PR2Arms_kdl(): def __init__(self): self.right_chain = self.create_right_chain() fk, ik_v, ik_p, jac = self.create_solvers(self.right_chain) self.right_fk = fk self.right_ik_v = ik_v self.right_ik_p = ik_p self.right_jac = jac self.right_tooltip = np.matrix([0.,0.,0.]).T def create_right_chain(self): ch = kdl.Chain() self.right_arm_base_offset_from_torso_lift_link = np.matrix([0., -0.188, 0.]).T # shoulder pan ch.addSegment(kdl.Segment(kdl.Joint(kdl.Joint.RotZ),kdl.Frame(kdl.Vector(0.1,0.,0.)))) # shoulder lift ch.addSegment(kdl.Segment(kdl.Joint(kdl.Joint.RotY),kdl.Frame(kdl.Vector(0.,0.,0.)))) # upper arm roll ch.addSegment(kdl.Segment(kdl.Joint(kdl.Joint.RotX),kdl.Frame(kdl.Vector(0.4,0.,0.)))) # elbox flex ch.addSegment(kdl.Segment(kdl.Joint(kdl.Joint.RotY),kdl.Frame(kdl.Vector(0.0,0.,0.)))) # forearm roll ch.addSegment(kdl.Segment(kdl.Joint(kdl.Joint.RotX),kdl.Frame(kdl.Vector(0.321,0.,0.)))) # wrist flex ch.addSegment(kdl.Segment(kdl.Joint(kdl.Joint.RotY),kdl.Frame(kdl.Vector(0.,0.,0.)))) # wrist roll ch.addSegment(kdl.Segment(kdl.Joint(kdl.Joint.RotX),kdl.Frame(kdl.Vector(0.,0.,0.)))) return ch def create_solvers(self, ch): fk = kdl.ChainFkSolverPos_recursive(ch) ik_v = kdl.ChainIkSolverVel_pinv(ch) ik_p = kdl.ChainIkSolverPos_NR(ch, fk, ik_v) jac = kdl.ChainJntToJacSolver(ch) return fk, ik_v, ik_p, jac ## define tooltip as a 3x1 np matrix in the wrist coord frame. def set_tooltip(self, arm, p): if arm == 0: self.right_tooltip = p else: rospy.logerr('Arm %d is not supported.'%(arm)) def FK_kdl(self, arm, q, link_number): if arm == 0: fk = self.right_fk endeffec_frame = kdl.Frame() kinematics_status = fk.JntToCart(q, endeffec_frame, link_number) if kinematics_status >= 0: return endeffec_frame else: rospy.loginfo('Could not compute forward kinematics.') return None else: msg = '%s arm not supported.'%(arm) rospy.logerr(msg) raise RuntimeError(msg) ## returns point in torso lift link. def FK_all(self, arm, q, link_number = 7): q = self.pr2_to_kdl(q) frame = self.FK_kdl(arm, q, link_number) pos = frame.p pos = ku.kdl_vec_to_np(pos) pos = pos + self.right_arm_base_offset_from_torso_lift_link m = frame.M rot = ku.kdl_rot_to_np(m) if arm == 0: tooltip_baseframe = rot * self.right_tooltip pos += tooltip_baseframe else: rospy.logerr('Arm %d is not supported.'%(arm)) return None return pos, rot def kdl_to_pr2(self, q): if q == None: return None q_pr2 = [0] * 7 q_pr2[0] = q[0] q_pr2[1] = q[1] q_pr2[2] = q[2] q_pr2[3] = q[3] q_pr2[4] = q[4] q_pr2[5] = q[5] q_pr2[6] = q[6] return q_pr2 def pr2_to_kdl(self, q): if q == None: return None n = len(q) q_kdl = kdl.JntArray(n) for i in range(n): q_kdl[i] = q[i] return q_kdl def Jac_kdl(self, arm, q): J_kdl = kdl.Jacobian(7) if arm != 0: rospy.logerr('Unsupported arm: '+ str(arm)) return None self.right_jac.JntToJac(q,J_kdl) kdl_jac = np.matrix([ [J_kdl[0,0],J_kdl[0,1],J_kdl[0,2],J_kdl[0,3],J_kdl[0,4],J_kdl[0,5],J_kdl[0,6]], [J_kdl[1,0],J_kdl[1,1],J_kdl[1,2],J_kdl[1,3],J_kdl[1,4],J_kdl[1,5],J_kdl[1,6]], [J_kdl[2,0],J_kdl[2,1],J_kdl[2,2],J_kdl[2,3],J_kdl[2,4],J_kdl[2,5],J_kdl[2,6]], [J_kdl[3,0],J_kdl[3,1],J_kdl[3,2],J_kdl[3,3],J_kdl[3,4],J_kdl[3,5],J_kdl[3,6]], [J_kdl[4,0],J_kdl[4,1],J_kdl[4,2],J_kdl[4,3],J_kdl[4,4],J_kdl[4,5],J_kdl[4,6]], [J_kdl[5,0],J_kdl[5,1],J_kdl[5,2],J_kdl[5,3],J_kdl[5,4],J_kdl[5,5],J_kdl[5,6]], ]) return kdl_jac # ## compute Jacobian (at wrist). # # @param arm - 0 or 1 # # @param q - list of 7 joint angles. # # @return 6x7 np matrix # def Jac(self, arm, q): # rospy.logerr('Jac only works for getting the Jacobian at the wrist. Use Jacobian to get the Jacobian at a general location.') # jntarr = self.pr2_to_kdl(q) # kdl_jac = self.Jac_kdl(arm, jntarr) # pr2_jac = kdl_jac # return pr2_jac ## compute Jacobian at point pos. # p is in the torso_lift_link coord frame. def Jacobian(self, arm, q, pos): if arm != 0: rospy.logerr('Arm %d is not supported.'%(arm)) return None tooltip = self.right_tooltip self.right_tooltip = np.matrix([0.,0.,0.]).T v_list = [] w_list = [] for i in range(7): p, rot = self.FK_all(arm, q, i) r = pos - p z_idx = self.right_chain.getSegment(i).getJoint().getType() - 1 z = rot[:, z_idx] v_list.append(np.matrix(np.cross(z.A1, r.A1)).T) w_list.append(z) J = np.row_stack((np.column_stack(v_list), np.column_stack(w_list))) self.right_tooltip = tooltip return J def close_to_singularity(self, arm, q): pass def within_joint_limits(self, arm, q, delta_list=[0., 0., 0., 0., 0., 0., 0.]): if arm == 0: # right arm min_arr = np.radians(np.array([-109., -24, -220, -132, -np.inf, -120, -np.inf])) #max_arr = np.radians(np.array([26., 68, 41, 0, np.inf, 0, np.inf])) max_arr = np.radians(np.array([26., 68, 41, 5, np.inf, 5, np.inf])) # 5 to prevent singularity. Need to come up with a better solution. else: raise RuntimeError('within_joint_limits unimplemented for left arm') q_arr = np.array(q) d_arr = np.array(delta_list) return np.all((q_arr <= max_arr+d_arr, q_arr >= min_arr+d_arr)) if __name__ == '__main__': from visualization_msgs.msg import Marker import hrl_lib.viz as hv rospy.init_node('pr2_arms_test') pr2_arms = PR2Arms() pr2_kdl = PR2Arms_kdl() r_arm, l_arm = 0, 1 arm = r_arm if True: np.set_printoptions(precision=2, suppress=True) while not rospy.is_shutdown(): q = pr2_arms.get_joint_angles(arm) print 'q in degrees:', np.degrees(q) rospy.sleep(0.1) if False: jep = [0.] * 7 rospy.loginfo('Going to home location.') raw_input('Hit ENTER to go') pr2_arms.set_jep(arm, jep, duration=2.) if False: # testing FK by publishing a frame marker. marker_pub = rospy.Publisher('/pr2_kdl/ee_marker', Marker) pr2_kdl.set_tooltip(arm, np.matrix([0.15, 0., 0.]).T) rt = rospy.Rate(100) rospy.loginfo('Starting the maker publishing loop.') while not rospy.is_shutdown(): q = pr2_arms.get_joint_angles(arm) p, rot = pr2_kdl.FK_all(arm, q) m = hv.create_frame_marker(p, rot, 0.15, '/torso_lift_link') m.header.stamp = rospy.Time.now() marker_pub.publish(m) rt.sleep() if False: # testing Jacobian by printing KDL and my own Jacobian at the # current configuration. while not rospy.is_shutdown(): q = pr2_arms.get_joint_angles(arm) J_kdl = pr2_kdl.Jac(arm , q) p, rot = pr2_kdl.FK_all(arm, q) J_adv = pr2_kdl.Jacobian(arm, q, p) print J_adv.shape diff_J = J_kdl - J_adv print 'difference between KDL and adv is:' print diff_J print 'Norm of difference matrix:', np.linalg.norm(diff_J) raw_input('Move arm into some configuration and hit enter to get the Jacobian.') # ## Performs Inverse Kinematics on the given position and rotation # # @param arm 0 for right, 1 for left # # @param p cartesian position in torso_lift_link frame # # @param rot quaternion rotation column or rotation matrix # # of wrist in torso_lift_link frame # # @param q_guess initial joint angles to use for finding IK # def IK(self, arm, p, rot, q_guess): # if arm != 1: # arm = 0 # # p = make_column(p) # # if rot.shape == (3, 3): # quat = np.matrix(tr.matrix_to_quaternion(rot)).T # elif rot.shape == (4, 1): # quat = make_column(rot) # else: # rospy.logerr('Inverse kinematics failed (bad rotation)') # return None # # ik_req = GetPositionIKRequest() # ik_req.timeout = rospy.Duration(5.) # if arm == 0: # ik_req.ik_request.ik_link_name = 'r_wrist_roll_link' # else: # ik_req.ik_request.ik_link_name = 'l_wrist_roll_link' # ik_req.ik_request.pose_stamped.header.frame_id = 'torso_lift_link' # # ik_req.ik_request.pose_stamped.pose.position.x = p[0,0] # ik_req.ik_request.pose_stamped.pose.position.y = p[1,0] # ik_req.ik_request.pose_stamped.pose.position.z = p[2,0] # # ik_req.ik_request.pose_stamped.pose.orientation.x = quat[0] # ik_req.ik_request.pose_stamped.pose.orientation.y = quat[1] # ik_req.ik_request.pose_stamped.pose.orientation.z = quat[2] # ik_req.ik_request.pose_stamped.pose.orientation.w = quat[3] # # ik_req.ik_request.ik_seed_state.joint_state.position = q_guess # ik_req.ik_request.ik_seed_state.joint_state.name = self.joint_names_list[arm] # # ik_resp = self.ik_srv[arm].call(ik_req) # if ik_resp.error_code.val == ik_resp.error_code.SUCCESS: # ret = list(ik_resp.solution.joint_state.position) # else: # rospy.logerr('Inverse kinematics failed') # ret = None # # return ret #
ajibawa-2023/Python-Code-Large/train/row_99617
412
694
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Import_L3_C0", "label": "numpy import np, math", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0043, 0.0014, 0, 0.66, 0.0, 954, 0, 2, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np", "math"], "rhs_call_name": "", "annotation": ""}, "snippet": "import numpy as np, math"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:ImportFrom_L4_C0", "label": "from threading import RLock, Timer", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0058, 0.0014, 0, 0.66, 0.0323, 83, 0, 2, 0, 0, 83, 0, 0], "semantic": {"name": "threading", "arg_names": [], "import_names": ["RLock", "Timer"], "rhs_call_name": "", "annotation": ""}, "snippet": "from threading import RLock, Timer"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Import_L5_C0", "label": "sys import sys, copy", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0072, 0.0014, 0, 0.66, 0.0645, 509, 0, 2, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys", "copy"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys, copy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Import_L8_C0", "label": "roslib import roslib", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.0115, 0.0014, 0, 0.66, 0.0968, 796, 0, 1, 0, 0, 796, 0, 0], "semantic": {"name": "roslib", "arg_names": [], "import_names": ["roslib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('hrl_pr2_lib')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L8_C15", "label": "load_manifest()", "type": "expression", "loc": [8, 8], "level": 0, "parent": null, "vector": [8, 0, 0.0115, 0.0014, 0, 0.66, 0.129, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('hrl_pr2_lib')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L9_C0", "label": "load_manifest()", "type": "expression", "loc": [9, 9], "level": 0, "parent": null, "vector": [8, 0, 0.013, 0.0014, 0, 0.66, 0.1613, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest('force_torque') # hack by Advait"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Import_L10_C0", "label": "force_torque.FTClient import ftc", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.0144, 0.0014, 0, 0.66, 0.1935, 823, 0, 1, 0, 0, 823, 0, 0], "semantic": {"name": "force_torque.FTClient", "arg_names": [], "import_names": ["ftc"], "rhs_call_name": "", "annotation": ""}, "snippet": "import force_torque.FTClient as ftc"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Import_L12_C0", "label": "tf import tf", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.0173, 0.0014, 0, 0.66, 0.2258, 951, 0, 1, 0, 0, 951, 0, 0], "semantic": {"name": "tf", "arg_names": [], "import_names": ["tf"], "rhs_call_name": "", "annotation": ""}, "snippet": "import tf"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Import_L13_C0", "label": "hrl_lib.transforms import tr", "type": "import", "loc": [13, 13], "level": 0, "parent": null, "vector": [1, 0, 0.0187, 0.0014, 0, 0.66, 0.2581, 82, 0, 1, 0, 0, 82, 0, 0], "semantic": {"name": "hrl_lib.transforms", "arg_names": [], "import_names": ["tr"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.transforms as tr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Import_L14_C0", "label": "hrl_lib.viz import hv", "type": "import", "loc": [14, 14], "level": 0, "parent": null, "vector": [1, 0, 0.0202, 0.0014, 0, 0.66, 0.2903, 48, 0, 1, 0, 0, 48, 0, 0], "semantic": {"name": "hrl_lib.viz", "arg_names": [], "import_names": ["hv"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.viz as hv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Import_L16_C0", "label": "rospy import rospy", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.0231, 0.0014, 0, 0.66, 0.3226, 164, 0, 1, 0, 0, 164, 0, 0], "semantic": {"name": "rospy", "arg_names": [], "import_names": ["rospy"], "rhs_call_name": "", "annotation": ""}, "snippet": "import rospy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Import_L17_C0", "label": "PyKDL import kdl", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.0245, 0.0014, 0, 0.66, 0.3548, 198, 0, 1, 0, 0, 198, 0, 0], "semantic": {"name": "PyKDL", "arg_names": [], "import_names": ["kdl"], "rhs_call_name": "", "annotation": ""}, "snippet": "import PyKDL as kdl"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Import_L19_C0", "label": "actionlib import actionlib", "type": "import", "loc": [19, 19], "level": 0, "parent": null, "vector": [1, 0, 0.0274, 0.0014, 0, 0.66, 0.3871, 694, 0, 1, 0, 0, 694, 0, 0], "semantic": {"name": "actionlib", "arg_names": [], "import_names": ["actionlib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import actionlib"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:ImportFrom_L20_C0", "label": "from actionlib_msgs.msg import GoalStatus", "type": "import", "loc": [20, 20], "level": 0, "parent": null, "vector": [1, 0, 0.0288, 0.0014, 0, 0.66, 0.4194, 245, 0, 1, 0, 0, 245, 0, 0], "semantic": {"name": "actionlib_msgs.msg", "arg_names": [], "import_names": ["GoalStatus"], "rhs_call_name": "", "annotation": ""}, "snippet": "from actionlib_msgs.msg import GoalStatus"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:ImportFrom_L22_C0", "label": "from kinematics_msgs.srv import GetPositionIK, GetPositionIKRequest, GetPositionIKResponse", "type": "import", "loc": [22, 22], "level": 0, "parent": null, "vector": [1, 0, 0.0317, 0.0014, 0, 0.66, 0.4516, 247, 0, 3, 0, 0, 247, 0, 0], "semantic": {"name": "kinematics_msgs.srv", "arg_names": [], "import_names": ["GetPositionIK", "GetPositionIKRequest", "GetPositionIKResponse"], "rhs_call_name": "", "annotation": ""}, "snippet": "from kinematics_msgs.srv import GetPositionIK, GetPositionIKRequest, GetPositionIKResponse"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:ImportFrom_L23_C0", "label": "from pr2_controllers_msgs.msg import JointTrajectoryAction, JointTrajectoryGoal, JointTrajectoryControllerState", "type": "import", "loc": [23, 23], "level": 0, "parent": null, "vector": [1, 0, 0.0331, 0.0014, 0, 0.66, 0.4839, 457, 0, 3, 0, 0, 457, 0, 0], "semantic": {"name": "pr2_controllers_msgs.msg", "arg_names": [], "import_names": ["JointTrajectoryAction", "JointTrajectoryGoal", "JointTrajectoryControllerState"], "rhs_call_name": "", "annotation": ""}, "snippet": "from pr2_controllers_msgs.msg import JointTrajectoryAction, JointTrajectoryGoal, JointTrajectoryControllerState"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:ImportFrom_L24_C0", "label": "from pr2_controllers_msgs.msg import Pr2GripperCommandGoal, Pr2GripperCommandAction, Pr2GripperCommand", "type": "import", "loc": [24, 24], "level": 0, "parent": null, "vector": [1, 0, 0.0346, 0.0014, 0, 0.66, 0.5161, 457, 0, 3, 0, 0, 457, 0, 0], "semantic": {"name": "pr2_controllers_msgs.msg", "arg_names": [], "import_names": ["Pr2GripperCommandGoal", "Pr2GripperCommandAction", "Pr2GripperCommand"], "rhs_call_name": "", "annotation": ""}, "snippet": "from pr2_controllers_msgs.msg import Pr2GripperCommandGoal, Pr2GripperCommandAction, Pr2GripperCommand"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:ImportFrom_L26_C0", "label": "from trajectory_msgs.msg import JointTrajectoryPoint", "type": "import", "loc": [26, 26], "level": 0, "parent": null, "vector": [1, 0, 0.0375, 0.0014, 0, 0.66, 0.5484, 485, 0, 1, 0, 0, 485, 0, 0], "semantic": {"name": "trajectory_msgs.msg", "arg_names": [], "import_names": ["JointTrajectoryPoint"], "rhs_call_name": "", "annotation": ""}, "snippet": "from trajectory_msgs.msg import JointTrajectoryPoint"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:ImportFrom_L27_C0", "label": "from geometry_msgs.msg import PoseStamped", "type": "import", "loc": [27, 27], "level": 0, "parent": null, "vector": [1, 0, 0.0389, 0.0014, 0, 0.66, 0.5806, 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_99617:ImportFrom_L29_C0", "label": "from teleop_controllers.msg import JTTeleopControllerState", "type": "import", "loc": [29, 29], "level": 0, "parent": null, "vector": [1, 0, 0.0418, 0.0014, 0, 0.66, 0.6129, 185, 0, 1, 0, 0, 185, 0, 0], "semantic": {"name": "teleop_controllers.msg", "arg_names": [], "import_names": ["JTTeleopControllerState"], "rhs_call_name": "", "annotation": ""}, "snippet": "from teleop_controllers.msg import JTTeleopControllerState"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:ImportFrom_L31_C0", "label": "from std_msgs.msg import Float64", "type": "import", "loc": [31, 31], "level": 0, "parent": null, "vector": [1, 0, 0.0447, 0.0014, 0, 0.66, 0.6452, 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_99617:ImportFrom_L32_C0", "label": "from sensor_msgs.msg import JointState", "type": "import", "loc": [32, 32], "level": 0, "parent": null, "vector": [1, 0, 0.0461, 0.0014, 0, 0.66, 0.6774, 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_99617:Import_L34_C0", "label": "hrl_lib.transforms import tr", "type": "import", "loc": [34, 34], "level": 0, "parent": null, "vector": [1, 0, 0.049, 0.0014, 0, 0.66, 0.7097, 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_99617:Import_L35_C0", "label": "hrl_lib.kdl_utils import ku", "type": "import", "loc": [35, 35], "level": 0, "parent": null, "vector": [1, 0, 0.0504, 0.0014, 0, 0.66, 0.7419, 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_99617:Import_L36_C0", "label": "time import time", "type": "import", "loc": [36, 36], "level": 0, "parent": null, "vector": [1, 0, 0.0519, 0.0014, 0, 0.66, 0.7742, 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_99617:ImportFrom_L38_C0", "label": "from visualization_msgs.msg import Marker", "type": "import", "loc": [38, 38], "level": 0, "parent": null, "vector": [1, 0, 0.0548, 0.0014, 0, 0.66, 0.8065, 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_99617:Assign_L41_C0", "label": "node_name =", "type": "assigned_variable", "loc": [41, 41], "level": 0, "parent": null, "vector": [14, 0, 0.0591, 0.0014, 0, 0.66, 0.8387, 516, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "node_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "node_name = \"pr2_arms\" "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L43_C0", "label": "log", "type": "function", "loc": [43, 44], "level": 0, "parent": null, "vector": [2, 0, 0.0627, 0.0029, 0, 0.66, 0.871, 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_99617:Expr_L44_C4", "label": "loginfo()", "type": "expression", "loc": [44, 44], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L43_C0", "vector": [8, 1, 0.0634, 0.0014, 1, 0.71, 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_99617:FunctionDef_L51_C0", "label": "make_column", "type": "function", "loc": [51, 60], "level": 0, "parent": null, "vector": [2, 0, 0.08, 0.0144, 0, 0.66, 0.9032, 304, 0, 1, 1, 0, 0, 0, 8], "semantic": {"name": "make_column", "arg_names": ["x"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def make_column(x):\n if (type(x) == type([]) \n or (type(x) == np.ndarray and x.ndim == 1)\n or type(x) == type(())):\n return np.matrix(x).T\n if type(x) == np.ndarray:\n x = np.matrix(x)\n if x.shape[0] == 1:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L52_C4", "label": "if", "type": "if", "loc": [52, 55], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L51_C0", "vector": [4, 1, 0.0771, 0.0058, 1, 0.25, 0.0, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (type(x) == type([]) \n or (type(x) == np.ndarray and x.ndim == 1)\n or type(x) == type(())):\n return np.matrix(x).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Return_L55_C8", "label": "return", "type": "return", "loc": [55, 55], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L52_C4", "vector": [13, 2, 0.0793, 0.0014, 2, 0.59, 0.0, 0, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return np.matrix(x).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L56_C4", "label": "if", "type": "if", "loc": [56, 57], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L51_C0", "vector": [4, 1, 0.0814, 0.0029, 1, 0.25, 0.3333, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if type(x) == np.ndarray:\n x = np.matrix(x)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L57_C8", "label": "x = matrix()", "type": "assigned_variable", "loc": [57, 57], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L56_C4", "vector": [14, 2, 0.0821, 0.0014, 2, 0.76, 0.0, 190, 3, 1, 0, 0, 162, 10, 1], "semantic": {"name": "x", "arg_names": [], "import_names": [], "rhs_call_name": "matrix", "annotation": ""}, "snippet": " x = np.matrix(x)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L58_C4", "label": "if", "type": "if", "loc": [58, 59], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L51_C0", "vector": [4, 1, 0.0843, 0.0029, 1, 0.25, 0.6667, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if x.shape[0] == 1:\n return x.T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Return_L59_C8", "label": "return", "type": "return", "loc": [59, 59], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L58_C4", "vector": [13, 2, 0.085, 0.0014, 2, 0.71, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return x.T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Return_L60_C4", "label": "return", "type": "return", "loc": [60, 60], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L51_C0", "vector": [13, 1, 0.0865, 0.0014, 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 x"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:ClassDef_L63_C0", "label": "PR2Arms", "type": "class", "loc": [63, 403], "level": 0, "parent": null, "vector": [3, 0, 0.3357, 0.4914, 0, 0.66, 0.9355, 694, 0, 19, 0, 0, 186, 0, 99], "semantic": {"name": "PR2Arms", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class PR2Arms(object):\n def __init__(self, primary_ft_sensor):\n log(\"Loading PR2Arms\")\n\n self.arms = PR2Arms_kdl() # KDL chain.\n\n self.joint_names_list = [['r_shoulder_pan_joint',\n 'r_shoulder_lift_joint', 'r_upper_arm_roll_joint',"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L64_C4", "label": "__init__", "type": "function", "loc": [64, 123], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:ClassDef_L63_C0", "vector": [2, 1, 0.1347, 0.0865, 1, 0.58, 0.0, 555, 0, 2, 0, 0, 0, 0, 21], "semantic": {"name": "__init__", "arg_names": ["self", "primary_ft_sensor"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, primary_ft_sensor):\n log(\"Loading PR2Arms\")\n\n self.arms = PR2Arms_kdl() # KDL chain.\n\n self.joint_names_list = [['r_shoulder_pan_joint',\n 'r_shoulder_lift_joint', 'r_upper_arm_roll_joint',\n 'r_elbow_flex_joint', 'r_forearm_roll_joint',"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L65_C8", "label": "log()", "type": "expression", "loc": [65, 65], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L64_C4", "vector": [8, 2, 0.0937, 0.0014, 2, 0.02, 0.0, 432, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "log", "arg_names": [], "import_names": [], "rhs_call_name": "log", "annotation": ""}, "snippet": " log(\"Loading PR2Arms\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L67_C8", "label": "self.arms = PR2Arms_kdl()", "type": "assigned_variable", "loc": [67, 67], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L64_C4", "vector": [14, 2, 0.0965, 0.0014, 2, 0.02, 0.0345, 495, 3, 0, 0, 0, 188, 10, 1], "semantic": {"name": "self.arms", "arg_names": [], "import_names": [], "rhs_call_name": "PR2Arms_kdl", "annotation": ""}, "snippet": " self.arms = PR2Arms_kdl() # KDL chain."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L69_C8", "label": "self.joint_names_list =", "type": "assigned_variable", "loc": [69, 76], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L64_C4", "vector": [14, 2, 0.1045, 0.0115, 2, 0.02, 0.069, 515, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.joint_names_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.joint_names_list = [['r_shoulder_pan_joint',\n 'r_shoulder_lift_joint', 'r_upper_arm_roll_joint',\n 'r_elbow_flex_joint', 'r_forearm_roll_joint',\n 'r_wrist_flex_joint', 'r_wrist_roll_joint'],\n ['l_shoulder_pan_joint',\n 'l_shoulder_lift_joint', 'l_upper_arm_roll_joint',\n 'l_elbow_flex_joint', 'l_forearm_roll_joint',\n 'l_wrist_flex_joint', 'l_wrist_roll_joint']]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L78_C8", "label": "self.arm_state_lock =", "type": "assigned_variable", "loc": [78, 78], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L64_C4", "vector": [14, 2, 0.1124, 0.0014, 2, 0.02, 0.1034, 845, 0, 0, 0, 0, 0, 5, 2], "semantic": {"name": "self.arm_state_lock", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.arm_state_lock = [RLock(), RLock()]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L79_C8", "label": "self.jep =", "type": "assigned_variable", "loc": [79, 79], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L64_C4", "vector": [14, 2, 0.1138, 0.0014, 2, 0.02, 0.1379, 580, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.jep", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.jep = [None, None]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L81_C8", "label": "self.arm_angles =", "type": "assigned_variable", "loc": [81, 81], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L64_C4", "vector": [14, 2, 0.1167, 0.0014, 2, 0.02, 0.1724, 980, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.arm_angles", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.arm_angles = [None, None]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L82_C8", "label": "self.torso_position =", "type": "assigned_variable", "loc": [82, 82], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L64_C4", "vector": [14, 2, 0.1182, 0.0014, 2, 0.02, 0.2069, 371, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.torso_position", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.torso_position = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L83_C8", "label": "self.arm_efforts =", "type": "assigned_variable", "loc": [83, 83], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L64_C4", "vector": [14, 2, 0.1196, 0.0014, 2, 0.02, 0.2414, 222, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.arm_efforts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.arm_efforts = [None, None]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L85_C8", "label": "self.r_arm_cart_pub = Publisher()", "type": "assigned_variable", "loc": [85, 85], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L64_C4", "vector": [14, 2, 0.1225, 0.0014, 2, 0.02, 0.2759, 7, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "self.r_arm_cart_pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " self.r_arm_cart_pub = rospy.Publisher('/r_cart/command_pose', PoseStamped)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L86_C8", "label": "self.l_arm_cart_pub = Publisher()", "type": "assigned_variable", "loc": [86, 86], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L64_C4", "vector": [14, 2, 0.1239, 0.0014, 2, 0.02, 0.3103, 808, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "self.l_arm_cart_pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " self.l_arm_cart_pub = rospy.Publisher('/l_cart/command_pose', PoseStamped)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L88_C8", "label": "Subscriber()", "type": "expression", "loc": [88, 88], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L64_C4", "vector": [8, 2, 0.1268, 0.0014, 2, 0.02, 0.3448, 455, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "Subscriber", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " rospy.Subscriber('/r_cart/state', JTTeleopControllerState, self.r_cart_state_cb)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L89_C8", "label": "Subscriber()", "type": "expression", "loc": [89, 89], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L64_C4", "vector": [8, 2, 0.1282, 0.0014, 2, 0.02, 0.3793, 455, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "Subscriber", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " rospy.Subscriber('/l_cart/state', JTTeleopControllerState, self.l_cart_state_cb)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L91_C8", "label": "Subscriber()", "type": "expression", "loc": [91, 92], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L64_C4", "vector": [8, 2, 0.1318, 0.0029, 2, 0.02, 0.4138, 455, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "Subscriber", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " rospy.Subscriber('/joint_states', JointState,\n self.joint_states_cb, queue_size=2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L93_C8", "label": "self.marker_pub = Publisher()", "type": "assigned_variable", "loc": [93, 93], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L64_C4", "vector": [14, 2, 0.134, 0.0014, 2, 0.02, 0.4483, 368, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "self.marker_pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " self.marker_pub = rospy.Publisher('/pr2_arms/viz_markers', Marker)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L94_C8", "label": "self.cep_marker_id =", "type": "assigned_variable", "loc": [94, 94], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L64_C4", "vector": [14, 2, 0.1354, 0.0014, 2, 0.02, 0.4828, 419, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.cep_marker_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.cep_marker_id = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L96_C8", "label": "self.r_arm_ftc = FTClient()", "type": "assigned_variable", "loc": [96, 96], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L64_C4", "vector": [14, 2, 0.1383, 0.0014, 2, 0.02, 0.5172, 538, 3, 1, 0, 0, 78, 10, 1], "semantic": {"name": "self.r_arm_ftc", "arg_names": [], "import_names": [], "rhs_call_name": "FTClient", "annotation": ""}, "snippet": " self.r_arm_ftc = ftc.FTClient('force_torque_ft2')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L97_C8", "label": "self.r_arm_ftc_estimate = FTClient()", "type": "assigned_variable", "loc": [97, 97], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L64_C4", "vector": [14, 2, 0.1398, 0.0014, 2, 0.02, 0.5517, 293, 3, 1, 0, 0, 78, 10, 1], "semantic": {"name": "self.r_arm_ftc_estimate", "arg_names": [], "import_names": [], "rhs_call_name": "FTClient", "annotation": ""}, "snippet": " self.r_arm_ftc_estimate = ftc.FTClient('force_torque_ft2_estimate')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L98_C8", "label": "self.tf_lstnr = TransformListener()", "type": "assigned_variable", "loc": [98, 98], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L64_C4", "vector": [14, 2, 0.1412, 0.0014, 2, 0.02, 0.5862, 699, 3, 0, 0, 0, 108, 10, 1], "semantic": {"name": "self.tf_lstnr", "arg_names": [], "import_names": [], "rhs_call_name": "TransformListener", "annotation": ""}, "snippet": " self.tf_lstnr = tf.TransformListener()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L100_C8", "label": "if", "type": "if", "loc": [100, 101], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L64_C4", "vector": [4, 2, 0.1448, 0.0029, 2, 0.02, 0.6207, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if primary_ft_sensor == 'ati':\n self.get_wrist_force = self.get_wrist_force_ati"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L101_C12", "label": "self.get_wrist_force =", "type": "assigned_variable", "loc": [101, 101], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L100_C8", "vector": [14, 3, 0.1455, 0.0014, 3, 0.16, 0.0, 994, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.get_wrist_force", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.get_wrist_force = self.get_wrist_force_ati"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L102_C8", "label": "if", "type": "if", "loc": [102, 103], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L64_C4", "vector": [4, 2, 0.1477, 0.0029, 2, 0.02, 0.6552, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if primary_ft_sensor == 'estimate':\n self.get_wrist_force = self.get_wrist_force_estimate"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L103_C12", "label": "self.get_wrist_force =", "type": "assigned_variable", "loc": [103, 103], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L102_C8", "vector": [14, 3, 0.1484, 0.0014, 3, 0.61, 0.0, 994, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.get_wrist_force", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.get_wrist_force = self.get_wrist_force_estimate"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L105_C8", "label": "r_action_client = SimpleActionClient()", "type": "assigned_variable", "loc": [105, 106], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L64_C4", "vector": [14, 2, 0.152, 0.0029, 2, 0.02, 0.6897, 242, 3, 2, 0, 0, 230, 10, 1], "semantic": {"name": "r_action_client", "arg_names": [], "import_names": [], "rhs_call_name": "SimpleActionClient", "annotation": ""}, "snippet": " r_action_client = actionlib.SimpleActionClient('r_arm_controller/joint_trajectory_action',\n JointTrajectoryAction)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L107_C8", "label": "l_action_client = SimpleActionClient()", "type": "assigned_variable", "loc": [107, 108], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L64_C4", "vector": [14, 2, 0.1549, 0.0029, 2, 0.02, 0.7241, 492, 3, 2, 0, 0, 230, 10, 1], "semantic": {"name": "l_action_client", "arg_names": [], "import_names": [], "rhs_call_name": "SimpleActionClient", "annotation": ""}, "snippet": " l_action_client = actionlib.SimpleActionClient('l_arm_controller/joint_trajectory_action',\n JointTrajectoryAction)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L109_C8", "label": "self.joint_action_client =", "type": "assigned_variable", "loc": [109, 109], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L64_C4", "vector": [14, 2, 0.1571, 0.0014, 2, 0.02, 0.7586, 369, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.joint_action_client", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.joint_action_client = [r_action_client, l_action_client]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L111_C8", "label": "r_gripper_client = SimpleActionClient()", "type": "assigned_variable", "loc": [111, 112], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L64_C4", "vector": [14, 2, 0.1607, 0.0029, 2, 0.02, 0.7931, 204, 3, 2, 0, 0, 230, 10, 1], "semantic": {"name": "r_gripper_client", "arg_names": [], "import_names": [], "rhs_call_name": "SimpleActionClient", "annotation": ""}, "snippet": " r_gripper_client = actionlib.SimpleActionClient('r_gripper_controller/gripper_action',\n Pr2GripperCommandAction)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L113_C8", "label": "l_gripper_client = SimpleActionClient()", "type": "assigned_variable", "loc": [113, 114], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L64_C4", "vector": [14, 2, 0.1635, 0.0029, 2, 0.02, 0.8276, 647, 3, 2, 0, 0, 230, 10, 1], "semantic": {"name": "l_gripper_client", "arg_names": [], "import_names": [], "rhs_call_name": "SimpleActionClient", "annotation": ""}, "snippet": " l_gripper_client = actionlib.SimpleActionClient('l_gripper_controller/gripper_action',\n Pr2GripperCommandAction)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L115_C8", "label": "self.gripper_action_client =", "type": "assigned_variable", "loc": [115, 115], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L64_C4", "vector": [14, 2, 0.1657, 0.0014, 2, 0.02, 0.8621, 87, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.gripper_action_client", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.gripper_action_client = [r_gripper_client, l_gripper_client]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L116_C8", "label": "sleep()", "type": "expression", "loc": [116, 116], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L64_C4", "vector": [8, 2, 0.1671, 0.0014, 2, 0.02, 0.8966, 476, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " rospy.sleep(2.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L120_C8", "label": "wait_for_server()", "type": "expression", "loc": [120, 120], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L64_C4", "vector": [8, 2, 0.1729, 0.0014, 2, 0.02, 0.931, 784, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "wait_for_server", "arg_names": [], "import_names": [], "rhs_call_name": "wait_for_server", "annotation": ""}, "snippet": " self.gripper_action_client[0].wait_for_server()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L121_C8", "label": "wait_for_server()", "type": "expression", "loc": [121, 121], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L64_C4", "vector": [8, 2, 0.1744, 0.0014, 2, 0.02, 0.9655, 784, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "wait_for_server", "arg_names": [], "import_names": [], "rhs_call_name": "wait_for_server", "annotation": ""}, "snippet": " self.gripper_action_client[1].wait_for_server()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L123_C8", "label": "log()", "type": "expression", "loc": [123, 123], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L64_C4", "vector": [8, 2, 0.1772, 0.0014, 2, 0.02, 1.0, 432, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "log", "arg_names": [], "import_names": [], "rhs_call_name": "log", "annotation": ""}, "snippet": " log(\"Finished loading SimpleArmManger\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L129_C4", "label": "joint_states_cb", "type": "function", "loc": [129, 167], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:ClassDef_L63_C0", "vector": [2, 1, 0.2133, 0.0562, 1, 0.58, 0.0556, 800, 0, 2, 0, 0, 0, 0, 14], "semantic": {"name": "joint_states_cb", "arg_names": ["self", "data"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def joint_states_cb(self, data):\n arm_angles = [[], []]\n arm_efforts = [[], []]\n r_jt_idx_list = [0]*7\n l_jt_idx_list = [0]*7\n for i, jt_nm in enumerate(self.joint_names_list[0]):\n r_jt_idx_list[i] = data.name.index(jt_nm)\n for i, jt_nm in enumerate(self.joint_names_list[1]):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L130_C8", "label": "arm_angles =", "type": "assigned_variable", "loc": [130, 130], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L129_C4", "vector": [14, 2, 0.1873, 0.0014, 2, 0.59, 0.0, 148, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "arm_angles", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " arm_angles = [[], []]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L131_C8", "label": "arm_efforts =", "type": "assigned_variable", "loc": [131, 131], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L129_C4", "vector": [14, 2, 0.1888, 0.0014, 2, 0.59, 0.0625, 394, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "arm_efforts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " arm_efforts = [[], []]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L132_C8", "label": "r_jt_idx_list =", "type": "assigned_variable", "loc": [132, 132], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L129_C4", "vector": [14, 2, 0.1902, 0.0014, 2, 0.59, 0.125, 924, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "r_jt_idx_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " r_jt_idx_list = [0]*7"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L133_C8", "label": "l_jt_idx_list =", "type": "assigned_variable", "loc": [133, 133], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L129_C4", "vector": [14, 2, 0.1916, 0.0014, 2, 0.59, 0.1875, 974, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "l_jt_idx_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " l_jt_idx_list = [0]*7"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:For_L134_C8", "label": "for i, jt_nm", "type": "for", "loc": [134, 135], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L129_C4", "vector": [6, 2, 0.1938, 0.0029, 2, 0.59, 0.25, 122, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "i, jt_nm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i, jt_nm in enumerate(self.joint_names_list[0]):\n r_jt_idx_list[i] = data.name.index(jt_nm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L135_C12", "label": " = index()", "type": "assigned_variable", "loc": [135, 135], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:For_L134_C8", "vector": [14, 3, 0.1945, 0.0014, 3, 0.65, 0.0, 0, 3, 1, 0, 0, 780, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "index", "annotation": ""}, "snippet": " r_jt_idx_list[i] = data.name.index(jt_nm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:For_L136_C8", "label": "for i, jt_nm", "type": "for", "loc": [136, 137], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L129_C4", "vector": [6, 2, 0.1967, 0.0029, 2, 0.59, 0.3125, 122, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "i, jt_nm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i, jt_nm in enumerate(self.joint_names_list[1]):\n l_jt_idx_list[i] = data.name.index(jt_nm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L137_C12", "label": " = index()", "type": "assigned_variable", "loc": [137, 137], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:For_L136_C8", "vector": [14, 3, 0.1974, 0.0014, 3, 0.16, 0.0, 0, 3, 1, 0, 0, 780, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "index", "annotation": ""}, "snippet": " l_jt_idx_list[i] = data.name.index(jt_nm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:For_L140_C8", "label": "for i", "type": "for", "loc": [140, 153], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L129_C4", "vector": [6, 2, 0.2111, 0.0202, 2, 0.59, 0.375, 826, 3, 0, 0, 0, 0, 0, 5], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(7):\n idx = r_jt_idx_list[i]\n if data.name[idx] != self.joint_names_list[0][i]:\n raise RuntimeError('joint angle name does not match. Expected: %s, Actual: %s i: %d'%('r_'+nm+'_joint', data.name[idx], i))\n arm_angles[0].append(data.position[idx])\n arm_efforts[0].append(data.effort[idx])\n\n idx = l_jt_idx_list[i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L141_C12", "label": "idx =", "type": "assigned_variable", "loc": [141, 141], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:For_L140_C8", "vector": [14, 3, 0.2032, 0.0014, 3, 0.83, 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_99617:If_L142_C12", "label": "if", "type": "if", "loc": [142, 143], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:For_L140_C8", "vector": [4, 3, 0.2053, 0.0029, 3, 0.83, 0.1667, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if data.name[idx] != self.joint_names_list[0][i]:\n raise RuntimeError('joint angle name does not match. Expected: %s, Actual: %s i: %d'%('r_'+nm+'_joint', data.name[idx], i))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L144_C12", "label": "append()", "type": "expression", "loc": [144, 144], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:For_L140_C8", "vector": [8, 3, 0.2075, 0.0014, 3, 0.83, 0.3333, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " arm_angles[0].append(data.position[idx])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L145_C12", "label": "append()", "type": "expression", "loc": [145, 145], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:For_L140_C8", "vector": [8, 3, 0.2089, 0.0014, 3, 0.83, 0.5, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " arm_efforts[0].append(data.effort[idx])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L147_C12", "label": "idx =", "type": "assigned_variable", "loc": [147, 147], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:For_L140_C8", "vector": [14, 3, 0.2118, 0.0014, 3, 0.83, 0.6667, 187, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "idx", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " idx = l_jt_idx_list[i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L148_C12", "label": "if", "type": "if", "loc": [148, 149], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:For_L140_C8", "vector": [4, 3, 0.214, 0.0029, 3, 0.83, 0.8333, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if data.name[idx] != self.joint_names_list[1][i]:\n raise RuntimeError('joint angle name does not match. Expected: %s, Actual: %s i: %d'%('r_'+nm+'_joint', data.name[idx], i))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L151_C12", "label": "ang =", "type": "assigned_variable", "loc": [151, 151], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:For_L140_C8", "vector": [14, 3, 0.2176, 0.0014, 3, 0.83, 1.0, 762, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ang", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ang = data.position[idx]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L155_C8", "label": "acquire()", "type": "expression", "loc": [155, 155], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L129_C4", "vector": [8, 2, 0.2233, 0.0014, 2, 0.59, 0.4375, 229, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "acquire", "arg_names": [], "import_names": [], "rhs_call_name": "acquire", "annotation": ""}, "snippet": " self.arm_state_lock[0].acquire()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L156_C8", "label": "assign", "type": "assigned_variable", "loc": [156, 156], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L129_C4", "vector": [14, 2, 0.2248, 0.0014, 2, 0.59, 0.5, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.arm_angles[0] = arm_angles[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L157_C8", "label": "assign", "type": "assigned_variable", "loc": [157, 157], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L129_C4", "vector": [14, 2, 0.2262, 0.0014, 2, 0.59, 0.5625, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.arm_efforts[0] = arm_efforts[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L159_C8", "label": "torso_idx = index()", "type": "assigned_variable", "loc": [159, 159], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L129_C4", "vector": [14, 2, 0.2291, 0.0014, 2, 0.59, 0.625, 34, 3, 1, 0, 0, 780, 10, 1], "semantic": {"name": "torso_idx", "arg_names": [], "import_names": [], "rhs_call_name": "index", "annotation": ""}, "snippet": " torso_idx = data.name.index('torso_lift_joint')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L160_C8", "label": "self.torso_position =", "type": "assigned_variable", "loc": [160, 160], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L129_C4", "vector": [14, 2, 0.2305, 0.0014, 2, 0.59, 0.6875, 371, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.torso_position", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.torso_position = data.position[torso_idx]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L162_C8", "label": "release()", "type": "expression", "loc": [162, 162], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L129_C4", "vector": [8, 2, 0.2334, 0.0014, 2, 0.59, 0.75, 784, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "release", "arg_names": [], "import_names": [], "rhs_call_name": "release", "annotation": ""}, "snippet": " self.arm_state_lock[0].release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L164_C8", "label": "acquire()", "type": "expression", "loc": [164, 164], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L129_C4", "vector": [8, 2, 0.2363, 0.0014, 2, 0.59, 0.8125, 229, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "acquire", "arg_names": [], "import_names": [], "rhs_call_name": "acquire", "annotation": ""}, "snippet": " self.arm_state_lock[1].acquire()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L165_C8", "label": "assign", "type": "assigned_variable", "loc": [165, 165], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L129_C4", "vector": [14, 2, 0.2378, 0.0014, 2, 0.59, 0.875, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.arm_angles[1] = arm_angles[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L166_C8", "label": "assign", "type": "assigned_variable", "loc": [166, 166], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L129_C4", "vector": [14, 2, 0.2392, 0.0014, 2, 0.59, 0.9375, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.arm_efforts[1] = arm_efforts[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L167_C8", "label": "release()", "type": "expression", "loc": [167, 167], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L129_C4", "vector": [8, 2, 0.2406, 0.0014, 2, 0.59, 1.0, 784, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "release", "arg_names": [], "import_names": [], "rhs_call_name": "release", "annotation": ""}, "snippet": " self.arm_state_lock[1].release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L169_C4", "label": "r_cart_state_cb", "type": "function", "loc": [169, 215], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:ClassDef_L63_C0", "vector": [2, 1, 0.2767, 0.0677, 1, 0.58, 0.1111, 925, 0, 2, 0, 0, 0, 0, 14], "semantic": {"name": "r_cart_state_cb", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def r_cart_state_cb(self, msg):\n trans, quat = self.tf_lstnr.lookupTransform('/torso_lift_link',\n 'r_gripper_tool_frame', rospy.Time(0))\n rot = tr.quaternion_to_matrix(quat)\n tip = np.matrix([0.12, 0., 0.]).T\n self.r_ee_pos = rot*tip + np.matrix(trans).T\n self.r_ee_rot = rot\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L170_C8", "label": "trans, quat = lookupTransform()", "type": "assigned_variable", "loc": [170, 171], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L169_C4", "vector": [14, 2, 0.2457, 0.0029, 2, 0.58, 0.0, 441, 3, 3, 0, 0, 926, 10, 2], "semantic": {"name": "trans, quat", "arg_names": [], "import_names": [], "rhs_call_name": "lookupTransform", "annotation": ""}, "snippet": " trans, quat = self.tf_lstnr.lookupTransform('/torso_lift_link',\n 'r_gripper_tool_frame', rospy.Time(0))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L172_C8", "label": "rot = quaternion_to_matrix()", "type": "assigned_variable", "loc": [172, 172], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L169_C4", "vector": [14, 2, 0.2478, 0.0014, 2, 0.58, 0.0256, 812, 3, 1, 0, 0, 149, 10, 1], "semantic": {"name": "rot", "arg_names": [], "import_names": [], "rhs_call_name": "quaternion_to_matrix", "annotation": ""}, "snippet": " rot = tr.quaternion_to_matrix(quat)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L173_C8", "label": "tip =", "type": "assigned_variable", "loc": [173, 173], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L169_C4", "vector": [14, 2, 0.2493, 0.0014, 2, 0.58, 0.0513, 726, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "tip", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tip = np.matrix([0.12, 0., 0.]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L174_C8", "label": "self.r_ee_pos =", "type": "assigned_variable", "loc": [174, 174], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L169_C4", "vector": [14, 2, 0.2507, 0.0014, 2, 0.58, 0.0769, 506, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.r_ee_pos", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.r_ee_pos = rot*tip + np.matrix(trans).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L175_C8", "label": "self.r_ee_rot =", "type": "assigned_variable", "loc": [175, 175], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L169_C4", "vector": [14, 2, 0.2522, 0.0014, 2, 0.58, 0.1026, 375, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.r_ee_rot", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.r_ee_rot = rot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L178_C8", "label": "marker = Marker()", "type": "assigned_variable", "loc": [178, 178], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L169_C4", "vector": [14, 2, 0.2565, 0.0014, 2, 0.58, 0.1282, 864, 3, 0, 0, 0, 923, 10, 1], "semantic": {"name": "marker", "arg_names": [], "import_names": [], "rhs_call_name": "Marker", "annotation": ""}, "snippet": " marker = Marker()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L179_C8", "label": "marker.header.frame_id =", "type": "assigned_variable", "loc": [179, 179], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L169_C4", "vector": [14, 2, 0.2579, 0.0014, 2, 0.58, 0.1538, 22, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "marker.header.frame_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.header.frame_id = 'torso_lift_link'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L180_C8", "label": "time_stamp = now()", "type": "assigned_variable", "loc": [180, 180], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L169_C4", "vector": [14, 2, 0.2594, 0.0014, 2, 0.58, 0.1795, 156, 3, 0, 0, 0, 894, 10, 1], "semantic": {"name": "time_stamp", "arg_names": [], "import_names": [], "rhs_call_name": "now", "annotation": ""}, "snippet": " time_stamp = rospy.Time.now()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L181_C8", "label": "marker.header.stamp =", "type": "assigned_variable", "loc": [181, 181], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L169_C4", "vector": [14, 2, 0.2608, 0.0014, 2, 0.58, 0.2051, 625, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "marker.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.header.stamp = time_stamp"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L182_C8", "label": "marker.ns =", "type": "assigned_variable", "loc": [182, 182], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L169_C4", "vector": [14, 2, 0.2622, 0.0014, 2, 0.58, 0.2308, 748, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "marker.ns", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.ns = 'aloha land'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L183_C8", "label": "marker.type =", "type": "assigned_variable", "loc": [183, 183], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L169_C4", "vector": [14, 2, 0.2637, 0.0014, 2, 0.58, 0.2564, 726, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "marker.type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.type = Marker.SPHERE"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L184_C8", "label": "marker.action =", "type": "assigned_variable", "loc": [184, 184], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L169_C4", "vector": [14, 2, 0.2651, 0.0014, 2, 0.58, 0.2821, 211, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "marker.action", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.action = Marker.ADD"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L185_C8", "label": "marker.pose.position.x =", "type": "assigned_variable", "loc": [185, 185], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L169_C4", "vector": [14, 2, 0.2666, 0.0014, 2, 0.58, 0.3077, 294, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "marker.pose.position.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.pose.position.x = self.r_ee_pos[0,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L186_C8", "label": "marker.pose.position.y =", "type": "assigned_variable", "loc": [186, 186], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L169_C4", "vector": [14, 2, 0.268, 0.0014, 2, 0.58, 0.3333, 911, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "marker.pose.position.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.pose.position.y = self.r_ee_pos[1,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L187_C8", "label": "marker.pose.position.z =", "type": "assigned_variable", "loc": [187, 187], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L169_C4", "vector": [14, 2, 0.2695, 0.0014, 2, 0.58, 0.359, 473, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "marker.pose.position.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.pose.position.z = self.r_ee_pos[2,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L188_C8", "label": "size =", "type": "assigned_variable", "loc": [188, 188], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L169_C4", "vector": [14, 2, 0.2709, 0.0014, 2, 0.58, 0.3846, 714, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "size", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " size = 0.02"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L189_C8", "label": "marker.scale.x =", "type": "assigned_variable", "loc": [189, 189], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L169_C4", "vector": [14, 2, 0.2723, 0.0014, 2, 0.58, 0.4103, 887, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "marker.scale.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.scale.x = size"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L190_C8", "label": "marker.scale.y =", "type": "assigned_variable", "loc": [190, 190], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L169_C4", "vector": [14, 2, 0.2738, 0.0014, 2, 0.58, 0.4359, 730, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "marker.scale.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.scale.y = size"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L191_C8", "label": "marker.scale.z =", "type": "assigned_variable", "loc": [191, 191], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L169_C4", "vector": [14, 2, 0.2752, 0.0014, 2, 0.58, 0.4615, 969, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "marker.scale.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.scale.z = size"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L192_C8", "label": "marker.lifetime = Duration()", "type": "assigned_variable", "loc": [192, 192], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L169_C4", "vector": [14, 2, 0.2767, 0.0014, 2, 0.58, 0.4872, 788, 3, 0, 0, 0, 972, 10, 1], "semantic": {"name": "marker.lifetime", "arg_names": [], "import_names": [], "rhs_call_name": "Duration", "annotation": ""}, "snippet": " marker.lifetime = rospy.Duration()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L194_C8", "label": "marker.id =", "type": "assigned_variable", "loc": [194, 194], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L169_C4", "vector": [14, 2, 0.2795, 0.0014, 2, 0.58, 0.5128, 570, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "marker.id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.id = 71"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L195_C8", "label": "marker.pose.orientation.x =", "type": "assigned_variable", "loc": [195, 195], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L169_C4", "vector": [14, 2, 0.281, 0.0014, 2, 0.58, 0.5385, 831, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "marker.pose.orientation.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.pose.orientation.x = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L196_C8", "label": "marker.pose.orientation.y =", "type": "assigned_variable", "loc": [196, 196], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L169_C4", "vector": [14, 2, 0.2824, 0.0014, 2, 0.58, 0.5641, 626, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "marker.pose.orientation.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.pose.orientation.y = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L197_C8", "label": "marker.pose.orientation.z =", "type": "assigned_variable", "loc": [197, 197], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L169_C4", "vector": [14, 2, 0.2839, 0.0014, 2, 0.58, 0.5897, 538, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "marker.pose.orientation.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.pose.orientation.z = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L198_C8", "label": "marker.pose.orientation.w =", "type": "assigned_variable", "loc": [198, 198], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L169_C4", "vector": [14, 2, 0.2853, 0.0014, 2, 0.58, 0.6154, 522, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "marker.pose.orientation.w", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.pose.orientation.w = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L200_C8", "label": "color =", "type": "assigned_variable", "loc": [200, 200], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L169_C4", "vector": [14, 2, 0.2882, 0.0014, 2, 0.58, 0.641, 776, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "color", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " color = (0.5, 0., 0.0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L201_C8", "label": "marker.color.r =", "type": "assigned_variable", "loc": [201, 201], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L169_C4", "vector": [14, 2, 0.2896, 0.0014, 2, 0.58, 0.6667, 486, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "marker.color.r", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.color.r = color[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L202_C8", "label": "marker.color.g =", "type": "assigned_variable", "loc": [202, 202], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L169_C4", "vector": [14, 2, 0.2911, 0.0014, 2, 0.58, 0.6923, 536, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "marker.color.g", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.color.g = color[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L203_C8", "label": "marker.color.b =", "type": "assigned_variable", "loc": [203, 203], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L169_C4", "vector": [14, 2, 0.2925, 0.0014, 2, 0.58, 0.7179, 744, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "marker.color.b", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.color.b = color[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L204_C8", "label": "marker.color.a =", "type": "assigned_variable", "loc": [204, 204], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L169_C4", "vector": [14, 2, 0.2939, 0.0014, 2, 0.58, 0.7436, 240, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "marker.color.a", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.color.a = 1."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L205_C8", "label": "publish()", "type": "expression", "loc": [205, 205], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L169_C4", "vector": [8, 2, 0.2954, 0.0014, 2, 0.58, 0.7692, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.marker_pub.publish(marker)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L207_C8", "label": "ros_pt =", "type": "assigned_variable", "loc": [207, 207], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L169_C4", "vector": [14, 2, 0.2983, 0.0014, 2, 0.58, 0.7949, 874, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ros_pt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ros_pt = msg.x_desi_filtered.pose.position"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L208_C8", "label": "x, y, z =", "type": "assigned_variable", "loc": [208, 208], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L169_C4", "vector": [14, 2, 0.2997, 0.0014, 2, 0.58, 0.8205, 971, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "x, y, z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " x, y, z = ros_pt.x, ros_pt.y, ros_pt.z"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L209_C8", "label": "self.r_cep_pos =", "type": "assigned_variable", "loc": [209, 209], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L169_C4", "vector": [14, 2, 0.3012, 0.0014, 2, 0.58, 0.8462, 277, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.r_cep_pos", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.r_cep_pos = np.matrix([x, y, z]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L210_C8", "label": "pt =", "type": "assigned_variable", "loc": [210, 210], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L169_C4", "vector": [14, 2, 0.3026, 0.0014, 2, 0.58, 0.8718, 989, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "pt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pt = rot.T * (np.matrix([x,y,z]).T - np.matrix(trans).T)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L211_C8", "label": "pt =", "type": "assigned_variable", "loc": [211, 211], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L169_C4", "vector": [14, 2, 0.304, 0.0014, 2, 0.58, 0.8974, 989, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pt = pt + tip"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L212_C8", "label": "self.r_cep_pos_hooktip =", "type": "assigned_variable", "loc": [212, 212], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L169_C4", "vector": [14, 2, 0.3055, 0.0014, 2, 0.58, 0.9231, 508, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.r_cep_pos_hooktip", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.r_cep_pos_hooktip = rot*pt + np.matrix(trans).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L213_C8", "label": "ros_quat =", "type": "assigned_variable", "loc": [213, 213], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L169_C4", "vector": [14, 2, 0.3069, 0.0014, 2, 0.58, 0.9487, 920, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ros_quat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ros_quat = msg.x_desi_filtered.pose.orientation"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L214_C8", "label": "quat =", "type": "assigned_variable", "loc": [214, 214], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L169_C4", "vector": [14, 2, 0.3084, 0.0014, 2, 0.58, 0.9744, 367, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "quat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " quat = (ros_quat.x, ros_quat.y, ros_quat.z, ros_quat.w)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L215_C8", "label": "self.r_cep_rot = quaternion_to_matrix()", "type": "assigned_variable", "loc": [215, 215], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L169_C4", "vector": [14, 2, 0.3098, 0.0014, 2, 0.58, 1.0, 764, 3, 1, 0, 0, 149, 10, 1], "semantic": {"name": "self.r_cep_rot", "arg_names": [], "import_names": [], "rhs_call_name": "quaternion_to_matrix", "annotation": ""}, "snippet": " self.r_cep_rot = tr.quaternion_to_matrix(quat)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L217_C4", "label": "l_cart_state_cb", "type": "function", "loc": [217, 222], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:ClassDef_L63_C0", "vector": [2, 1, 0.3163, 0.0086, 1, 0.58, 0.1667, 1, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "l_cart_state_cb", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def l_cart_state_cb(self, msg):\n ros_pt = msg.x_desi_filtered.pose.position\n self.l_cep_pos = np.matrix([ros_pt.x, ros_pt.y, ros_pt.z]).T\n ros_quat = msg.x_desi_filtered.pose.orientation\n quat = (ros_quat.x, ros_quat.y, ros_quat.z, ros_quat.w)\n self.l_cep_rot = tr.quaternion_to_matrix(quat)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L218_C8", "label": "ros_pt =", "type": "assigned_variable", "loc": [218, 218], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L217_C4", "vector": [14, 2, 0.3141, 0.0014, 2, 0.13, 0.0, 874, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ros_pt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ros_pt = msg.x_desi_filtered.pose.position"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L219_C8", "label": "self.l_cep_pos =", "type": "assigned_variable", "loc": [219, 219], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L217_C4", "vector": [14, 2, 0.3156, 0.0014, 2, 0.13, 0.25, 973, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.l_cep_pos", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.l_cep_pos = np.matrix([ros_pt.x, ros_pt.y, ros_pt.z]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L220_C8", "label": "ros_quat =", "type": "assigned_variable", "loc": [220, 220], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L217_C4", "vector": [14, 2, 0.317, 0.0014, 2, 0.13, 0.5, 920, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ros_quat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ros_quat = msg.x_desi_filtered.pose.orientation"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L221_C8", "label": "quat =", "type": "assigned_variable", "loc": [221, 221], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L217_C4", "vector": [14, 2, 0.3184, 0.0014, 2, 0.13, 0.75, 367, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "quat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " quat = (ros_quat.x, ros_quat.y, ros_quat.z, ros_quat.w)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L222_C8", "label": "self.l_cep_rot = quaternion_to_matrix()", "type": "assigned_variable", "loc": [222, 222], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L217_C4", "vector": [14, 2, 0.3199, 0.0014, 2, 0.13, 1.0, 385, 3, 1, 0, 0, 149, 10, 1], "semantic": {"name": "self.l_cep_rot", "arg_names": [], "import_names": [], "rhs_call_name": "quaternion_to_matrix", "annotation": ""}, "snippet": " self.l_cep_rot = tr.quaternion_to_matrix(quat)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L228_C4", "label": "end_effector_pos", "type": "function", "loc": [228, 230], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:ClassDef_L63_C0", "vector": [2, 1, 0.33, 0.0043, 1, 0.58, 0.2222, 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_99617:Assign_L229_C8", "label": "q = get_joint_angles()", "type": "assigned_variable", "loc": [229, 229], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L228_C4", "vector": [14, 2, 0.33, 0.0014, 2, 0.32, 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_99617:Return_L230_C8", "label": "return", "type": "return", "loc": [230, 230], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L228_C4", "vector": [13, 2, 0.3314, 0.0014, 2, 0.32, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.arms.FK_all(arm, q)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L235_C4", "label": "get_joint_angles", "type": "function", "loc": [235, 241], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:ClassDef_L63_C0", "vector": [2, 1, 0.3429, 0.0101, 1, 0.58, 0.2778, 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 if arm != 1:\n arm = 0\n self.arm_state_lock[arm].acquire()\n q = self.arm_angles[arm]\n self.arm_state_lock[arm].release()\n return q"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L236_C8", "label": "if", "type": "if", "loc": [236, 237], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L235_C4", "vector": [4, 2, 0.3408, 0.0029, 2, 0.64, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if arm != 1:\n arm = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L237_C12", "label": "arm =", "type": "assigned_variable", "loc": [237, 237], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L236_C8", "vector": [14, 3, 0.3415, 0.0014, 3, 0.21, 0.0, 413, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "arm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " arm = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L238_C8", "label": "acquire()", "type": "expression", "loc": [238, 238], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L235_C4", "vector": [8, 2, 0.3429, 0.0014, 2, 0.64, 0.25, 229, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "acquire", "arg_names": [], "import_names": [], "rhs_call_name": "acquire", "annotation": ""}, "snippet": " self.arm_state_lock[arm].acquire()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L239_C8", "label": "q =", "type": "assigned_variable", "loc": [239, 239], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L235_C4", "vector": [14, 2, 0.3444, 0.0014, 2, 0.64, 0.5, 516, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "q", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " q = self.arm_angles[arm]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L240_C8", "label": "release()", "type": "expression", "loc": [240, 240], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L235_C4", "vector": [8, 2, 0.3458, 0.0014, 2, 0.64, 0.75, 784, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "release", "arg_names": [], "import_names": [], "rhs_call_name": "release", "annotation": ""}, "snippet": " self.arm_state_lock[arm].release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Return_L241_C8", "label": "return", "type": "return", "loc": [241, 241], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L235_C4", "vector": [13, 2, 0.3473, 0.0014, 2, 0.64, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return q"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L243_C4", "label": "set_jep", "type": "function", "loc": [243, 267], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:ClassDef_L63_C0", "vector": [2, 1, 0.3674, 0.036, 1, 0.58, 0.3333, 799, 0, 4, 0, 0, 0, 0, 12], "semantic": {"name": "set_jep", "arg_names": ["self", "arm", "q", "duration"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def set_jep(self, arm, q, duration=0.15):\n self.arm_state_lock[arm].acquire()\n\n jtg = JointTrajectoryGoal()\n jtg.trajectory.joint_names = self.joint_names_list[arm]\n jtp = JointTrajectoryPoint()\n jtp.positions = q\n #jtp.velocities = [0 for i in range(len(q))]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L244_C8", "label": "acquire()", "type": "expression", "loc": [244, 244], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L243_C4", "vector": [8, 2, 0.3516, 0.0014, 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.arm_state_lock[arm].acquire()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L246_C8", "label": "jtg = JointTrajectoryGoal()", "type": "assigned_variable", "loc": [246, 246], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L243_C4", "vector": [14, 2, 0.3545, 0.0014, 2, 0.61, 0.0714, 511, 3, 0, 0, 0, 970, 10, 1], "semantic": {"name": "jtg", "arg_names": [], "import_names": [], "rhs_call_name": "JointTrajectoryGoal", "annotation": ""}, "snippet": " jtg = JointTrajectoryGoal()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L247_C8", "label": "jtg.trajectory.joint_names =", "type": "assigned_variable", "loc": [247, 247], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L243_C4", "vector": [14, 2, 0.3559, 0.0014, 2, 0.61, 0.1429, 747, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "jtg.trajectory.joint_names", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " jtg.trajectory.joint_names = self.joint_names_list[arm]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L248_C8", "label": "jtp = JointTrajectoryPoint()", "type": "assigned_variable", "loc": [248, 248], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L243_C4", "vector": [14, 2, 0.3573, 0.0014, 2, 0.61, 0.2143, 952, 3, 0, 0, 0, 302, 10, 1], "semantic": {"name": "jtp", "arg_names": [], "import_names": [], "rhs_call_name": "JointTrajectoryPoint", "annotation": ""}, "snippet": " jtp = JointTrajectoryPoint()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L249_C8", "label": "jtp.positions =", "type": "assigned_variable", "loc": [249, 249], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L243_C4", "vector": [14, 2, 0.3588, 0.0014, 2, 0.61, 0.2857, 984, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "jtp.positions", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " jtp.positions = q"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L252_C8", "label": "jtp.time_from_start = Duration()", "type": "assigned_variable", "loc": [252, 252], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L243_C4", "vector": [14, 2, 0.3631, 0.0014, 2, 0.61, 0.3571, 272, 3, 1, 0, 0, 972, 10, 1], "semantic": {"name": "jtp.time_from_start", "arg_names": [], "import_names": [], "rhs_call_name": "Duration", "annotation": ""}, "snippet": " jtp.time_from_start = rospy.Duration(duration)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L253_C8", "label": "append()", "type": "expression", "loc": [253, 253], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L243_C4", "vector": [8, 2, 0.3646, 0.0014, 2, 0.61, 0.4286, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " jtg.trajectory.points.append(jtp)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L254_C8", "label": "send_goal()", "type": "expression", "loc": [254, 254], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L243_C4", "vector": [8, 2, 0.366, 0.0014, 2, 0.61, 0.5, 184, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "send_goal", "arg_names": [], "import_names": [], "rhs_call_name": "send_goal", "annotation": ""}, "snippet": " self.joint_action_client[arm].send_goal(jtg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L256_C8", "label": "assign", "type": "assigned_variable", "loc": [256, 256], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L243_C4", "vector": [14, 2, 0.3689, 0.0014, 2, 0.61, 0.5714, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.jep[arm] = q"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L257_C8", "label": "cep, r = FK_all()", "type": "assigned_variable", "loc": [257, 257], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L243_C4", "vector": [14, 2, 0.3703, 0.0014, 2, 0.61, 0.6429, 805, 3, 2, 0, 0, 415, 10, 1], "semantic": {"name": "cep, r", "arg_names": [], "import_names": [], "rhs_call_name": "FK_all", "annotation": ""}, "snippet": " cep, r = self.arms.FK_all(arm, q)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L258_C8", "label": "release()", "type": "expression", "loc": [258, 258], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L243_C4", "vector": [8, 2, 0.3718, 0.0014, 2, 0.61, 0.7143, 784, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "release", "arg_names": [], "import_names": [], "rhs_call_name": "release", "annotation": ""}, "snippet": " self.arm_state_lock[arm].release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L260_C8", "label": "o =", "type": "assigned_variable", "loc": [260, 260], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L243_C4", "vector": [14, 2, 0.3746, 0.0014, 2, 0.61, 0.7857, 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_99617:Assign_L261_C8", "label": "cep_marker = single_marker()", "type": "assigned_variable", "loc": [261, 264], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L243_C4", "vector": [14, 2, 0.3782, 0.0058, 2, 0.61, 0.8571, 414, 3, 7, 0, 0, 614, 10, 1], "semantic": {"name": "cep_marker", "arg_names": [], "import_names": [], "rhs_call_name": "single_marker", "annotation": ""}, "snippet": " cep_marker = hv.single_marker(cep, o, 'sphere',\n '/torso_lift_link', color=(0., 0., 1., 1.),\n scale = (0.02, 0.02, 0.02),\n m_id = self.cep_marker_id)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L266_C8", "label": "cep_marker.header.stamp = now()", "type": "assigned_variable", "loc": [266, 266], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L243_C4", "vector": [14, 2, 0.3833, 0.0014, 2, 0.61, 0.9286, 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_99617:Expr_L267_C8", "label": "publish()", "type": "expression", "loc": [267, 267], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L243_C4", "vector": [8, 2, 0.3847, 0.0014, 2, 0.61, 1.0, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.marker_pub.publish(cep_marker)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L269_C4", "label": "get_jep", "type": "function", "loc": [269, 273], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:ClassDef_L63_C0", "vector": [2, 1, 0.3905, 0.0072, 1, 0.58, 0.3889, 898, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "get_jep", "arg_names": ["self", "arm"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_jep(self, arm):\n self.arm_state_lock[arm].acquire()\n jep = copy.copy(self.jep[arm])\n self.arm_state_lock[arm].release()\n return jep"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L270_C8", "label": "acquire()", "type": "expression", "loc": [270, 270], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L269_C4", "vector": [8, 2, 0.389, 0.0014, 2, 0.81, 0.0, 229, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "acquire", "arg_names": [], "import_names": [], "rhs_call_name": "acquire", "annotation": ""}, "snippet": " self.arm_state_lock[arm].acquire()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L271_C8", "label": "jep = copy()", "type": "assigned_variable", "loc": [271, 271], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L269_C4", "vector": [14, 2, 0.3905, 0.0014, 2, 0.81, 0.3333, 838, 3, 1, 0, 0, 739, 10, 1], "semantic": {"name": "jep", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " jep = copy.copy(self.jep[arm])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L272_C8", "label": "release()", "type": "expression", "loc": [272, 272], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L269_C4", "vector": [8, 2, 0.3919, 0.0014, 2, 0.81, 0.6667, 784, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "release", "arg_names": [], "import_names": [], "rhs_call_name": "release", "annotation": ""}, "snippet": " self.arm_state_lock[arm].release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Return_L273_C8", "label": "return", "type": "return", "loc": [273, 273], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L269_C4", "vector": [13, 2, 0.3934, 0.0014, 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 jep"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L275_C4", "label": "get_ee_jtt", "type": "function", "loc": [275, 279], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:ClassDef_L63_C0", "vector": [2, 1, 0.3991, 0.0072, 1, 0.58, 0.4444, 15, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "get_ee_jtt", "arg_names": ["self", "arm"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_ee_jtt(self, arm):\n if arm == 0:\n return self.r_ee_pos, self.r_ee_rot\n else:\n return self.l_ee_pos, self.l_ee_rot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L276_C8", "label": "if", "type": "if", "loc": [276, 279], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L275_C4", "vector": [4, 2, 0.3999, 0.0058, 2, 0.96, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if arm == 0:\n return self.r_ee_pos, self.r_ee_rot\n else:\n return self.l_ee_pos, self.l_ee_rot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Return_L277_C12", "label": "return", "type": "return", "loc": [277, 277], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L276_C8", "vector": [13, 3, 0.3991, 0.0014, 3, 0.35, 0.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.r_ee_pos, self.r_ee_rot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Return_L279_C12", "label": "return", "type": "return", "loc": [279, 279], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L276_C8", "vector": [13, 3, 0.402, 0.0014, 3, 0.35, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.l_ee_pos, self.l_ee_rot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L281_C4", "label": "get_cep_jtt", "type": "function", "loc": [281, 288], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:ClassDef_L63_C0", "vector": [2, 1, 0.4099, 0.0115, 1, 0.58, 0.5, 532, 0, 3, 1, 0, 0, 0, 0], "semantic": {"name": "get_cep_jtt", "arg_names": ["self", "arm", "hook_tip"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_cep_jtt(self, arm, hook_tip = False):\n if arm == 0:\n if hook_tip:\n return self.r_cep_pos_hooktip, self.r_cep_rot\n else:\n return self.r_cep_pos, self.r_cep_rot\n else:\n return self.l_cep_pos, self.l_cep_rot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L282_C8", "label": "if", "type": "if", "loc": [282, 288], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L281_C4", "vector": [4, 2, 0.4107, 0.0101, 2, 0.1, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if arm == 0:\n if hook_tip:\n return self.r_cep_pos_hooktip, self.r_cep_rot\n else:\n return self.r_cep_pos, self.r_cep_rot\n else:\n return self.l_cep_pos, self.l_cep_rot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L283_C12", "label": "if", "type": "if", "loc": [283, 286], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L282_C8", "vector": [4, 3, 0.4099, 0.0058, 3, 0.04, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if hook_tip:\n return self.r_cep_pos_hooktip, self.r_cep_rot\n else:\n return self.r_cep_pos, self.r_cep_rot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Return_L284_C16", "label": "return", "type": "return", "loc": [284, 284], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L283_C12", "vector": [13, 4, 0.4092, 0.0014, 4, 0.11, 0.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.r_cep_pos_hooktip, self.r_cep_rot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Return_L286_C16", "label": "return", "type": "return", "loc": [286, 286], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L283_C12", "vector": [13, 4, 0.4121, 0.0014, 4, 0.11, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.r_cep_pos, self.r_cep_rot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Return_L288_C12", "label": "return", "type": "return", "loc": [288, 288], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L282_C8", "vector": [13, 3, 0.415, 0.0014, 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 self.l_cep_pos, self.l_cep_rot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L291_C4", "label": "set_cep_jtt", "type": "function", "loc": [291, 316], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:ClassDef_L63_C0", "vector": [2, 1, 0.4373, 0.0375, 1, 0.58, 0.5556, 820, 0, 4, 0, 0, 0, 0, 5], "semantic": {"name": "set_cep_jtt", "arg_names": ["self", "arm", "p", "rot"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def set_cep_jtt(self, arm, p, rot=None):\n if arm != 1:\n arm = 0\n ps = PoseStamped()\n ps.header.stamp = rospy.rostime.get_rostime()\n ps.header.frame_id = 'torso_lift_link'\n \n ps.pose.position.x = p[0,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L292_C8", "label": "if", "type": "if", "loc": [292, 293], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L291_C4", "vector": [4, 2, 0.4215, 0.0029, 2, 0.79, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if arm != 1:\n arm = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L293_C12", "label": "arm =", "type": "assigned_variable", "loc": [293, 293], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L292_C8", "vector": [14, 3, 0.4222, 0.0014, 3, 0.94, 0.0, 413, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "arm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " arm = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L294_C8", "label": "ps = PoseStamped()", "type": "assigned_variable", "loc": [294, 294], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L291_C4", "vector": [14, 2, 0.4236, 0.0014, 2, 0.79, 0.0769, 232, 3, 0, 0, 0, 226, 10, 1], "semantic": {"name": "ps", "arg_names": [], "import_names": [], "rhs_call_name": "PoseStamped", "annotation": ""}, "snippet": " ps = PoseStamped()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L295_C8", "label": "ps.header.stamp = get_rostime()", "type": "assigned_variable", "loc": [295, 295], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L291_C4", "vector": [14, 2, 0.4251, 0.0014, 2, 0.79, 0.1538, 161, 3, 0, 0, 0, 173, 10, 1], "semantic": {"name": "ps.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "get_rostime", "annotation": ""}, "snippet": " ps.header.stamp = rospy.rostime.get_rostime()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L296_C8", "label": "ps.header.frame_id =", "type": "assigned_variable", "loc": [296, 296], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L291_C4", "vector": [14, 2, 0.4265, 0.0014, 2, 0.79, 0.2308, 293, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "ps.header.frame_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ps.header.frame_id = 'torso_lift_link'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L298_C8", "label": "ps.pose.position.x =", "type": "assigned_variable", "loc": [298, 298], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L291_C4", "vector": [14, 2, 0.4294, 0.0014, 2, 0.79, 0.3077, 782, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ps.pose.position.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ps.pose.position.x = p[0,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L299_C8", "label": "ps.pose.position.y =", "type": "assigned_variable", "loc": [299, 299], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L291_C4", "vector": [14, 2, 0.4308, 0.0014, 2, 0.79, 0.3846, 661, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ps.pose.position.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ps.pose.position.y = p[1,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L300_C8", "label": "ps.pose.position.z =", "type": "assigned_variable", "loc": [300, 300], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L291_C4", "vector": [14, 2, 0.4323, 0.0014, 2, 0.79, 0.4615, 771, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ps.pose.position.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ps.pose.position.z = p[2,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L302_C8", "label": "if", "type": "if", "loc": [302, 306], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L291_C4", "vector": [4, 2, 0.438, 0.0072, 2, 0.79, 0.5385, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if rot == None:\n if arm == 0:\n rot = self.r_cep_rot\n else:\n rot = self.l_cep_rot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L303_C12", "label": "if", "type": "if", "loc": [303, 306], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L302_C8", "vector": [4, 3, 0.4388, 0.0058, 3, 0.13, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if arm == 0:\n rot = self.r_cep_rot\n else:\n rot = self.l_cep_rot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L304_C16", "label": "rot =", "type": "assigned_variable", "loc": [304, 304], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L303_C12", "vector": [14, 4, 0.438, 0.0014, 4, 0.4, 0.0, 812, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "rot", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rot = self.r_cep_rot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L306_C16", "label": "rot =", "type": "assigned_variable", "loc": [306, 306], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L303_C12", "vector": [14, 4, 0.4409, 0.0014, 4, 0.4, 1.0, 812, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "rot", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rot = self.l_cep_rot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L308_C8", "label": "quat = matrix_to_quaternion()", "type": "assigned_variable", "loc": [308, 308], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L291_C4", "vector": [14, 2, 0.4438, 0.0014, 2, 0.79, 0.6154, 367, 3, 1, 0, 0, 615, 10, 1], "semantic": {"name": "quat", "arg_names": [], "import_names": [], "rhs_call_name": "matrix_to_quaternion", "annotation": ""}, "snippet": " quat = tr.matrix_to_quaternion(rot)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L309_C8", "label": "ps.pose.orientation.x =", "type": "assigned_variable", "loc": [309, 309], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L291_C4", "vector": [14, 2, 0.4452, 0.0014, 2, 0.79, 0.6923, 628, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ps.pose.orientation.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ps.pose.orientation.x = quat[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L310_C8", "label": "ps.pose.orientation.y =", "type": "assigned_variable", "loc": [310, 310], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L291_C4", "vector": [14, 2, 0.4467, 0.0014, 2, 0.79, 0.7692, 848, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ps.pose.orientation.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ps.pose.orientation.y = quat[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L311_C8", "label": "ps.pose.orientation.z =", "type": "assigned_variable", "loc": [311, 311], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L291_C4", "vector": [14, 2, 0.4481, 0.0014, 2, 0.79, 0.8462, 126, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ps.pose.orientation.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ps.pose.orientation.z = quat[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L312_C8", "label": "ps.pose.orientation.w =", "type": "assigned_variable", "loc": [312, 312], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L291_C4", "vector": [14, 2, 0.4496, 0.0014, 2, 0.79, 0.9231, 163, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ps.pose.orientation.w", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ps.pose.orientation.w = quat[3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L313_C8", "label": "if", "type": "if", "loc": [313, 316], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L291_C4", "vector": [4, 2, 0.4532, 0.0058, 2, 0.79, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if arm == 0:\n self.r_arm_cart_pub.publish(ps)\n else:\n self.l_arm_cart_pub.publish(ps)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L314_C12", "label": "publish()", "type": "expression", "loc": [314, 314], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L313_C8", "vector": [8, 3, 0.4524, 0.0014, 3, 0.17, 0.0, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.r_arm_cart_pub.publish(ps)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L316_C12", "label": "publish()", "type": "expression", "loc": [316, 316], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L313_C8", "vector": [8, 3, 0.4553, 0.0014, 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.l_arm_cart_pub.publish(ps)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L319_C4", "label": "go_cep_jtt", "type": "function", "loc": [319, 330], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:ClassDef_L63_C0", "vector": [2, 1, 0.4676, 0.0173, 1, 0.58, 0.6111, 219, 0, 3, 0, 0, 0, 0, 7], "semantic": {"name": "go_cep_jtt", "arg_names": ["self", "arm", "p"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def go_cep_jtt(self, arm, p):\n step_size = 0.01\n sleep_time = 0.1\n cep_p, cep_rot = self.get_cep_jtt(arm)\n unit_vec = (p-cep_p)\n unit_vec = unit_vec / np.linalg.norm(unit_vec)\n while np.linalg.norm(p-cep_p) > step_size:\n cep_p += unit_vec * step_size"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L320_C8", "label": "step_size =", "type": "assigned_variable", "loc": [320, 320], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L319_C4", "vector": [14, 2, 0.4611, 0.0014, 2, 0.01, 0.0, 764, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "step_size", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " step_size = 0.01"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L321_C8", "label": "sleep_time =", "type": "assigned_variable", "loc": [321, 321], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L319_C4", "vector": [14, 2, 0.4625, 0.0014, 2, 0.01, 0.1429, 355, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "sleep_time", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " sleep_time = 0.1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L322_C8", "label": "cep_p, cep_rot = get_cep_jtt()", "type": "assigned_variable", "loc": [322, 322], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L319_C4", "vector": [14, 2, 0.464, 0.0014, 2, 0.01, 0.2857, 891, 3, 1, 0, 0, 532, 10, 1], "semantic": {"name": "cep_p, cep_rot", "arg_names": [], "import_names": [], "rhs_call_name": "get_cep_jtt", "annotation": ""}, "snippet": " cep_p, cep_rot = self.get_cep_jtt(arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L323_C8", "label": "unit_vec =", "type": "assigned_variable", "loc": [323, 323], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L319_C4", "vector": [14, 2, 0.4654, 0.0014, 2, 0.01, 0.4286, 372, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "unit_vec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " unit_vec = (p-cep_p)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L324_C8", "label": "unit_vec =", "type": "assigned_variable", "loc": [324, 324], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L319_C4", "vector": [14, 2, 0.4669, 0.0014, 2, 0.01, 0.5714, 372, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "unit_vec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " unit_vec = unit_vec / np.linalg.norm(unit_vec)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:While_L325_C8", "label": "while", "type": "while", "loc": [325, 328], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L319_C4", "vector": [5, 2, 0.4705, 0.0058, 2, 0.01, 0.7143, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while np.linalg.norm(p-cep_p) > step_size:\n cep_p += unit_vec * step_size\n self.set_cep_jtt(arm, cep_p)\n rospy.sleep(sleep_time)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L327_C12", "label": "set_cep_jtt()", "type": "expression", "loc": [327, 327], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:While_L325_C8", "vector": [8, 3, 0.4712, 0.0014, 3, 0.58, 0.0, 820, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "set_cep_jtt", "arg_names": [], "import_names": [], "rhs_call_name": "set_cep_jtt", "annotation": ""}, "snippet": " self.set_cep_jtt(arm, cep_p)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L328_C12", "label": "sleep()", "type": "expression", "loc": [328, 328], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:While_L325_C8", "vector": [8, 3, 0.4726, 0.0014, 3, 0.58, 1.0, 476, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " rospy.sleep(sleep_time)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L329_C8", "label": "set_cep_jtt()", "type": "expression", "loc": [329, 329], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L319_C4", "vector": [8, 2, 0.4741, 0.0014, 2, 0.01, 0.8571, 820, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "set_cep_jtt", "arg_names": [], "import_names": [], "rhs_call_name": "set_cep_jtt", "annotation": ""}, "snippet": " self.set_cep_jtt(arm, p)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L330_C8", "label": "sleep()", "type": "expression", "loc": [330, 330], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L319_C4", "vector": [8, 2, 0.4755, 0.0014, 2, 0.01, 1.0, 476, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " rospy.sleep(sleep_time)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L337_C4", "label": "get_wrist_force_estimate", "type": "function", "loc": [337, 349], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:ClassDef_L63_C0", "vector": [2, 1, 0.4942, 0.0187, 1, 0.58, 0.6667, 346, 0, 4, 1, 0, 0, 0, 6], "semantic": {"name": "get_wrist_force_estimate", "arg_names": ["self", "arm", "bias", "base_frame"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_wrist_force_estimate(self, arm, bias = True, base_frame = False):\n if arm != 0:\n rospy.logerr('Unsupported arm: %d'%arm)\n raise RuntimeError('Unimplemented function')\n \n f = self.r_arm_ftc_estimate.read(without_bias = not bias)\n f = f[0:3, :]\n if base_frame:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L338_C8", "label": "if", "type": "if", "loc": [338, 340], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L337_C4", "vector": [4, 2, 0.4885, 0.0043, 2, 0.09, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if arm != 0:\n rospy.logerr('Unsupported arm: %d'%arm)\n raise RuntimeError('Unimplemented function')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L339_C12", "label": "logerr()", "type": "expression", "loc": [339, 339], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L338_C8", "vector": [8, 3, 0.4885, 0.0014, 3, 0.09, 0.0, 747, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logerr", "arg_names": [], "import_names": [], "rhs_call_name": "logerr", "annotation": ""}, "snippet": " rospy.logerr('Unsupported arm: %d'%arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L342_C8", "label": "f = read()", "type": "assigned_variable", "loc": [342, 342], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L337_C4", "vector": [14, 2, 0.4928, 0.0014, 2, 0.09, 0.25, 899, 3, 1, 0, 0, 453, 10, 1], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "read", "annotation": ""}, "snippet": " f = self.r_arm_ftc_estimate.read(without_bias = not bias)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L343_C8", "label": "f =", "type": "assigned_variable", "loc": [343, 343], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L337_C4", "vector": [14, 2, 0.4942, 0.0014, 2, 0.09, 0.5, 899, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " f = f[0:3, :]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L344_C8", "label": "if", "type": "if", "loc": [344, 348], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L337_C4", "vector": [4, 2, 0.4986, 0.0072, 2, 0.09, 0.75, 0, 2, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if base_frame:\n trans, quat = self.tf_lstnr.lookupTransform('/torso_lift_link',\n '/ft2_estimate', rospy.Time(0))\n rot = tr.quaternion_to_matrix(quat)\n f = rot * f"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L345_C12", "label": "trans, quat = lookupTransform()", "type": "assigned_variable", "loc": [345, 346], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L344_C8", "vector": [14, 3, 0.4978, 0.0029, 3, 0.66, 0.0, 441, 3, 3, 0, 0, 926, 10, 2], "semantic": {"name": "trans, quat", "arg_names": [], "import_names": [], "rhs_call_name": "lookupTransform", "annotation": ""}, "snippet": " trans, quat = self.tf_lstnr.lookupTransform('/torso_lift_link',\n '/ft2_estimate', rospy.Time(0))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L347_C12", "label": "rot = quaternion_to_matrix()", "type": "assigned_variable", "loc": [347, 347], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L344_C8", "vector": [14, 3, 0.5, 0.0014, 3, 0.66, 0.5, 812, 3, 1, 0, 0, 149, 10, 1], "semantic": {"name": "rot", "arg_names": [], "import_names": [], "rhs_call_name": "quaternion_to_matrix", "annotation": ""}, "snippet": " rot = tr.quaternion_to_matrix(quat)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L348_C12", "label": "f =", "type": "assigned_variable", "loc": [348, 348], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L344_C8", "vector": [14, 3, 0.5014, 0.0014, 3, 0.66, 1.0, 899, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " f = rot * f"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Return_L349_C8", "label": "return", "type": "return", "loc": [349, 349], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L337_C4", "vector": [13, 2, 0.5029, 0.0014, 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 -f # the negative is intentional (Advait, Nov 24. 2010.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L352_C4", "label": "get_wrist_force_ati", "type": "function", "loc": [352, 364], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:ClassDef_L63_C0", "vector": [2, 1, 0.5159, 0.0187, 1, 0.58, 0.7222, 170, 0, 4, 1, 0, 0, 0, 6], "semantic": {"name": "get_wrist_force_ati", "arg_names": ["self", "arm", "bias", "base_frame"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_wrist_force_ati(self, arm, bias = True, base_frame = False):\n if arm != 0:\n rospy.logerr('Unsupported arm: %d'%arm)\n raise RuntimeError('Unimplemented function')\n \n f = self.r_arm_ftc.read(without_bias = not bias)\n f = f[0:3, :]\n if base_frame:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L353_C8", "label": "if", "type": "if", "loc": [353, 355], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L352_C4", "vector": [4, 2, 0.5101, 0.0043, 2, 0.76, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if arm != 0:\n rospy.logerr('Unsupported arm: %d'%arm)\n raise RuntimeError('Unimplemented function')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L354_C12", "label": "logerr()", "type": "expression", "loc": [354, 354], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L353_C8", "vector": [8, 3, 0.5101, 0.0014, 3, 0.26, 0.0, 747, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logerr", "arg_names": [], "import_names": [], "rhs_call_name": "logerr", "annotation": ""}, "snippet": " rospy.logerr('Unsupported arm: %d'%arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L357_C8", "label": "f = read()", "type": "assigned_variable", "loc": [357, 357], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L352_C4", "vector": [14, 2, 0.5144, 0.0014, 2, 0.76, 0.25, 899, 3, 1, 0, 0, 453, 10, 1], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "read", "annotation": ""}, "snippet": " f = self.r_arm_ftc.read(without_bias = not bias)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L358_C8", "label": "f =", "type": "assigned_variable", "loc": [358, 358], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L352_C4", "vector": [14, 2, 0.5159, 0.0014, 2, 0.76, 0.5, 899, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " f = f[0:3, :]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L359_C8", "label": "if", "type": "if", "loc": [359, 363], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L352_C4", "vector": [4, 2, 0.5202, 0.0072, 2, 0.76, 0.75, 0, 2, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if base_frame:\n trans, quat = self.tf_lstnr.lookupTransform('/torso_lift_link',\n '/ft2', rospy.Time(0))\n rot = tr.quaternion_to_matrix(quat)\n f = rot * f"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L360_C12", "label": "trans, quat = lookupTransform()", "type": "assigned_variable", "loc": [360, 361], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L359_C8", "vector": [14, 3, 0.5195, 0.0029, 3, 0.12, 0.0, 441, 3, 3, 0, 0, 926, 10, 2], "semantic": {"name": "trans, quat", "arg_names": [], "import_names": [], "rhs_call_name": "lookupTransform", "annotation": ""}, "snippet": " trans, quat = self.tf_lstnr.lookupTransform('/torso_lift_link',\n '/ft2', rospy.Time(0))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L362_C12", "label": "rot = quaternion_to_matrix()", "type": "assigned_variable", "loc": [362, 362], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L359_C8", "vector": [14, 3, 0.5216, 0.0014, 3, 0.12, 0.5, 812, 3, 1, 0, 0, 149, 10, 1], "semantic": {"name": "rot", "arg_names": [], "import_names": [], "rhs_call_name": "quaternion_to_matrix", "annotation": ""}, "snippet": " rot = tr.quaternion_to_matrix(quat)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L363_C12", "label": "f =", "type": "assigned_variable", "loc": [363, 363], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L359_C8", "vector": [14, 3, 0.5231, 0.0014, 3, 0.12, 1.0, 899, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " f = rot * f"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Return_L364_C8", "label": "return", "type": "return", "loc": [364, 364], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L352_C4", "vector": [13, 2, 0.5245, 0.0014, 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 -f # the negative is intentional (Advait, Nov 24. 2010.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L369_C4", "label": "get_force_from_torques", "type": "function", "loc": [369, 380], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:ClassDef_L63_C0", "vector": [2, 1, 0.5396, 0.0173, 1, 0.58, 0.7778, 497, 0, 2, 1, 0, 0, 0, 6], "semantic": {"name": "get_force_from_torques", "arg_names": ["self", "arm"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_force_from_torques(self, arm):\n if arm != 1:\n arm = 0\n self.arm_state_lock[arm].acquire()\n q = self.arm_angles[arm]\n tau = self.arm_efforts[arm]\n self.arm_state_lock[arm].release()\n p, _ = self.arms.FK_all(arm, q)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L370_C8", "label": "if", "type": "if", "loc": [370, 371], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L369_C4", "vector": [4, 2, 0.5339, 0.0029, 2, 0.39, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if arm != 1:\n arm = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L371_C12", "label": "arm =", "type": "assigned_variable", "loc": [371, 371], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L370_C8", "vector": [14, 3, 0.5346, 0.0014, 3, 0.11, 0.0, 413, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "arm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " arm = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L372_C8", "label": "acquire()", "type": "expression", "loc": [372, 372], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L369_C4", "vector": [8, 2, 0.536, 0.0014, 2, 0.39, 0.1111, 229, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "acquire", "arg_names": [], "import_names": [], "rhs_call_name": "acquire", "annotation": ""}, "snippet": " self.arm_state_lock[arm].acquire()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L373_C8", "label": "q =", "type": "assigned_variable", "loc": [373, 373], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L369_C4", "vector": [14, 2, 0.5375, 0.0014, 2, 0.39, 0.2222, 516, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "q", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " q = self.arm_angles[arm]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L374_C8", "label": "tau =", "type": "assigned_variable", "loc": [374, 374], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L369_C4", "vector": [14, 2, 0.5389, 0.0014, 2, 0.39, 0.3333, 329, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "tau", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tau = self.arm_efforts[arm]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L375_C8", "label": "release()", "type": "expression", "loc": [375, 375], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L369_C4", "vector": [8, 2, 0.5403, 0.0014, 2, 0.39, 0.4444, 784, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "release", "arg_names": [], "import_names": [], "rhs_call_name": "release", "annotation": ""}, "snippet": " self.arm_state_lock[arm].release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L376_C8", "label": "p, _ = FK_all()", "type": "assigned_variable", "loc": [376, 376], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L369_C4", "vector": [14, 2, 0.5418, 0.0014, 2, 0.39, 0.5556, 31, 3, 2, 0, 0, 415, 10, 1], "semantic": {"name": "p, _", "arg_names": [], "import_names": [], "rhs_call_name": "FK_all", "annotation": ""}, "snippet": " p, _ = self.arms.FK_all(arm, q)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L377_C8", "label": "J = Jacobian()", "type": "assigned_variable", "loc": [377, 377], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L369_C4", "vector": [14, 2, 0.5432, 0.0014, 2, 0.39, 0.6667, 946, 3, 3, 0, 0, 182, 10, 1], "semantic": {"name": "J", "arg_names": [], "import_names": [], "rhs_call_name": "Jacobian", "annotation": ""}, "snippet": " J = self.arms.Jacobian(arm, q, p)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L378_C8", "label": "f =", "type": "assigned_variable", "loc": [378, 378], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L369_C4", "vector": [14, 2, 0.5447, 0.0014, 2, 0.39, 0.7778, 899, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " f = np.linalg.pinv(J.T) * np.matrix(tau).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L379_C8", "label": "f =", "type": "assigned_variable", "loc": [379, 379], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L369_C4", "vector": [14, 2, 0.5461, 0.0014, 2, 0.39, 0.8889, 899, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " f = f[0:3,:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Return_L380_C8", "label": "return", "type": "return", "loc": [380, 380], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L369_C4", "vector": [13, 2, 0.5476, 0.0014, 2, 0.39, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return -f"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L383_C4", "label": "bias_wrist_ft", "type": "function", "loc": [383, 388], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:ClassDef_L63_C0", "vector": [2, 1, 0.5555, 0.0086, 1, 0.58, 0.8333, 604, 0, 2, 0, 0, 0, 0, 4], "semantic": {"name": "bias_wrist_ft", "arg_names": ["self", "arm"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def bias_wrist_ft(self, arm):\n if arm != 0:\n rospy.logerr('Unsupported arm: %d'%arm)\n raise RuntimeError('Unimplemented function')\n self.r_arm_ftc.bias()\n self.r_arm_ftc_estimate.bias()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L384_C8", "label": "if", "type": "if", "loc": [384, 386], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L383_C4", "vector": [4, 2, 0.5548, 0.0043, 2, 0.61, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if arm != 0:\n rospy.logerr('Unsupported arm: %d'%arm)\n raise RuntimeError('Unimplemented function')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L385_C12", "label": "logerr()", "type": "expression", "loc": [385, 385], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L384_C8", "vector": [8, 3, 0.5548, 0.0014, 3, 0.43, 0.0, 747, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logerr", "arg_names": [], "import_names": [], "rhs_call_name": "logerr", "annotation": ""}, "snippet": " rospy.logerr('Unsupported arm: %d'%arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L387_C8", "label": "bias()", "type": "expression", "loc": [387, 387], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L383_C4", "vector": [8, 2, 0.5576, 0.0014, 2, 0.61, 0.5, 354, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "bias", "arg_names": [], "import_names": [], "rhs_call_name": "bias", "annotation": ""}, "snippet": " self.r_arm_ftc.bias()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L388_C8", "label": "bias()", "type": "expression", "loc": [388, 388], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L383_C4", "vector": [8, 2, 0.5591, 0.0014, 2, 0.61, 1.0, 354, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "bias", "arg_names": [], "import_names": [], "rhs_call_name": "bias", "annotation": ""}, "snippet": " self.r_arm_ftc_estimate.bias()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L391_C4", "label": "move_gripper", "type": "function", "loc": [391, 393], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:ClassDef_L63_C0", "vector": [2, 1, 0.5648, 0.0043, 1, 0.58, 0.8889, 327, 0, 4, 0, 0, 0, 0, 3], "semantic": {"name": "move_gripper", "arg_names": ["self", "arm", "amount", "effort"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def move_gripper(self, arm, amount=0.08, effort = 15):\n self.gripper_action_client[arm].send_goal(Pr2GripperCommandGoal(Pr2GripperCommand(position=amount,\n max_effort = effort)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L392_C8", "label": "send_goal()", "type": "expression", "loc": [392, 393], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L391_C4", "vector": [8, 2, 0.5656, 0.0029, 2, 0.9, 0.0, 184, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "send_goal", "arg_names": [], "import_names": [], "rhs_call_name": "send_goal", "annotation": ""}, "snippet": " self.gripper_action_client[arm].send_goal(Pr2GripperCommandGoal(Pr2GripperCommand(position=amount,\n max_effort = effort)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L397_C4", "label": "open_gripper", "type": "function", "loc": [397, 398], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:ClassDef_L63_C0", "vector": [2, 1, 0.5728, 0.0029, 1, 0.58, 0.9444, 833, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "open_gripper", "arg_names": ["self", "arm"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def open_gripper(self, arm):\n self.move_gripper(arm, 0.08, -1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L398_C8", "label": "move_gripper()", "type": "expression", "loc": [398, 398], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L397_C4", "vector": [8, 2, 0.5735, 0.0014, 2, 0.14, 0.0, 327, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "move_gripper", "arg_names": [], "import_names": [], "rhs_call_name": "move_gripper", "annotation": ""}, "snippet": " self.move_gripper(arm, 0.08, -1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L402_C4", "label": "close_gripper", "type": "function", "loc": [402, 403], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:ClassDef_L63_C0", "vector": [2, 1, 0.58, 0.0029, 1, 0.58, 1.0, 807, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "close_gripper", "arg_names": ["self", "arm", "effort"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def close_gripper(self, arm, effort = 15):\n self.move_gripper(arm, 0.0, effort)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L403_C8", "label": "move_gripper()", "type": "expression", "loc": [403, 403], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L402_C4", "vector": [8, 2, 0.5807, 0.0014, 2, 0.65, 0.0, 327, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "move_gripper", "arg_names": [], "import_names": [], "rhs_call_name": "move_gripper", "annotation": ""}, "snippet": " self.move_gripper(arm, 0.0, effort)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:ClassDef_L408_C0", "label": "PR2Arms_kdl", "type": "class", "loc": [408, 572], "level": 0, "parent": null, "vector": [3, 0, 0.7061, 0.2378, 0, 0.66, 0.9677, 188, 0, 12, 0, 0, 0, 0, 85], "semantic": {"name": "PR2Arms_kdl", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class PR2Arms_kdl():\n def __init__(self):\n self.right_chain = self.create_right_chain()\n fk, ik_v, ik_p, jac = self.create_solvers(self.right_chain)\n self.right_fk = fk\n self.right_ik_v = ik_v\n self.right_ik_p = ik_p\n self.right_jac = jac"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L409_C4", "label": "__init__", "type": "function", "loc": [409, 416], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:ClassDef_L408_C0", "vector": [2, 1, 0.5944, 0.0115, 1, 0.7, 0.0, 555, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "__init__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self):\n self.right_chain = self.create_right_chain()\n fk, ik_v, ik_p, jac = self.create_solvers(self.right_chain)\n self.right_fk = fk\n self.right_ik_v = ik_v\n self.right_ik_p = ik_p\n self.right_jac = jac\n self.right_tooltip = np.matrix([0.,0.,0.]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L410_C8", "label": "self.right_chain = create_right_chain()", "type": "assigned_variable", "loc": [410, 410], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L409_C4", "vector": [14, 2, 0.5908, 0.0014, 2, 0.34, 0.0, 233, 3, 0, 0, 0, 956, 10, 1], "semantic": {"name": "self.right_chain", "arg_names": [], "import_names": [], "rhs_call_name": "create_right_chain", "annotation": ""}, "snippet": " self.right_chain = self.create_right_chain()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L411_C8", "label": "fk, ik_v, ik_p, jac = create_solvers()", "type": "assigned_variable", "loc": [411, 411], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L409_C4", "vector": [14, 2, 0.5922, 0.0014, 2, 0.34, 0.1667, 737, 3, 1, 0, 0, 845, 10, 1], "semantic": {"name": "fk, ik_v, ik_p, jac", "arg_names": [], "import_names": [], "rhs_call_name": "create_solvers", "annotation": ""}, "snippet": " fk, ik_v, ik_p, jac = self.create_solvers(self.right_chain)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L412_C8", "label": "self.right_fk =", "type": "assigned_variable", "loc": [412, 412], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L409_C4", "vector": [14, 2, 0.5937, 0.0014, 2, 0.34, 0.3333, 700, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.right_fk", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.right_fk = fk"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L413_C8", "label": "self.right_ik_v =", "type": "assigned_variable", "loc": [413, 413], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L409_C4", "vector": [14, 2, 0.5951, 0.0014, 2, 0.34, 0.5, 402, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.right_ik_v", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.right_ik_v = ik_v"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L414_C8", "label": "self.right_ik_p =", "type": "assigned_variable", "loc": [414, 414], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L409_C4", "vector": [14, 2, 0.5965, 0.0014, 2, 0.34, 0.6667, 101, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.right_ik_p", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.right_ik_p = ik_p"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L415_C8", "label": "self.right_jac =", "type": "assigned_variable", "loc": [415, 415], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L409_C4", "vector": [14, 2, 0.598, 0.0014, 2, 0.34, 0.8333, 574, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.right_jac", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.right_jac = jac"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L416_C8", "label": "self.right_tooltip =", "type": "assigned_variable", "loc": [416, 416], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L409_C4", "vector": [14, 2, 0.5994, 0.0014, 2, 0.34, 1.0, 402, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.right_tooltip", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.right_tooltip = np.matrix([0.,0.,0.]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L418_C4", "label": "create_right_chain", "type": "function", "loc": [418, 435], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:ClassDef_L408_C0", "vector": [2, 1, 0.6146, 0.0259, 1, 0.7, 0.0909, 956, 0, 1, 1, 0, 0, 0, 37], "semantic": {"name": "create_right_chain", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def create_right_chain(self):\n ch = kdl.Chain()\n self.right_arm_base_offset_from_torso_lift_link = np.matrix([0., -0.188, 0.]).T\n # shoulder pan\n ch.addSegment(kdl.Segment(kdl.Joint(kdl.Joint.RotZ),kdl.Frame(kdl.Vector(0.1,0.,0.))))\n # shoulder lift\n ch.addSegment(kdl.Segment(kdl.Joint(kdl.Joint.RotY),kdl.Frame(kdl.Vector(0.,0.,0.))))\n # upper arm roll"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L419_C8", "label": "ch = Chain()", "type": "assigned_variable", "loc": [419, 419], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L418_C4", "vector": [14, 2, 0.6037, 0.0014, 2, 0.35, 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_99617:Assign_L420_C8", "label": "self.right_arm_base_offset_from_torso_lift_link =", "type": "assigned_variable", "loc": [420, 420], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L418_C4", "vector": [14, 2, 0.6052, 0.0014, 2, 0.35, 0.1111, 255, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.right_arm_base_offset_from_torso_lift_link", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.right_arm_base_offset_from_torso_lift_link = np.matrix([0., -0.188, 0.]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L422_C8", "label": "addSegment()", "type": "expression", "loc": [422, 422], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L418_C4", "vector": [8, 2, 0.6081, 0.0014, 2, 0.35, 0.2222, 73, 3, 1, 0, 0, 0, 0, 5], "semantic": {"name": "addSegment", "arg_names": [], "import_names": [], "rhs_call_name": "addSegment", "annotation": ""}, "snippet": " ch.addSegment(kdl.Segment(kdl.Joint(kdl.Joint.RotZ),kdl.Frame(kdl.Vector(0.1,0.,0.))))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L424_C8", "label": "addSegment()", "type": "expression", "loc": [424, 424], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L418_C4", "vector": [8, 2, 0.611, 0.0014, 2, 0.35, 0.3333, 73, 3, 1, 0, 0, 0, 0, 5], "semantic": {"name": "addSegment", "arg_names": [], "import_names": [], "rhs_call_name": "addSegment", "annotation": ""}, "snippet": " ch.addSegment(kdl.Segment(kdl.Joint(kdl.Joint.RotY),kdl.Frame(kdl.Vector(0.,0.,0.))))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L426_C8", "label": "addSegment()", "type": "expression", "loc": [426, 426], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L418_C4", "vector": [8, 2, 0.6138, 0.0014, 2, 0.35, 0.4444, 73, 3, 1, 0, 0, 0, 0, 5], "semantic": {"name": "addSegment", "arg_names": [], "import_names": [], "rhs_call_name": "addSegment", "annotation": ""}, "snippet": " ch.addSegment(kdl.Segment(kdl.Joint(kdl.Joint.RotX),kdl.Frame(kdl.Vector(0.4,0.,0.))))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L428_C8", "label": "addSegment()", "type": "expression", "loc": [428, 428], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L418_C4", "vector": [8, 2, 0.6167, 0.0014, 2, 0.35, 0.5556, 73, 3, 1, 0, 0, 0, 0, 5], "semantic": {"name": "addSegment", "arg_names": [], "import_names": [], "rhs_call_name": "addSegment", "annotation": ""}, "snippet": " ch.addSegment(kdl.Segment(kdl.Joint(kdl.Joint.RotY),kdl.Frame(kdl.Vector(0.0,0.,0.))))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L430_C8", "label": "addSegment()", "type": "expression", "loc": [430, 430], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L418_C4", "vector": [8, 2, 0.6196, 0.0014, 2, 0.35, 0.6667, 73, 3, 1, 0, 0, 0, 0, 5], "semantic": {"name": "addSegment", "arg_names": [], "import_names": [], "rhs_call_name": "addSegment", "annotation": ""}, "snippet": " ch.addSegment(kdl.Segment(kdl.Joint(kdl.Joint.RotX),kdl.Frame(kdl.Vector(0.321,0.,0.))))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L432_C8", "label": "addSegment()", "type": "expression", "loc": [432, 432], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L418_C4", "vector": [8, 2, 0.6225, 0.0014, 2, 0.35, 0.7778, 73, 3, 1, 0, 0, 0, 0, 5], "semantic": {"name": "addSegment", "arg_names": [], "import_names": [], "rhs_call_name": "addSegment", "annotation": ""}, "snippet": " ch.addSegment(kdl.Segment(kdl.Joint(kdl.Joint.RotY),kdl.Frame(kdl.Vector(0.,0.,0.))))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L434_C8", "label": "addSegment()", "type": "expression", "loc": [434, 434], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L418_C4", "vector": [8, 2, 0.6254, 0.0014, 2, 0.35, 0.8889, 73, 3, 1, 0, 0, 0, 0, 5], "semantic": {"name": "addSegment", "arg_names": [], "import_names": [], "rhs_call_name": "addSegment", "annotation": ""}, "snippet": " ch.addSegment(kdl.Segment(kdl.Joint(kdl.Joint.RotX),kdl.Frame(kdl.Vector(0.,0.,0.))))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Return_L435_C8", "label": "return", "type": "return", "loc": [435, 435], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L418_C4", "vector": [13, 2, 0.6268, 0.0014, 2, 0.35, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ch"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L437_C4", "label": "create_solvers", "type": "function", "loc": [437, 442], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:ClassDef_L408_C0", "vector": [2, 1, 0.6333, 0.0086, 1, 0.7, 0.1818, 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_99617:Assign_L438_C9", "label": "fk = ChainFkSolverPos_recursive()", "type": "assigned_variable", "loc": [438, 438], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L437_C4", "vector": [14, 2, 0.6311, 0.0014, 2, 0.62, 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_99617:Assign_L439_C9", "label": "ik_v = ChainIkSolverVel_pinv()", "type": "assigned_variable", "loc": [439, 439], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L437_C4", "vector": [14, 2, 0.6326, 0.0014, 2, 0.62, 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_99617:Assign_L440_C9", "label": "ik_p = ChainIkSolverPos_NR()", "type": "assigned_variable", "loc": [440, 440], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L437_C4", "vector": [14, 2, 0.634, 0.0014, 2, 0.62, 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_99617:Assign_L441_C9", "label": "jac = ChainJntToJacSolver()", "type": "assigned_variable", "loc": [441, 441], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L437_C4", "vector": [14, 2, 0.6354, 0.0014, 2, 0.62, 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_99617:Return_L442_C9", "label": "return", "type": "return", "loc": [442, 442], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L437_C4", "vector": [13, 2, 0.6369, 0.0014, 2, 0.62, 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_99617:FunctionDef_L445_C4", "label": "set_tooltip", "type": "function", "loc": [445, 449], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:ClassDef_L408_C0", "vector": [2, 1, 0.6441, 0.0072, 1, 0.7, 0.2727, 350, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "set_tooltip", "arg_names": ["self", "arm", "p"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def set_tooltip(self, arm, p):\n if arm == 0:\n self.right_tooltip = p\n else:\n rospy.logerr('Arm %d is not supported.'%(arm))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L446_C8", "label": "if", "type": "if", "loc": [446, 449], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L445_C4", "vector": [4, 2, 0.6448, 0.0058, 2, 0.41, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if arm == 0:\n self.right_tooltip = p\n else:\n rospy.logerr('Arm %d is not supported.'%(arm))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L447_C12", "label": "self.right_tooltip =", "type": "assigned_variable", "loc": [447, 447], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L446_C8", "vector": [14, 3, 0.6441, 0.0014, 3, 0.44, 0.0, 402, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.right_tooltip", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.right_tooltip = p"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L449_C12", "label": "logerr()", "type": "expression", "loc": [449, 449], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L446_C8", "vector": [8, 3, 0.647, 0.0014, 3, 0.44, 1.0, 747, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logerr", "arg_names": [], "import_names": [], "rhs_call_name": "logerr", "annotation": ""}, "snippet": " rospy.logerr('Arm %d is not supported.'%(arm))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L451_C4", "label": "FK_kdl", "type": "function", "loc": [451, 465], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:ClassDef_L408_C0", "vector": [2, 1, 0.6599, 0.0216, 1, 0.7, 0.3636, 929, 0, 4, 1, 0, 0, 0, 5], "semantic": {"name": "FK_kdl", "arg_names": ["self", "arm", "q", "link_number"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def FK_kdl(self, arm, q, link_number):\n if arm == 0:\n fk = self.right_fk\n endeffec_frame = kdl.Frame()\n kinematics_status = fk.JntToCart(q, endeffec_frame,\n link_number)\n if kinematics_status >= 0:\n return endeffec_frame"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L452_C8", "label": "if", "type": "if", "loc": [452, 465], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L451_C4", "vector": [4, 2, 0.6607, 0.0202, 2, 0.11, 0.0, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if arm == 0:\n fk = self.right_fk\n endeffec_frame = kdl.Frame()\n kinematics_status = fk.JntToCart(q, endeffec_frame,\n link_number)\n if kinematics_status >= 0:\n return endeffec_frame\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L453_C12", "label": "fk =", "type": "assigned_variable", "loc": [453, 453], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L452_C8", "vector": [14, 3, 0.6527, 0.0014, 3, 0.27, 0.0, 714, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "fk", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " fk = self.right_fk"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L454_C12", "label": "endeffec_frame = Frame()", "type": "assigned_variable", "loc": [454, 454], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L452_C8", "vector": [14, 3, 0.6542, 0.0014, 3, 0.27, 0.2, 271, 3, 0, 0, 0, 342, 10, 1], "semantic": {"name": "endeffec_frame", "arg_names": [], "import_names": [], "rhs_call_name": "Frame", "annotation": ""}, "snippet": " endeffec_frame = kdl.Frame()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L455_C12", "label": "kinematics_status = JntToCart()", "type": "assigned_variable", "loc": [455, 456], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L452_C8", "vector": [14, 3, 0.6563, 0.0029, 3, 0.27, 0.4, 714, 3, 3, 0, 0, 79, 10, 1], "semantic": {"name": "kinematics_status", "arg_names": [], "import_names": [], "rhs_call_name": "JntToCart", "annotation": ""}, "snippet": " kinematics_status = fk.JntToCart(q, endeffec_frame,\n link_number)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L457_C12", "label": "if", "type": "if", "loc": [457, 461], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L452_C8", "vector": [4, 3, 0.6614, 0.0072, 3, 0.27, 0.6, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if kinematics_status >= 0:\n return endeffec_frame\n else:\n rospy.loginfo('Could not compute forward kinematics.')\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Return_L458_C16", "label": "return", "type": "return", "loc": [458, 458], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L457_C12", "vector": [13, 4, 0.6599, 0.0014, 4, 0.85, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return endeffec_frame"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L460_C16", "label": "loginfo()", "type": "expression", "loc": [460, 460], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L457_C12", "vector": [8, 4, 0.6628, 0.0014, 4, 0.85, 0.5, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo('Could not compute forward kinematics.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Return_L461_C16", "label": "return", "type": "return", "loc": [461, 461], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L457_C12", "vector": [13, 4, 0.6643, 0.0014, 4, 0.85, 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_99617:Assign_L463_C12", "label": "msg =", "type": "assigned_variable", "loc": [463, 463], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L452_C8", "vector": [14, 3, 0.6671, 0.0014, 3, 0.27, 0.8, 712, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "msg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " msg = '%s arm not supported.'%(arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L464_C12", "label": "logerr()", "type": "expression", "loc": [464, 464], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L452_C8", "vector": [8, 3, 0.6686, 0.0014, 3, 0.27, 1.0, 747, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logerr", "arg_names": [], "import_names": [], "rhs_call_name": "logerr", "annotation": ""}, "snippet": " rospy.logerr(msg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L468_C4", "label": "FK_all", "type": "function", "loc": [468, 482], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:ClassDef_L408_C0", "vector": [2, 1, 0.6844, 0.0216, 1, 0.7, 0.4545, 415, 0, 4, 1, 0, 0, 0, 5], "semantic": {"name": "FK_all", "arg_names": ["self", "arm", "q", "link_number"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def FK_all(self, arm, q, link_number = 7):\n q = self.pr2_to_kdl(q)\n frame = self.FK_kdl(arm, q, link_number)\n pos = frame.p\n pos = ku.kdl_vec_to_np(pos)\n pos = pos + self.right_arm_base_offset_from_torso_lift_link\n m = frame.M\n rot = ku.kdl_rot_to_np(m)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L469_C8", "label": "q = pr2_to_kdl()", "type": "assigned_variable", "loc": [469, 469], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L468_C4", "vector": [14, 2, 0.6758, 0.0014, 2, 0.68, 0.0, 516, 3, 1, 0, 0, 85, 10, 1], "semantic": {"name": "q", "arg_names": [], "import_names": [], "rhs_call_name": "pr2_to_kdl", "annotation": ""}, "snippet": " q = self.pr2_to_kdl(q)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L470_C8", "label": "frame = FK_kdl()", "type": "assigned_variable", "loc": [470, 470], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L468_C4", "vector": [14, 2, 0.6772, 0.0014, 2, 0.68, 0.125, 313, 3, 3, 0, 0, 929, 10, 1], "semantic": {"name": "frame", "arg_names": [], "import_names": [], "rhs_call_name": "FK_kdl", "annotation": ""}, "snippet": " frame = self.FK_kdl(arm, q, link_number)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L471_C8", "label": "pos =", "type": "assigned_variable", "loc": [471, 471], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L468_C4", "vector": [14, 2, 0.6787, 0.0014, 2, 0.68, 0.25, 627, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pos", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pos = frame.p"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L472_C8", "label": "pos = kdl_vec_to_np()", "type": "assigned_variable", "loc": [472, 472], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L468_C4", "vector": [14, 2, 0.6801, 0.0014, 2, 0.68, 0.375, 627, 3, 1, 0, 0, 707, 10, 1], "semantic": {"name": "pos", "arg_names": [], "import_names": [], "rhs_call_name": "kdl_vec_to_np", "annotation": ""}, "snippet": " pos = ku.kdl_vec_to_np(pos)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L473_C8", "label": "pos =", "type": "assigned_variable", "loc": [473, 473], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L468_C4", "vector": [14, 2, 0.6816, 0.0014, 2, 0.68, 0.5, 627, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pos", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pos = pos + self.right_arm_base_offset_from_torso_lift_link"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L474_C8", "label": "m =", "type": "assigned_variable", "loc": [474, 474], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L468_C4", "vector": [14, 2, 0.683, 0.0014, 2, 0.68, 0.625, 711, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " m = frame.M"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L475_C8", "label": "rot = kdl_rot_to_np()", "type": "assigned_variable", "loc": [475, 475], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L468_C4", "vector": [14, 2, 0.6844, 0.0014, 2, 0.68, 0.75, 812, 3, 1, 0, 0, 380, 10, 1], "semantic": {"name": "rot", "arg_names": [], "import_names": [], "rhs_call_name": "kdl_rot_to_np", "annotation": ""}, "snippet": " rot = ku.kdl_rot_to_np(m)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L476_C8", "label": "if", "type": "if", "loc": [476, 481], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L468_C4", "vector": [4, 2, 0.6895, 0.0086, 2, 0.68, 0.875, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if arm == 0:\n tooltip_baseframe = rot * self.right_tooltip\n pos += tooltip_baseframe\n else:\n rospy.logerr('Arm %d is not supported.'%(arm))\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L477_C12", "label": "tooltip_baseframe =", "type": "assigned_variable", "loc": [477, 477], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L476_C8", "vector": [14, 3, 0.6873, 0.0014, 3, 0.04, 0.0, 649, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "tooltip_baseframe", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tooltip_baseframe = rot * self.right_tooltip"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L480_C12", "label": "logerr()", "type": "expression", "loc": [480, 480], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L476_C8", "vector": [8, 3, 0.6916, 0.0014, 3, 0.04, 0.5, 747, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logerr", "arg_names": [], "import_names": [], "rhs_call_name": "logerr", "annotation": ""}, "snippet": " rospy.logerr('Arm %d is not supported.'%(arm))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Return_L481_C12", "label": "return", "type": "return", "loc": [481, 481], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L476_C8", "vector": [13, 3, 0.6931, 0.0014, 3, 0.04, 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_99617:Return_L482_C8", "label": "return", "type": "return", "loc": [482, 482], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L468_C4", "vector": [13, 2, 0.6945, 0.0014, 2, 0.68, 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_99617:FunctionDef_L484_C4", "label": "kdl_to_pr2", "type": "function", "loc": [484, 496], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:ClassDef_L408_C0", "vector": [2, 1, 0.7061, 0.0187, 1, 0.7, 0.5455, 288, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "kdl_to_pr2", "arg_names": ["self", "q"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def kdl_to_pr2(self, q):\n if q == None:\n return None\n\n q_pr2 = [0] * 7\n q_pr2[0] = q[0]\n q_pr2[1] = q[1]\n q_pr2[2] = q[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L485_C8", "label": "if", "type": "if", "loc": [485, 486], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L484_C4", "vector": [4, 2, 0.6996, 0.0029, 2, 0.84, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if q == None:\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Return_L486_C12", "label": "return", "type": "return", "loc": [486, 486], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L485_C8", "vector": [13, 3, 0.7003, 0.0014, 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_99617:Assign_L488_C8", "label": "q_pr2 =", "type": "assigned_variable", "loc": [488, 488], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L484_C4", "vector": [14, 2, 0.7032, 0.0014, 2, 0.84, 0.1111, 714, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "q_pr2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " q_pr2 = [0] * 7"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L489_C8", "label": "assign", "type": "assigned_variable", "loc": [489, 489], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L484_C4", "vector": [14, 2, 0.7046, 0.0014, 2, 0.84, 0.2222, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " q_pr2[0] = q[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L490_C8", "label": "assign", "type": "assigned_variable", "loc": [490, 490], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L484_C4", "vector": [14, 2, 0.7061, 0.0014, 2, 0.84, 0.3333, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " q_pr2[1] = q[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L491_C8", "label": "assign", "type": "assigned_variable", "loc": [491, 491], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L484_C4", "vector": [14, 2, 0.7075, 0.0014, 2, 0.84, 0.4444, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " q_pr2[2] = q[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L492_C8", "label": "assign", "type": "assigned_variable", "loc": [492, 492], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L484_C4", "vector": [14, 2, 0.7089, 0.0014, 2, 0.84, 0.5556, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " q_pr2[3] = q[3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L493_C8", "label": "assign", "type": "assigned_variable", "loc": [493, 493], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L484_C4", "vector": [14, 2, 0.7104, 0.0014, 2, 0.84, 0.6667, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " q_pr2[4] = q[4]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L494_C8", "label": "assign", "type": "assigned_variable", "loc": [494, 494], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L484_C4", "vector": [14, 2, 0.7118, 0.0014, 2, 0.84, 0.7778, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " q_pr2[5] = q[5]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L495_C8", "label": "assign", "type": "assigned_variable", "loc": [495, 495], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L484_C4", "vector": [14, 2, 0.7133, 0.0014, 2, 0.84, 0.8889, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " q_pr2[6] = q[6]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Return_L496_C8", "label": "return", "type": "return", "loc": [496, 496], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L484_C4", "vector": [13, 2, 0.7147, 0.0014, 2, 0.84, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return q_pr2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L498_C4", "label": "pr2_to_kdl", "type": "function", "loc": [498, 505], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:ClassDef_L408_C0", "vector": [2, 1, 0.7226, 0.0115, 1, 0.7, 0.6364, 85, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "pr2_to_kdl", "arg_names": ["self", "q"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def pr2_to_kdl(self, q):\n if q == None:\n return None\n n = len(q)\n q_kdl = kdl.JntArray(n)\n for i in range(n):\n q_kdl[i] = q[i]\n return q_kdl"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L499_C8", "label": "if", "type": "if", "loc": [499, 500], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L498_C4", "vector": [4, 2, 0.7197, 0.0029, 2, 0.83, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if q == None:\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Return_L500_C12", "label": "return", "type": "return", "loc": [500, 500], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L499_C8", "vector": [13, 3, 0.7205, 0.0014, 3, 0.83, 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_99617:Assign_L501_C8", "label": "n = len()", "type": "assigned_variable", "loc": [501, 501], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L498_C4", "vector": [14, 2, 0.7219, 0.0014, 2, 0.83, 0.25, 773, 3, 1, 0, 0, 890, 10, 1], "semantic": {"name": "n", "arg_names": [], "import_names": [], "rhs_call_name": "len", "annotation": ""}, "snippet": " n = len(q)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L502_C8", "label": "q_kdl = JntArray()", "type": "assigned_variable", "loc": [502, 502], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L498_C4", "vector": [14, 2, 0.7233, 0.0014, 2, 0.83, 0.5, 784, 3, 1, 0, 0, 115, 10, 1], "semantic": {"name": "q_kdl", "arg_names": [], "import_names": [], "rhs_call_name": "JntArray", "annotation": ""}, "snippet": " q_kdl = kdl.JntArray(n)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:For_L503_C8", "label": "for i", "type": "for", "loc": [503, 504], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L498_C4", "vector": [6, 2, 0.7255, 0.0029, 2, 0.83, 0.75, 826, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(n):\n q_kdl[i] = q[i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L504_C12", "label": "assign", "type": "assigned_variable", "loc": [504, 504], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:For_L503_C8", "vector": [14, 3, 0.7262, 0.0014, 3, 0.12, 0.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " q_kdl[i] = q[i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Return_L505_C8", "label": "return", "type": "return", "loc": [505, 505], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L498_C4", "vector": [13, 2, 0.7277, 0.0014, 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 q_kdl"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L507_C4", "label": "Jac_kdl", "type": "function", "loc": [507, 523], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:ClassDef_L408_C0", "vector": [2, 1, 0.7421, 0.0245, 1, 0.7, 0.7273, 295, 0, 3, 1, 0, 0, 0, 5], "semantic": {"name": "Jac_kdl", "arg_names": ["self", "arm", "q"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def Jac_kdl(self, arm, q):\n J_kdl = kdl.Jacobian(7)\n if arm != 0:\n rospy.logerr('Unsupported arm: '+ str(arm))\n return None\n\n self.right_jac.JntToJac(q,J_kdl)\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L508_C8", "label": "J_kdl = Jacobian()", "type": "assigned_variable", "loc": [508, 508], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L507_C4", "vector": [14, 2, 0.732, 0.0014, 2, 0.06, 0.0, 652, 3, 1, 0, 0, 182, 10, 1], "semantic": {"name": "J_kdl", "arg_names": [], "import_names": [], "rhs_call_name": "Jacobian", "annotation": ""}, "snippet": " J_kdl = kdl.Jacobian(7)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L509_C8", "label": "if", "type": "if", "loc": [509, 511], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L507_C4", "vector": [4, 2, 0.7349, 0.0043, 2, 0.06, 0.25, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if arm != 0:\n rospy.logerr('Unsupported arm: '+ str(arm))\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L510_C12", "label": "logerr()", "type": "expression", "loc": [510, 510], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L509_C8", "vector": [8, 3, 0.7349, 0.0014, 3, 0.45, 0.0, 747, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "logerr", "arg_names": [], "import_names": [], "rhs_call_name": "logerr", "annotation": ""}, "snippet": " rospy.logerr('Unsupported arm: '+ str(arm))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Return_L511_C12", "label": "return", "type": "return", "loc": [511, 511], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L509_C8", "vector": [13, 3, 0.7363, 0.0014, 3, 0.45, 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_99617:Expr_L513_C8", "label": "JntToJac()", "type": "expression", "loc": [513, 513], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L507_C4", "vector": [8, 2, 0.7392, 0.0014, 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.right_jac.JntToJac(q,J_kdl)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L515_C8", "label": "kdl_jac = matrix()", "type": "assigned_variable", "loc": [515, 522], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L507_C4", "vector": [14, 2, 0.7471, 0.0115, 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_99617:Return_L523_C8", "label": "return", "type": "return", "loc": [523, 523], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L507_C4", "vector": [13, 2, 0.7536, 0.0014, 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_99617:FunctionDef_L538_C4", "label": "Jacobian", "type": "function", "loc": [538, 557], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:ClassDef_L408_C0", "vector": [2, 1, 0.7889, 0.0288, 1, 0.7, 0.8182, 182, 0, 4, 1, 0, 0, 0, 14], "semantic": {"name": "Jacobian", "arg_names": ["self", "arm", "q", "pos"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def Jacobian(self, arm, q, pos):\n if arm != 0:\n rospy.logerr('Arm %d is not supported.'%(arm))\n return None\n\n tooltip = self.right_tooltip\n self.right_tooltip = np.matrix([0.,0.,0.]).T\n v_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L539_C8", "label": "if", "type": "if", "loc": [539, 541], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L538_C4", "vector": [4, 2, 0.7781, 0.0043, 2, 0.1, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if arm != 0:\n rospy.logerr('Arm %d is not supported.'%(arm))\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L540_C12", "label": "logerr()", "type": "expression", "loc": [540, 540], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L539_C8", "vector": [8, 3, 0.7781, 0.0014, 3, 0.27, 0.0, 747, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logerr", "arg_names": [], "import_names": [], "rhs_call_name": "logerr", "annotation": ""}, "snippet": " rospy.logerr('Arm %d is not supported.'%(arm))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Return_L541_C12", "label": "return", "type": "return", "loc": [541, 541], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L539_C8", "vector": [13, 3, 0.7795, 0.0014, 3, 0.27, 1.0, 0, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L543_C8", "label": "tooltip =", "type": "assigned_variable", "loc": [543, 543], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L538_C4", "vector": [14, 2, 0.7824, 0.0014, 2, 0.1, 0.125, 568, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "tooltip", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tooltip = self.right_tooltip"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L544_C8", "label": "self.right_tooltip =", "type": "assigned_variable", "loc": [544, 544], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L538_C4", "vector": [14, 2, 0.7839, 0.0014, 2, 0.1, 0.25, 402, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.right_tooltip", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.right_tooltip = np.matrix([0.,0.,0.]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L545_C8", "label": "v_list =", "type": "assigned_variable", "loc": [545, 545], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L538_C4", "vector": [14, 2, 0.7853, 0.0014, 2, 0.1, 0.375, 218, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "v_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " v_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L546_C8", "label": "w_list =", "type": "assigned_variable", "loc": [546, 546], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L538_C4", "vector": [14, 2, 0.7867, 0.0014, 2, 0.1, 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_99617:For_L547_C8", "label": "for i", "type": "for", "loc": [547, 553], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L538_C4", "vector": [6, 2, 0.7925, 0.0101, 2, 0.1, 0.625, 826, 3, 0, 0, 0, 0, 0, 9], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(7):\n p, rot = self.FK_all(arm, q, i)\n r = pos - p\n z_idx = self.right_chain.getSegment(i).getJoint().getType() - 1\n z = rot[:, z_idx]\n v_list.append(np.matrix(np.cross(z.A1, r.A1)).T)\n w_list.append(z)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L548_C12", "label": "p, rot = FK_all()", "type": "assigned_variable", "loc": [548, 548], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:For_L547_C8", "vector": [14, 3, 0.7896, 0.0014, 3, 0.09, 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_99617:Assign_L549_C12", "label": "r =", "type": "assigned_variable", "loc": [549, 549], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:For_L547_C8", "vector": [14, 3, 0.7911, 0.0014, 3, 0.09, 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_99617:Assign_L550_C12", "label": "z_idx =", "type": "assigned_variable", "loc": [550, 550], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:For_L547_C8", "vector": [14, 3, 0.7925, 0.0014, 3, 0.09, 0.4, 160, 4, 0, 0, 0, 0, 0, 3], "semantic": {"name": "z_idx", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " z_idx = self.right_chain.getSegment(i).getJoint().getType() - 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L551_C12", "label": "z =", "type": "assigned_variable", "loc": [551, 551], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:For_L547_C8", "vector": [14, 3, 0.7939, 0.0014, 3, 0.09, 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_99617:Expr_L552_C12", "label": "append()", "type": "expression", "loc": [552, 552], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:For_L547_C8", "vector": [8, 3, 0.7954, 0.0014, 3, 0.09, 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_99617:Expr_L553_C12", "label": "append()", "type": "expression", "loc": [553, 553], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:For_L547_C8", "vector": [8, 3, 0.7968, 0.0014, 3, 0.09, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " w_list.append(z)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L555_C8", "label": "J = row_stack()", "type": "assigned_variable", "loc": [555, 555], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L538_C4", "vector": [14, 2, 0.7997, 0.0014, 2, 0.1, 0.75, 946, 3, 1, 0, 0, 612, 10, 3], "semantic": {"name": "J", "arg_names": [], "import_names": [], "rhs_call_name": "row_stack", "annotation": ""}, "snippet": " J = np.row_stack((np.column_stack(v_list), np.column_stack(w_list)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L556_C8", "label": "self.right_tooltip =", "type": "assigned_variable", "loc": [556, 556], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L538_C4", "vector": [14, 2, 0.8012, 0.0014, 2, 0.1, 0.875, 402, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.right_tooltip", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.right_tooltip = tooltip"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Return_L557_C8", "label": "return", "type": "return", "loc": [557, 557], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L538_C4", "vector": [13, 2, 0.8026, 0.0014, 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 J"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L559_C4", "label": "close_to_singularity", "type": "function", "loc": [559, 560], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:ClassDef_L408_C0", "vector": [2, 1, 0.8062, 0.0029, 1, 0.7, 0.9091, 738, 0, 3, 0, 0, 0, 0, 0], "semantic": {"name": "close_to_singularity", "arg_names": ["self", "arm", "q"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def close_to_singularity(self, arm, q):\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L562_C4", "label": "within_joint_limits", "type": "function", "loc": [562, 572], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:ClassDef_L408_C0", "vector": [2, 1, 0.817, 0.0159, 1, 0.7, 1.0, 596, 0, 4, 1, 0, 0, 0, 8], "semantic": {"name": "within_joint_limits", "arg_names": ["self", "arm", "q", "delta_list"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def within_joint_limits(self, arm, q, delta_list=[0., 0., 0., 0., 0., 0., 0.]):\n if arm == 0: # right arm\n min_arr = np.radians(np.array([-109., -24, -220, -132, -np.inf, -120, -np.inf]))\n #max_arr = np.radians(np.array([26., 68, 41, 0, np.inf, 0, np.inf]))\n max_arr = np.radians(np.array([26., 68, 41, 5, np.inf, 5, np.inf])) # 5 to prevent singularity. Need to come up with a better solution.\n else:\n raise RuntimeError('within_joint_limits unimplemented for left arm')\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L563_C8", "label": "if", "type": "if", "loc": [563, 568], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L562_C4", "vector": [4, 2, 0.8148, 0.0086, 2, 0.98, 0.0, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if arm == 0: # right arm\n min_arr = np.radians(np.array([-109., -24, -220, -132, -np.inf, -120, -np.inf]))\n #max_arr = np.radians(np.array([26., 68, 41, 0, np.inf, 0, np.inf]))\n max_arr = np.radians(np.array([26., 68, 41, 5, np.inf, 5, np.inf])) # 5 to prevent singularity. Need to come up with a better solution.\n else:\n raise RuntimeError('within_joint_limits unimplemented for left arm')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L564_C12", "label": "min_arr = radians()", "type": "assigned_variable", "loc": [564, 564], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L563_C8", "vector": [14, 3, 0.8127, 0.0014, 3, 0.39, 0.0, 34, 3, 1, 0, 0, 383, 10, 2], "semantic": {"name": "min_arr", "arg_names": [], "import_names": [], "rhs_call_name": "radians", "annotation": ""}, "snippet": " min_arr = np.radians(np.array([-109., -24, -220, -132, -np.inf, -120, -np.inf]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L566_C12", "label": "max_arr = radians()", "type": "assigned_variable", "loc": [566, 566], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L563_C8", "vector": [14, 3, 0.8156, 0.0014, 3, 0.39, 1.0, 605, 3, 1, 0, 0, 383, 10, 2], "semantic": {"name": "max_arr", "arg_names": [], "import_names": [], "rhs_call_name": "radians", "annotation": ""}, "snippet": " max_arr = np.radians(np.array([26., 68, 41, 5, np.inf, 5, np.inf])) # 5 to prevent singularity. Need to come up with a better solution."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L570_C8", "label": "q_arr = array()", "type": "assigned_variable", "loc": [570, 570], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L562_C4", "vector": [14, 2, 0.8213, 0.0014, 2, 0.98, 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_99617:Assign_L571_C8", "label": "d_arr = array()", "type": "assigned_variable", "loc": [571, 571], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L562_C4", "vector": [14, 2, 0.8228, 0.0014, 2, 0.98, 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_99617:Return_L572_C8", "label": "return", "type": "return", "loc": [572, 572], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L562_C4", "vector": [13, 2, 0.8242, 0.0014, 2, 0.98, 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_99617:If_L577_C0", "label": "if", "type": "if", "loc": [577, 629], "level": 0, "parent": null, "vector": [4, 0, 0.8689, 0.0764, 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 from visualization_msgs.msg import Marker\n import hrl_lib.viz as hv\n\n rospy.init_node('pr2_arms_test')\n\n pr2_arms = PR2Arms()\n pr2_kdl = PR2Arms_kdl()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:ImportFrom_L578_C4", "label": "from visualization_msgs.msg import Marker", "type": "import", "loc": [578, 578], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L577_C0", "vector": [1, 1, 0.8329, 0.0014, 1, 0.6, 0.0, 124, 0, 1, 0, 0, 124, 0, 0], "semantic": {"name": "visualization_msgs.msg", "arg_names": [], "import_names": ["Marker"], "rhs_call_name": "", "annotation": ""}, "snippet": " from visualization_msgs.msg import Marker"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Import_L579_C4", "label": "hrl_lib.viz import hv", "type": "import", "loc": [579, 579], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L577_C0", "vector": [1, 1, 0.8343, 0.0014, 1, 0.6, 0.1, 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_99617:Expr_L581_C4", "label": "init_node()", "type": "expression", "loc": [581, 581], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L577_C0", "vector": [8, 1, 0.8372, 0.0014, 1, 0.6, 0.2, 463, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "init_node", "arg_names": [], "import_names": [], "rhs_call_name": "init_node", "annotation": ""}, "snippet": " rospy.init_node('pr2_arms_test')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L583_C4", "label": "pr2_arms = PR2Arms()", "type": "assigned_variable", "loc": [583, 583], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L577_C0", "vector": [14, 1, 0.8401, 0.0014, 1, 0.6, 0.3, 369, 3, 0, 0, 0, 694, 10, 1], "semantic": {"name": "pr2_arms", "arg_names": [], "import_names": [], "rhs_call_name": "PR2Arms", "annotation": ""}, "snippet": " pr2_arms = PR2Arms()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L584_C4", "label": "pr2_kdl = PR2Arms_kdl()", "type": "assigned_variable", "loc": [584, 584], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L577_C0", "vector": [14, 1, 0.8415, 0.0014, 1, 0.6, 0.4, 561, 3, 0, 0, 0, 188, 10, 1], "semantic": {"name": "pr2_kdl", "arg_names": [], "import_names": [], "rhs_call_name": "PR2Arms_kdl", "annotation": ""}, "snippet": " pr2_kdl = PR2Arms_kdl()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L585_C4", "label": "r_arm, l_arm =", "type": "assigned_variable", "loc": [585, 585], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L577_C0", "vector": [14, 1, 0.8429, 0.0014, 1, 0.6, 0.5, 451, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "r_arm, l_arm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " r_arm, l_arm = 0, 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L586_C4", "label": "arm =", "type": "assigned_variable", "loc": [586, 586], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L577_C0", "vector": [14, 1, 0.8444, 0.0014, 1, 0.6, 0.6, 413, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "arm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " arm = r_arm"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L589_C4", "label": "if", "type": "if", "loc": [589, 594], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L577_C0", "vector": [4, 1, 0.8523, 0.0086, 1, 0.6, 0.7, 0, 1, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if True:\n np.set_printoptions(precision=2, suppress=True)\n while not rospy.is_shutdown():\n q = pr2_arms.get_joint_angles(arm)\n print('q in degrees:', np.degrees(q))\n rospy.sleep(0.1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L590_C8", "label": "set_printoptions()", "type": "expression", "loc": [590, 590], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L589_C4", "vector": [8, 2, 0.8501, 0.0014, 2, 0.71, 0.0, 763, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "set_printoptions", "arg_names": [], "import_names": [], "rhs_call_name": "set_printoptions", "annotation": ""}, "snippet": " np.set_printoptions(precision=2, suppress=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:While_L591_C8", "label": "while", "type": "while", "loc": [591, 594], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L589_C4", "vector": [5, 2, 0.8537, 0.0058, 2, 0.71, 1.0, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while not rospy.is_shutdown():\n q = pr2_arms.get_joint_angles(arm)\n print('q in degrees:', np.degrees(q))\n rospy.sleep(0.1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L592_C12", "label": "q = get_joint_angles()", "type": "assigned_variable", "loc": [592, 592], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:While_L591_C8", "vector": [14, 3, 0.853, 0.0014, 3, 0.21, 0.0, 516, 3, 1, 0, 0, 820, 10, 1], "semantic": {"name": "q", "arg_names": [], "import_names": [], "rhs_call_name": "get_joint_angles", "annotation": ""}, "snippet": " q = pr2_arms.get_joint_angles(arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L593_C12", "label": "print()", "type": "expression", "loc": [593, 593], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:While_L591_C8", "vector": [8, 3, 0.8545, 0.0014, 3, 0.21, 0.5, 535, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('q in degrees:', np.degrees(q))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L594_C12", "label": "sleep()", "type": "expression", "loc": [594, 594], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:While_L591_C8", "vector": [8, 3, 0.8559, 0.0014, 3, 0.21, 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_99617:If_L596_C4", "label": "if", "type": "if", "loc": [596, 600], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L577_C0", "vector": [4, 1, 0.8617, 0.0072, 1, 0.6, 0.8, 0, 1, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if False:\n jep = [0.] * 7\n rospy.loginfo('Going to home location.')\n raw_input('Hit ENTER to go')\n pr2_arms.set_jep(arm, jep, duration=2.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L597_C8", "label": "jep =", "type": "assigned_variable", "loc": [597, 597], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L596_C4", "vector": [14, 2, 0.8602, 0.0014, 2, 0.12, 0.0, 838, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "jep", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " jep = [0.] * 7"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L598_C8", "label": "loginfo()", "type": "expression", "loc": [598, 598], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L596_C4", "vector": [8, 2, 0.8617, 0.0014, 2, 0.12, 0.3333, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo('Going to home location.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L599_C8", "label": "raw_input()", "type": "expression", "loc": [599, 599], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L596_C4", "vector": [8, 2, 0.8631, 0.0014, 2, 0.12, 0.6667, 821, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "raw_input", "arg_names": [], "import_names": [], "rhs_call_name": "raw_input", "annotation": ""}, "snippet": " raw_input('Hit ENTER to go')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L600_C8", "label": "set_jep()", "type": "expression", "loc": [600, 600], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L596_C4", "vector": [8, 2, 0.8646, 0.0014, 2, 0.12, 1.0, 799, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "set_jep", "arg_names": [], "import_names": [], "rhs_call_name": "set_jep", "annotation": ""}, "snippet": " pr2_arms.set_jep(arm, jep, duration=2.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L602_C4", "label": "if", "type": "if", "loc": [602, 614], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L577_C0", "vector": [4, 1, 0.8761, 0.0187, 1, 0.6, 0.9, 0, 1, 0, 0, 0, 0, 0, 12], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if False:\n # testing FK by publishing a frame marker.\n marker_pub = rospy.Publisher('/pr2_kdl/ee_marker', Marker)\n pr2_kdl.set_tooltip(arm, np.matrix([0.15, 0., 0.]).T)\n rt = rospy.Rate(100)\n rospy.loginfo('Starting the maker publishing loop.')\n while not rospy.is_shutdown():\n q = pr2_arms.get_joint_angles(arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L604_C8", "label": "marker_pub = Publisher()", "type": "assigned_variable", "loc": [604, 604], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L602_C4", "vector": [14, 2, 0.8703, 0.0014, 2, 0.83, 0.0, 918, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "marker_pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " marker_pub = rospy.Publisher('/pr2_kdl/ee_marker', Marker)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L605_C8", "label": "set_tooltip()", "type": "expression", "loc": [605, 605], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L602_C4", "vector": [8, 2, 0.8718, 0.0014, 2, 0.83, 0.25, 350, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "set_tooltip", "arg_names": [], "import_names": [], "rhs_call_name": "set_tooltip", "annotation": ""}, "snippet": " pr2_kdl.set_tooltip(arm, np.matrix([0.15, 0., 0.]).T)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L606_C8", "label": "rt = Rate()", "type": "assigned_variable", "loc": [606, 606], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L602_C4", "vector": [14, 2, 0.8732, 0.0014, 2, 0.83, 0.5, 991, 3, 1, 0, 0, 543, 10, 1], "semantic": {"name": "rt", "arg_names": [], "import_names": [], "rhs_call_name": "Rate", "annotation": ""}, "snippet": " rt = rospy.Rate(100)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L607_C8", "label": "loginfo()", "type": "expression", "loc": [607, 607], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L602_C4", "vector": [8, 2, 0.8746, 0.0014, 2, 0.83, 0.75, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo('Starting the maker publishing loop.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:While_L608_C8", "label": "while", "type": "while", "loc": [608, 614], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L602_C4", "vector": [5, 2, 0.8804, 0.0101, 2, 0.83, 1.0, 0, 0, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while not rospy.is_shutdown():\n q = pr2_arms.get_joint_angles(arm)\n p, rot = pr2_kdl.FK_all(arm, q)\n m = hv.create_frame_marker(p, rot, 0.15, '/torso_lift_link')\n m.header.stamp = rospy.Time.now()\n marker_pub.publish(m)\n rt.sleep()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L609_C12", "label": "q = get_joint_angles()", "type": "assigned_variable", "loc": [609, 609], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:While_L608_C8", "vector": [14, 3, 0.8775, 0.0014, 3, 0.99, 0.0, 516, 3, 1, 0, 0, 820, 10, 1], "semantic": {"name": "q", "arg_names": [], "import_names": [], "rhs_call_name": "get_joint_angles", "annotation": ""}, "snippet": " q = pr2_arms.get_joint_angles(arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L610_C12", "label": "p, rot = FK_all()", "type": "assigned_variable", "loc": [610, 610], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:While_L608_C8", "vector": [14, 3, 0.879, 0.0014, 3, 0.99, 0.2, 466, 3, 2, 0, 0, 415, 10, 1], "semantic": {"name": "p, rot", "arg_names": [], "import_names": [], "rhs_call_name": "FK_all", "annotation": ""}, "snippet": " p, rot = pr2_kdl.FK_all(arm, q)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L611_C12", "label": "m = create_frame_marker()", "type": "assigned_variable", "loc": [611, 611], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:While_L608_C8", "vector": [14, 3, 0.8804, 0.0014, 3, 0.99, 0.4, 711, 3, 4, 0, 0, 345, 10, 1], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "create_frame_marker", "annotation": ""}, "snippet": " m = hv.create_frame_marker(p, rot, 0.15, '/torso_lift_link')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L612_C12", "label": "m.header.stamp = now()", "type": "assigned_variable", "loc": [612, 612], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:While_L608_C8", "vector": [14, 3, 0.8818, 0.0014, 3, 0.99, 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_99617:Expr_L613_C12", "label": "publish()", "type": "expression", "loc": [613, 613], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:While_L608_C8", "vector": [8, 3, 0.8833, 0.0014, 3, 0.99, 0.8, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " marker_pub.publish(m)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L614_C12", "label": "sleep()", "type": "expression", "loc": [614, 614], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:While_L608_C8", "vector": [8, 3, 0.8847, 0.0014, 3, 0.99, 1.0, 476, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " rt.sleep()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L616_C4", "label": "if", "type": "if", "loc": [616, 629], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L577_C0", "vector": [4, 1, 0.897, 0.0202, 1, 0.6, 1.0, 0, 1, 0, 0, 0, 0, 0, 11], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if False:\n # testing Jacobian by printing KDL and my own Jacobian at the\n # current configuration.\n while not rospy.is_shutdown():\n q = pr2_arms.get_joint_angles(arm)\n J_kdl = pr2_kdl.Jac(arm , q)\n p, rot = pr2_kdl.FK_all(arm, q)\n J_adv = pr2_kdl.Jacobian(arm, q, p)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:While_L619_C8", "label": "while", "type": "while", "loc": [619, 629], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L616_C4", "vector": [5, 2, 0.8991, 0.0159, 2, 0.8, 0.0, 0, 0, 0, 0, 0, 0, 0, 11], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while not rospy.is_shutdown():\n q = pr2_arms.get_joint_angles(arm)\n J_kdl = pr2_kdl.Jac(arm , q)\n p, rot = pr2_kdl.FK_all(arm, q)\n J_adv = pr2_kdl.Jacobian(arm, q, p)\n print(J_adv.shape)\n diff_J = J_kdl - J_adv\n print('difference between KDL and adv is:')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L620_C12", "label": "q = get_joint_angles()", "type": "assigned_variable", "loc": [620, 620], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:While_L619_C8", "vector": [14, 3, 0.8934, 0.0014, 3, 0.12, 0.0, 516, 3, 1, 0, 0, 820, 10, 1], "semantic": {"name": "q", "arg_names": [], "import_names": [], "rhs_call_name": "get_joint_angles", "annotation": ""}, "snippet": " q = pr2_arms.get_joint_angles(arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L621_C12", "label": "J_kdl = Jac()", "type": "assigned_variable", "loc": [621, 621], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:While_L619_C8", "vector": [14, 3, 0.8948, 0.0014, 3, 0.12, 0.1111, 652, 3, 2, 0, 0, 115, 10, 1], "semantic": {"name": "J_kdl", "arg_names": [], "import_names": [], "rhs_call_name": "Jac", "annotation": ""}, "snippet": " J_kdl = pr2_kdl.Jac(arm , q)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L622_C12", "label": "p, rot = FK_all()", "type": "assigned_variable", "loc": [622, 622], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:While_L619_C8", "vector": [14, 3, 0.8963, 0.0014, 3, 0.12, 0.2222, 466, 3, 2, 0, 0, 415, 10, 1], "semantic": {"name": "p, rot", "arg_names": [], "import_names": [], "rhs_call_name": "FK_all", "annotation": ""}, "snippet": " p, rot = pr2_kdl.FK_all(arm, q)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L623_C12", "label": "J_adv = Jacobian()", "type": "assigned_variable", "loc": [623, 623], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:While_L619_C8", "vector": [14, 3, 0.8977, 0.0014, 3, 0.12, 0.3333, 267, 3, 3, 0, 0, 182, 10, 1], "semantic": {"name": "J_adv", "arg_names": [], "import_names": [], "rhs_call_name": "Jacobian", "annotation": ""}, "snippet": " J_adv = pr2_kdl.Jacobian(arm, q, p)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L624_C12", "label": "print()", "type": "expression", "loc": [624, 624], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:While_L619_C8", "vector": [8, 3, 0.8991, 0.0014, 3, 0.12, 0.4444, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(J_adv.shape)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L625_C12", "label": "diff_J =", "type": "assigned_variable", "loc": [625, 625], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:While_L619_C8", "vector": [14, 3, 0.9006, 0.0014, 3, 0.12, 0.5556, 66, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "diff_J", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " diff_J = J_kdl - J_adv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L626_C12", "label": "print()", "type": "expression", "loc": [626, 626], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:While_L619_C8", "vector": [8, 3, 0.902, 0.0014, 3, 0.12, 0.6667, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('difference between KDL and adv is:')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L627_C12", "label": "print()", "type": "expression", "loc": [627, 627], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:While_L619_C8", "vector": [8, 3, 0.9035, 0.0014, 3, 0.12, 0.7778, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(diff_J)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L628_C12", "label": "print()", "type": "expression", "loc": [628, 628], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:While_L619_C8", "vector": [8, 3, 0.9049, 0.0014, 3, 0.12, 0.8889, 535, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Norm of difference matrix:', np.linalg.norm(diff_J))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L629_C12", "label": "raw_input()", "type": "expression", "loc": [629, 629], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99617:While_L619_C8", "vector": [8, 3, 0.9063, 0.0014, 3, 0.12, 1.0, 821, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "raw_input", "arg_names": [], "import_names": [], "rhs_call_name": "raw_input", "annotation": ""}, "snippet": " raw_input('Move arm into some configuration and hit enter to get the Jacobian.')"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L43_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L44_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L51_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L52_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L52_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Return_L55_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L51_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L56_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L57_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L51_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L58_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Return_L59_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L51_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Return_L60_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:ClassDef_L63_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L64_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L64_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L65_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L64_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L67_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L64_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L69_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L64_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L78_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L64_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L79_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L64_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L81_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L64_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L82_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L64_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L83_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L64_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L85_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L64_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L86_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L64_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L88_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L64_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L89_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L64_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L91_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L64_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L93_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L64_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L94_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L64_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L96_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L64_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L97_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L64_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L98_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L64_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L100_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L100_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L101_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L64_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L102_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L102_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L103_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L64_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L105_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L64_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L107_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L64_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L109_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L64_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L111_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L64_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L113_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L64_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L115_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L64_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L116_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L64_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L120_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L64_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L121_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L64_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L123_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:ClassDef_L63_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L129_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L129_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L130_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L129_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L131_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L129_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L132_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L129_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L133_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L129_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:For_L134_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:For_L134_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L135_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L129_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:For_L136_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:For_L136_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L137_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L129_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:For_L140_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:For_L140_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L141_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:For_L140_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L142_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:For_L140_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L144_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:For_L140_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L145_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:For_L140_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L147_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:For_L140_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L148_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:For_L140_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L151_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L129_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L155_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L129_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L156_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L129_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L157_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L129_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L159_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L129_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L160_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L129_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L162_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L129_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L164_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L129_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L165_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L129_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L166_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L129_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L167_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:ClassDef_L63_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L169_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L169_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L170_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L169_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L172_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L169_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L173_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L169_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L174_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L169_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L175_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L169_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L178_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L169_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L179_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L169_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L180_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L169_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L181_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L169_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L182_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L169_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L183_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L169_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L184_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L169_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L185_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L169_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L186_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L169_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L187_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L169_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L188_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L169_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L189_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L169_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L190_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L169_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L191_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L169_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L192_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L169_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L194_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L169_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L195_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L169_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L196_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L169_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L197_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L169_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L198_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L169_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L200_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L169_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L201_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L169_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L202_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L169_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L203_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L169_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L204_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L169_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L205_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L169_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L207_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L169_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L208_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L169_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L209_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L169_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L210_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L169_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L211_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L169_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L212_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L169_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L213_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L169_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L214_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L169_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L215_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:ClassDef_L63_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L217_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L217_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L218_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L217_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L219_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L217_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L220_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L217_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L221_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L217_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L222_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:ClassDef_L63_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L228_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L228_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L229_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L228_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Return_L230_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:ClassDef_L63_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L235_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L235_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L236_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L236_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L237_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L235_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L238_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L235_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L239_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L235_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L240_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L235_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Return_L241_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:ClassDef_L63_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L243_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L243_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L244_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L243_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L246_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L243_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L247_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L243_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L248_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L243_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L249_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L243_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L252_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L243_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L253_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L243_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L254_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L243_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L256_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L243_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L257_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L243_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L258_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L243_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L260_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L243_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L261_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L243_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L266_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L243_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L267_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:ClassDef_L63_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L269_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L269_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L270_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L269_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L271_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L269_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L272_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L269_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Return_L273_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:ClassDef_L63_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L275_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L275_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L276_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L276_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Return_L277_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L276_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Return_L279_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:ClassDef_L63_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L281_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L281_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L282_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L282_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L283_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L283_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Return_L284_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L283_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Return_L286_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L282_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Return_L288_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:ClassDef_L63_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L291_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L291_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L292_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L292_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L293_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L291_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L294_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L291_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L295_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L291_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L296_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L291_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L298_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L291_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L299_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L291_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L300_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L291_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L302_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L302_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L303_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L303_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L304_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L303_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L306_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L291_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L308_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L291_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L309_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L291_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L310_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L291_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L311_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L291_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L312_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L291_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L313_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L313_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L314_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L313_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L316_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:ClassDef_L63_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L319_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L319_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L320_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L319_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L321_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L319_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L322_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L319_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L323_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L319_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L324_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L319_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:While_L325_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:While_L325_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L327_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:While_L325_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L328_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L319_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L329_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L319_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L330_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:ClassDef_L63_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L337_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L337_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L338_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L338_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L339_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L337_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L342_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L337_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L343_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L337_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L344_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L344_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L345_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L344_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L347_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L344_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L348_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L337_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Return_L349_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:ClassDef_L63_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L352_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L352_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L353_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L353_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L354_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L352_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L357_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L352_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L358_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L352_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L359_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L359_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L360_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L359_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L362_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L359_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L363_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L352_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Return_L364_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:ClassDef_L63_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L369_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L369_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L370_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L370_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L371_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L369_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L372_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L369_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L373_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L369_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L374_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L369_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L375_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L369_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L376_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L369_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L377_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L369_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L378_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L369_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L379_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L369_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Return_L380_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:ClassDef_L63_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L383_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L383_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L384_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L384_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L385_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L383_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L387_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L383_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L388_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:ClassDef_L63_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L391_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L391_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L392_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:ClassDef_L63_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L397_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L397_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L398_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:ClassDef_L63_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L402_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L402_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L403_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:ClassDef_L408_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L409_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L409_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L410_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L409_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L411_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L409_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L412_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L409_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L413_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L409_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L414_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L409_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L415_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L409_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L416_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:ClassDef_L408_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L418_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L418_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L419_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L418_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L420_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L418_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L422_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L418_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L424_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L418_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L426_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L418_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L428_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L418_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L430_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L418_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L432_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L418_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L434_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L418_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Return_L435_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:ClassDef_L408_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L437_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L437_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L438_C9"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L437_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L439_C9"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L437_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L440_C9"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L437_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L441_C9"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L437_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Return_L442_C9"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:ClassDef_L408_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L445_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L445_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L446_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L446_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L447_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L446_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L449_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:ClassDef_L408_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L451_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L451_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L452_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L452_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L453_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L452_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L454_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L452_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L455_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L452_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L457_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L457_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Return_L458_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L457_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L460_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L457_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Return_L461_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L452_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L463_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L452_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L464_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:ClassDef_L408_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L468_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L468_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L469_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L468_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L470_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L468_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L471_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L468_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L472_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L468_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L473_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L468_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L474_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L468_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L475_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L468_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L476_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L476_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L477_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L476_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L480_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L476_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Return_L481_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L468_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Return_L482_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:ClassDef_L408_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L484_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L484_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L485_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L485_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Return_L486_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L484_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L488_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L484_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L489_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L484_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L490_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L484_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L491_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L484_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L492_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L484_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L493_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L484_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L494_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L484_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L495_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L484_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Return_L496_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:ClassDef_L408_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L498_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L498_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L499_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L499_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Return_L500_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L498_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L501_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L498_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L502_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L498_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:For_L503_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:For_L503_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L504_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L498_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Return_L505_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:ClassDef_L408_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L507_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L507_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L508_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L507_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L509_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L509_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L510_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L509_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Return_L511_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L507_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L513_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L507_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L515_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L507_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Return_L523_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:ClassDef_L408_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L538_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L538_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L539_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L539_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L540_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L539_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Return_L541_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L538_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L543_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L538_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L544_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L538_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L545_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L538_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L546_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L538_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:For_L547_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:For_L547_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L548_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:For_L547_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L549_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:For_L547_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L550_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:For_L547_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L551_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:For_L547_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L552_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:For_L547_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L553_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L538_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L555_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L538_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L556_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L538_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Return_L557_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:ClassDef_L408_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L559_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:ClassDef_L408_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L562_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L562_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L563_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L563_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L564_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L563_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L566_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L562_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L570_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L562_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L571_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:FunctionDef_L562_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Return_L572_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L577_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:ImportFrom_L578_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L577_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Import_L579_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L577_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L581_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L577_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L583_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L577_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L584_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L577_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L585_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L577_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L586_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L577_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L589_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L589_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L590_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L589_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:While_L591_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:While_L591_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L592_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:While_L591_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L593_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:While_L591_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L594_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L577_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L596_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L596_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L597_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L596_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L598_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L596_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L599_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L596_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L600_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L577_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L602_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L602_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L604_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L602_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L605_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L602_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L606_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L602_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L607_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L602_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:While_L608_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:While_L608_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L609_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:While_L608_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L610_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:While_L608_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L611_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:While_L608_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L612_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:While_L608_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L613_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:While_L608_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L614_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L577_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L616_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:If_L616_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:While_L619_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:While_L619_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L620_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:While_L619_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L621_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:While_L619_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L622_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:While_L619_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L623_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:While_L619_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L624_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:While_L619_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Assign_L625_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:While_L619_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L626_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:While_L619_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L627_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:While_L619_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L628_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99617:While_L619_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99617:Expr_L629_C12"}]
# # Temoprarily in this package. Advait needs to move it to a better # location. # import numpy as np, math import copy import roslib; roslib.load_manifest('hrl_pr2_door_opening') import rospy import hrl_lib.util as ut ## 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): self.robot = robot self.f_list = [] self.ee_list = [] self.cep_list = [] ## # @param equi_pt_generator: function that returns stop, ea where ea: equilibrium angles and stop: string which is '' for epc motion to continue # @param rapid_call_func: called in the time between calls to the equi_pt_generator can be used for logging, safety etc. returns string which is '' for epc motion to continue # @param time_step: time between successive calls to equi_pt_generator # @param arg_list - list of arguments to be passed to the equi_pt_generator # @return stop (the string which has the reason why the epc # motion stopped.), ea (last commanded equilibrium angles) def epc_motion(self, equi_pt_generator, time_step, arm, arg_list, rapid_call_func=None, control_function=None): stop, ea = equi_pt_generator(*arg_list) t_end = rospy.get_time() while stop == '': if rospy.is_shutdown(): stop = 'rospy shutdown' continue t_end += time_step #self.robot.set_jointangles(arm, ea) #import pdb; pdb.set_trace() control_function(arm, *ea) # self.robot.step() this should be within the rapid_call_func for the meka arms. t1 = rospy.get_time() while t1<t_end: if rapid_call_func != None: stop = rapid_call_func(arm) if stop != '': break #self.robot.step() this should be within the rapid_call_func for the meka arms rospy.sleep(0.01) t1 = rospy.get_time() if stop == '': stop, ea = equi_pt_generator(*arg_list) if stop == 'reset timing': stop = '' t_end = rospy.get_time() return stop, ea ## Pull back along a straight line (-ve x direction) # @param arm - 'right_arm' or 'left_arm' # @param distance - how far back to pull. def pull_back_cartesian_control(self, arm, distance, logging_fn): cep, _ = self.robot.get_cep_jtt(arm) cep_end = cep + distance * np.matrix([-1., 0., 0.]).T self.dist_left = distance def eq_gen_pull_back(cep): logging_fn(arm) if self.dist_left <= 0.: return 'done', None step_size = 0.01 cep[0,0] -= step_size self.dist_left -= step_size if cep[0,0] < 0.4: return 'very close to the body: %.3f'%cep[0,0], None return '', (cep, None) arg_list = [cep] s = self.epc_motion(eq_gen_pull_back, 0.1, arm, arg_list, control_function = self.robot.set_cep_jtt) print s 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) time_step = 0.1 dist = np.linalg.norm(vec) step_size = speed * time_step cep_start, _ = self.robot.get_cep_jtt(arm) cep = copy.copy(cep_start) def eq_gen(cep): force = self.robot.get_wrist_force(arm, base_frame = True) force_projection = force.T*unit_vec *-1 # projection in direction opposite to motion. print 'force_projection:', force_projection if force_projection>force_threshold: return 'done', None elif np.linalg.norm(force)>45.: return 'large force', None elif np.linalg.norm(cep_start-cep) >= dist: return 'reached without contact', None else: cep_t = cep + unit_vec * step_size cep[0,0] = cep_t[0,0] cep[1,0] = cep_t[1,0] cep[2,0] = cep_t[2,0] return '', (cep, None) if bias_FT: self.robot.bias_wrist_ft(arm) rospy.sleep(0.5) return self.epc_motion(eq_gen, time_step, arm, [cep], control_function = self.robot.set_cep_jtt) def cep_gen_surface_follow(self, arm, move_dir, force_threshold, cep, cep_start): wrist_force = self.robot.get_wrist_force(arm, base_frame=True) if wrist_force[0,0] < -3.: cep[0,0] -= 0.002 if wrist_force[0,0] > -1.: cep[0,0] += 0.003 if cep[0,0] > (cep_start[0,0]+0.05): cep[0,0] = cep_start[0,0]+0.05 step_size = 0.002 cep_t = cep + move_dir * step_size cep[0,0] = cep_t[0,0] cep[1,0] = cep_t[1,0] cep[2,0] = cep_t[2,0] print 'wrist_force:', wrist_force.A1 v = cep - cep_start if (wrist_force.T * move_dir)[0,0] < -force_threshold: stop = 'got a hook' elif np.linalg.norm(wrist_force) > 50.: stop = 'force is large %f'%(np.linalg.norm(wrist_force)) elif (v.T * move_dir)[0,0] > 0.20: stop = 'moved a lot without a hook' else: stop = '' return stop, (cep, None) if __name__ == '__main__': import pr2_arms as pa rospy.init_node('epc_pr2', anonymous = True) rospy.logout('epc_pr2: ready') pr2_arms = pa.PR2Arms() epc = EPC(pr2_arms) r_arm, l_arm = 0, 1 arm = r_arm # #----- testing move_till_hit ------ # p1 = np.matrix([0.6, -0.22, -0.05]).T # epc.robot.go_cep_jtt(arm, p1) # epc.move_till_hit(arm) raw_input('Hit ENTER to close') pr2_arms.close_gripper(arm) raw_input('Hit ENTER to search_and_hook') p1 = np.matrix([0.8, -0.22, -0.05]).T epc.search_and_hook(arm, p1) epc.pull_back_cartesian_control(arm, 0.3) d = { 'f_list': epc.f_list, 'ee_list': epc.ee_list, 'cep_list': epc.cep_list } ut.save_pickle(d, 'pr2_pull_'+ut.formatted_time()+'.pkl') # if False: # ea = [0, 0, 0, 0, 0, 0, 0] # ea = epc.robot.get_joint_angles(arm) # rospy.logout('Going to starting position') # epc.robot.set_jointangles(arm, ea, duration=4.0) # raw_input('Hit ENTER to pull') # epc.pull_back(arm, ea, tr.Rx(0), 0.2) # # if False: # p = np.matrix([0.9, -0.3, -0.15]).T # rot = tr.Rx(0.) # rot = tr.Rx(math.radians(90.)) # # rospy.logout('Going to starting position') # # epc.robot.open_gripper(arm) # epc.robot.set_cartesian(arm, p, rot) # # raw_input('Hit ENTER to close the gripper') # # epc.robot.close_gripper(arm) # raw_input('Hit ENTER to pull') # epc.pull_back_cartesian_control(arm, p, rot, 0.4)
ajibawa-2023/Python-Code-Large/train/row_99618
110
205
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99618:Import_L7_C0", "label": "numpy import np, math", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.0341, 0.0049, 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_99618:Import_L8_C0", "label": "copy import copy", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.039, 0.0049, 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_99618:Import_L10_C0", "label": "roslib import roslib", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.0488, 0.0049, 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('hrl_pr2_door_opening')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99618:Expr_L10_C15", "label": "load_manifest()", "type": "expression", "loc": [10, 10], "level": 0, "parent": null, "vector": [8, 0, 0.0488, 0.0049, 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('hrl_pr2_door_opening')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99618:Import_L11_C0", "label": "rospy import rospy", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.0537, 0.0049, 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_99618:Import_L13_C0", "label": "hrl_lib.util import ut", "type": "import", "loc": [13, 13], "level": 0, "parent": null, "vector": [1, 0, 0.0634, 0.0049, 0, 0.66, 0.7143, 775, 0, 1, 0, 0, 775, 0, 0], "semantic": {"name": "hrl_lib.util", "arg_names": [], "import_names": ["ut"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.util as ut"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99618:ClassDef_L18_C0", "label": "EPC", "type": "class", "loc": [18, 148], "level": 0, "parent": null, "vector": [3, 0, 0.4049, 0.639, 0, 0.66, 0.8571, 417, 0, 7, 0, 0, 0, 0, 31], "semantic": {"name": "EPC", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class EPC():\n def __init__(self, robot):\n self.robot = robot\n self.f_list = []\n self.ee_list = []\n self.cep_list = []\n\n ##"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99618:FunctionDef_L19_C4", "label": "__init__", "type": "function", "loc": [19, 23], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99618:ClassDef_L18_C0", "vector": [2, 1, 0.1024, 0.0244, 1, 0.77, 0.0, 555, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "robot"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, robot):\n self.robot = robot\n self.f_list = []\n self.ee_list = []\n self.cep_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99618:Assign_L20_C8", "label": "self.robot =", "type": "assigned_variable", "loc": [20, 20], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99618:FunctionDef_L19_C4", "vector": [14, 2, 0.0976, 0.0049, 2, 0.59, 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_99618:Assign_L21_C8", "label": "self.f_list =", "type": "assigned_variable", "loc": [21, 21], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99618:FunctionDef_L19_C4", "vector": [14, 2, 0.1024, 0.0049, 2, 0.59, 0.3333, 589, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.f_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.f_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99618:Assign_L22_C8", "label": "self.ee_list =", "type": "assigned_variable", "loc": [22, 22], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99618:FunctionDef_L19_C4", "vector": [14, 2, 0.1073, 0.0049, 2, 0.59, 0.6667, 959, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.ee_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.ee_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99618:Assign_L23_C8", "label": "self.cep_list =", "type": "assigned_variable", "loc": [23, 23], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99618:FunctionDef_L19_C4", "vector": [14, 2, 0.1122, 0.0049, 2, 0.59, 1.0, 867, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.cep_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.cep_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99618:FunctionDef_L32_C4", "label": "epc_motion", "type": "function", "loc": [32, 63], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99618:ClassDef_L18_C0", "vector": [2, 1, 0.2317, 0.1561, 1, 0.77, 0.25, 938, 0, 7, 1, 0, 0, 0, 10], "semantic": {"name": "epc_motion", "arg_names": ["self", "equi_pt_generator", "time_step", "arm", "arg_list", "rapid_call_func", "control_function"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def epc_motion(self, equi_pt_generator, time_step, arm, arg_list,\n rapid_call_func=None, control_function=None):\n\n stop, ea = equi_pt_generator(*arg_list)\n t_end = rospy.get_time()\n while stop == '':\n if rospy.is_shutdown():\n stop = 'rospy shutdown'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99618:Assign_L35_C8", "label": "stop, ea = equi_pt_generator()", "type": "assigned_variable", "loc": [35, 35], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99618:FunctionDef_L32_C4", "vector": [14, 2, 0.1707, 0.0049, 2, 0.55, 0.0, 665, 3, 1, 0, 0, 648, 10, 1], "semantic": {"name": "stop, ea", "arg_names": [], "import_names": [], "rhs_call_name": "equi_pt_generator", "annotation": ""}, "snippet": " stop, ea = equi_pt_generator(*arg_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99618:Assign_L36_C8", "label": "t_end = get_time()", "type": "assigned_variable", "loc": [36, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99618:FunctionDef_L32_C4", "vector": [14, 2, 0.1756, 0.0049, 2, 0.55, 0.3333, 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_99618:While_L37_C8", "label": "while", "type": "while", "loc": [37, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99618:FunctionDef_L32_C4", "vector": [5, 2, 0.239, 0.122, 2, 0.55, 0.6667, 0, 0, 0, 0, 0, 0, 0, 8], "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 t_end += time_step\n #self.robot.set_jointangles(arm, ea)\n #import pdb; pdb.set_trace()\n control_function(arm, *ea)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L38_C12", "label": "if", "type": "if", "loc": [38, 40], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99618:While_L37_C8", "vector": [4, 3, 0.1902, 0.0146, 3, 0.04, 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_99618:Assign_L39_C16", "label": "stop =", "type": "assigned_variable", "loc": [39, 39], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L38_C12", "vector": [14, 4, 0.1902, 0.0049, 4, 0.32, 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_99618:Expr_L44_C12", "label": "control_function()", "type": "expression", "loc": [44, 44], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99618:While_L37_C8", "vector": [8, 3, 0.2146, 0.0049, 3, 0.04, 0.2, 736, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "control_function", "arg_names": [], "import_names": [], "rhs_call_name": "control_function", "annotation": ""}, "snippet": " control_function(arm, *ea)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99618:Assign_L47_C12", "label": "t1 = get_time()", "type": "assigned_variable", "loc": [47, 47], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99618:While_L37_C8", "vector": [14, 3, 0.2293, 0.0049, 3, 0.04, 0.4, 329, 3, 0, 0, 0, 164, 10, 1], "semantic": {"name": "t1", "arg_names": [], "import_names": [], "rhs_call_name": "get_time", "annotation": ""}, "snippet": " t1 = rospy.get_time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99618:While_L48_C12", "label": "while", "type": "while", "loc": [48, 55], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99618:While_L37_C8", "vector": [5, 3, 0.2512, 0.039, 3, 0.04, 0.6, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while t1<t_end:\n if rapid_call_func != None:\n stop = rapid_call_func(arm)\n if stop != '':\n break\n #self.robot.step() this should be within the rapid_call_func for the meka arms\n rospy.sleep(0.01)\n t1 = rospy.get_time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L49_C16", "label": "if", "type": "if", "loc": [49, 52], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99618:While_L48_C12", "vector": [4, 4, 0.2463, 0.0195, 4, 0.09, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if rapid_call_func != None:\n stop = rapid_call_func(arm)\n if stop != '':\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99618:Assign_L50_C20", "label": "stop = rapid_call_func()", "type": "assigned_variable", "loc": [50, 50], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L49_C16", "vector": [14, 5, 0.2439, 0.0049, 5, 0.8, 0.0, 343, 3, 1, 0, 0, 571, 10, 1], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "rapid_call_func", "annotation": ""}, "snippet": " stop = rapid_call_func(arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L51_C20", "label": "if", "type": "if", "loc": [51, 52], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L49_C16", "vector": [4, 5, 0.2512, 0.0098, 5, 0.8, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if stop != '':\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99618:Expr_L54_C16", "label": "sleep()", "type": "expression", "loc": [54, 54], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99618:While_L48_C12", "vector": [8, 4, 0.2634, 0.0049, 4, 0.09, 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_99618:Assign_L55_C16", "label": "t1 = get_time()", "type": "assigned_variable", "loc": [55, 55], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99618:While_L48_C12", "vector": [14, 4, 0.2683, 0.0049, 4, 0.09, 1.0, 329, 3, 0, 0, 0, 164, 10, 1], "semantic": {"name": "t1", "arg_names": [], "import_names": [], "rhs_call_name": "get_time", "annotation": ""}, "snippet": " t1 = rospy.get_time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L57_C12", "label": "if", "type": "if", "loc": [57, 58], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99618:While_L37_C8", "vector": [4, 3, 0.2805, 0.0098, 3, 0.04, 0.8, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if stop == '':\n stop, ea = equi_pt_generator(*arg_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99618:Assign_L58_C16", "label": "stop, ea = equi_pt_generator()", "type": "assigned_variable", "loc": [58, 58], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L57_C12", "vector": [14, 4, 0.2829, 0.0049, 4, 0.85, 0.0, 665, 3, 1, 0, 0, 648, 10, 1], "semantic": {"name": "stop, ea", "arg_names": [], "import_names": [], "rhs_call_name": "equi_pt_generator", "annotation": ""}, "snippet": " stop, ea = equi_pt_generator(*arg_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L59_C12", "label": "if", "type": "if", "loc": [59, 61], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99618:While_L37_C8", "vector": [4, 3, 0.2927, 0.0146, 3, 0.04, 1.0, 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_99618:Assign_L60_C16", "label": "stop =", "type": "assigned_variable", "loc": [60, 60], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L59_C12", "vector": [14, 4, 0.2927, 0.0049, 4, 0.65, 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_99618:Assign_L61_C16", "label": "t_end = get_time()", "type": "assigned_variable", "loc": [61, 61], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L59_C12", "vector": [14, 4, 0.2976, 0.0049, 4, 0.65, 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_99618:Return_L63_C8", "label": "return", "type": "return", "loc": [63, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99618:FunctionDef_L32_C4", "vector": [13, 2, 0.3073, 0.0049, 2, 0.55, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return stop, ea"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99618:FunctionDef_L69_C4", "label": "pull_back_cartesian_control", "type": "function", "loc": [69, 88], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99618:ClassDef_L18_C0", "vector": [2, 1, 0.3829, 0.0976, 1, 0.77, 0.5, 632, 0, 4, 1, 0, 0, 0, 5], "semantic": {"name": "pull_back_cartesian_control", "arg_names": ["self", "arm", "distance", "logging_fn"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def pull_back_cartesian_control(self, arm, distance, logging_fn):\n cep, _ = self.robot.get_cep_jtt(arm)\n cep_end = cep + distance * np.matrix([-1., 0., 0.]).T\n self.dist_left = distance\n\n def eq_gen_pull_back(cep):\n logging_fn(arm)\n if self.dist_left <= 0.:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99618:Assign_L70_C8", "label": "cep, _ = get_cep_jtt()", "type": "assigned_variable", "loc": [70, 70], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99618:FunctionDef_L69_C4", "vector": [14, 2, 0.3415, 0.0049, 2, 0.89, 0.0, 705, 3, 1, 0, 0, 532, 10, 1], "semantic": {"name": "cep, _", "arg_names": [], "import_names": [], "rhs_call_name": "get_cep_jtt", "annotation": ""}, "snippet": " cep, _ = self.robot.get_cep_jtt(arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99618:Assign_L71_C8", "label": "cep_end =", "type": "assigned_variable", "loc": [71, 71], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99618:FunctionDef_L69_C4", "vector": [14, 2, 0.3463, 0.0049, 2, 0.89, 0.1667, 694, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "cep_end", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cep_end = cep + distance * np.matrix([-1., 0., 0.]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99618:Assign_L72_C8", "label": "self.dist_left =", "type": "assigned_variable", "loc": [72, 72], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99618:FunctionDef_L69_C4", "vector": [14, 2, 0.3512, 0.0049, 2, 0.89, 0.3333, 539, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.dist_left", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.dist_left = distance"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99618:FunctionDef_L74_C8", "label": "eq_gen_pull_back", "type": "function", "loc": [74, 83], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99618:FunctionDef_L69_C4", "vector": [2, 2, 0.3829, 0.0488, 2, 0.89, 0.5, 336, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "eq_gen_pull_back", "arg_names": ["cep"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def eq_gen_pull_back(cep):\n logging_fn(arm)\n if self.dist_left <= 0.:\n return 'done', None\n step_size = 0.01\n cep[0,0] -= step_size\n self.dist_left -= step_size\n if cep[0,0] < 0.4:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99618:Expr_L75_C12", "label": "logging_fn()", "type": "expression", "loc": [75, 75], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99618:FunctionDef_L74_C8", "vector": [8, 3, 0.3659, 0.0049, 3, 0.69, 0.0, 515, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logging_fn", "arg_names": [], "import_names": [], "rhs_call_name": "logging_fn", "annotation": ""}, "snippet": " logging_fn(arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L76_C12", "label": "if", "type": "if", "loc": [76, 77], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99618:FunctionDef_L74_C8", "vector": [4, 3, 0.3732, 0.0098, 3, 0.69, 0.25, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.dist_left <= 0.:\n return 'done', None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99618:Return_L77_C16", "label": "return", "type": "return", "loc": [77, 77], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L76_C12", "vector": [13, 4, 0.3756, 0.0049, 4, 0.5, 0.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'done', None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99618:Assign_L78_C12", "label": "step_size =", "type": "assigned_variable", "loc": [78, 78], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99618:FunctionDef_L74_C8", "vector": [14, 3, 0.3805, 0.0049, 3, 0.69, 0.5, 764, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "step_size", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " step_size = 0.01"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L81_C12", "label": "if", "type": "if", "loc": [81, 82], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99618:FunctionDef_L74_C8", "vector": [4, 3, 0.3976, 0.0098, 3, 0.69, 0.75, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if cep[0,0] < 0.4:\n return 'very close to the body: %.3f'%cep[0,0], None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99618:Return_L82_C16", "label": "return", "type": "return", "loc": [82, 82], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L81_C12", "vector": [13, 4, 0.4, 0.0049, 4, 0.14, 0.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'very close to the body: %.3f'%cep[0,0], None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99618:Return_L83_C12", "label": "return", "type": "return", "loc": [83, 83], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99618:FunctionDef_L74_C8", "vector": [13, 3, 0.4049, 0.0049, 3, 0.69, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return '', (cep, None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99618:Assign_L85_C8", "label": "arg_list =", "type": "assigned_variable", "loc": [85, 85], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99618:FunctionDef_L69_C4", "vector": [14, 2, 0.4146, 0.0049, 2, 0.89, 0.6667, 873, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "arg_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " arg_list = [cep]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99618:Assign_L86_C8", "label": "s = epc_motion()", "type": "assigned_variable", "loc": [86, 87], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99618:FunctionDef_L69_C4", "vector": [14, 2, 0.422, 0.0098, 2, 0.89, 0.8333, 553, 3, 5, 0, 0, 938, 10, 1], "semantic": {"name": "s", "arg_names": [], "import_names": [], "rhs_call_name": "epc_motion", "annotation": ""}, "snippet": " s = self.epc_motion(eq_gen_pull_back, 0.1, arm, arg_list,\n control_function = self.robot.set_cep_jtt)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99618:Expr_L88_C8", "label": "print()", "type": "expression", "loc": [88, 88], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99618:FunctionDef_L69_C4", "vector": [8, 2, 0.4293, 0.0049, 2, 0.89, 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)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99618:FunctionDef_L90_C4", "label": "move_till_hit", "type": "function", "loc": [90, 119], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99618:ClassDef_L18_C0", "vector": [2, 1, 0.5098, 0.1463, 1, 0.77, 0.75, 163, 0, 6, 1, 0, 0, 0, 12], "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 time_step = 0.1\n dist = np.linalg.norm(vec)\n step_size = speed * time_step\n cep_start, _ = self.robot.get_cep_jtt(arm)\n cep = copy.copy(cep_start)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99618:Assign_L92_C8", "label": "unit_vec =", "type": "assigned_variable", "loc": [92, 92], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99618:FunctionDef_L90_C4", "vector": [14, 2, 0.4488, 0.0049, 2, 0.01, 0.0, 372, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "unit_vec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " unit_vec = vec/np.linalg.norm(vec)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99618:Assign_L93_C8", "label": "time_step =", "type": "assigned_variable", "loc": [93, 93], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99618:FunctionDef_L90_C4", "vector": [14, 2, 0.4537, 0.0049, 2, 0.01, 0.1111, 387, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "time_step", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " time_step = 0.1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99618:Assign_L94_C8", "label": "dist = norm()", "type": "assigned_variable", "loc": [94, 94], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99618:FunctionDef_L90_C4", "vector": [14, 2, 0.4585, 0.0049, 2, 0.01, 0.2222, 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_99618:Assign_L95_C8", "label": "step_size =", "type": "assigned_variable", "loc": [95, 95], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99618:FunctionDef_L90_C4", "vector": [14, 2, 0.4634, 0.0049, 2, 0.01, 0.3333, 764, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "step_size", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " step_size = speed * time_step"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99618:Assign_L96_C8", "label": "cep_start, _ = get_cep_jtt()", "type": "assigned_variable", "loc": [96, 96], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99618:FunctionDef_L90_C4", "vector": [14, 2, 0.4683, 0.0049, 2, 0.01, 0.4444, 342, 3, 1, 0, 0, 532, 10, 1], "semantic": {"name": "cep_start, _", "arg_names": [], "import_names": [], "rhs_call_name": "get_cep_jtt", "annotation": ""}, "snippet": " cep_start, _ = self.robot.get_cep_jtt(arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99618:Assign_L97_C8", "label": "cep = copy()", "type": "assigned_variable", "loc": [97, 97], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99618:FunctionDef_L90_C4", "vector": [14, 2, 0.4732, 0.0049, 2, 0.01, 0.5556, 487, 3, 1, 0, 0, 739, 10, 1], "semantic": {"name": "cep", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " cep = copy.copy(cep_start)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99618:FunctionDef_L98_C8", "label": "eq_gen", "type": "function", "loc": [98, 113], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99618:FunctionDef_L90_C4", "vector": [2, 2, 0.5146, 0.078, 2, 0.01, 0.6667, 35, 0, 1, 1, 0, 0, 0, 4], "semantic": {"name": "eq_gen", "arg_names": ["cep"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def eq_gen(cep):\n force = self.robot.get_wrist_force(arm, base_frame = True)\n force_projection = force.T*unit_vec *-1 # projection in direction opposite to motion.\n print('force_projection:', force_projection)\n if force_projection>force_threshold:\n return 'done', None\n elif np.linalg.norm(force)>45.:\n return 'large force', None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99618:Assign_L99_C12", "label": "force = get_wrist_force()", "type": "assigned_variable", "loc": [99, 99], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99618:FunctionDef_L98_C8", "vector": [14, 3, 0.4829, 0.0049, 3, 0.09, 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.robot.get_wrist_force(arm, base_frame = True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99618:Assign_L100_C12", "label": "force_projection =", "type": "assigned_variable", "loc": [100, 100], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99618:FunctionDef_L98_C8", "vector": [14, 3, 0.4878, 0.0049, 3, 0.09, 0.3333, 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_99618:Expr_L101_C12", "label": "print()", "type": "expression", "loc": [101, 101], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99618:FunctionDef_L98_C8", "vector": [8, 3, 0.4927, 0.0049, 3, 0.09, 0.6667, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('force_projection:', force_projection)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L102_C12", "label": "if", "type": "if", "loc": [102, 113], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99618:FunctionDef_L98_C8", "vector": [4, 3, 0.5244, 0.0585, 3, 0.09, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if force_projection>force_threshold:\n return 'done', None\n elif np.linalg.norm(force)>45.:\n return 'large force', None\n elif np.linalg.norm(cep_start-cep) >= dist:\n return 'reached without contact', None\n else:\n cep_t = cep + unit_vec * step_size"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99618:Return_L103_C16", "label": "return", "type": "return", "loc": [103, 103], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L102_C12", "vector": [13, 4, 0.5024, 0.0049, 4, 0.76, 0.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'done', None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L104_C12", "label": "if", "type": "if", "loc": [104, 113], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L102_C12", "vector": [4, 4, 0.5293, 0.0488, 4, 0.76, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif np.linalg.norm(force)>45.:\n return 'large force', None\n elif np.linalg.norm(cep_start-cep) >= dist:\n return 'reached without contact', None\n else:\n cep_t = cep + unit_vec * step_size\n cep[0,0] = cep_t[0,0]\n cep[1,0] = cep_t[1,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99618:Return_L105_C16", "label": "return", "type": "return", "loc": [105, 105], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L104_C12", "vector": [13, 5, 0.5122, 0.0049, 5, 0.93, 0.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'large force', None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L106_C12", "label": "if", "type": "if", "loc": [106, 113], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L104_C12", "vector": [4, 5, 0.5341, 0.039, 5, 0.93, 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(cep_start-cep) >= dist:\n return 'reached without contact', None\n else:\n cep_t = cep + unit_vec * step_size\n cep[0,0] = cep_t[0,0]\n cep[1,0] = cep_t[1,0]\n cep[2,0] = cep_t[2,0]\n return '', (cep, None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99618:Return_L107_C16", "label": "return", "type": "return", "loc": [107, 107], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L106_C12", "vector": [13, 6, 0.522, 0.0049, 6, 0.41, 0.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'reached without contact', None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99618:Assign_L109_C16", "label": "cep_t =", "type": "assigned_variable", "loc": [109, 109], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L106_C12", "vector": [14, 6, 0.5317, 0.0049, 6, 0.41, 0.2, 772, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "cep_t", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cep_t = cep + unit_vec * step_size"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99618:Assign_L110_C16", "label": "assign", "type": "assigned_variable", "loc": [110, 110], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L106_C12", "vector": [14, 6, 0.5366, 0.0049, 6, 0.41, 0.4, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cep[0,0] = cep_t[0,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99618:Assign_L111_C16", "label": "assign", "type": "assigned_variable", "loc": [111, 111], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L106_C12", "vector": [14, 6, 0.5415, 0.0049, 6, 0.41, 0.6, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cep[1,0] = cep_t[1,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99618:Assign_L112_C16", "label": "assign", "type": "assigned_variable", "loc": [112, 112], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L106_C12", "vector": [14, 6, 0.5463, 0.0049, 6, 0.41, 0.8, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cep[2,0] = cep_t[2,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99618:Return_L113_C16", "label": "return", "type": "return", "loc": [113, 113], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L106_C12", "vector": [13, 6, 0.5512, 0.0049, 6, 0.41, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return '', (cep, None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L115_C8", "label": "if", "type": "if", "loc": [115, 116], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99618:FunctionDef_L90_C4", "vector": [4, 2, 0.5634, 0.0098, 2, 0.01, 0.7778, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if bias_FT:\n self.robot.bias_wrist_ft(arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99618:Expr_L116_C12", "label": "bias_wrist_ft()", "type": "expression", "loc": [116, 116], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L115_C8", "vector": [8, 3, 0.5659, 0.0049, 3, 0.13, 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.robot.bias_wrist_ft(arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99618:Expr_L117_C8", "label": "sleep()", "type": "expression", "loc": [117, 117], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99618:FunctionDef_L90_C4", "vector": [8, 2, 0.5707, 0.0049, 2, 0.01, 0.8889, 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_99618:Return_L118_C8", "label": "return", "type": "return", "loc": [118, 119], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99618:FunctionDef_L90_C4", "vector": [13, 2, 0.578, 0.0098, 2, 0.01, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.epc_motion(eq_gen, time_step, arm, [cep],\n control_function = self.robot.set_cep_jtt)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99618:FunctionDef_L121_C4", "label": "cep_gen_surface_follow", "type": "function", "loc": [121, 148], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99618:ClassDef_L18_C0", "vector": [2, 1, 0.6561, 0.1366, 1, 0.77, 1.0, 994, 0, 6, 1, 0, 0, 0, 4], "semantic": {"name": "cep_gen_surface_follow", "arg_names": ["self", "arm", "move_dir", "force_threshold", "cep", "cep_start"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def cep_gen_surface_follow(self, arm, move_dir, force_threshold,\n cep, cep_start):\n wrist_force = self.robot.get_wrist_force(arm, base_frame=True)\n if wrist_force[0,0] < -3.:\n cep[0,0] -= 0.002\n if wrist_force[0,0] > -1.:\n cep[0,0] += 0.003\n "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99618:Assign_L123_C8", "label": "wrist_force = get_wrist_force()", "type": "assigned_variable", "loc": [123, 123], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99618:FunctionDef_L121_C4", "vector": [14, 2, 0.6, 0.0049, 2, 0.71, 0.0, 483, 3, 2, 0, 0, 854, 10, 1], "semantic": {"name": "wrist_force", "arg_names": [], "import_names": [], "rhs_call_name": "get_wrist_force", "annotation": ""}, "snippet": " wrist_force = self.robot.get_wrist_force(arm, base_frame=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L124_C8", "label": "if", "type": "if", "loc": [124, 125], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99618:FunctionDef_L121_C4", "vector": [4, 2, 0.6073, 0.0098, 2, 0.71, 0.0833, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if wrist_force[0,0] < -3.:\n cep[0,0] -= 0.002"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L126_C8", "label": "if", "type": "if", "loc": [126, 127], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99618:FunctionDef_L121_C4", "vector": [4, 2, 0.6171, 0.0098, 2, 0.71, 0.1667, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if wrist_force[0,0] > -1.:\n cep[0,0] += 0.003"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L129_C8", "label": "if", "type": "if", "loc": [129, 130], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99618:FunctionDef_L121_C4", "vector": [4, 2, 0.6317, 0.0098, 2, 0.71, 0.25, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if cep[0,0] > (cep_start[0,0]+0.05):\n cep[0,0] = cep_start[0,0]+0.05"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99618:Assign_L130_C12", "label": "assign", "type": "assigned_variable", "loc": [130, 130], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L129_C8", "vector": [14, 3, 0.6341, 0.0049, 3, 0.27, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cep[0,0] = cep_start[0,0]+0.05"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99618:Assign_L132_C8", "label": "step_size =", "type": "assigned_variable", "loc": [132, 132], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99618:FunctionDef_L121_C4", "vector": [14, 2, 0.6439, 0.0049, 2, 0.71, 0.3333, 764, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "step_size", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " step_size = 0.002"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99618:Assign_L133_C8", "label": "cep_t =", "type": "assigned_variable", "loc": [133, 133], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99618:FunctionDef_L121_C4", "vector": [14, 2, 0.6488, 0.0049, 2, 0.71, 0.4167, 772, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "cep_t", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cep_t = cep + move_dir * step_size"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99618:Assign_L134_C8", "label": "assign", "type": "assigned_variable", "loc": [134, 134], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99618:FunctionDef_L121_C4", "vector": [14, 2, 0.6537, 0.0049, 2, 0.71, 0.5, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cep[0,0] = cep_t[0,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99618:Assign_L135_C8", "label": "assign", "type": "assigned_variable", "loc": [135, 135], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99618:FunctionDef_L121_C4", "vector": [14, 2, 0.6585, 0.0049, 2, 0.71, 0.5833, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cep[1,0] = cep_t[1,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99618:Assign_L136_C8", "label": "assign", "type": "assigned_variable", "loc": [136, 136], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99618:FunctionDef_L121_C4", "vector": [14, 2, 0.6634, 0.0049, 2, 0.71, 0.6667, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cep[2,0] = cep_t[2,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99618:Expr_L138_C8", "label": "print()", "type": "expression", "loc": [138, 138], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99618:FunctionDef_L121_C4", "vector": [8, 2, 0.6732, 0.0049, 2, 0.71, 0.75, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('wrist_force:', wrist_force.A1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99618:Assign_L139_C8", "label": "v =", "type": "assigned_variable", "loc": [139, 139], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99618:FunctionDef_L121_C4", "vector": [14, 2, 0.678, 0.0049, 2, 0.71, 0.8333, 553, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "v", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " v = cep - cep_start"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L140_C8", "label": "if", "type": "if", "loc": [140, 147], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99618:FunctionDef_L121_C4", "vector": [4, 2, 0.7, 0.039, 2, 0.71, 0.9167, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (wrist_force.T * move_dir)[0,0] < -force_threshold:\n stop = 'got a hook'\n elif np.linalg.norm(wrist_force) > 50.:\n stop = 'force is large %f'%(np.linalg.norm(wrist_force))\n elif (v.T * move_dir)[0,0] > 0.20:\n stop = 'moved a lot without a hook'\n else:\n stop = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99618:Assign_L141_C12", "label": "stop =", "type": "assigned_variable", "loc": [141, 141], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L140_C8", "vector": [14, 3, 0.6878, 0.0049, 3, 0.32, 0.0, 343, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " stop = 'got a hook'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L142_C8", "label": "if", "type": "if", "loc": [142, 147], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L140_C8", "vector": [4, 3, 0.7049, 0.0293, 3, 0.32, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif np.linalg.norm(wrist_force) > 50.:\n stop = 'force is large %f'%(np.linalg.norm(wrist_force))\n elif (v.T * move_dir)[0,0] > 0.20:\n stop = 'moved a lot without a hook'\n else:\n stop = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99618:Assign_L143_C12", "label": "stop =", "type": "assigned_variable", "loc": [143, 143], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L142_C8", "vector": [14, 4, 0.6976, 0.0049, 4, 0.62, 0.0, 343, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " stop = 'force is large %f'%(np.linalg.norm(wrist_force))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L144_C8", "label": "if", "type": "if", "loc": [144, 147], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L142_C8", "vector": [4, 4, 0.7098, 0.0195, 4, 0.62, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif (v.T * move_dir)[0,0] > 0.20:\n stop = 'moved a lot without a hook'\n else:\n stop = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99618:Assign_L145_C12", "label": "stop =", "type": "assigned_variable", "loc": [145, 145], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L144_C8", "vector": [14, 5, 0.7073, 0.0049, 5, 0.61, 0.0, 343, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " stop = 'moved a lot without a hook'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99618:Assign_L147_C12", "label": "stop =", "type": "assigned_variable", "loc": [147, 147], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L144_C8", "vector": [14, 5, 0.7171, 0.0049, 5, 0.61, 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_99618:Return_L148_C8", "label": "return", "type": "return", "loc": [148, 148], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99618:FunctionDef_L121_C4", "vector": [13, 2, 0.722, 0.0049, 2, 0.71, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return stop, (cep, None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L150_C0", "label": "if", "type": "if", "loc": [150, 178], "level": 0, "parent": null, "vector": [4, 0, 0.8, 0.1415, 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 pr2_arms as pa\n rospy.init_node('epc_pr2', anonymous = True)\n rospy.logout('epc_pr2: ready')\n\n pr2_arms = pa.PR2Arms()\n epc = EPC(pr2_arms)\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99618:Import_L151_C4", "label": "pr2_arms import pa", "type": "import", "loc": [151, 151], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L150_C0", "vector": [1, 1, 0.7366, 0.0049, 1, 0.91, 0.0, 369, 0, 1, 0, 0, 369, 0, 0], "semantic": {"name": "pr2_arms", "arg_names": [], "import_names": ["pa"], "rhs_call_name": "", "annotation": ""}, "snippet": " import pr2_arms as pa"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99618:Expr_L152_C4", "label": "init_node()", "type": "expression", "loc": [152, 152], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L150_C0", "vector": [8, 1, 0.7415, 0.0049, 1, 0.91, 0.0714, 463, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "init_node", "arg_names": [], "import_names": [], "rhs_call_name": "init_node", "annotation": ""}, "snippet": " rospy.init_node('epc_pr2', anonymous = True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99618:Expr_L153_C4", "label": "logout()", "type": "expression", "loc": [153, 153], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L150_C0", "vector": [8, 1, 0.7463, 0.0049, 1, 0.91, 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('epc_pr2: ready')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99618:Assign_L155_C4", "label": "pr2_arms = PR2Arms()", "type": "assigned_variable", "loc": [155, 155], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L150_C0", "vector": [14, 1, 0.7561, 0.0049, 1, 0.91, 0.2143, 369, 3, 0, 0, 0, 694, 10, 1], "semantic": {"name": "pr2_arms", "arg_names": [], "import_names": [], "rhs_call_name": "PR2Arms", "annotation": ""}, "snippet": " pr2_arms = pa.PR2Arms()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99618:Assign_L156_C4", "label": "epc = EPC()", "type": "assigned_variable", "loc": [156, 156], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L150_C0", "vector": [14, 1, 0.761, 0.0049, 1, 0.91, 0.2857, 304, 3, 1, 0, 0, 417, 10, 1], "semantic": {"name": "epc", "arg_names": [], "import_names": [], "rhs_call_name": "EPC", "annotation": ""}, "snippet": " epc = EPC(pr2_arms)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99618:Assign_L158_C4", "label": "r_arm, l_arm =", "type": "assigned_variable", "loc": [158, 158], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L150_C0", "vector": [14, 1, 0.7707, 0.0049, 1, 0.91, 0.3571, 451, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "r_arm, l_arm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " r_arm, l_arm = 0, 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99618:Assign_L159_C4", "label": "arm =", "type": "assigned_variable", "loc": [159, 159], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L150_C0", "vector": [14, 1, 0.7756, 0.0049, 1, 0.91, 0.4286, 413, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "arm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " arm = r_arm"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99618:Expr_L166_C4", "label": "raw_input()", "type": "expression", "loc": [166, 166], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L150_C0", "vector": [8, 1, 0.8098, 0.0049, 1, 0.91, 0.5, 821, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "raw_input", "arg_names": [], "import_names": [], "rhs_call_name": "raw_input", "annotation": ""}, "snippet": " raw_input('Hit ENTER to close')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99618:Expr_L167_C4", "label": "close_gripper()", "type": "expression", "loc": [167, 167], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L150_C0", "vector": [8, 1, 0.8146, 0.0049, 1, 0.91, 0.5714, 807, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "close_gripper", "arg_names": [], "import_names": [], "rhs_call_name": "close_gripper", "annotation": ""}, "snippet": " pr2_arms.close_gripper(arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99618:Expr_L168_C4", "label": "raw_input()", "type": "expression", "loc": [168, 168], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L150_C0", "vector": [8, 1, 0.8195, 0.0049, 1, 0.91, 0.6429, 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 search_and_hook')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99618:Assign_L169_C4", "label": "p1 =", "type": "assigned_variable", "loc": [169, 169], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L150_C0", "vector": [14, 1, 0.8244, 0.0049, 1, 0.91, 0.7143, 87, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "p1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p1 = np.matrix([0.8, -0.22, -0.05]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99618:Expr_L170_C4", "label": "search_and_hook()", "type": "expression", "loc": [170, 170], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L150_C0", "vector": [8, 1, 0.8293, 0.0049, 1, 0.91, 0.7857, 913, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "search_and_hook", "arg_names": [], "import_names": [], "rhs_call_name": "search_and_hook", "annotation": ""}, "snippet": " epc.search_and_hook(arm, p1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99618:Expr_L171_C4", "label": "pull_back_cartesian_control()", "type": "expression", "loc": [171, 171], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L150_C0", "vector": [8, 1, 0.8341, 0.0049, 1, 0.91, 0.8571, 632, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "pull_back_cartesian_control", "arg_names": [], "import_names": [], "rhs_call_name": "pull_back_cartesian_control", "annotation": ""}, "snippet": " epc.pull_back_cartesian_control(arm, 0.3)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99618:Assign_L173_C4", "label": "d =", "type": "assigned_variable", "loc": [173, 176], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L150_C0", "vector": [14, 1, 0.8512, 0.0195, 1, 0.91, 0.9286, 355, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " d = {\n 'f_list': epc.f_list, 'ee_list': epc.ee_list,\n 'cep_list': epc.cep_list\n }"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99618:Expr_L178_C4", "label": "save_pickle()", "type": "expression", "loc": [178, 178], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L150_C0", "vector": [8, 1, 0.8683, 0.0049, 1, 0.91, 1.0, 390, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "save_pickle", "arg_names": [], "import_names": [], "rhs_call_name": "save_pickle", "annotation": ""}, "snippet": " ut.save_pickle(d, 'pr2_pull_'+ut.formatted_time()+'.pkl')"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99618:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99618:FunctionDef_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99618:FunctionDef_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99618:Assign_L20_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99618:FunctionDef_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99618:Assign_L21_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99618:FunctionDef_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99618:Assign_L22_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99618:FunctionDef_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99618:Assign_L23_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99618:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99618:FunctionDef_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99618:FunctionDef_L32_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99618:Assign_L35_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99618:FunctionDef_L32_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99618:Assign_L36_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99618:FunctionDef_L32_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99618:While_L37_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99618:While_L37_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L38_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L38_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99618:Assign_L39_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99618:While_L37_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99618:Expr_L44_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99618:While_L37_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99618:Assign_L47_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99618:While_L37_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99618:While_L48_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99618:While_L48_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L49_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L49_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99618:Assign_L50_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L49_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L51_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99618:While_L48_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99618:Expr_L54_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99618:While_L48_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99618:Assign_L55_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99618:While_L37_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L57_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L57_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99618:Assign_L58_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99618:While_L37_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L59_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L59_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99618:Assign_L60_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L59_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99618:Assign_L61_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99618:FunctionDef_L32_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99618:Return_L63_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99618:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99618:FunctionDef_L69_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99618:FunctionDef_L69_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99618:Assign_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99618:FunctionDef_L69_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99618:Assign_L71_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99618:FunctionDef_L69_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99618:Assign_L72_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99618:FunctionDef_L69_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99618:FunctionDef_L74_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99618:FunctionDef_L74_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99618:Expr_L75_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99618:FunctionDef_L74_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L76_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L76_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99618:Return_L77_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99618:FunctionDef_L74_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99618:Assign_L78_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99618:FunctionDef_L74_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L81_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L81_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99618:Return_L82_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99618:FunctionDef_L74_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99618:Return_L83_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99618:FunctionDef_L69_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99618:Assign_L85_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99618:FunctionDef_L69_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99618:Assign_L86_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99618:FunctionDef_L69_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99618:Expr_L88_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99618:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99618:FunctionDef_L90_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99618:FunctionDef_L90_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99618:Assign_L92_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99618:FunctionDef_L90_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99618:Assign_L93_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99618:FunctionDef_L90_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99618:Assign_L94_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99618:FunctionDef_L90_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99618:Assign_L95_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99618:FunctionDef_L90_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99618:Assign_L96_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99618:FunctionDef_L90_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99618:Assign_L97_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99618:FunctionDef_L90_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99618:FunctionDef_L98_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99618:FunctionDef_L98_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99618:Assign_L99_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99618:FunctionDef_L98_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99618:Assign_L100_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99618:FunctionDef_L98_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99618:Expr_L101_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99618:FunctionDef_L98_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L102_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L102_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99618:Return_L103_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L102_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L104_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L104_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99618:Return_L105_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L104_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L106_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L106_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99618:Return_L107_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L106_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99618:Assign_L109_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L106_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99618:Assign_L110_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L106_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99618:Assign_L111_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L106_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99618:Assign_L112_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L106_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99618:Return_L113_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99618:FunctionDef_L90_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L115_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L115_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99618:Expr_L116_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99618:FunctionDef_L90_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99618:Expr_L117_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99618:FunctionDef_L90_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99618:Return_L118_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99618:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99618:FunctionDef_L121_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99618:FunctionDef_L121_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99618:Assign_L123_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99618:FunctionDef_L121_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L124_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99618:FunctionDef_L121_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L126_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99618:FunctionDef_L121_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L129_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L129_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99618:Assign_L130_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99618:FunctionDef_L121_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99618:Assign_L132_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99618:FunctionDef_L121_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99618:Assign_L133_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99618:FunctionDef_L121_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99618:Assign_L134_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99618:FunctionDef_L121_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99618:Assign_L135_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99618:FunctionDef_L121_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99618:Assign_L136_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99618:FunctionDef_L121_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99618:Expr_L138_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99618:FunctionDef_L121_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99618:Assign_L139_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99618:FunctionDef_L121_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L140_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L140_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99618:Assign_L141_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L140_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L142_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L142_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99618:Assign_L143_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L142_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L144_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L144_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99618:Assign_L145_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L144_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99618:Assign_L147_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99618:FunctionDef_L121_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99618:Return_L148_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L150_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99618:Import_L151_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L150_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99618:Expr_L152_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L150_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99618:Expr_L153_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L150_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99618:Assign_L155_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L150_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99618:Assign_L156_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L150_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99618:Assign_L158_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L150_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99618:Assign_L159_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L150_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99618:Expr_L166_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L150_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99618:Expr_L167_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L150_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99618:Expr_L168_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L150_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99618:Assign_L169_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L150_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99618:Expr_L170_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L150_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99618:Expr_L171_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L150_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99618:Assign_L173_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99618:If_L150_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99618:Expr_L178_C4"}]
import numpy as np, math import copy from threading import RLock import roslib; roslib.load_manifest('hrl_pr2_door_opening') roslib.load_manifest('equilibrium_point_control') import rospy from equilibrium_point_control.msg import MechanismKinematicsRot from equilibrium_point_control.msg import MechanismKinematicsJac from equilibrium_point_control.msg import ForceTrajectory from geometry_msgs.msg import Point32 from std_msgs.msg import Empty import epc import hrl_lib.util as ut class Door_EPC(epc.EPC): def __init__(self, robot): epc.EPC.__init__(self, robot) self.mech_kinematics_lock = RLock() self.fit_circle_lock = RLock() rospy.Subscriber('mechanism_kinematics_rot', MechanismKinematicsRot, self.mechanism_kinematics_rot_cb) rospy.Subscriber('epc/stop', Empty, self.stop_cb) # used in the ROS stop_cb and equi_pt_generator_control_radial_force self.force_traj_pub = rospy.Publisher('epc/force_test', ForceTrajectory) self.mech_traj_pub = rospy.Publisher('mechanism_trajectory', Point32) def init_log(self): self.f_list = [] self.f_list_ati = [] self.f_list_estimate = [] self.f_list_torques = [] self.cep_list = [] self.ee_list = [] self.ft = ForceTrajectory() if self.mechanism_type != '': self.ft.type = self.mechanism_type else: self.ft.type = 'rotary' def log_state(self, arm): # only logging the right arm. f = self.robot.get_wrist_force_ati(arm, base_frame=True) self.f_list_ati.append(f.A1.tolist()) f = self.robot.get_wrist_force_estimate(arm, base_frame=True) self.f_list_estimate.append(f.A1.tolist()) f = self.robot.get_force_from_torques(arm) self.f_list_torques.append(f.A1.tolist()) f = self.robot.get_wrist_force(arm, base_frame=True) self.f_list.append(f.A1.tolist()) cep, _ = self.robot.get_cep_jtt(arm, hook_tip=True) self.cep_list.append(cep.A1.tolist()) # ee, _ = self.robot.get_ee_jtt(arm) ee, _ = self.robot.end_effector_pos(arm) self.ee_list.append(ee.A1.tolist()) if self.started_pulling_on_handle == False: if f[0,0] > 10.: self.started_pulling_on_handle_count += 1 else: self.started_pulling_on_handle_count = 0 self.init_log() # reset logs until started pulling on the handle. self.init_tangent_vector = None if self.started_pulling_on_handle_count > 1: self.started_pulling_on_handle = True return '' ## ROS callback. Stop and maintain position. def stop_cb(self, cmd): self.stopping_string = 'stop_cb called.' def common_stopping_conditions(self): stop = '' # right arm only. wrist_force = self.robot.get_wrist_force(0, base_frame=True) mag = np.linalg.norm(wrist_force) if mag > self.eq_force_threshold: stop = 'force exceed' if mag < 1.2 and self.hooked_location_moved: if (self.prev_force_mag - mag) > 30.: stop = 'slip: force step decrease and below thresold.' else: self.slip_count += 1 else: self.slip_count = 0 if self.slip_count == 10: stop = 'slip: force below threshold for too long.' return stop def mechanism_kinematics_rot_cb(self, mk): self.fit_circle_lock.acquire() self.cx_start = mk.cx self.cy_start = mk.cy self.cz_start = mk.cz self.rad = mk.rad self.fit_circle_lock.release() ## constantly update the estimate of the kinematics and move the # equilibrium point along the tangent of the estimated arc, and # try to keep the radial force constant. # @param h_force_possible - True (hook side) or False (hook up). # @param v_force_possible - False (hook side) or True (hook up). # Is maintaining a radial force possible or not (based on hook # geometry and orientation) # @param cep_vel - tangential velocity of the cep in m/s def cep_gen_control_radial_force(self, arm, cep, cep_vel): self.log_state(arm) if self.started_pulling_on_handle == False: cep_vel = 0.02 #step_size = 0.01 * cep_vel step_size = 0.1 * cep_vel # 0.1 is the time interval between calls to the equi_generator function (see pull) stop = self.common_stopping_conditions() wrist_force = self.robot.get_wrist_force(arm, base_frame=True) mag = np.linalg.norm(wrist_force) curr_pos, _ = self.robot.get_ee_jtt(arm) if len(self.ee_list)>1: start_pos = np.matrix(self.ee_list[0]).T else: start_pos = curr_pos #mechanism kinematics. if self.started_pulling_on_handle: self.mech_traj_pub.publish(Point32(curr_pos[0,0], curr_pos[1,0], curr_pos[2,0])) self.fit_circle_lock.acquire() rad = self.rad cx_start, cy_start = self.cx_start, self.cy_start cz_start = self.cz_start self.fit_circle_lock.release() cx, cy = cx_start, cy_start cz = cz_start print 'cx, cy, r:', cx, cy, rad radial_vec = curr_pos - np.matrix([cx,cy,cz]).T radial_vec = radial_vec/np.linalg.norm(radial_vec) if cy_start < start_pos[1,0]: tan_x,tan_y = -radial_vec[1,0],radial_vec[0,0] else: tan_x,tan_y = radial_vec[1,0],-radial_vec[0,0] if tan_x > 0. and (start_pos[0,0]-curr_pos[0,0]) < 0.09: tan_x = -tan_x tan_y = -tan_y if cy_start > start_pos[1,0]: radial_vec = -radial_vec # axis to the left, want force in # anti-radial direction. rv = radial_vec force_vec = np.matrix([rv[0,0], rv[1,0], 0.]).T tangential_vec = np.matrix([tan_x, tan_y, 0.]).T tangential_vec_ts = tangential_vec radial_vec_ts = radial_vec force_vec_ts = force_vec if arm == 'right_arm' or arm == 0: if force_vec_ts[1,0] < 0.: # only allowing force to the left force_vec_ts = -force_vec_ts else: if force_vec_ts[1,0] > 0.: # only allowing force to the right force_vec_ts = -force_vec_ts f_vec = -1*np.array([wrist_force[0,0], wrist_force[1,0], wrist_force[2,0]]) f_rad_mag = np.dot(f_vec, force_vec.A1) err = f_rad_mag-4. if err>0.: kp = -0.1 else: kp = -0.2 radial_motion_mag = kp * err # radial_motion_mag in cm (depends on eq_motion step size) radial_motion_vec = force_vec * radial_motion_mag print 'tangential_vec:', tangential_vec.A1 eq_motion_vec = copy.copy(tangential_vec) eq_motion_vec += radial_motion_vec self.prev_force_mag = mag if self.init_tangent_vector == None or self.started_pulling_on_handle == False: self.init_tangent_vector = copy.copy(tangential_vec_ts) c = np.dot(tangential_vec_ts.A1, self.init_tangent_vector.A1) ang = np.arccos(c) if np.isnan(ang): ang = 0. tangential_vec = tangential_vec / np.linalg.norm(tangential_vec) # paranoia abot vectors not being unit vectors. dist_moved = np.dot((curr_pos - start_pos).A1, tangential_vec_ts.A1) ftan = abs(np.dot(wrist_force.A1, tangential_vec.A1)) self.ft.tangential_force.append(ftan) self.ft.radial_force.append(f_rad_mag) if self.ft.type == 'rotary': self.ft.configuration.append(ang) else: # drawer print 'dist_moved:', dist_moved self.ft.configuration.append(dist_moved) if self.started_pulling_on_handle: self.force_traj_pub.publish(self.ft) # if self.started_pulling_on_handle == False: # ftan_pull_test = -np.dot(wrist_force.A1, tangential_vec.A1) # print 'ftan_pull_test:', ftan_pull_test # if ftan_pull_test > 5.: # self.started_pulling_on_handle_count += 1 # else: # self.started_pulling_on_handle_count = 0 # self.init_log() # reset logs until started pulling on the handle. # self.init_tangent_vector = None # # if self.started_pulling_on_handle_count > 1: # self.started_pulling_on_handle = True if abs(dist_moved) > 0.09 and self.hooked_location_moved == False: # change the force threshold once the hook has started pulling. self.hooked_location_moved = True self.eq_force_threshold = ut.bound(mag+30.,20.,80.) self.ftan_threshold = 1.2 * self.ftan_threshold + 20. if self.hooked_location_moved: if abs(tangential_vec_ts[2,0]) < 0.2 and ftan > self.ftan_threshold: stop = 'ftan threshold exceed: %f'%ftan else: self.ftan_threshold = max(self.ftan_threshold, ftan) if self.hooked_location_moved and ang > math.radians(90.): print 'Angle:', math.degrees(ang) self.open_ang_exceed_count += 1 if self.open_ang_exceed_count > 2: stop = 'opened mechanism through large angle: %.1f'%(math.degrees(ang)) else: self.open_ang_exceed_count = 0 cep_t = cep + eq_motion_vec * step_size cep[0,0] = cep_t[0,0] cep[1,0] = cep_t[1,0] cep[2,0] = cep_t[2,0] print 'CEP:', cep.A1 stop = stop + self.stopping_string return stop, (cep, None) def pull(self, arm, force_threshold, cep_vel, mechanism_type=''): self.mechanism_type = mechanism_type self.stopping_string = '' self.eq_pt_not_moving_counter = 0 self.init_log() self.init_tangent_vector = None self.open_ang_exceed_count = 0. self.eq_force_threshold = force_threshold self.ftan_threshold = 2. self.hooked_location_moved = False # flag to indicate when the hooking location started moving. self.prev_force_mag = np.linalg.norm(self.robot.get_wrist_force(arm)) self.slip_count = 0 self.started_pulling_on_handle = False self.started_pulling_on_handle_count = 0 ee_pos, _ = self.robot.get_ee_jtt(arm) self.cx_start = ee_pos[0,0] self.rad = 10.0 self.cy_start = ee_pos[1,0]-self.rad self.cz_start = ee_pos[2,0] cep, _ = self.robot.get_cep_jtt(arm) arg_list = [arm, cep, cep_vel] result, _ = self.epc_motion(self.cep_gen_control_radial_force, 0.1, arm, arg_list, self.log_state, #0.01, arm, arg_list, control_function = self.robot.set_cep_jtt) print 'EPC motion result:', result print 'Original force threshold:', force_threshold print 'Adapted force threshold:', self.eq_force_threshold print 'Adapted ftan threshold:', self.ftan_threshold d = { 'f_list': self.f_list, 'ee_list': self.ee_list, 'cep_list': self.cep_list, 'ftan_list': self.ft.tangential_force, 'config_list': self.ft.configuration, 'frad_list': self.ft.radial_force, 'f_list_ati': self.f_list_ati, 'f_list_estimate': self.f_list_estimate, 'f_list_torques': self.f_list_torques } ut.save_pickle(d,'pr2_pull_'+ut.formatted_time()+'.pkl') def search_and_hook(self, arm, hook_loc, hooking_force_threshold = 5., hit_threshold=15., hit_motions = 1, hook_direction = 'left'): # this needs to be debugged. Hardcoded for now. #if arm == 'right_arm' or arm == 0: # hook_dir = np.matrix([0., 1., 0.]).T # hook direc in home position # offset = -0.03 #elif arm == 'left_arm' or arm == 1: # hook_dir = np.matrix([0., -1., 0.]).T # hook direc in home position # offset = -0.03 #else: # raise RuntimeError('Unknown arm: %s', arm) #start_loc = hook_loc + rot_mat.T * hook_dir * offset if hook_direction == 'left': offset = np.matrix([0., -0.03, 0.]).T move_dir = np.matrix([0., 1., 0.]).T elif hook_direction == 'up': offset = np.matrix([0., 0., -0.03]).T move_dir = np.matrix([0., 0., 1.]).T start_loc = hook_loc + offset # vector normal to surface and pointing into the surface. normal_tl = np.matrix([1.0, 0., 0.]).T pt1 = start_loc - normal_tl * 0.1 self.robot.go_cep_jtt(arm, pt1) raw_input('Hit ENTER to go') vec = normal_tl * 0.2 rospy.sleep(1.) for i in range(hit_motions): s = self.move_till_hit(arm, vec=vec, force_threshold=hit_threshold, speed=0.07) cep_start, _ = self.robot.get_cep_jtt(arm) cep = copy.copy(cep_start) arg_list = [arm, move_dir, hooking_force_threshold, cep, cep_start] print 'Hi there.' s = self.epc_motion(self.cep_gen_surface_follow, 0.1, arm, arg_list, control_function = self.robot.set_cep_jtt) print 'result:', s return s if __name__ == '__main__': import pr2_arms as pa rospy.init_node('epc_pr2', anonymous = True) rospy.logout('epc_pr2: ready') #pr2_arms = pa.PR2Arms(primary_ft_sensor='ati') pr2_arms = pa.PR2Arms(primary_ft_sensor='estimate') door_epc = Door_EPC(pr2_arms) r_arm, l_arm = 0, 1 arm = r_arm tip = np.matrix([0.35, 0., 0.]).T pr2_arms.arms.set_tooltip(arm, tip) raw_input('Hit ENTER to close') pr2_arms.close_gripper(arm, effort=80) raw_input('Hit ENTER to start Door Opening') # for cabinets. #p1 = np.matrix([0.8, -0.40, -0.04]).T # pos 3 #p1 = np.matrix([0.8, -0.10, -0.04]).T # pos 2 p1 = np.matrix([0.8, -0.35, 0.1]).T # pos 1 door_epc.search_and_hook(arm, p1, hook_direction='left') door_epc.pull(arm, force_threshold=40., cep_vel=0.05) # # hrl toolchest drawer. # p1 = np.matrix([0.8, -0.2, -0.17]).T # door_epc.search_and_hook(arm, p1, hook_direction='up') # door_epc.pull(arm, force_threshold=40., cep_vel=0.05)
ajibawa-2023/Python-Code-Large/train/row_99619
235
384
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Import_L2_C0", "label": "numpy import np, math", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0052, 0.0026, 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_99619:Import_L3_C0", "label": "copy import copy", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0078, 0.0026, 0, 0.66, 0.0667, 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_99619:ImportFrom_L4_C0", "label": "from threading import RLock", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0104, 0.0026, 0, 0.66, 0.1333, 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_99619:Import_L6_C0", "label": "roslib import roslib", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0156, 0.0026, 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_pr2_door_opening')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Expr_L6_C15", "label": "load_manifest()", "type": "expression", "loc": [6, 6], "level": 0, "parent": null, "vector": [8, 0, 0.0156, 0.0026, 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": "import roslib; roslib.load_manifest('hrl_pr2_door_opening')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Expr_L7_C0", "label": "load_manifest()", "type": "expression", "loc": [7, 7], "level": 0, "parent": null, "vector": [8, 0, 0.0182, 0.0026, 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('equilibrium_point_control')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Import_L8_C0", "label": "rospy import rospy", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.0208, 0.0026, 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_99619:ImportFrom_L10_C0", "label": "from equilibrium_point_control.msg import MechanismKinematicsRot", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.026, 0.0026, 0, 0.66, 0.4667, 178, 0, 1, 0, 0, 178, 0, 0], "semantic": {"name": "equilibrium_point_control.msg", "arg_names": [], "import_names": ["MechanismKinematicsRot"], "rhs_call_name": "", "annotation": ""}, "snippet": "from equilibrium_point_control.msg import MechanismKinematicsRot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:ImportFrom_L11_C0", "label": "from equilibrium_point_control.msg import MechanismKinematicsJac", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.0286, 0.0026, 0, 0.66, 0.5333, 178, 0, 1, 0, 0, 178, 0, 0], "semantic": {"name": "equilibrium_point_control.msg", "arg_names": [], "import_names": ["MechanismKinematicsJac"], "rhs_call_name": "", "annotation": ""}, "snippet": "from equilibrium_point_control.msg import MechanismKinematicsJac"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:ImportFrom_L12_C0", "label": "from equilibrium_point_control.msg import ForceTrajectory", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.0312, 0.0026, 0, 0.66, 0.6, 178, 0, 1, 0, 0, 178, 0, 0], "semantic": {"name": "equilibrium_point_control.msg", "arg_names": [], "import_names": ["ForceTrajectory"], "rhs_call_name": "", "annotation": ""}, "snippet": "from equilibrium_point_control.msg import ForceTrajectory"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:ImportFrom_L13_C0", "label": "from geometry_msgs.msg import Point32", "type": "import", "loc": [13, 13], "level": 0, "parent": null, "vector": [1, 0, 0.0339, 0.0026, 0, 0.66, 0.6667, 951, 0, 1, 0, 0, 951, 0, 0], "semantic": {"name": "geometry_msgs.msg", "arg_names": [], "import_names": ["Point32"], "rhs_call_name": "", "annotation": ""}, "snippet": "from geometry_msgs.msg import Point32"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:ImportFrom_L14_C0", "label": "from std_msgs.msg import Empty", "type": "import", "loc": [14, 14], "level": 0, "parent": null, "vector": [1, 0, 0.0365, 0.0026, 0, 0.66, 0.7333, 366, 0, 1, 0, 0, 366, 0, 0], "semantic": {"name": "std_msgs.msg", "arg_names": [], "import_names": ["Empty"], "rhs_call_name": "", "annotation": ""}, "snippet": "from std_msgs.msg import Empty"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Import_L16_C0", "label": "epc import epc", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.0417, 0.0026, 0, 0.66, 0.8, 304, 0, 1, 0, 0, 304, 0, 0], "semantic": {"name": "epc", "arg_names": [], "import_names": ["epc"], "rhs_call_name": "", "annotation": ""}, "snippet": "import epc"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Import_L17_C0", "label": "hrl_lib.util import ut", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.0443, 0.0026, 0, 0.66, 0.8667, 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_99619:ClassDef_L19_C0", "label": "Door_EPC", "type": "class", "loc": [19, 350], "level": 0, "parent": null, "vector": [3, 0, 0.4805, 0.8646, 0, 0.66, 0.9333, 468, 0, 9, 0, 0, 62, 0, 99], "semantic": {"name": "Door_EPC", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Door_EPC(epc.EPC):\n def __init__(self, robot):\n epc.EPC.__init__(self, robot)\n\n self.mech_kinematics_lock = RLock()\n self.fit_circle_lock = RLock()\n\n rospy.Subscriber('mechanism_kinematics_rot',"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L20_C4", "label": "__init__", "type": "function", "loc": [20, 32], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:ClassDef_L19_C0", "vector": [2, 1, 0.0677, 0.0339, 1, 0.46, 0.0, 555, 0, 2, 0, 0, 0, 0, 7], "semantic": {"name": "__init__", "arg_names": ["self", "robot"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, robot):\n epc.EPC.__init__(self, robot)\n\n self.mech_kinematics_lock = RLock()\n self.fit_circle_lock = RLock()\n\n rospy.Subscriber('mechanism_kinematics_rot',\n MechanismKinematicsRot,"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Expr_L21_C8", "label": "__init__()", "type": "expression", "loc": [21, 21], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L20_C4", "vector": [8, 2, 0.0547, 0.0026, 2, 0.56, 0.0, 555, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " epc.EPC.__init__(self, robot)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L23_C8", "label": "self.mech_kinematics_lock = RLock()", "type": "assigned_variable", "loc": [23, 23], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L20_C4", "vector": [14, 2, 0.0599, 0.0026, 2, 0.56, 0.1667, 542, 3, 0, 0, 0, 207, 10, 1], "semantic": {"name": "self.mech_kinematics_lock", "arg_names": [], "import_names": [], "rhs_call_name": "RLock", "annotation": ""}, "snippet": " self.mech_kinematics_lock = RLock()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L24_C8", "label": "self.fit_circle_lock = RLock()", "type": "assigned_variable", "loc": [24, 24], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L20_C4", "vector": [14, 2, 0.0625, 0.0026, 2, 0.56, 0.3333, 336, 3, 0, 0, 0, 207, 10, 1], "semantic": {"name": "self.fit_circle_lock", "arg_names": [], "import_names": [], "rhs_call_name": "RLock", "annotation": ""}, "snippet": " self.fit_circle_lock = RLock()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Expr_L26_C8", "label": "Subscriber()", "type": "expression", "loc": [26, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L20_C4", "vector": [8, 2, 0.0703, 0.0078, 2, 0.56, 0.5, 455, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "Subscriber", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " rospy.Subscriber('mechanism_kinematics_rot',\n MechanismKinematicsRot,\n self.mechanism_kinematics_rot_cb)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Expr_L29_C8", "label": "Subscriber()", "type": "expression", "loc": [29, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L20_C4", "vector": [8, 2, 0.0755, 0.0026, 2, 0.56, 0.6667, 455, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "Subscriber", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " rospy.Subscriber('epc/stop', Empty, self.stop_cb)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L31_C8", "label": "self.force_traj_pub = Publisher()", "type": "assigned_variable", "loc": [31, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L20_C4", "vector": [14, 2, 0.0807, 0.0026, 2, 0.56, 0.8333, 477, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "self.force_traj_pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " self.force_traj_pub = rospy.Publisher('epc/force_test', ForceTrajectory)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L32_C8", "label": "self.mech_traj_pub = Publisher()", "type": "assigned_variable", "loc": [32, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L20_C4", "vector": [14, 2, 0.0833, 0.0026, 2, 0.56, 1.0, 690, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "self.mech_traj_pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " self.mech_traj_pub = rospy.Publisher('mechanism_trajectory', Point32)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L34_C4", "label": "init_log", "type": "function", "loc": [34, 45], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:ClassDef_L19_C0", "vector": [2, 1, 0.1029, 0.0312, 1, 0.46, 0.125, 377, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "init_log", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def init_log(self):\n self.f_list = []\n self.f_list_ati = []\n self.f_list_estimate = []\n self.f_list_torques = []\n self.cep_list = []\n self.ee_list = []\n self.ft = ForceTrajectory()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L35_C8", "label": "self.f_list =", "type": "assigned_variable", "loc": [35, 35], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L34_C4", "vector": [14, 2, 0.0911, 0.0026, 2, 0.7, 0.0, 589, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.f_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.f_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L36_C8", "label": "self.f_list_ati =", "type": "assigned_variable", "loc": [36, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L34_C4", "vector": [14, 2, 0.0938, 0.0026, 2, 0.7, 0.1429, 588, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.f_list_ati", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.f_list_ati = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L37_C8", "label": "self.f_list_estimate =", "type": "assigned_variable", "loc": [37, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L34_C4", "vector": [14, 2, 0.0964, 0.0026, 2, 0.7, 0.2857, 232, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.f_list_estimate", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.f_list_estimate = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L38_C8", "label": "self.f_list_torques =", "type": "assigned_variable", "loc": [38, 38], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L34_C4", "vector": [14, 2, 0.099, 0.0026, 2, 0.7, 0.4286, 446, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.f_list_torques", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.f_list_torques = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L39_C8", "label": "self.cep_list =", "type": "assigned_variable", "loc": [39, 39], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L34_C4", "vector": [14, 2, 0.1016, 0.0026, 2, 0.7, 0.5714, 867, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.cep_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.cep_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L40_C8", "label": "self.ee_list =", "type": "assigned_variable", "loc": [40, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L34_C4", "vector": [14, 2, 0.1042, 0.0026, 2, 0.7, 0.7143, 959, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.ee_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.ee_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L41_C8", "label": "self.ft = ForceTrajectory()", "type": "assigned_variable", "loc": [41, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L34_C4", "vector": [14, 2, 0.1068, 0.0026, 2, 0.7, 0.8571, 470, 3, 0, 0, 0, 306, 10, 1], "semantic": {"name": "self.ft", "arg_names": [], "import_names": [], "rhs_call_name": "ForceTrajectory", "annotation": ""}, "snippet": " self.ft = ForceTrajectory()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L42_C8", "label": "if", "type": "if", "loc": [42, 45], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L34_C4", "vector": [4, 2, 0.1133, 0.0104, 2, 0.7, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.mechanism_type != '':\n self.ft.type = self.mechanism_type\n else:\n self.ft.type = 'rotary'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L43_C12", "label": "self.ft.type =", "type": "assigned_variable", "loc": [43, 43], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L42_C8", "vector": [14, 3, 0.112, 0.0026, 3, 0.15, 0.0, 531, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.ft.type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.ft.type = self.mechanism_type"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L45_C12", "label": "self.ft.type =", "type": "assigned_variable", "loc": [45, 45], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L42_C8", "vector": [14, 3, 0.1172, 0.0026, 3, 0.15, 1.0, 531, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self.ft.type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.ft.type = 'rotary'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L47_C4", "label": "log_state", "type": "function", "loc": [47, 78], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:ClassDef_L19_C0", "vector": [2, 1, 0.1628, 0.0833, 1, 0.46, 0.25, 805, 0, 2, 1, 0, 0, 0, 19], "semantic": {"name": "log_state", "arg_names": ["self", "arm"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def log_state(self, arm):\n # only logging the right arm.\n f = self.robot.get_wrist_force_ati(arm, base_frame=True)\n self.f_list_ati.append(f.A1.tolist())\n\n f = self.robot.get_wrist_force_estimate(arm, base_frame=True)\n self.f_list_estimate.append(f.A1.tolist())\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L49_C8", "label": "f = get_wrist_force_ati()", "type": "assigned_variable", "loc": [49, 49], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L47_C4", "vector": [14, 2, 0.1276, 0.0026, 2, 0.37, 0.0, 899, 3, 2, 0, 0, 170, 10, 1], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "get_wrist_force_ati", "annotation": ""}, "snippet": " f = self.robot.get_wrist_force_ati(arm, base_frame=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Expr_L50_C8", "label": "append()", "type": "expression", "loc": [50, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L47_C4", "vector": [8, 2, 0.1302, 0.0026, 2, 0.37, 0.0769, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.f_list_ati.append(f.A1.tolist())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L52_C8", "label": "f = get_wrist_force_estimate()", "type": "assigned_variable", "loc": [52, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L47_C4", "vector": [14, 2, 0.1354, 0.0026, 2, 0.37, 0.1538, 899, 3, 2, 0, 0, 346, 10, 1], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "get_wrist_force_estimate", "annotation": ""}, "snippet": " f = self.robot.get_wrist_force_estimate(arm, base_frame=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Expr_L53_C8", "label": "append()", "type": "expression", "loc": [53, 53], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L47_C4", "vector": [8, 2, 0.138, 0.0026, 2, 0.37, 0.2308, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.f_list_estimate.append(f.A1.tolist())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L55_C8", "label": "f = get_force_from_torques()", "type": "assigned_variable", "loc": [55, 55], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L47_C4", "vector": [14, 2, 0.1432, 0.0026, 2, 0.37, 0.3077, 899, 3, 1, 0, 0, 497, 10, 1], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "get_force_from_torques", "annotation": ""}, "snippet": " f = self.robot.get_force_from_torques(arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Expr_L56_C8", "label": "append()", "type": "expression", "loc": [56, 56], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L47_C4", "vector": [8, 2, 0.1458, 0.0026, 2, 0.37, 0.3846, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.f_list_torques.append(f.A1.tolist())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L58_C8", "label": "f = get_wrist_force()", "type": "assigned_variable", "loc": [58, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L47_C4", "vector": [14, 2, 0.151, 0.0026, 2, 0.37, 0.4615, 899, 3, 2, 0, 0, 854, 10, 1], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "get_wrist_force", "annotation": ""}, "snippet": " f = self.robot.get_wrist_force(arm, base_frame=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Expr_L59_C8", "label": "append()", "type": "expression", "loc": [59, 59], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L47_C4", "vector": [8, 2, 0.1536, 0.0026, 2, 0.37, 0.5385, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.f_list.append(f.A1.tolist())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L61_C8", "label": "cep, _ = get_cep_jtt()", "type": "assigned_variable", "loc": [61, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L47_C4", "vector": [14, 2, 0.1589, 0.0026, 2, 0.37, 0.6154, 705, 3, 2, 0, 0, 532, 10, 1], "semantic": {"name": "cep, _", "arg_names": [], "import_names": [], "rhs_call_name": "get_cep_jtt", "annotation": ""}, "snippet": " cep, _ = self.robot.get_cep_jtt(arm, hook_tip=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Expr_L62_C8", "label": "append()", "type": "expression", "loc": [62, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L47_C4", "vector": [8, 2, 0.1615, 0.0026, 2, 0.37, 0.6923, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.cep_list.append(cep.A1.tolist())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L64_C8", "label": "ee, _ = end_effector_pos()", "type": "assigned_variable", "loc": [64, 64], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L47_C4", "vector": [14, 2, 0.1667, 0.0026, 2, 0.37, 0.7692, 241, 3, 1, 0, 0, 889, 10, 1], "semantic": {"name": "ee, _", "arg_names": [], "import_names": [], "rhs_call_name": "end_effector_pos", "annotation": ""}, "snippet": " ee, _ = self.robot.end_effector_pos(arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Expr_L65_C8", "label": "append()", "type": "expression", "loc": [65, 65], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L47_C4", "vector": [8, 2, 0.1693, 0.0026, 2, 0.37, 0.8462, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.ee_list.append(ee.A1.tolist())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L67_C8", "label": "if", "type": "if", "loc": [67, 76], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L47_C4", "vector": [4, 2, 0.1862, 0.026, 2, 0.37, 0.9231, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.started_pulling_on_handle == False:\n if f[0,0] > 10.:\n self.started_pulling_on_handle_count += 1\n else:\n self.started_pulling_on_handle_count = 0\n self.init_log() # reset logs until started pulling on the handle.\n self.init_tangent_vector = None\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L68_C12", "label": "if", "type": "if", "loc": [68, 73], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L67_C8", "vector": [4, 3, 0.1836, 0.0156, 3, 0.76, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if f[0,0] > 10.:\n self.started_pulling_on_handle_count += 1\n else:\n self.started_pulling_on_handle_count = 0\n self.init_log() # reset logs until started pulling on the handle.\n self.init_tangent_vector = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L71_C16", "label": "self.started_pulling_on_handle_count =", "type": "assigned_variable", "loc": [71, 71], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L68_C12", "vector": [14, 4, 0.1849, 0.0026, 4, 0.92, 0.0, 870, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.started_pulling_on_handle_count", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.started_pulling_on_handle_count = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Expr_L72_C16", "label": "init_log()", "type": "expression", "loc": [72, 72], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L68_C12", "vector": [8, 4, 0.1875, 0.0026, 4, 0.92, 0.5, 377, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "init_log", "arg_names": [], "import_names": [], "rhs_call_name": "init_log", "annotation": ""}, "snippet": " self.init_log() # reset logs until started pulling on the handle."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L73_C16", "label": "self.init_tangent_vector =", "type": "assigned_variable", "loc": [73, 73], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L68_C12", "vector": [14, 4, 0.1901, 0.0026, 4, 0.92, 1.0, 965, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.init_tangent_vector", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.init_tangent_vector = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L75_C12", "label": "if", "type": "if", "loc": [75, 76], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L67_C8", "vector": [4, 3, 0.1966, 0.0052, 3, 0.76, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.started_pulling_on_handle_count > 1:\n self.started_pulling_on_handle = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L76_C16", "label": "self.started_pulling_on_handle =", "type": "assigned_variable", "loc": [76, 76], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L75_C12", "vector": [14, 4, 0.1979, 0.0026, 4, 0.29, 0.0, 945, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.started_pulling_on_handle", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.started_pulling_on_handle = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Return_L78_C8", "label": "return", "type": "return", "loc": [78, 78], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L47_C4", "vector": [13, 2, 0.2031, 0.0026, 2, 0.37, 1.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L81_C4", "label": "stop_cb", "type": "function", "loc": [81, 82], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:ClassDef_L19_C0", "vector": [2, 1, 0.2122, 0.0052, 1, 0.46, 0.375, 430, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "stop_cb", "arg_names": ["self", "cmd"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def stop_cb(self, cmd):\n self.stopping_string = 'stop_cb called.'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L82_C8", "label": "self.stopping_string =", "type": "assigned_variable", "loc": [82, 82], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L81_C4", "vector": [14, 2, 0.2135, 0.0026, 2, 0.36, 0.0, 265, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self.stopping_string", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.stopping_string = 'stop_cb called.'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L84_C4", "label": "common_stopping_conditions", "type": "function", "loc": [84, 102], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:ClassDef_L19_C0", "vector": [2, 1, 0.2422, 0.0495, 1, 0.46, 0.5, 763, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "common_stopping_conditions", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def common_stopping_conditions(self):\n stop = ''\n # right arm only.\n wrist_force = self.robot.get_wrist_force(0, base_frame=True)\n mag = np.linalg.norm(wrist_force)\n if mag > self.eq_force_threshold:\n stop = 'force exceed'\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L85_C8", "label": "stop =", "type": "assigned_variable", "loc": [85, 85], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L84_C4", "vector": [14, 2, 0.2214, 0.0026, 2, 0.15, 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_99619:Assign_L87_C8", "label": "wrist_force = get_wrist_force()", "type": "assigned_variable", "loc": [87, 87], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L84_C4", "vector": [14, 2, 0.2266, 0.0026, 2, 0.15, 0.1667, 483, 3, 2, 0, 0, 854, 10, 1], "semantic": {"name": "wrist_force", "arg_names": [], "import_names": [], "rhs_call_name": "get_wrist_force", "annotation": ""}, "snippet": " wrist_force = self.robot.get_wrist_force(0, base_frame=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L88_C8", "label": "mag = norm()", "type": "assigned_variable", "loc": [88, 88], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L84_C4", "vector": [14, 2, 0.2292, 0.0026, 2, 0.15, 0.3333, 533, 3, 1, 0, 0, 902, 10, 1], "semantic": {"name": "mag", "arg_names": [], "import_names": [], "rhs_call_name": "norm", "annotation": ""}, "snippet": " mag = np.linalg.norm(wrist_force)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L89_C8", "label": "if", "type": "if", "loc": [89, 90], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L84_C4", "vector": [4, 2, 0.2331, 0.0052, 2, 0.15, 0.5, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if mag > self.eq_force_threshold:\n stop = 'force exceed'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L90_C12", "label": "stop =", "type": "assigned_variable", "loc": [90, 90], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L89_C8", "vector": [14, 3, 0.2344, 0.0026, 3, 0.51, 0.0, 343, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " stop = 'force exceed'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L92_C8", "label": "if", "type": "if", "loc": [92, 98], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L84_C4", "vector": [4, 2, 0.2474, 0.0182, 2, 0.15, 0.6667, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if mag < 1.2 and self.hooked_location_moved:\n if (self.prev_force_mag - mag) > 30.:\n stop = 'slip: force step decrease and below thresold.'\n else:\n self.slip_count += 1\n else:\n self.slip_count = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L93_C12", "label": "if", "type": "if", "loc": [93, 96], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L92_C8", "vector": [4, 3, 0.2461, 0.0104, 3, 0.6, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (self.prev_force_mag - mag) > 30.:\n stop = 'slip: force step decrease and below thresold.'\n else:\n self.slip_count += 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L94_C16", "label": "stop =", "type": "assigned_variable", "loc": [94, 94], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L93_C12", "vector": [14, 4, 0.2448, 0.0026, 4, 0.88, 0.0, 343, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " stop = 'slip: force step decrease and below thresold.'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L98_C12", "label": "self.slip_count =", "type": "assigned_variable", "loc": [98, 98], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L92_C8", "vector": [14, 3, 0.2552, 0.0026, 3, 0.6, 1.0, 338, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.slip_count", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.slip_count = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L100_C8", "label": "if", "type": "if", "loc": [100, 101], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L84_C4", "vector": [4, 2, 0.2617, 0.0052, 2, 0.15, 0.8333, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.slip_count == 10:\n stop = 'slip: force below threshold for too long.'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L101_C12", "label": "stop =", "type": "assigned_variable", "loc": [101, 101], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L100_C8", "vector": [14, 3, 0.263, 0.0026, 3, 0.81, 0.0, 343, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " stop = 'slip: force below threshold for too long.'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Return_L102_C8", "label": "return", "type": "return", "loc": [102, 102], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L84_C4", "vector": [13, 2, 0.2656, 0.0026, 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 stop"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L104_C4", "label": "mechanism_kinematics_rot_cb", "type": "function", "loc": [104, 110], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:ClassDef_L19_C0", "vector": [2, 1, 0.2786, 0.0182, 1, 0.46, 0.625, 407, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "mechanism_kinematics_rot_cb", "arg_names": ["self", "mk"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def mechanism_kinematics_rot_cb(self, mk):\n self.fit_circle_lock.acquire()\n self.cx_start = mk.cx\n self.cy_start = mk.cy\n self.cz_start = mk.cz\n self.rad = mk.rad\n self.fit_circle_lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Expr_L105_C8", "label": "acquire()", "type": "expression", "loc": [105, 105], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L104_C4", "vector": [8, 2, 0.2734, 0.0026, 2, 0.38, 0.0, 229, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "acquire", "arg_names": [], "import_names": [], "rhs_call_name": "acquire", "annotation": ""}, "snippet": " self.fit_circle_lock.acquire()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L106_C8", "label": "self.cx_start =", "type": "assigned_variable", "loc": [106, 106], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L104_C4", "vector": [14, 2, 0.276, 0.0026, 2, 0.38, 0.2, 939, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.cx_start", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.cx_start = mk.cx"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L107_C8", "label": "self.cy_start =", "type": "assigned_variable", "loc": [107, 107], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L104_C4", "vector": [14, 2, 0.2786, 0.0026, 2, 0.38, 0.4, 418, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.cy_start", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.cy_start = mk.cy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L108_C8", "label": "self.cz_start =", "type": "assigned_variable", "loc": [108, 108], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L104_C4", "vector": [14, 2, 0.2812, 0.0026, 2, 0.38, 0.6, 113, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.cz_start", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.cz_start = mk.cz"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L109_C8", "label": "self.rad =", "type": "assigned_variable", "loc": [109, 109], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L104_C4", "vector": [14, 2, 0.2839, 0.0026, 2, 0.38, 0.8, 240, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.rad", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.rad = mk.rad"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Expr_L110_C8", "label": "release()", "type": "expression", "loc": [110, 110], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L104_C4", "vector": [8, 2, 0.2865, 0.0026, 2, 0.38, 1.0, 784, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "release", "arg_names": [], "import_names": [], "rhs_call_name": "release", "annotation": ""}, "snippet": " self.fit_circle_lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "label": "cep_gen_control_radial_force", "type": "function", "loc": [120, 258], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:ClassDef_L19_C0", "vector": [2, 1, 0.4922, 0.362, 1, 0.46, 0.75, 877, 0, 4, 1, 0, 0, 0, 43], "semantic": {"name": "cep_gen_control_radial_force", "arg_names": ["self", "arm", "cep", "cep_vel"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def cep_gen_control_radial_force(self, arm, cep, cep_vel):\n self.log_state(arm)\n if self.started_pulling_on_handle == False:\n cep_vel = 0.02\n\n #step_size = 0.01 * cep_vel\n step_size = 0.1 * cep_vel # 0.1 is the time interval between calls to the equi_generator function (see pull)\n stop = self.common_stopping_conditions()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Expr_L121_C8", "label": "log_state()", "type": "expression", "loc": [121, 121], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "vector": [8, 2, 0.3151, 0.0026, 2, 0.62, 0.0, 805, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "log_state", "arg_names": [], "import_names": [], "rhs_call_name": "log_state", "annotation": ""}, "snippet": " self.log_state(arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L122_C8", "label": "if", "type": "if", "loc": [122, 123], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "vector": [4, 2, 0.319, 0.0052, 2, 0.62, 0.0172, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.started_pulling_on_handle == False:\n cep_vel = 0.02"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L123_C12", "label": "cep_vel =", "type": "assigned_variable", "loc": [123, 123], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L122_C8", "vector": [14, 3, 0.3203, 0.0026, 3, 0.57, 0.0, 568, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "cep_vel", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cep_vel = 0.02"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L126_C8", "label": "step_size =", "type": "assigned_variable", "loc": [126, 126], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "vector": [14, 2, 0.3281, 0.0026, 2, 0.62, 0.0345, 764, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "step_size", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " step_size = 0.1 * cep_vel # 0.1 is the time interval between calls to the equi_generator function (see pull)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L127_C8", "label": "stop = common_stopping_conditions()", "type": "assigned_variable", "loc": [127, 127], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "vector": [14, 2, 0.3307, 0.0026, 2, 0.62, 0.0517, 343, 3, 0, 0, 0, 763, 10, 1], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "common_stopping_conditions", "annotation": ""}, "snippet": " stop = self.common_stopping_conditions()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L128_C8", "label": "wrist_force = get_wrist_force()", "type": "assigned_variable", "loc": [128, 128], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "vector": [14, 2, 0.3333, 0.0026, 2, 0.62, 0.069, 483, 3, 2, 0, 0, 854, 10, 1], "semantic": {"name": "wrist_force", "arg_names": [], "import_names": [], "rhs_call_name": "get_wrist_force", "annotation": ""}, "snippet": " wrist_force = self.robot.get_wrist_force(arm, base_frame=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L129_C8", "label": "mag = norm()", "type": "assigned_variable", "loc": [129, 129], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "vector": [14, 2, 0.3359, 0.0026, 2, 0.62, 0.0862, 533, 3, 1, 0, 0, 902, 10, 1], "semantic": {"name": "mag", "arg_names": [], "import_names": [], "rhs_call_name": "norm", "annotation": ""}, "snippet": " mag = np.linalg.norm(wrist_force)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L131_C8", "label": "curr_pos, _ = get_ee_jtt()", "type": "assigned_variable", "loc": [131, 131], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "vector": [14, 2, 0.3411, 0.0026, 2, 0.62, 0.1034, 183, 3, 1, 0, 0, 15, 10, 1], "semantic": {"name": "curr_pos, _", "arg_names": [], "import_names": [], "rhs_call_name": "get_ee_jtt", "annotation": ""}, "snippet": " curr_pos, _ = self.robot.get_ee_jtt(arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L132_C8", "label": "if", "type": "if", "loc": [132, 135], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "vector": [4, 2, 0.3477, 0.0104, 2, 0.62, 0.1207, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(self.ee_list)>1:\n start_pos = np.matrix(self.ee_list[0]).T\n else:\n start_pos = curr_pos"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L133_C12", "label": "start_pos =", "type": "assigned_variable", "loc": [133, 133], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L132_C8", "vector": [14, 3, 0.3464, 0.0026, 3, 0.04, 0.0, 12, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "start_pos", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " start_pos = np.matrix(self.ee_list[0]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L135_C12", "label": "start_pos =", "type": "assigned_variable", "loc": [135, 135], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L132_C8", "vector": [14, 3, 0.3516, 0.0026, 3, 0.04, 1.0, 12, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "start_pos", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " start_pos = curr_pos"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L138_C8", "label": "if", "type": "if", "loc": [138, 140], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "vector": [4, 2, 0.362, 0.0078, 2, 0.62, 0.1379, 0, 7, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.started_pulling_on_handle:\n self.mech_traj_pub.publish(Point32(curr_pos[0,0],\n curr_pos[1,0], curr_pos[2,0]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Expr_L139_C12", "label": "publish()", "type": "expression", "loc": [139, 140], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L138_C8", "vector": [8, 3, 0.3633, 0.0052, 3, 0.45, 0.0, 102, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.mech_traj_pub.publish(Point32(curr_pos[0,0],\n curr_pos[1,0], curr_pos[2,0]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Expr_L142_C8", "label": "acquire()", "type": "expression", "loc": [142, 142], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "vector": [8, 2, 0.3698, 0.0026, 2, 0.62, 0.1552, 229, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "acquire", "arg_names": [], "import_names": [], "rhs_call_name": "acquire", "annotation": ""}, "snippet": " self.fit_circle_lock.acquire()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L143_C8", "label": "rad =", "type": "assigned_variable", "loc": [143, 143], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "vector": [14, 2, 0.3724, 0.0026, 2, 0.62, 0.1724, 439, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "rad", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rad = self.rad"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L144_C8", "label": "cx_start, cy_start =", "type": "assigned_variable", "loc": [144, 144], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "vector": [14, 2, 0.375, 0.0026, 2, 0.62, 0.1897, 372, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "cx_start, cy_start", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cx_start, cy_start = self.cx_start, self.cy_start"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L145_C8", "label": "cz_start =", "type": "assigned_variable", "loc": [145, 145], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "vector": [14, 2, 0.3776, 0.0026, 2, 0.62, 0.2069, 322, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "cz_start", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cz_start = self.cz_start"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Expr_L146_C8", "label": "release()", "type": "expression", "loc": [146, 146], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "vector": [8, 2, 0.3802, 0.0026, 2, 0.62, 0.2241, 784, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "release", "arg_names": [], "import_names": [], "rhs_call_name": "release", "annotation": ""}, "snippet": " self.fit_circle_lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L147_C8", "label": "cx, cy =", "type": "assigned_variable", "loc": [147, 147], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "vector": [14, 2, 0.3828, 0.0026, 2, 0.62, 0.2414, 959, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "cx, cy", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cx, cy = cx_start, cy_start"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L148_C8", "label": "cz =", "type": "assigned_variable", "loc": [148, 148], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "vector": [14, 2, 0.3854, 0.0026, 2, 0.62, 0.2586, 330, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "cz", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cz = cz_start"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Expr_L149_C8", "label": "print()", "type": "expression", "loc": [149, 149], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "vector": [8, 2, 0.388, 0.0026, 2, 0.62, 0.2759, 535, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('cx, cy, r:', cx, cy, rad)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L151_C8", "label": "radial_vec =", "type": "assigned_variable", "loc": [151, 151], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "vector": [14, 2, 0.3932, 0.0026, 2, 0.62, 0.2931, 253, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "radial_vec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " radial_vec = curr_pos - np.matrix([cx,cy,cz]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L152_C8", "label": "radial_vec =", "type": "assigned_variable", "loc": [152, 152], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "vector": [14, 2, 0.3958, 0.0026, 2, 0.62, 0.3103, 253, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "radial_vec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " radial_vec = radial_vec/np.linalg.norm(radial_vec)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L153_C8", "label": "if", "type": "if", "loc": [153, 156], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "vector": [4, 2, 0.4023, 0.0104, 2, 0.62, 0.3276, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if cy_start < start_pos[1,0]:\n tan_x,tan_y = -radial_vec[1,0],radial_vec[0,0]\n else:\n tan_x,tan_y = radial_vec[1,0],-radial_vec[0,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L154_C12", "label": "tan_x, tan_y =", "type": "assigned_variable", "loc": [154, 154], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L153_C8", "vector": [14, 3, 0.401, 0.0026, 3, 0.13, 0.0, 33, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "tan_x, tan_y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tan_x,tan_y = -radial_vec[1,0],radial_vec[0,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L156_C12", "label": "tan_x, tan_y =", "type": "assigned_variable", "loc": [156, 156], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L153_C8", "vector": [14, 3, 0.4062, 0.0026, 3, 0.13, 1.0, 33, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "tan_x, tan_y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tan_x,tan_y = radial_vec[1,0],-radial_vec[0,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L158_C8", "label": "if", "type": "if", "loc": [158, 160], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "vector": [4, 2, 0.4141, 0.0078, 2, 0.62, 0.3448, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if tan_x > 0. and (start_pos[0,0]-curr_pos[0,0]) < 0.09:\n tan_x = -tan_x\n tan_y = -tan_y"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L159_C12", "label": "tan_x =", "type": "assigned_variable", "loc": [159, 159], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L158_C8", "vector": [14, 3, 0.4141, 0.0026, 3, 0.9, 0.0, 718, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "tan_x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tan_x = -tan_x"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L160_C12", "label": "tan_y =", "type": "assigned_variable", "loc": [160, 160], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L158_C8", "vector": [14, 3, 0.4167, 0.0026, 3, 0.9, 1.0, 936, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "tan_y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tan_y = -tan_y"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L162_C8", "label": "if", "type": "if", "loc": [162, 163], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "vector": [4, 2, 0.4232, 0.0052, 2, 0.62, 0.3621, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if cy_start > start_pos[1,0]:\n radial_vec = -radial_vec # axis to the left, want force in"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L163_C12", "label": "radial_vec =", "type": "assigned_variable", "loc": [163, 163], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L162_C8", "vector": [14, 3, 0.4245, 0.0026, 3, 0.39, 0.0, 253, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "radial_vec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " radial_vec = -radial_vec # axis to the left, want force in"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L165_C8", "label": "rv =", "type": "assigned_variable", "loc": [165, 165], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "vector": [14, 2, 0.4297, 0.0026, 2, 0.62, 0.3793, 222, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "rv", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rv = radial_vec"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L166_C8", "label": "force_vec =", "type": "assigned_variable", "loc": [166, 166], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "vector": [14, 2, 0.4323, 0.0026, 2, 0.62, 0.3966, 819, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "force_vec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " force_vec = np.matrix([rv[0,0], rv[1,0], 0.]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L167_C8", "label": "tangential_vec =", "type": "assigned_variable", "loc": [167, 167], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "vector": [14, 2, 0.4349, 0.0026, 2, 0.62, 0.4138, 367, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "tangential_vec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tangential_vec = np.matrix([tan_x, tan_y, 0.]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L169_C8", "label": "tangential_vec_ts =", "type": "assigned_variable", "loc": [169, 169], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "vector": [14, 2, 0.4401, 0.0026, 2, 0.62, 0.431, 833, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "tangential_vec_ts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tangential_vec_ts = tangential_vec"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L170_C8", "label": "radial_vec_ts =", "type": "assigned_variable", "loc": [170, 170], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "vector": [14, 2, 0.4427, 0.0026, 2, 0.62, 0.4483, 149, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "radial_vec_ts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " radial_vec_ts = radial_vec"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L171_C8", "label": "force_vec_ts =", "type": "assigned_variable", "loc": [171, 171], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "vector": [14, 2, 0.4453, 0.0026, 2, 0.62, 0.4655, 900, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "force_vec_ts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " force_vec_ts = force_vec"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L173_C8", "label": "if", "type": "if", "loc": [173, 178], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "vector": [4, 2, 0.457, 0.0156, 2, 0.62, 0.4828, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if arm == 'right_arm' or arm == 0:\n if force_vec_ts[1,0] < 0.: # only allowing force to the left\n force_vec_ts = -force_vec_ts\n else:\n if force_vec_ts[1,0] > 0.: # only allowing force to the right\n force_vec_ts = -force_vec_ts"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L174_C12", "label": "if", "type": "if", "loc": [174, 175], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L173_C8", "vector": [4, 3, 0.4544, 0.0052, 3, 0.41, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if force_vec_ts[1,0] < 0.: # only allowing force to the left\n force_vec_ts = -force_vec_ts"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L175_C16", "label": "force_vec_ts =", "type": "assigned_variable", "loc": [175, 175], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L174_C12", "vector": [14, 4, 0.4557, 0.0026, 4, 0.73, 0.0, 900, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "force_vec_ts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " force_vec_ts = -force_vec_ts"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L177_C12", "label": "if", "type": "if", "loc": [177, 178], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L173_C8", "vector": [4, 3, 0.4622, 0.0052, 3, 0.41, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if force_vec_ts[1,0] > 0.: # only allowing force to the right\n force_vec_ts = -force_vec_ts"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L178_C16", "label": "force_vec_ts =", "type": "assigned_variable", "loc": [178, 178], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L177_C12", "vector": [14, 4, 0.4635, 0.0026, 4, 0.56, 0.0, 900, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "force_vec_ts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " force_vec_ts = -force_vec_ts"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L180_C8", "label": "f_vec =", "type": "assigned_variable", "loc": [180, 181], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "vector": [14, 2, 0.4701, 0.0052, 2, 0.62, 0.5, 231, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "f_vec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " f_vec = -1*np.array([wrist_force[0,0], wrist_force[1,0],\n wrist_force[2,0]])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L182_C8", "label": "f_rad_mag = dot()", "type": "assigned_variable", "loc": [182, 182], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "vector": [14, 2, 0.474, 0.0026, 2, 0.62, 0.5172, 421, 3, 2, 0, 0, 310, 10, 1], "semantic": {"name": "f_rad_mag", "arg_names": [], "import_names": [], "rhs_call_name": "dot", "annotation": ""}, "snippet": " f_rad_mag = np.dot(f_vec, force_vec.A1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L183_C8", "label": "err =", "type": "assigned_variable", "loc": [183, 183], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "vector": [14, 2, 0.4766, 0.0026, 2, 0.62, 0.5345, 541, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "err", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " err = f_rad_mag-4."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L184_C8", "label": "if", "type": "if", "loc": [184, 187], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "vector": [4, 2, 0.4831, 0.0104, 2, 0.62, 0.5517, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if err>0.:\n kp = -0.1\n else:\n kp = -0.2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L185_C12", "label": "kp =", "type": "assigned_variable", "loc": [185, 185], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L184_C8", "vector": [14, 3, 0.4818, 0.0026, 3, 0.65, 0.0, 93, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "kp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " kp = -0.1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L187_C12", "label": "kp =", "type": "assigned_variable", "loc": [187, 187], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L184_C8", "vector": [14, 3, 0.487, 0.0026, 3, 0.65, 1.0, 93, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "kp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " kp = -0.2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L188_C8", "label": "radial_motion_mag =", "type": "assigned_variable", "loc": [188, 188], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "vector": [14, 2, 0.4896, 0.0026, 2, 0.62, 0.569, 633, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "radial_motion_mag", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " radial_motion_mag = kp * err # radial_motion_mag in cm (depends on eq_motion step size)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L189_C8", "label": "radial_motion_vec =", "type": "assigned_variable", "loc": [189, 189], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "vector": [14, 2, 0.4922, 0.0026, 2, 0.62, 0.5862, 721, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "radial_motion_vec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " radial_motion_vec = force_vec * radial_motion_mag"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Expr_L190_C8", "label": "print()", "type": "expression", "loc": [190, 190], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "vector": [8, 2, 0.4948, 0.0026, 2, 0.62, 0.6034, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('tangential_vec:', tangential_vec.A1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L191_C8", "label": "eq_motion_vec = copy()", "type": "assigned_variable", "loc": [191, 191], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "vector": [14, 2, 0.4974, 0.0026, 2, 0.62, 0.6207, 4, 3, 1, 0, 0, 739, 10, 1], "semantic": {"name": "eq_motion_vec", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " eq_motion_vec = copy.copy(tangential_vec)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L194_C8", "label": "self.prev_force_mag =", "type": "assigned_variable", "loc": [194, 194], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "vector": [14, 2, 0.5052, 0.0026, 2, 0.62, 0.6379, 497, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.prev_force_mag", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.prev_force_mag = mag"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L196_C8", "label": "if", "type": "if", "loc": [196, 197], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "vector": [4, 2, 0.5117, 0.0052, 2, 0.62, 0.6552, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.init_tangent_vector == None or self.started_pulling_on_handle == False:\n self.init_tangent_vector = copy.copy(tangential_vec_ts)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L197_C12", "label": "self.init_tangent_vector = copy()", "type": "assigned_variable", "loc": [197, 197], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L196_C8", "vector": [14, 3, 0.513, 0.0026, 3, 0.23, 0.0, 965, 3, 1, 0, 0, 739, 10, 1], "semantic": {"name": "self.init_tangent_vector", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " self.init_tangent_vector = copy.copy(tangential_vec_ts)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L198_C8", "label": "c = dot()", "type": "assigned_variable", "loc": [198, 198], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "vector": [14, 2, 0.5156, 0.0026, 2, 0.62, 0.6724, 411, 3, 2, 0, 0, 310, 10, 1], "semantic": {"name": "c", "arg_names": [], "import_names": [], "rhs_call_name": "dot", "annotation": ""}, "snippet": " c = np.dot(tangential_vec_ts.A1, self.init_tangent_vector.A1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L199_C8", "label": "ang = arccos()", "type": "assigned_variable", "loc": [199, 199], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "vector": [14, 2, 0.5182, 0.0026, 2, 0.62, 0.6897, 762, 3, 1, 0, 0, 793, 10, 1], "semantic": {"name": "ang", "arg_names": [], "import_names": [], "rhs_call_name": "arccos", "annotation": ""}, "snippet": " ang = np.arccos(c)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L200_C8", "label": "if", "type": "if", "loc": [200, 201], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "vector": [4, 2, 0.5221, 0.0052, 2, 0.62, 0.7069, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if np.isnan(ang):\n ang = 0."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L201_C12", "label": "ang =", "type": "assigned_variable", "loc": [201, 201], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L200_C8", "vector": [14, 3, 0.5234, 0.0026, 3, 0.78, 0.0, 762, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "ang", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ang = 0."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L203_C8", "label": "tangential_vec =", "type": "assigned_variable", "loc": [203, 203], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "vector": [14, 2, 0.5286, 0.0026, 2, 0.62, 0.7241, 367, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "tangential_vec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tangential_vec = tangential_vec / np.linalg.norm(tangential_vec) # paranoia abot vectors not being unit vectors."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L204_C8", "label": "dist_moved = dot()", "type": "assigned_variable", "loc": [204, 204], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "vector": [14, 2, 0.5312, 0.0026, 2, 0.62, 0.7414, 696, 3, 2, 0, 0, 310, 10, 1], "semantic": {"name": "dist_moved", "arg_names": [], "import_names": [], "rhs_call_name": "dot", "annotation": ""}, "snippet": " dist_moved = np.dot((curr_pos - start_pos).A1, tangential_vec_ts.A1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L205_C8", "label": "ftan = abs()", "type": "assigned_variable", "loc": [205, 205], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "vector": [14, 2, 0.5339, 0.0026, 2, 0.62, 0.7586, 771, 3, 1, 0, 0, 799, 10, 2], "semantic": {"name": "ftan", "arg_names": [], "import_names": [], "rhs_call_name": "abs", "annotation": ""}, "snippet": " ftan = abs(np.dot(wrist_force.A1, tangential_vec.A1))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Expr_L206_C8", "label": "append()", "type": "expression", "loc": [206, 206], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "vector": [8, 2, 0.5365, 0.0026, 2, 0.62, 0.7759, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.ft.tangential_force.append(ftan)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Expr_L207_C8", "label": "append()", "type": "expression", "loc": [207, 207], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "vector": [8, 2, 0.5391, 0.0026, 2, 0.62, 0.7931, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.ft.radial_force.append(f_rad_mag)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L209_C8", "label": "if", "type": "if", "loc": [209, 213], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "vector": [4, 2, 0.5495, 0.013, 2, 0.62, 0.8103, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.ft.type == 'rotary':\n self.ft.configuration.append(ang)\n else: # drawer\n print('dist_moved:', dist_moved)\n self.ft.configuration.append(dist_moved)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Expr_L210_C12", "label": "append()", "type": "expression", "loc": [210, 210], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L209_C8", "vector": [8, 3, 0.5469, 0.0026, 3, 0.06, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.ft.configuration.append(ang)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Expr_L212_C12", "label": "print()", "type": "expression", "loc": [212, 212], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L209_C8", "vector": [8, 3, 0.5521, 0.0026, 3, 0.06, 0.5, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('dist_moved:', dist_moved)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Expr_L213_C12", "label": "append()", "type": "expression", "loc": [213, 213], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L209_C8", "vector": [8, 3, 0.5547, 0.0026, 3, 0.06, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.ft.configuration.append(dist_moved)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L215_C8", "label": "if", "type": "if", "loc": [215, 216], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "vector": [4, 2, 0.5612, 0.0052, 2, 0.62, 0.8276, 0, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.started_pulling_on_handle:\n self.force_traj_pub.publish(self.ft)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Expr_L216_C12", "label": "publish()", "type": "expression", "loc": [216, 216], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L215_C8", "vector": [8, 3, 0.5625, 0.0026, 3, 0.84, 0.0, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.force_traj_pub.publish(self.ft)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L231_C8", "label": "if", "type": "if", "loc": [231, 235], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "vector": [4, 2, 0.6068, 0.013, 2, 0.62, 0.8448, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if abs(dist_moved) > 0.09 and self.hooked_location_moved == False:\n # change the force threshold once the hook has started pulling.\n self.hooked_location_moved = True\n self.eq_force_threshold = ut.bound(mag+30.,20.,80.)\n self.ftan_threshold = 1.2 * self.ftan_threshold + 20."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L233_C12", "label": "self.hooked_location_moved =", "type": "assigned_variable", "loc": [233, 233], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L231_C8", "vector": [14, 3, 0.6068, 0.0026, 3, 0.09, 0.0, 183, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.hooked_location_moved", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.hooked_location_moved = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L234_C12", "label": "self.eq_force_threshold = bound()", "type": "assigned_variable", "loc": [234, 234], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L231_C8", "vector": [14, 3, 0.6094, 0.0026, 3, 0.09, 0.5, 675, 3, 3, 0, 0, 996, 10, 1], "semantic": {"name": "self.eq_force_threshold", "arg_names": [], "import_names": [], "rhs_call_name": "bound", "annotation": ""}, "snippet": " self.eq_force_threshold = ut.bound(mag+30.,20.,80.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L235_C12", "label": "self.ftan_threshold =", "type": "assigned_variable", "loc": [235, 235], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L231_C8", "vector": [14, 3, 0.612, 0.0026, 3, 0.09, 1.0, 667, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.ftan_threshold", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.ftan_threshold = 1.2 * self.ftan_threshold + 20."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L236_C8", "label": "if", "type": "if", "loc": [236, 240], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "vector": [4, 2, 0.6198, 0.013, 2, 0.62, 0.8621, 0, 7, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.hooked_location_moved:\n if abs(tangential_vec_ts[2,0]) < 0.2 and ftan > self.ftan_threshold:\n stop = 'ftan threshold exceed: %f'%ftan\n else:\n self.ftan_threshold = max(self.ftan_threshold, ftan)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L237_C12", "label": "if", "type": "if", "loc": [237, 238], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L236_C8", "vector": [4, 3, 0.6185, 0.0052, 3, 0.41, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if abs(tangential_vec_ts[2,0]) < 0.2 and ftan > self.ftan_threshold:\n stop = 'ftan threshold exceed: %f'%ftan"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L238_C16", "label": "stop =", "type": "assigned_variable", "loc": [238, 238], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L237_C12", "vector": [14, 4, 0.6198, 0.0026, 4, 0.83, 0.0, 343, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " stop = 'ftan threshold exceed: %f'%ftan"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L240_C12", "label": "self.ftan_threshold = max()", "type": "assigned_variable", "loc": [240, 240], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L236_C8", "vector": [14, 3, 0.625, 0.0026, 3, 0.41, 1.0, 667, 3, 2, 0, 0, 442, 10, 1], "semantic": {"name": "self.ftan_threshold", "arg_names": [], "import_names": [], "rhs_call_name": "max", "annotation": ""}, "snippet": " self.ftan_threshold = max(self.ftan_threshold, ftan)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L242_C8", "label": "if", "type": "if", "loc": [242, 248], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "vector": [4, 2, 0.638, 0.0182, 2, 0.62, 0.8793, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.hooked_location_moved and ang > math.radians(90.):\n print('Angle:', math.degrees(ang))\n self.open_ang_exceed_count += 1\n if self.open_ang_exceed_count > 2:\n stop = 'opened mechanism through large angle: %.1f'%(math.degrees(ang))\n else:\n self.open_ang_exceed_count = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Expr_L243_C12", "label": "print()", "type": "expression", "loc": [243, 243], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L242_C8", "vector": [8, 3, 0.6328, 0.0026, 3, 0.75, 0.0, 535, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Angle:', math.degrees(ang))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L245_C12", "label": "if", "type": "if", "loc": [245, 246], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L242_C8", "vector": [4, 3, 0.6393, 0.0052, 3, 0.75, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.open_ang_exceed_count > 2:\n stop = 'opened mechanism through large angle: %.1f'%(math.degrees(ang))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L246_C16", "label": "stop =", "type": "assigned_variable", "loc": [246, 246], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L245_C12", "vector": [14, 4, 0.6406, 0.0026, 4, 0.47, 0.0, 343, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " stop = 'opened mechanism through large angle: %.1f'%(math.degrees(ang))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L248_C12", "label": "self.open_ang_exceed_count =", "type": "assigned_variable", "loc": [248, 248], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L242_C8", "vector": [14, 3, 0.6458, 0.0026, 3, 0.75, 1.0, 172, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.open_ang_exceed_count", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.open_ang_exceed_count = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L250_C8", "label": "cep_t =", "type": "assigned_variable", "loc": [250, 250], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "vector": [14, 2, 0.651, 0.0026, 2, 0.62, 0.8966, 772, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "cep_t", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cep_t = cep + eq_motion_vec * step_size"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L251_C8", "label": "assign", "type": "assigned_variable", "loc": [251, 251], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "vector": [14, 2, 0.6536, 0.0026, 2, 0.62, 0.9138, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cep[0,0] = cep_t[0,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L252_C8", "label": "assign", "type": "assigned_variable", "loc": [252, 252], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "vector": [14, 2, 0.6562, 0.0026, 2, 0.62, 0.931, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cep[1,0] = cep_t[1,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L253_C8", "label": "assign", "type": "assigned_variable", "loc": [253, 253], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "vector": [14, 2, 0.6589, 0.0026, 2, 0.62, 0.9483, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cep[2,0] = cep_t[2,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Expr_L255_C8", "label": "print()", "type": "expression", "loc": [255, 255], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "vector": [8, 2, 0.6641, 0.0026, 2, 0.62, 0.9655, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('CEP:', cep.A1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L257_C8", "label": "stop =", "type": "assigned_variable", "loc": [257, 257], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "vector": [14, 2, 0.6693, 0.0026, 2, 0.62, 0.9828, 343, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " stop = stop + self.stopping_string"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Return_L258_C8", "label": "return", "type": "return", "loc": [258, 258], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "vector": [13, 2, 0.6719, 0.0026, 2, 0.62, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return stop, (cep, None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L260_C4", "label": "pull", "type": "function", "loc": [260, 306], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:ClassDef_L19_C0", "vector": [2, 1, 0.737, 0.1224, 1, 0.46, 0.875, 964, 0, 5, 0, 0, 0, 0, 12], "semantic": {"name": "pull", "arg_names": ["self", "arm", "force_threshold", "cep_vel", "mechanism_type"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def pull(self, arm, force_threshold, cep_vel, mechanism_type=''):\n self.mechanism_type = mechanism_type\n self.stopping_string = ''\n self.eq_pt_not_moving_counter = 0\n\n self.init_log()\n\n self.init_tangent_vector = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L261_C8", "label": "self.mechanism_type =", "type": "assigned_variable", "loc": [261, 261], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L260_C4", "vector": [14, 2, 0.6797, 0.0026, 2, 0.33, 0.0, 701, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.mechanism_type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.mechanism_type = mechanism_type"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L262_C8", "label": "self.stopping_string =", "type": "assigned_variable", "loc": [262, 262], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L260_C4", "vector": [14, 2, 0.6823, 0.0026, 2, 0.33, 0.0385, 265, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self.stopping_string", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.stopping_string = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L263_C8", "label": "self.eq_pt_not_moving_counter =", "type": "assigned_variable", "loc": [263, 263], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L260_C4", "vector": [14, 2, 0.6849, 0.0026, 2, 0.33, 0.0769, 123, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.eq_pt_not_moving_counter", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.eq_pt_not_moving_counter = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Expr_L265_C8", "label": "init_log()", "type": "expression", "loc": [265, 265], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L260_C4", "vector": [8, 2, 0.6901, 0.0026, 2, 0.33, 0.1154, 377, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "init_log", "arg_names": [], "import_names": [], "rhs_call_name": "init_log", "annotation": ""}, "snippet": " self.init_log()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L267_C8", "label": "self.init_tangent_vector =", "type": "assigned_variable", "loc": [267, 267], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L260_C4", "vector": [14, 2, 0.6953, 0.0026, 2, 0.33, 0.1538, 965, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.init_tangent_vector", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.init_tangent_vector = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L268_C8", "label": "self.open_ang_exceed_count =", "type": "assigned_variable", "loc": [268, 268], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L260_C4", "vector": [14, 2, 0.6979, 0.0026, 2, 0.33, 0.1923, 172, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "self.open_ang_exceed_count", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.open_ang_exceed_count = 0."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L270_C8", "label": "self.eq_force_threshold =", "type": "assigned_variable", "loc": [270, 270], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L260_C4", "vector": [14, 2, 0.7031, 0.0026, 2, 0.33, 0.2308, 675, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.eq_force_threshold", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.eq_force_threshold = force_threshold"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L271_C8", "label": "self.ftan_threshold =", "type": "assigned_variable", "loc": [271, 271], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L260_C4", "vector": [14, 2, 0.7057, 0.0026, 2, 0.33, 0.2692, 667, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "self.ftan_threshold", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.ftan_threshold = 2."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L272_C8", "label": "self.hooked_location_moved =", "type": "assigned_variable", "loc": [272, 272], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L260_C4", "vector": [14, 2, 0.7083, 0.0026, 2, 0.33, 0.3077, 183, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.hooked_location_moved", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.hooked_location_moved = False # flag to indicate when the hooking location started moving."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L273_C8", "label": "self.prev_force_mag = norm()", "type": "assigned_variable", "loc": [273, 273], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L260_C4", "vector": [14, 2, 0.7109, 0.0026, 2, 0.33, 0.3462, 497, 3, 1, 0, 0, 902, 10, 2], "semantic": {"name": "self.prev_force_mag", "arg_names": [], "import_names": [], "rhs_call_name": "norm", "annotation": ""}, "snippet": " self.prev_force_mag = np.linalg.norm(self.robot.get_wrist_force(arm))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L274_C8", "label": "self.slip_count =", "type": "assigned_variable", "loc": [274, 274], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L260_C4", "vector": [14, 2, 0.7135, 0.0026, 2, 0.33, 0.3846, 338, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.slip_count", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.slip_count = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L276_C8", "label": "self.started_pulling_on_handle =", "type": "assigned_variable", "loc": [276, 276], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L260_C4", "vector": [14, 2, 0.7188, 0.0026, 2, 0.33, 0.4231, 945, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.started_pulling_on_handle", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.started_pulling_on_handle = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L277_C8", "label": "self.started_pulling_on_handle_count =", "type": "assigned_variable", "loc": [277, 277], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L260_C4", "vector": [14, 2, 0.7214, 0.0026, 2, 0.33, 0.4615, 870, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.started_pulling_on_handle_count", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.started_pulling_on_handle_count = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L279_C8", "label": "ee_pos, _ = get_ee_jtt()", "type": "assigned_variable", "loc": [279, 279], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L260_C4", "vector": [14, 2, 0.7266, 0.0026, 2, 0.33, 0.5, 323, 3, 1, 0, 0, 15, 10, 1], "semantic": {"name": "ee_pos, _", "arg_names": [], "import_names": [], "rhs_call_name": "get_ee_jtt", "annotation": ""}, "snippet": " ee_pos, _ = self.robot.get_ee_jtt(arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L281_C8", "label": "self.cx_start =", "type": "assigned_variable", "loc": [281, 281], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L260_C4", "vector": [14, 2, 0.7318, 0.0026, 2, 0.33, 0.5385, 939, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.cx_start", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.cx_start = ee_pos[0,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L282_C8", "label": "self.rad =", "type": "assigned_variable", "loc": [282, 282], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L260_C4", "vector": [14, 2, 0.7344, 0.0026, 2, 0.33, 0.5769, 240, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "self.rad", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.rad = 10.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L283_C8", "label": "self.cy_start =", "type": "assigned_variable", "loc": [283, 283], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L260_C4", "vector": [14, 2, 0.737, 0.0026, 2, 0.33, 0.6154, 418, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.cy_start", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.cy_start = ee_pos[1,0]-self.rad"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L284_C8", "label": "self.cz_start =", "type": "assigned_variable", "loc": [284, 284], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L260_C4", "vector": [14, 2, 0.7396, 0.0026, 2, 0.33, 0.6538, 113, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.cz_start", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.cz_start = ee_pos[2,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L286_C8", "label": "cep, _ = get_cep_jtt()", "type": "assigned_variable", "loc": [286, 286], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L260_C4", "vector": [14, 2, 0.7448, 0.0026, 2, 0.33, 0.6923, 705, 3, 1, 0, 0, 532, 10, 1], "semantic": {"name": "cep, _", "arg_names": [], "import_names": [], "rhs_call_name": "get_cep_jtt", "annotation": ""}, "snippet": " cep, _ = self.robot.get_cep_jtt(arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L287_C8", "label": "arg_list =", "type": "assigned_variable", "loc": [287, 287], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L260_C4", "vector": [14, 2, 0.7474, 0.0026, 2, 0.33, 0.7308, 873, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "arg_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " arg_list = [arm, cep, cep_vel]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L288_C8", "label": "result, _ = epc_motion()", "type": "assigned_variable", "loc": [288, 291], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L260_C4", "vector": [14, 2, 0.7539, 0.0104, 2, 0.33, 0.7692, 438, 3, 6, 0, 0, 938, 10, 1], "semantic": {"name": "result, _", "arg_names": [], "import_names": [], "rhs_call_name": "epc_motion", "annotation": ""}, "snippet": " result, _ = self.epc_motion(self.cep_gen_control_radial_force,\n 0.1, arm, arg_list, self.log_state,\n #0.01, arm, arg_list,\n control_function = self.robot.set_cep_jtt)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Expr_L293_C8", "label": "print()", "type": "expression", "loc": [293, 293], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L260_C4", "vector": [8, 2, 0.763, 0.0026, 2, 0.33, 0.8077, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('EPC motion result:', result)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Expr_L294_C8", "label": "print()", "type": "expression", "loc": [294, 294], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L260_C4", "vector": [8, 2, 0.7656, 0.0026, 2, 0.33, 0.8462, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Original force threshold:', force_threshold)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Expr_L295_C8", "label": "print()", "type": "expression", "loc": [295, 295], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L260_C4", "vector": [8, 2, 0.7682, 0.0026, 2, 0.33, 0.8846, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Adapted force threshold:', self.eq_force_threshold)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Expr_L296_C8", "label": "print()", "type": "expression", "loc": [296, 296], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L260_C4", "vector": [8, 2, 0.7708, 0.0026, 2, 0.33, 0.9231, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Adapted ftan threshold:', self.ftan_threshold)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L298_C8", "label": "d =", "type": "assigned_variable", "loc": [298, 305], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L260_C4", "vector": [14, 2, 0.7852, 0.0208, 2, 0.33, 0.9615, 355, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " d = {\n 'f_list': self.f_list, 'ee_list': self.ee_list,\n 'cep_list': self.cep_list, 'ftan_list': self.ft.tangential_force,\n 'config_list': self.ft.configuration, 'frad_list': self.ft.radial_force,\n 'f_list_ati': self.f_list_ati,\n 'f_list_estimate': self.f_list_estimate,\n 'f_list_torques': self.f_list_torques\n }"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Expr_L306_C8", "label": "save_pickle()", "type": "expression", "loc": [306, 306], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L260_C4", "vector": [8, 2, 0.7969, 0.0026, 2, 0.33, 1.0, 390, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "save_pickle", "arg_names": [], "import_names": [], "rhs_call_name": "save_pickle", "annotation": ""}, "snippet": " ut.save_pickle(d,'pr2_pull_'+ut.formatted_time()+'.pkl')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L308_C4", "label": "search_and_hook", "type": "function", "loc": [308, 350], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:ClassDef_L19_C0", "vector": [2, 1, 0.8568, 0.112, 1, 0.46, 1.0, 913, 0, 7, 1, 0, 0, 0, 15], "semantic": {"name": "search_and_hook", "arg_names": ["self", "arm", "hook_loc", "hooking_force_threshold", "hit_threshold", "hit_motions", "hook_direction"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def search_and_hook(self, arm, hook_loc, hooking_force_threshold = 5.,\n hit_threshold=15., hit_motions = 1,\n hook_direction = 'left'):\n # this needs to be debugged. Hardcoded for now.\n #if arm == 'right_arm' or arm == 0:\n # hook_dir = np.matrix([0., 1., 0.]).T # hook direc in home position\n # offset = -0.03\n #elif arm == 'left_arm' or arm == 1:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L322_C8", "label": "if", "type": "if", "loc": [322, 327], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L308_C4", "vector": [4, 2, 0.8451, 0.0156, 2, 0.36, 0.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if hook_direction == 'left':\n offset = np.matrix([0., -0.03, 0.]).T\n move_dir = np.matrix([0., 1., 0.]).T\n elif hook_direction == 'up':\n offset = np.matrix([0., 0., -0.03]).T\n move_dir = np.matrix([0., 0., 1.]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L323_C12", "label": "offset =", "type": "assigned_variable", "loc": [323, 323], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L322_C8", "vector": [14, 3, 0.8411, 0.0026, 3, 0.53, 0.0, 132, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "offset", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " offset = np.matrix([0., -0.03, 0.]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L324_C12", "label": "move_dir =", "type": "assigned_variable", "loc": [324, 324], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L322_C8", "vector": [14, 3, 0.8438, 0.0026, 3, 0.53, 0.5, 21, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "move_dir", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " move_dir = np.matrix([0., 1., 0.]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L325_C8", "label": "if", "type": "if", "loc": [325, 327], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L322_C8", "vector": [4, 3, 0.849, 0.0078, 3, 0.53, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif hook_direction == 'up':\n offset = np.matrix([0., 0., -0.03]).T\n move_dir = np.matrix([0., 0., 1.]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L326_C12", "label": "offset =", "type": "assigned_variable", "loc": [326, 326], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L325_C8", "vector": [14, 4, 0.849, 0.0026, 4, 0.18, 0.0, 132, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "offset", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " offset = np.matrix([0., 0., -0.03]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L327_C12", "label": "move_dir =", "type": "assigned_variable", "loc": [327, 327], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L325_C8", "vector": [14, 4, 0.8516, 0.0026, 4, 0.18, 1.0, 21, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "move_dir", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " move_dir = np.matrix([0., 0., 1.]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L328_C8", "label": "start_loc =", "type": "assigned_variable", "loc": [328, 328], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L308_C4", "vector": [14, 2, 0.8542, 0.0026, 2, 0.36, 0.0667, 912, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "start_loc", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " start_loc = hook_loc + offset"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L331_C8", "label": "normal_tl =", "type": "assigned_variable", "loc": [331, 331], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L308_C4", "vector": [14, 2, 0.862, 0.0026, 2, 0.36, 0.1333, 601, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "normal_tl", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " normal_tl = np.matrix([1.0, 0., 0.]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L333_C8", "label": "pt1 =", "type": "assigned_variable", "loc": [333, 333], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L308_C4", "vector": [14, 2, 0.8672, 0.0026, 2, 0.36, 0.2, 211, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pt1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pt1 = start_loc - normal_tl * 0.1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Expr_L334_C8", "label": "go_cep_jtt()", "type": "expression", "loc": [334, 334], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L308_C4", "vector": [8, 2, 0.8698, 0.0026, 2, 0.36, 0.2667, 219, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "go_cep_jtt", "arg_names": [], "import_names": [], "rhs_call_name": "go_cep_jtt", "annotation": ""}, "snippet": " self.robot.go_cep_jtt(arm, pt1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Expr_L336_C8", "label": "raw_input()", "type": "expression", "loc": [336, 336], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L308_C4", "vector": [8, 2, 0.875, 0.0026, 2, 0.36, 0.3333, 821, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "raw_input", "arg_names": [], "import_names": [], "rhs_call_name": "raw_input", "annotation": ""}, "snippet": " raw_input('Hit ENTER to go')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L338_C8", "label": "vec =", "type": "assigned_variable", "loc": [338, 338], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L308_C4", "vector": [14, 2, 0.8802, 0.0026, 2, 0.36, 0.4, 132, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "vec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " vec = normal_tl * 0.2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Expr_L339_C8", "label": "sleep()", "type": "expression", "loc": [339, 339], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L308_C4", "vector": [8, 2, 0.8828, 0.0026, 2, 0.36, 0.4667, 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_99619:For_L340_C8", "label": "for i", "type": "for", "loc": [340, 341], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L308_C4", "vector": [6, 2, 0.8867, 0.0052, 2, 0.36, 0.5333, 826, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(hit_motions):\n s = self.move_till_hit(arm, vec=vec, force_threshold=hit_threshold, speed=0.07)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L341_C12", "label": "s = move_till_hit()", "type": "assigned_variable", "loc": [341, 341], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:For_L340_C8", "vector": [14, 3, 0.888, 0.0026, 3, 0.76, 0.0, 553, 3, 4, 0, 0, 163, 10, 1], "semantic": {"name": "s", "arg_names": [], "import_names": [], "rhs_call_name": "move_till_hit", "annotation": ""}, "snippet": " s = self.move_till_hit(arm, vec=vec, force_threshold=hit_threshold, speed=0.07)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L343_C8", "label": "cep_start, _ = get_cep_jtt()", "type": "assigned_variable", "loc": [343, 343], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L308_C4", "vector": [14, 2, 0.8932, 0.0026, 2, 0.36, 0.6, 342, 3, 1, 0, 0, 532, 10, 1], "semantic": {"name": "cep_start, _", "arg_names": [], "import_names": [], "rhs_call_name": "get_cep_jtt", "annotation": ""}, "snippet": " cep_start, _ = self.robot.get_cep_jtt(arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L344_C8", "label": "cep = copy()", "type": "assigned_variable", "loc": [344, 344], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L308_C4", "vector": [14, 2, 0.8958, 0.0026, 2, 0.36, 0.6667, 487, 3, 1, 0, 0, 739, 10, 1], "semantic": {"name": "cep", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " cep = copy.copy(cep_start)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L345_C8", "label": "arg_list =", "type": "assigned_variable", "loc": [345, 345], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L308_C4", "vector": [14, 2, 0.8984, 0.0026, 2, 0.36, 0.7333, 873, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "arg_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " arg_list = [arm, move_dir, hooking_force_threshold, cep, cep_start]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Expr_L346_C8", "label": "print()", "type": "expression", "loc": [346, 346], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L308_C4", "vector": [8, 2, 0.901, 0.0026, 2, 0.36, 0.8, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Hi there.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L347_C8", "label": "s = epc_motion()", "type": "assigned_variable", "loc": [347, 348], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L308_C4", "vector": [14, 2, 0.9049, 0.0052, 2, 0.36, 0.8667, 553, 3, 5, 0, 0, 938, 10, 1], "semantic": {"name": "s", "arg_names": [], "import_names": [], "rhs_call_name": "epc_motion", "annotation": ""}, "snippet": " s = self.epc_motion(self.cep_gen_surface_follow, 0.1, arm,\n arg_list, control_function = self.robot.set_cep_jtt)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Expr_L349_C8", "label": "print()", "type": "expression", "loc": [349, 349], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L308_C4", "vector": [8, 2, 0.9089, 0.0026, 2, 0.36, 0.9333, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('result:', s)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Return_L350_C8", "label": "return", "type": "return", "loc": [350, 350], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L308_C4", "vector": [13, 2, 0.9115, 0.0026, 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 s"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L353_C0", "label": "if", "type": "if", "loc": [353, 377], "level": 0, "parent": null, "vector": [4, 0, 0.9505, 0.0651, 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 pr2_arms as pa\n rospy.init_node('epc_pr2', anonymous = True)\n rospy.logout('epc_pr2: ready')\n\n #pr2_arms = pa.PR2Arms(primary_ft_sensor='ati')\n pr2_arms = pa.PR2Arms(primary_ft_sensor='estimate')\n door_epc = Door_EPC(pr2_arms)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Import_L354_C4", "label": "pr2_arms import pa", "type": "import", "loc": [354, 354], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L353_C0", "vector": [1, 1, 0.9219, 0.0026, 1, 0.09, 0.0, 369, 0, 1, 0, 0, 369, 0, 0], "semantic": {"name": "pr2_arms", "arg_names": [], "import_names": ["pa"], "rhs_call_name": "", "annotation": ""}, "snippet": " import pr2_arms as pa"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Expr_L355_C4", "label": "init_node()", "type": "expression", "loc": [355, 355], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L353_C0", "vector": [8, 1, 0.9245, 0.0026, 1, 0.09, 0.0714, 463, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "init_node", "arg_names": [], "import_names": [], "rhs_call_name": "init_node", "annotation": ""}, "snippet": " rospy.init_node('epc_pr2', anonymous = True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Expr_L356_C4", "label": "logout()", "type": "expression", "loc": [356, 356], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L353_C0", "vector": [8, 1, 0.9271, 0.0026, 1, 0.09, 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('epc_pr2: ready')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L359_C4", "label": "pr2_arms = PR2Arms()", "type": "assigned_variable", "loc": [359, 359], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L353_C0", "vector": [14, 1, 0.9349, 0.0026, 1, 0.09, 0.2143, 369, 3, 1, 0, 0, 694, 10, 1], "semantic": {"name": "pr2_arms", "arg_names": [], "import_names": [], "rhs_call_name": "PR2Arms", "annotation": ""}, "snippet": " pr2_arms = pa.PR2Arms(primary_ft_sensor='estimate')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L360_C4", "label": "door_epc = Door_EPC()", "type": "assigned_variable", "loc": [360, 360], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L353_C0", "vector": [14, 1, 0.9375, 0.0026, 1, 0.09, 0.2857, 350, 3, 1, 0, 0, 468, 10, 1], "semantic": {"name": "door_epc", "arg_names": [], "import_names": [], "rhs_call_name": "Door_EPC", "annotation": ""}, "snippet": " door_epc = Door_EPC(pr2_arms)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L362_C4", "label": "r_arm, l_arm =", "type": "assigned_variable", "loc": [362, 362], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L353_C0", "vector": [14, 1, 0.9427, 0.0026, 1, 0.09, 0.3571, 451, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "r_arm, l_arm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " r_arm, l_arm = 0, 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L363_C4", "label": "arm =", "type": "assigned_variable", "loc": [363, 363], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L353_C0", "vector": [14, 1, 0.9453, 0.0026, 1, 0.09, 0.4286, 413, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "arm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " arm = r_arm"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L365_C4", "label": "tip =", "type": "assigned_variable", "loc": [365, 365], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L353_C0", "vector": [14, 1, 0.9505, 0.0026, 1, 0.09, 0.5, 726, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "tip", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tip = np.matrix([0.35, 0., 0.]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Expr_L366_C4", "label": "set_tooltip()", "type": "expression", "loc": [366, 366], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L353_C0", "vector": [8, 1, 0.9531, 0.0026, 1, 0.09, 0.5714, 350, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "set_tooltip", "arg_names": [], "import_names": [], "rhs_call_name": "set_tooltip", "annotation": ""}, "snippet": " pr2_arms.arms.set_tooltip(arm, tip)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Expr_L368_C4", "label": "raw_input()", "type": "expression", "loc": [368, 368], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L353_C0", "vector": [8, 1, 0.9583, 0.0026, 1, 0.09, 0.6429, 821, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "raw_input", "arg_names": [], "import_names": [], "rhs_call_name": "raw_input", "annotation": ""}, "snippet": " raw_input('Hit ENTER to close')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Expr_L369_C4", "label": "close_gripper()", "type": "expression", "loc": [369, 369], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L353_C0", "vector": [8, 1, 0.9609, 0.0026, 1, 0.09, 0.7143, 807, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "close_gripper", "arg_names": [], "import_names": [], "rhs_call_name": "close_gripper", "annotation": ""}, "snippet": " pr2_arms.close_gripper(arm, effort=80)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Expr_L370_C4", "label": "raw_input()", "type": "expression", "loc": [370, 370], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L353_C0", "vector": [8, 1, 0.9635, 0.0026, 1, 0.09, 0.7857, 821, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "raw_input", "arg_names": [], "import_names": [], "rhs_call_name": "raw_input", "annotation": ""}, "snippet": " raw_input('Hit ENTER to start Door Opening')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L375_C4", "label": "p1 =", "type": "assigned_variable", "loc": [375, 375], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L353_C0", "vector": [14, 1, 0.9766, 0.0026, 1, 0.09, 0.8571, 87, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "p1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p1 = np.matrix([0.8, -0.35, 0.1]).T # pos 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Expr_L376_C4", "label": "search_and_hook()", "type": "expression", "loc": [376, 376], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L353_C0", "vector": [8, 1, 0.9792, 0.0026, 1, 0.09, 0.9286, 913, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "search_and_hook", "arg_names": [], "import_names": [], "rhs_call_name": "search_and_hook", "annotation": ""}, "snippet": " door_epc.search_and_hook(arm, p1, hook_direction='left')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99619:Expr_L377_C4", "label": "pull()", "type": "expression", "loc": [377, 377], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L353_C0", "vector": [8, 1, 0.9818, 0.0026, 1, 0.09, 1.0, 964, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "pull", "arg_names": [], "import_names": [], "rhs_call_name": "pull", "annotation": ""}, "snippet": " door_epc.pull(arm, force_threshold=40., cep_vel=0.05)"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99619:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Expr_L21_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L23_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L24_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Expr_L26_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Expr_L29_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L32_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L34_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L34_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L35_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L34_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L36_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L34_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L37_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L34_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L38_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L34_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L39_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L34_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L40_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L34_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L41_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L34_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L42_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L42_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L43_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L42_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L45_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L47_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L49_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Expr_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L52_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Expr_L53_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L55_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Expr_L56_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L58_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Expr_L59_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L61_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Expr_L62_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L64_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Expr_L65_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L67_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L67_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L68_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L68_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L71_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L68_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Expr_L72_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L68_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L73_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L67_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L75_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L75_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L76_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Return_L78_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L81_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L82_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L84_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L84_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L85_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L84_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L87_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L84_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L88_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L84_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L89_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L89_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L90_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L84_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L92_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L92_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L93_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L93_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L94_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L92_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L98_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L84_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L100_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L100_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L101_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L84_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Return_L102_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L104_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L104_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Expr_L105_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L104_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L106_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L104_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L107_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L104_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L108_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L104_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L109_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L104_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Expr_L110_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Expr_L121_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L122_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L122_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L123_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L126_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L127_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L128_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L129_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L131_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L132_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L132_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L133_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L132_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L135_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L138_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L138_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Expr_L139_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Expr_L142_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L143_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L144_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L145_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Expr_L146_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L147_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L148_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Expr_L149_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L151_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L152_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L153_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L153_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L154_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L153_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L156_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L158_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L158_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L159_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L158_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L160_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L162_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L162_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L163_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L165_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L166_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L167_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L169_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L170_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L171_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L173_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L173_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L174_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L174_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L175_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L173_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L177_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L177_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L178_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L180_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L182_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L183_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L184_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L184_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L185_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L184_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L187_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L188_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L189_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Expr_L190_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L191_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L194_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L196_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L196_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L197_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L198_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L199_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L200_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L200_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L201_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L203_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L204_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L205_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Expr_L206_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Expr_L207_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L209_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L209_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Expr_L210_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L209_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Expr_L212_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L209_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Expr_L213_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L215_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L215_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Expr_L216_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L231_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L231_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L233_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L231_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L234_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L231_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L235_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L236_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L236_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L237_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L237_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L238_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L236_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L240_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L242_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L242_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Expr_L243_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L242_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L245_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L245_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L246_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L242_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L248_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L250_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L251_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L252_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L253_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Expr_L255_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L257_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Return_L258_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L260_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L260_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L261_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L260_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L262_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L260_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L263_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L260_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Expr_L265_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L260_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L267_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L260_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L268_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L260_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L270_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L260_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L271_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L260_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L272_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L260_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L273_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L260_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L274_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L260_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L276_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L260_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L277_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L260_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L279_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L260_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L281_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L260_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L282_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L260_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L283_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L260_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L284_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L260_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L286_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L260_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L287_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L260_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L288_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L260_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Expr_L293_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L260_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Expr_L294_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L260_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Expr_L295_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L260_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Expr_L296_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L260_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L298_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L260_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Expr_L306_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L308_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L308_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L322_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L322_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L323_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L322_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L324_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L322_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L325_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L325_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L326_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L325_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L327_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L308_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L328_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L308_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L331_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L308_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L333_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L308_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Expr_L334_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L308_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Expr_L336_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L308_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L338_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L308_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Expr_L339_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L308_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:For_L340_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:For_L340_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L341_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L308_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L343_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L308_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L344_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L308_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L345_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L308_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Expr_L346_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L308_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L347_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L308_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Expr_L349_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:FunctionDef_L308_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Return_L350_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L353_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Import_L354_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L353_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Expr_L355_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L353_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Expr_L356_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L353_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L359_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L353_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L360_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L353_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L362_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L353_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L363_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L353_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L365_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L353_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Expr_L366_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L353_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Expr_L368_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L353_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Expr_L369_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L353_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Expr_L370_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L353_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Assign_L375_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L353_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Expr_L376_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99619:If_L353_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99619:Expr_L377_C4"}]
#!/usr/bin/python import numpy as np, math import copy from threading import RLock import roslib; roslib.load_manifest('hrl_pr2_door_opening') import rospy from hrl_msgs.msg import FloatArray from geometry_msgs.msg import Twist def ft_cb(data): lock.acquire() ft_val[0] = data.linear.x ft_val[1] = data.linear.y ft_val[2] = data.linear.z ft_val[3] = data.angular.x ft_val[4] = data.angular.y ft_val[5] = data.angular.z lock.release() if __name__ == '__main__': lock = RLock() ft_val = [0.] * 6 pub = rospy.Subscriber('/r_cart/state/wrench', Twist, ft_cb) pub = rospy.Publisher('/force_torque_ft2_estimate', FloatArray) rospy.init_node('ati_ft_emulator') rospy.loginfo('Started the ATI FT emulator.') rt = rospy.Rate(100) while not rospy.is_shutdown(): lock.acquire() send_ft_val = copy.copy(ft_val) lock.release() fa = FloatArray(rospy.Header(stamp=rospy.Time.now()), send_ft_val) pub.publish(fa) rt.sleep()
ajibawa-2023/Python-Code-Large/train/row_99620
32
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_99620:Import_L3_C0", "label": "numpy import np, math", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0769, 0.0256, 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_99620:Import_L4_C0", "label": "copy import copy", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.1026, 0.0256, 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_99620:ImportFrom_L5_C0", "label": "from threading import RLock", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.1282, 0.0256, 0, 0.66, 0.2222, 83, 0, 1, 0, 0, 83, 0, 0], "semantic": {"name": "threading", "arg_names": [], "import_names": ["RLock"], "rhs_call_name": "", "annotation": ""}, "snippet": "from threading import RLock"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99620:Import_L7_C0", "label": "roslib import roslib", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.1795, 0.0256, 0, 0.66, 0.3333, 796, 0, 1, 0, 0, 796, 0, 0], "semantic": {"name": "roslib", "arg_names": [], "import_names": ["roslib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('hrl_pr2_door_opening')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99620:Expr_L7_C15", "label": "load_manifest()", "type": "expression", "loc": [7, 7], "level": 0, "parent": null, "vector": [8, 0, 0.1795, 0.0256, 0, 0.66, 0.4444, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('hrl_pr2_door_opening')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99620:Import_L8_C0", "label": "rospy import rospy", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.2051, 0.0256, 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_99620:ImportFrom_L10_C0", "label": "from hrl_msgs.msg import FloatArray", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.2564, 0.0256, 0, 0.66, 0.6667, 513, 0, 1, 0, 0, 513, 0, 0], "semantic": {"name": "hrl_msgs.msg", "arg_names": [], "import_names": ["FloatArray"], "rhs_call_name": "", "annotation": ""}, "snippet": "from hrl_msgs.msg import FloatArray"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99620:ImportFrom_L11_C0", "label": "from geometry_msgs.msg import Twist", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.2821, 0.0256, 0, 0.66, 0.7778, 951, 0, 1, 0, 0, 951, 0, 0], "semantic": {"name": "geometry_msgs.msg", "arg_names": [], "import_names": ["Twist"], "rhs_call_name": "", "annotation": ""}, "snippet": "from geometry_msgs.msg import Twist"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99620:FunctionDef_L13_C0", "label": "ft_cb", "type": "function", "loc": [13, 21], "level": 0, "parent": null, "vector": [2, 0, 0.4359, 0.2308, 0, 0.66, 0.8889, 156, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "ft_cb", "arg_names": ["data"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def ft_cb(data):\n lock.acquire()\n ft_val[0] = data.linear.x\n ft_val[1] = data.linear.y\n ft_val[2] = data.linear.z\n ft_val[3] = data.angular.x\n ft_val[4] = data.angular.y\n ft_val[5] = data.angular.z"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99620:Expr_L14_C4", "label": "acquire()", "type": "expression", "loc": [14, 14], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99620:FunctionDef_L13_C0", "vector": [8, 1, 0.359, 0.0256, 1, 0.4, 0.0, 229, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "acquire", "arg_names": [], "import_names": [], "rhs_call_name": "acquire", "annotation": ""}, "snippet": " lock.acquire()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99620:Assign_L15_C4", "label": "assign", "type": "assigned_variable", "loc": [15, 15], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99620:FunctionDef_L13_C0", "vector": [14, 1, 0.3846, 0.0256, 1, 0.4, 0.1429, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ft_val[0] = data.linear.x"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99620:Assign_L16_C4", "label": "assign", "type": "assigned_variable", "loc": [16, 16], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99620:FunctionDef_L13_C0", "vector": [14, 1, 0.4103, 0.0256, 1, 0.4, 0.2857, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ft_val[1] = data.linear.y"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99620:Assign_L17_C4", "label": "assign", "type": "assigned_variable", "loc": [17, 17], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99620:FunctionDef_L13_C0", "vector": [14, 1, 0.4359, 0.0256, 1, 0.4, 0.4286, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ft_val[2] = data.linear.z"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99620:Assign_L18_C4", "label": "assign", "type": "assigned_variable", "loc": [18, 18], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99620:FunctionDef_L13_C0", "vector": [14, 1, 0.4615, 0.0256, 1, 0.4, 0.5714, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ft_val[3] = data.angular.x"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99620:Assign_L19_C4", "label": "assign", "type": "assigned_variable", "loc": [19, 19], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99620:FunctionDef_L13_C0", "vector": [14, 1, 0.4872, 0.0256, 1, 0.4, 0.7143, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ft_val[4] = data.angular.y"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99620:Assign_L20_C4", "label": "assign", "type": "assigned_variable", "loc": [20, 20], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99620:FunctionDef_L13_C0", "vector": [14, 1, 0.5128, 0.0256, 1, 0.4, 0.8571, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ft_val[5] = data.angular.z"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99620:Expr_L21_C4", "label": "release()", "type": "expression", "loc": [21, 21], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99620:FunctionDef_L13_C0", "vector": [8, 1, 0.5385, 0.0256, 1, 0.4, 1.0, 784, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "release", "arg_names": [], "import_names": [], "rhs_call_name": "release", "annotation": ""}, "snippet": " lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99620:If_L23_C0", "label": "if", "type": "if", "loc": [23, 37], "level": 0, "parent": null, "vector": [4, 0, 0.7692, 0.3846, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 15], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n lock = RLock()\n ft_val = [0.] * 6\n pub = rospy.Subscriber('/r_cart/state/wrench', Twist, ft_cb)\n pub = rospy.Publisher('/force_torque_ft2_estimate', FloatArray)\n rospy.init_node('ati_ft_emulator')\n rospy.loginfo('Started the ATI FT emulator.')\n rt = rospy.Rate(100)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99620:Assign_L24_C4", "label": "lock = RLock()", "type": "assigned_variable", "loc": [24, 24], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99620:If_L23_C0", "vector": [14, 1, 0.6154, 0.0256, 1, 0.51, 0.0, 104, 3, 0, 0, 0, 207, 10, 1], "semantic": {"name": "lock", "arg_names": [], "import_names": [], "rhs_call_name": "RLock", "annotation": ""}, "snippet": " lock = RLock()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99620:Assign_L25_C4", "label": "ft_val =", "type": "assigned_variable", "loc": [25, 25], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99620:If_L23_C0", "vector": [14, 1, 0.641, 0.0256, 1, 0.51, 0.1429, 62, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ft_val", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ft_val = [0.] * 6"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99620:Assign_L26_C4", "label": "pub = Subscriber()", "type": "assigned_variable", "loc": [26, 26], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99620:If_L23_C0", "vector": [14, 1, 0.6667, 0.0256, 1, 0.51, 0.2857, 41, 3, 3, 0, 0, 455, 10, 1], "semantic": {"name": "pub", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " pub = rospy.Subscriber('/r_cart/state/wrench', Twist, ft_cb)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99620:Assign_L27_C4", "label": "pub = Publisher()", "type": "assigned_variable", "loc": [27, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99620:If_L23_C0", "vector": [14, 1, 0.6923, 0.0256, 1, 0.51, 0.4286, 41, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " pub = rospy.Publisher('/force_torque_ft2_estimate', FloatArray)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99620:Expr_L28_C4", "label": "init_node()", "type": "expression", "loc": [28, 28], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99620:If_L23_C0", "vector": [8, 1, 0.7179, 0.0256, 1, 0.51, 0.5714, 463, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "init_node", "arg_names": [], "import_names": [], "rhs_call_name": "init_node", "annotation": ""}, "snippet": " rospy.init_node('ati_ft_emulator')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99620:Expr_L29_C4", "label": "loginfo()", "type": "expression", "loc": [29, 29], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99620:If_L23_C0", "vector": [8, 1, 0.7436, 0.0256, 1, 0.51, 0.7143, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo('Started the ATI FT emulator.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99620:Assign_L30_C4", "label": "rt = Rate()", "type": "assigned_variable", "loc": [30, 30], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99620:If_L23_C0", "vector": [14, 1, 0.7692, 0.0256, 1, 0.51, 0.8571, 991, 3, 1, 0, 0, 543, 10, 1], "semantic": {"name": "rt", "arg_names": [], "import_names": [], "rhs_call_name": "Rate", "annotation": ""}, "snippet": " rt = rospy.Rate(100)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99620:While_L31_C4", "label": "while", "type": "while", "loc": [31, 37], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99620:If_L23_C0", "vector": [5, 1, 0.8718, 0.1795, 1, 0.51, 1.0, 0, 0, 0, 0, 0, 0, 0, 9], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while not rospy.is_shutdown():\n lock.acquire()\n send_ft_val = copy.copy(ft_val)\n lock.release()\n fa = FloatArray(rospy.Header(stamp=rospy.Time.now()), send_ft_val)\n pub.publish(fa)\n rt.sleep()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99620:Expr_L32_C8", "label": "acquire()", "type": "expression", "loc": [32, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99620:While_L31_C4", "vector": [8, 2, 0.8205, 0.0256, 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": " lock.acquire()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99620:Assign_L33_C8", "label": "send_ft_val = copy()", "type": "assigned_variable", "loc": [33, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99620:While_L31_C4", "vector": [14, 2, 0.8462, 0.0256, 2, 0.17, 0.2, 47, 3, 1, 0, 0, 739, 10, 1], "semantic": {"name": "send_ft_val", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " send_ft_val = copy.copy(ft_val)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99620:Expr_L34_C8", "label": "release()", "type": "expression", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99620:While_L31_C4", "vector": [8, 2, 0.8718, 0.0256, 2, 0.17, 0.4, 784, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "release", "arg_names": [], "import_names": [], "rhs_call_name": "release", "annotation": ""}, "snippet": " lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99620:Assign_L35_C8", "label": "fa = FloatArray()", "type": "assigned_variable", "loc": [35, 35], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99620:While_L31_C4", "vector": [14, 2, 0.8974, 0.0256, 2, 0.17, 0.6, 730, 3, 2, 0, 0, 755, 10, 3], "semantic": {"name": "fa", "arg_names": [], "import_names": [], "rhs_call_name": "FloatArray", "annotation": ""}, "snippet": " fa = FloatArray(rospy.Header(stamp=rospy.Time.now()), send_ft_val)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99620:Expr_L36_C8", "label": "publish()", "type": "expression", "loc": [36, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99620:While_L31_C4", "vector": [8, 2, 0.9231, 0.0256, 2, 0.17, 0.8, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " pub.publish(fa)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99620:Expr_L37_C8", "label": "sleep()", "type": "expression", "loc": [37, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99620:While_L31_C4", "vector": [8, 2, 0.9487, 0.0256, 2, 0.17, 1.0, 476, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " rt.sleep()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99620:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99620:Expr_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99620:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99620:Assign_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99620:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99620:Assign_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99620:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99620:Assign_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99620:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99620:Assign_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99620:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99620:Assign_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99620:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99620:Assign_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99620:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99620:Expr_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99620:If_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99620:Assign_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99620:If_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99620:Assign_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99620:If_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99620:Assign_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99620:If_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99620:Assign_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99620:If_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99620:Expr_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99620:If_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99620:Expr_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99620:If_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99620:Assign_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99620:If_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99620:While_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99620:While_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99620:Expr_L32_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99620:While_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99620:Assign_L33_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99620:While_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99620:Expr_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99620:While_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99620:Assign_L35_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99620:While_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99620:Expr_L36_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99620:While_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99620:Expr_L37_C8"}]
import roslib roslib.load_manifest('rospy') roslib.load_manifest('visualization_msgs') import rospy from visualization_msgs.msg import Marker import numpy as np class SceneDraw: def __init__(self, topic='contact_visualization', node='contact_sim', frame='/world_frame'): self.pub = rospy.Publisher(topic+'_marker', Marker) self.frame = frame self.Marker = Marker def pub_body(self, pos, quat, scale, color, num, shape, text = ''): marker = Marker() marker.header.frame_id = self.frame marker.header.stamp = rospy.Time.now() marker.ns = "basic_shapes" marker.id = num marker.type = shape marker.action = Marker.ADD marker.pose.position.x = pos[0] marker.pose.position.y = pos[1] marker.pose.position.z = pos[2] 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.scale.x = scale[0] marker.scale.y = scale[1] marker.scale.z = scale[2] marker.color.r = color[0] marker.color.g = color[1] marker.color.b = color[2] marker.color.a = color[3] marker.lifetime = rospy.Duration() marker.text = text self.pub.publish(marker) def get_rot_mat(self, rot): # rot_mat = np.matrix([[rot[0], rot[3], rot[6]],[rot[1], rot[4], rot[7]], [rot[2], rot[5], rot[8]]]) rot_mat = np.matrix([[rot[0], rot[4], rot[8]],[rot[1], rot[5], rot[9]], [rot[2], rot[6], rot[10]]]) return rot_mat
ajibawa-2023/Python-Code-Large/train/row_99623
39
50
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99623:Import_L1_C0", "label": "roslib import roslib", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.02, 0.02, 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_99623:Expr_L2_C0", "label": "load_manifest()", "type": "expression", "loc": [2, 2], "level": 0, "parent": null, "vector": [8, 0, 0.04, 0.02, 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('rospy')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99623:Expr_L3_C0", "label": "load_manifest()", "type": "expression", "loc": [3, 3], "level": 0, "parent": null, "vector": [8, 0, 0.06, 0.02, 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('visualization_msgs')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99623:Import_L4_C0", "label": "rospy import rospy", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.08, 0.02, 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_99623:ImportFrom_L5_C0", "label": "from visualization_msgs.msg import Marker", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.1, 0.02, 0, 0.66, 0.6667, 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_99623:Import_L6_C0", "label": "numpy import np", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.12, 0.02, 0, 0.66, 0.8333, 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_99623:ClassDef_L8_C0", "label": "SceneDraw", "type": "class", "loc": [8, 46], "level": 0, "parent": null, "vector": [3, 0, 0.54, 0.78, 0, 0.66, 1.0, 319, 0, 3, 0, 0, 0, 0, 6], "semantic": {"name": "SceneDraw", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class SceneDraw:\n def __init__(self, topic='contact_visualization', node='contact_sim', frame='/world_frame'):\n self.pub = rospy.Publisher(topic+'_marker', Marker)\n self.frame = frame\n self.Marker = Marker\n\n def pub_body(self, pos, quat, scale, color, num, shape, text = ''):\n marker = Marker()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99623:FunctionDef_L9_C4", "label": "__init__", "type": "function", "loc": [9, 12], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99623:ClassDef_L8_C0", "vector": [2, 1, 0.21, 0.08, 1, 0.83, 0.0, 555, 0, 4, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "topic", "node", "frame"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, topic='contact_visualization', node='contact_sim', frame='/world_frame'):\n self.pub = rospy.Publisher(topic+'_marker', Marker)\n self.frame = frame\n self.Marker = Marker"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99623:Assign_L10_C8", "label": "self.pub = Publisher()", "type": "assigned_variable", "loc": [10, 10], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99623:FunctionDef_L9_C4", "vector": [14, 2, 0.2, 0.02, 2, 0.17, 0.0, 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+'_marker', Marker)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99623:Assign_L11_C8", "label": "self.frame =", "type": "assigned_variable", "loc": [11, 11], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99623:FunctionDef_L9_C4", "vector": [14, 2, 0.22, 0.02, 2, 0.17, 0.5, 409, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.frame", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.frame = frame"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99623:Assign_L12_C8", "label": "self.Marker =", "type": "assigned_variable", "loc": [12, 12], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99623:FunctionDef_L9_C4", "vector": [14, 2, 0.24, 0.02, 2, 0.17, 1.0, 172, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.Marker", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.Marker = Marker"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99623:FunctionDef_L14_C4", "label": "pub_body", "type": "function", "loc": [14, 41], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99623:ClassDef_L8_C0", "vector": [2, 1, 0.55, 0.56, 1, 0.83, 0.5, 841, 0, 8, 0, 0, 0, 0, 4], "semantic": {"name": "pub_body", "arg_names": ["self", "pos", "quat", "scale", "color", "num", "shape", "text"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def pub_body(self, pos, quat, scale, color, num, shape, text = ''):\n marker = Marker()\n marker.header.frame_id = self.frame\n marker.header.stamp = rospy.Time.now()\n\n marker.ns = \"basic_shapes\"\n marker.id = num\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99623:Assign_L15_C8", "label": "marker = Marker()", "type": "assigned_variable", "loc": [15, 15], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99623:FunctionDef_L14_C4", "vector": [14, 2, 0.3, 0.02, 2, 0.16, 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_99623:Assign_L16_C8", "label": "marker.header.frame_id =", "type": "assigned_variable", "loc": [16, 16], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99623:FunctionDef_L14_C4", "vector": [14, 2, 0.32, 0.02, 2, 0.16, 0.0435, 22, 7, 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 = self.frame"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99623:Assign_L17_C8", "label": "marker.header.stamp = now()", "type": "assigned_variable", "loc": [17, 17], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99623:FunctionDef_L14_C4", "vector": [14, 2, 0.34, 0.02, 2, 0.16, 0.087, 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_99623:Assign_L19_C8", "label": "marker.ns =", "type": "assigned_variable", "loc": [19, 19], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99623:FunctionDef_L14_C4", "vector": [14, 2, 0.38, 0.02, 2, 0.16, 0.1304, 748, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "marker.ns", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.ns = \"basic_shapes\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99623:Assign_L20_C8", "label": "marker.id =", "type": "assigned_variable", "loc": [20, 20], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99623:FunctionDef_L14_C4", "vector": [14, 2, 0.4, 0.02, 2, 0.16, 0.1739, 570, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "marker.id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.id = num"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99623:Assign_L22_C8", "label": "marker.type =", "type": "assigned_variable", "loc": [22, 22], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99623:FunctionDef_L14_C4", "vector": [14, 2, 0.44, 0.02, 2, 0.16, 0.2174, 726, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "marker.type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.type = shape"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99623:Assign_L23_C8", "label": "marker.action =", "type": "assigned_variable", "loc": [23, 23], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99623:FunctionDef_L14_C4", "vector": [14, 2, 0.46, 0.02, 2, 0.16, 0.2609, 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_99623:Assign_L25_C8", "label": "marker.pose.position.x =", "type": "assigned_variable", "loc": [25, 25], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99623:FunctionDef_L14_C4", "vector": [14, 2, 0.5, 0.02, 2, 0.16, 0.3043, 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 = pos[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99623:Assign_L26_C8", "label": "marker.pose.position.y =", "type": "assigned_variable", "loc": [26, 26], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99623:FunctionDef_L14_C4", "vector": [14, 2, 0.52, 0.02, 2, 0.16, 0.3478, 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 = pos[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99623:Assign_L27_C8", "label": "marker.pose.position.z =", "type": "assigned_variable", "loc": [27, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99623:FunctionDef_L14_C4", "vector": [14, 2, 0.54, 0.02, 2, 0.16, 0.3913, 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 = pos[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99623:Assign_L28_C8", "label": "marker.pose.orientation.x =", "type": "assigned_variable", "loc": [28, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99623:FunctionDef_L14_C4", "vector": [14, 2, 0.56, 0.02, 2, 0.16, 0.4348, 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_99623:Assign_L29_C8", "label": "marker.pose.orientation.y =", "type": "assigned_variable", "loc": [29, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99623:FunctionDef_L14_C4", "vector": [14, 2, 0.58, 0.02, 2, 0.16, 0.4783, 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_99623:Assign_L30_C8", "label": "marker.pose.orientation.z =", "type": "assigned_variable", "loc": [30, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99623:FunctionDef_L14_C4", "vector": [14, 2, 0.6, 0.02, 2, 0.16, 0.5217, 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_99623:Assign_L31_C8", "label": "marker.pose.orientation.w =", "type": "assigned_variable", "loc": [31, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99623:FunctionDef_L14_C4", "vector": [14, 2, 0.62, 0.02, 2, 0.16, 0.5652, 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_99623:Assign_L32_C8", "label": "marker.scale.x =", "type": "assigned_variable", "loc": [32, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99623:FunctionDef_L14_C4", "vector": [14, 2, 0.64, 0.02, 2, 0.16, 0.6087, 887, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "marker.scale.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.scale.x = scale[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99623:Assign_L33_C8", "label": "marker.scale.y =", "type": "assigned_variable", "loc": [33, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99623:FunctionDef_L14_C4", "vector": [14, 2, 0.66, 0.02, 2, 0.16, 0.6522, 730, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "marker.scale.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.scale.y = scale[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99623:Assign_L34_C8", "label": "marker.scale.z =", "type": "assigned_variable", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99623:FunctionDef_L14_C4", "vector": [14, 2, 0.68, 0.02, 2, 0.16, 0.6957, 969, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "marker.scale.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.scale.z = scale[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99623:Assign_L35_C8", "label": "marker.color.r =", "type": "assigned_variable", "loc": [35, 35], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99623:FunctionDef_L14_C4", "vector": [14, 2, 0.7, 0.02, 2, 0.16, 0.7391, 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_99623:Assign_L36_C8", "label": "marker.color.g =", "type": "assigned_variable", "loc": [36, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99623:FunctionDef_L14_C4", "vector": [14, 2, 0.72, 0.02, 2, 0.16, 0.7826, 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_99623:Assign_L37_C8", "label": "marker.color.b =", "type": "assigned_variable", "loc": [37, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99623:FunctionDef_L14_C4", "vector": [14, 2, 0.74, 0.02, 2, 0.16, 0.8261, 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_99623:Assign_L38_C8", "label": "marker.color.a =", "type": "assigned_variable", "loc": [38, 38], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99623:FunctionDef_L14_C4", "vector": [14, 2, 0.76, 0.02, 2, 0.16, 0.8696, 240, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "marker.color.a", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.color.a = color[3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99623:Assign_L39_C8", "label": "marker.lifetime = Duration()", "type": "assigned_variable", "loc": [39, 39], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99623:FunctionDef_L14_C4", "vector": [14, 2, 0.78, 0.02, 2, 0.16, 0.913, 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_99623:Assign_L40_C8", "label": "marker.text =", "type": "assigned_variable", "loc": [40, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99623:FunctionDef_L14_C4", "vector": [14, 2, 0.8, 0.02, 2, 0.16, 0.9565, 274, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "marker.text", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.text = text"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99623:Expr_L41_C8", "label": "publish()", "type": "expression", "loc": [41, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99623:FunctionDef_L14_C4", "vector": [8, 2, 0.82, 0.02, 2, 0.16, 1.0, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.pub.publish(marker)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99623:FunctionDef_L43_C4", "label": "get_rot_mat", "type": "function", "loc": [43, 46], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99623:ClassDef_L8_C0", "vector": [2, 1, 0.89, 0.08, 1, 0.83, 1.0, 391, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "get_rot_mat", "arg_names": ["self", "rot"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_rot_mat(self, rot):\n# rot_mat = np.matrix([[rot[0], rot[3], rot[6]],[rot[1], rot[4], rot[7]], [rot[2], rot[5], rot[8]]])\n rot_mat = np.matrix([[rot[0], rot[4], rot[8]],[rot[1], rot[5], rot[9]], [rot[2], rot[6], rot[10]]])\n return rot_mat"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99623:Assign_L45_C8", "label": "rot_mat = matrix()", "type": "assigned_variable", "loc": [45, 45], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99623:FunctionDef_L43_C4", "vector": [14, 2, 0.9, 0.02, 2, 0.14, 0.0, 968, 3, 1, 0, 0, 162, 10, 1], "semantic": {"name": "rot_mat", "arg_names": [], "import_names": [], "rhs_call_name": "matrix", "annotation": ""}, "snippet": " rot_mat = np.matrix([[rot[0], rot[4], rot[8]],[rot[1], rot[5], rot[9]], [rot[2], rot[6], rot[10]]])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99623:Return_L46_C8", "label": "return", "type": "return", "loc": [46, 46], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99623:FunctionDef_L43_C4", "vector": [13, 2, 0.92, 0.02, 2, 0.14, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return rot_mat"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99623:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99623:FunctionDef_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99623:FunctionDef_L9_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99623:Assign_L10_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99623:FunctionDef_L9_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99623:Assign_L11_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99623:FunctionDef_L9_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99623:Assign_L12_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99623:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99623:FunctionDef_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99623:FunctionDef_L14_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99623:Assign_L15_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99623:FunctionDef_L14_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99623:Assign_L16_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99623:FunctionDef_L14_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99623:Assign_L17_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99623:FunctionDef_L14_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99623:Assign_L19_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99623:FunctionDef_L14_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99623:Assign_L20_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99623:FunctionDef_L14_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99623:Assign_L22_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99623:FunctionDef_L14_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99623:Assign_L23_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99623:FunctionDef_L14_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99623:Assign_L25_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99623:FunctionDef_L14_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99623:Assign_L26_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99623:FunctionDef_L14_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99623:Assign_L27_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99623:FunctionDef_L14_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99623:Assign_L28_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99623:FunctionDef_L14_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99623:Assign_L29_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99623:FunctionDef_L14_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99623:Assign_L30_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99623:FunctionDef_L14_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99623:Assign_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99623:FunctionDef_L14_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99623:Assign_L32_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99623:FunctionDef_L14_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99623:Assign_L33_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99623:FunctionDef_L14_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99623:Assign_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99623:FunctionDef_L14_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99623:Assign_L35_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99623:FunctionDef_L14_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99623:Assign_L36_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99623:FunctionDef_L14_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99623:Assign_L37_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99623:FunctionDef_L14_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99623:Assign_L38_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99623:FunctionDef_L14_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99623:Assign_L39_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99623:FunctionDef_L14_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99623:Assign_L40_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99623:FunctionDef_L14_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99623:Expr_L41_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99623:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99623:FunctionDef_L43_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99623:FunctionDef_L43_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99623:Assign_L45_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99623:FunctionDef_L43_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99623:Return_L46_C8"}]
#!/usr/bin/env python # # Copyright (c) 2009, Georgia Tech Research Corporation # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # * Neither the name of the Georgia Tech Research Corporation nor the # names of its contributors may be used to endorse or promote products # derived from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY GEORGIA TECH RESEARCH CORPORATION ''AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL GEORGIA TECH BE LIABLE FOR ANY DIRECT, INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # #Author: Marc Killpack import roslib; roslib.load_manifest('pr2_playpen') import rospy from pr2_playpen.srv import * from robotis.lib_robotis import * class Play: def __init__(self): dyn = USB2Dynamixel_Device('/dev/ttyUSB0') self.playpen = Robotis_Servo(dyn, 31) self.conveyor = Robotis_Servo(dyn,32) self.conveyor.init_cont_turn() rospy.init_node('playpen_server') s_play = rospy.Service('playpen', Playpen, self.move_playpen) s_conv = rospy.Service('conveyor', Conveyor, self.move_conveyor) rospy.spin() def move_conveyor(self, data): delt_time = abs(data.distance)/2.39/0.685/0.0483*2/0.75 if data.distance > 0: self.conveyor.set_angvel(-5) else: self.conveyor.set_angvel(5) rospy.sleep(delt_time) self.conveyor.set_angvel(0) print "move conveyor" return ConveyorResponse(1) def move_playpen(self, data): if data.command == 0: self.playpen.move_angle(0.28) print "closing playpen" elif data.command == 1: self.playpen.move_angle(1.90) print "opening playpen...releasing object" return PlaypenResponse(1) if __name__== "__main__": go = Play()
ajibawa-2023/Python-Code-Large/train/row_99624
34
72
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99624:Import_L32_C0", "label": "roslib import roslib", "type": "import", "loc": [32, 32], "level": 0, "parent": null, "vector": [1, 0, 0.4444, 0.0139, 0, 0.66, 0.0, 796, 0, 1, 0, 0, 796, 0, 0], "semantic": {"name": "roslib", "arg_names": [], "import_names": ["roslib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('pr2_playpen')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99624:Expr_L32_C15", "label": "load_manifest()", "type": "expression", "loc": [32, 32], "level": 0, "parent": null, "vector": [8, 0, 0.4444, 0.0139, 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('pr2_playpen')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99624:Import_L33_C0", "label": "rospy import rospy", "type": "import", "loc": [33, 33], "level": 0, "parent": null, "vector": [1, 0, 0.4583, 0.0139, 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_99624:ImportFrom_L34_C0", "label": "from pr2_playpen.srv import *", "type": "import", "loc": [34, 34], "level": 0, "parent": null, "vector": [1, 0, 0.4722, 0.0139, 0, 0.66, 0.5, 216, 0, 1, 0, 0, 216, 0, 0], "semantic": {"name": "pr2_playpen.srv", "arg_names": [], "import_names": ["*"], "rhs_call_name": "", "annotation": ""}, "snippet": "from pr2_playpen.srv import *"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99624:ImportFrom_L35_C0", "label": "from robotis.lib_robotis import *", "type": "import", "loc": [35, 35], "level": 0, "parent": null, "vector": [1, 0, 0.4861, 0.0139, 0, 0.66, 0.6667, 324, 0, 1, 0, 0, 324, 0, 0], "semantic": {"name": "robotis.lib_robotis", "arg_names": [], "import_names": ["*"], "rhs_call_name": "", "annotation": ""}, "snippet": "from robotis.lib_robotis import *"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99624:ClassDef_L38_C0", "label": "Play", "type": "class", "loc": [38, 68], "level": 0, "parent": null, "vector": [3, 0, 0.7361, 0.4306, 0, 0.66, 0.8333, 185, 0, 3, 0, 0, 0, 0, 20], "semantic": {"name": "Play", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Play:\n\n def __init__(self):\n dyn = USB2Dynamixel_Device('/dev/ttyUSB0')\n self.playpen = Robotis_Servo(dyn, 31)\n self.conveyor = Robotis_Servo(dyn,32)\n self.conveyor.init_cont_turn()\n rospy.init_node('playpen_server')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99624:FunctionDef_L40_C4", "label": "__init__", "type": "function", "loc": [40, 48], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99624:ClassDef_L38_C0", "vector": [2, 1, 0.6111, 0.125, 1, 0.68, 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 dyn = USB2Dynamixel_Device('/dev/ttyUSB0')\n self.playpen = Robotis_Servo(dyn, 31)\n self.conveyor = Robotis_Servo(dyn,32)\n self.conveyor.init_cont_turn()\n rospy.init_node('playpen_server')\n s_play = rospy.Service('playpen', Playpen, self.move_playpen)\n s_conv = rospy.Service('conveyor', Conveyor, self.move_conveyor) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99624:Assign_L41_C8", "label": "dyn = USB2Dynamixel_Device()", "type": "assigned_variable", "loc": [41, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99624:FunctionDef_L40_C4", "vector": [14, 2, 0.5694, 0.0139, 2, 0.09, 0.0, 350, 3, 1, 0, 0, 935, 10, 1], "semantic": {"name": "dyn", "arg_names": [], "import_names": [], "rhs_call_name": "USB2Dynamixel_Device", "annotation": ""}, "snippet": " dyn = USB2Dynamixel_Device('/dev/ttyUSB0')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99624:Assign_L42_C8", "label": "self.playpen = Robotis_Servo()", "type": "assigned_variable", "loc": [42, 42], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99624:FunctionDef_L40_C4", "vector": [14, 2, 0.5833, 0.0139, 2, 0.09, 0.1429, 293, 3, 2, 0, 0, 124, 10, 1], "semantic": {"name": "self.playpen", "arg_names": [], "import_names": [], "rhs_call_name": "Robotis_Servo", "annotation": ""}, "snippet": " self.playpen = Robotis_Servo(dyn, 31)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99624:Assign_L43_C8", "label": "self.conveyor = Robotis_Servo()", "type": "assigned_variable", "loc": [43, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99624:FunctionDef_L40_C4", "vector": [14, 2, 0.5972, 0.0139, 2, 0.09, 0.2857, 17, 3, 2, 0, 0, 124, 10, 1], "semantic": {"name": "self.conveyor", "arg_names": [], "import_names": [], "rhs_call_name": "Robotis_Servo", "annotation": ""}, "snippet": " self.conveyor = Robotis_Servo(dyn,32)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99624:Expr_L44_C8", "label": "init_cont_turn()", "type": "expression", "loc": [44, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99624:FunctionDef_L40_C4", "vector": [8, 2, 0.6111, 0.0139, 2, 0.09, 0.4286, 468, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "init_cont_turn", "arg_names": [], "import_names": [], "rhs_call_name": "init_cont_turn", "annotation": ""}, "snippet": " self.conveyor.init_cont_turn()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99624:Expr_L45_C8", "label": "init_node()", "type": "expression", "loc": [45, 45], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99624:FunctionDef_L40_C4", "vector": [8, 2, 0.625, 0.0139, 2, 0.09, 0.5714, 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('playpen_server')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99624:Assign_L46_C8", "label": "s_play = Service()", "type": "assigned_variable", "loc": [46, 46], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99624:FunctionDef_L40_C4", "vector": [14, 2, 0.6389, 0.0139, 2, 0.09, 0.7143, 686, 3, 3, 0, 0, 451, 10, 1], "semantic": {"name": "s_play", "arg_names": [], "import_names": [], "rhs_call_name": "Service", "annotation": ""}, "snippet": " s_play = rospy.Service('playpen', Playpen, self.move_playpen)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99624:Assign_L47_C8", "label": "s_conv = Service()", "type": "assigned_variable", "loc": [47, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99624:FunctionDef_L40_C4", "vector": [14, 2, 0.6528, 0.0139, 2, 0.09, 0.8571, 745, 3, 3, 0, 0, 451, 10, 1], "semantic": {"name": "s_conv", "arg_names": [], "import_names": [], "rhs_call_name": "Service", "annotation": ""}, "snippet": " s_conv = rospy.Service('conveyor', Conveyor, self.move_conveyor) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99624:Expr_L48_C8", "label": "spin()", "type": "expression", "loc": [48, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99624:FunctionDef_L40_C4", "vector": [8, 2, 0.6667, 0.0139, 2, 0.09, 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_99624:FunctionDef_L50_C4", "label": "move_conveyor", "type": "function", "loc": [50, 59], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99624:ClassDef_L38_C0", "vector": [2, 1, 0.7569, 0.1389, 1, 0.68, 0.5, 464, 0, 2, 1, 0, 0, 0, 7], "semantic": {"name": "move_conveyor", "arg_names": ["self", "data"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def move_conveyor(self, data):\n delt_time = abs(data.distance)/2.39/0.685/0.0483*2/0.75\n if data.distance > 0:\n self.conveyor.set_angvel(-5)\n else:\n self.conveyor.set_angvel(5)\n rospy.sleep(delt_time)\n self.conveyor.set_angvel(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99624:Assign_L51_C8", "label": "delt_time =", "type": "assigned_variable", "loc": [51, 51], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99624:FunctionDef_L50_C4", "vector": [14, 2, 0.7083, 0.0139, 2, 0.14, 0.0, 796, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "delt_time", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " delt_time = abs(data.distance)/2.39/0.685/0.0483*2/0.75"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99624:If_L52_C8", "label": "if", "type": "if", "loc": [52, 55], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99624:FunctionDef_L50_C4", "vector": [4, 2, 0.7431, 0.0556, 2, 0.14, 0.2, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if data.distance > 0:\n self.conveyor.set_angvel(-5)\n else:\n self.conveyor.set_angvel(5)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99624:Expr_L53_C12", "label": "set_angvel()", "type": "expression", "loc": [53, 53], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99624:If_L52_C8", "vector": [8, 3, 0.7361, 0.0139, 3, 0.18, 0.0, 626, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_angvel", "arg_names": [], "import_names": [], "rhs_call_name": "set_angvel", "annotation": ""}, "snippet": " self.conveyor.set_angvel(-5)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99624:Expr_L55_C12", "label": "set_angvel()", "type": "expression", "loc": [55, 55], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99624:If_L52_C8", "vector": [8, 3, 0.7639, 0.0139, 3, 0.18, 1.0, 626, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_angvel", "arg_names": [], "import_names": [], "rhs_call_name": "set_angvel", "annotation": ""}, "snippet": " self.conveyor.set_angvel(5)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99624:Expr_L56_C8", "label": "sleep()", "type": "expression", "loc": [56, 56], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99624:FunctionDef_L50_C4", "vector": [8, 2, 0.7778, 0.0139, 2, 0.14, 0.4, 476, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " rospy.sleep(delt_time)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99624:Expr_L57_C8", "label": "set_angvel()", "type": "expression", "loc": [57, 57], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99624:FunctionDef_L50_C4", "vector": [8, 2, 0.7917, 0.0139, 2, 0.14, 0.6, 626, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_angvel", "arg_names": [], "import_names": [], "rhs_call_name": "set_angvel", "annotation": ""}, "snippet": " self.conveyor.set_angvel(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99624:Expr_L58_C8", "label": "print()", "type": "expression", "loc": [58, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99624:FunctionDef_L50_C4", "vector": [8, 2, 0.8056, 0.0139, 2, 0.14, 0.8, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"move conveyor\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99624:Return_L59_C8", "label": "return", "type": "return", "loc": [59, 59], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99624:FunctionDef_L50_C4", "vector": [13, 2, 0.8194, 0.0139, 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 ConveyorResponse(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99624:FunctionDef_L61_C4", "label": "move_playpen", "type": "function", "loc": [61, 68], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99624:ClassDef_L38_C0", "vector": [2, 1, 0.8958, 0.1111, 1, 0.68, 1.0, 149, 0, 2, 1, 0, 0, 0, 5], "semantic": {"name": "move_playpen", "arg_names": ["self", "data"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def move_playpen(self, data):\n if data.command == 0:\n self.playpen.move_angle(0.28)\n print(\"closing playpen\")\n elif data.command == 1:\n self.playpen.move_angle(1.90)\n print(\"opening playpen...releasing object\")\n return PlaypenResponse(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99624:If_L62_C8", "label": "if", "type": "if", "loc": [62, 67], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99624:FunctionDef_L61_C4", "vector": [4, 2, 0.8958, 0.0833, 2, 0.6, 0.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if data.command == 0:\n self.playpen.move_angle(0.28)\n print(\"closing playpen\")\n elif data.command == 1:\n self.playpen.move_angle(1.90)\n print(\"opening playpen...releasing object\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99624:Expr_L63_C12", "label": "move_angle()", "type": "expression", "loc": [63, 63], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99624:If_L62_C8", "vector": [8, 3, 0.875, 0.0139, 3, 0.03, 0.0, 293, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "move_angle", "arg_names": [], "import_names": [], "rhs_call_name": "move_angle", "annotation": ""}, "snippet": " self.playpen.move_angle(0.28)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99624:Expr_L64_C12", "label": "print()", "type": "expression", "loc": [64, 64], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99624:If_L62_C8", "vector": [8, 3, 0.8889, 0.0139, 3, 0.03, 0.5, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"closing playpen\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99624:If_L65_C8", "label": "if", "type": "if", "loc": [65, 67], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99624:If_L62_C8", "vector": [4, 3, 0.9167, 0.0417, 3, 0.03, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif data.command == 1:\n self.playpen.move_angle(1.90)\n print(\"opening playpen...releasing object\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99624:Expr_L66_C12", "label": "move_angle()", "type": "expression", "loc": [66, 66], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99624:If_L65_C8", "vector": [8, 4, 0.9167, 0.0139, 4, 0.67, 0.0, 293, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "move_angle", "arg_names": [], "import_names": [], "rhs_call_name": "move_angle", "annotation": ""}, "snippet": " self.playpen.move_angle(1.90)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99624:Expr_L67_C12", "label": "print()", "type": "expression", "loc": [67, 67], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99624:If_L65_C8", "vector": [8, 4, 0.9306, 0.0139, 4, 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(\"opening playpen...releasing object\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99624:Return_L68_C8", "label": "return", "type": "return", "loc": [68, 68], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99624:FunctionDef_L61_C4", "vector": [13, 2, 0.9444, 0.0139, 2, 0.6, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return PlaypenResponse(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99624:If_L71_C0", "label": "if", "type": "if", "loc": [71, 72], "level": 0, "parent": null, "vector": [4, 0, 0.9931, 0.0278, 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 go = Play()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99624:Assign_L72_C4", "label": "go = Play()", "type": "assigned_variable", "loc": [72, 72], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99624:If_L71_C0", "vector": [14, 1, 1.0, 0.0139, 1, 0.15, 0.0, 917, 3, 0, 0, 0, 185, 10, 1], "semantic": {"name": "go", "arg_names": [], "import_names": [], "rhs_call_name": "Play", "annotation": ""}, "snippet": " go = Play()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99624:ClassDef_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99624:FunctionDef_L40_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99624:FunctionDef_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99624:Assign_L41_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99624:FunctionDef_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99624:Assign_L42_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99624:FunctionDef_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99624:Assign_L43_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99624:FunctionDef_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99624:Expr_L44_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99624:FunctionDef_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99624:Expr_L45_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99624:FunctionDef_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99624:Assign_L46_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99624:FunctionDef_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99624:Assign_L47_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99624:FunctionDef_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99624:Expr_L48_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99624:ClassDef_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99624:FunctionDef_L50_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99624:FunctionDef_L50_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99624:Assign_L51_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99624:FunctionDef_L50_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99624:If_L52_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99624:If_L52_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99624:Expr_L53_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99624:If_L52_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99624:Expr_L55_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99624:FunctionDef_L50_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99624:Expr_L56_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99624:FunctionDef_L50_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99624:Expr_L57_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99624:FunctionDef_L50_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99624:Expr_L58_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99624:FunctionDef_L50_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99624:Return_L59_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99624:ClassDef_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99624:FunctionDef_L61_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99624:FunctionDef_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99624:If_L62_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99624:If_L62_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99624:Expr_L63_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99624:If_L62_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99624:Expr_L64_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99624:If_L62_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99624:If_L65_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99624:If_L65_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99624:Expr_L66_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99624:If_L65_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99624:Expr_L67_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99624:FunctionDef_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99624:Return_L68_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99624:If_L71_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99624:Assign_L72_C4"}]
#!/usr/bin/env python # # Copyright (c) 2009, Georgia Tech Research Corporation # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # * Neither the name of the Georgia Tech Research Corporation nor the # names of its contributors may be used to endorse or promote products # derived from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY GEORGIA TECH RESEARCH CORPORATION ''AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL GEORGIA TECH BE LIABLE FOR ANY DIRECT, INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # #Author: Marc Killpack import os import roslib roslib.load_manifest('pr2_playpen') roslib.load_manifest('tf_conversions') import rospy import math import tf import sys import tf_conversions.posemath as pm import numpy as np from geometry_msgs.msg import Pose if __name__ == '__main__': rospy.init_node('playpen_calibration') listener = tf.TransformListener() trans_list = [] rot_list = [] rate = rospy.Rate(10.0) while not rospy.is_shutdown(): try: (trans, rot) = listener.lookupTransform(sys.argv[1], sys.argv[2], rospy.Time(0)) (trans2, rot2) = listener.lookupTransform(sys.argv[3], sys.argv[4], rospy.Time(0)) msg1 = Pose() msg2 = Pose() msg1.position.x, msg1.position.y, msg1.position.z = trans[0], trans[1], trans[2] msg2.position.x, msg2.position.y, msg2.position.z = trans2[0], trans2[1], trans2[2] msg1.orientation.x, msg1.orientation.y, msg1.orientation.z, msg1.orientation.w = rot[0], rot[1], rot[2], rot[3] msg2.orientation.x, msg2.orientation.y, msg2.orientation.z, msg2.orientation.w = rot2[0], rot2[1], rot2[2], rot2[3] (trans_tot, rot_tot) = pm.toTf(pm.fromMsg(msg1)*pm.fromMsg(msg2)) print "translation: ", trans_tot, ", rotation :", rot_tot trans_list.append(trans_tot) rot_list.append(rot_tot) except (tf.LookupException, tf.ConnectivityException): continue rate.sleep() trans_str = str(np.median(np.array(trans_list), axis = 0)) rot_str = str(np.median(np.array(rot_list), axis = 0)) print "median of translation :", trans_str print "median of rotation :", rot_str try: os.remove('../../launch/kinect_playpen_to_torso_lift_link.launch') except: print 'no file to be removed, creating new file' f = open('../../launch/kinect_playpen_to_torso_lift_link.launch', 'w') f.write('<launch>\n') ############################################ I really need to verify the order of sys.arg[4] and sys.arg[1], this could be wrong!!! best way to check ############################################ is to transform something from argv[4] frame to argv[1] frame and check f.write('<node pkg="tf" type="static_transform_publisher" name="kinect_playpen_to_pr2_lift_link" args=" '+trans_str[1:-1]+' '+rot_str[1:-1]+' '+sys.argv[1]+' '+sys.argv[4]+' 30" />\n') f.write('</launch>') f.close() #run this to calibrate playpen, I should include it in a launch file with arguments and launching pr2_launch/ar_kinect and launch/ar_kinect #./calibrate.py /torso_lift_link /calibration_pattern /calibration_pattern2 /openni_camera2
ajibawa-2023/Python-Code-Large/train/row_99625
44
87
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99625:Import_L31_C0", "label": "os import os", "type": "import", "loc": [31, 31], "level": 0, "parent": null, "vector": [1, 0, 0.3563, 0.0115, 0, 0.66, 0.0, 688, 0, 1, 0, 0, 688, 0, 0], "semantic": {"name": "os", "arg_names": [], "import_names": ["os"], "rhs_call_name": "", "annotation": ""}, "snippet": "import os"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99625:Import_L32_C0", "label": "roslib import roslib", "type": "import", "loc": [32, 32], "level": 0, "parent": null, "vector": [1, 0, 0.3678, 0.0115, 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"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99625:Expr_L33_C0", "label": "load_manifest()", "type": "expression", "loc": [33, 33], "level": 0, "parent": null, "vector": [8, 0, 0.3793, 0.0115, 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('pr2_playpen')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99625:Expr_L34_C0", "label": "load_manifest()", "type": "expression", "loc": [34, 34], "level": 0, "parent": null, "vector": [8, 0, 0.3908, 0.0115, 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('tf_conversions')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99625:Import_L35_C0", "label": "rospy import rospy", "type": "import", "loc": [35, 35], "level": 0, "parent": null, "vector": [1, 0, 0.4023, 0.0115, 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_99625:Import_L36_C0", "label": "math import math", "type": "import", "loc": [36, 36], "level": 0, "parent": null, "vector": [1, 0, 0.4138, 0.0115, 0, 0.66, 0.4545, 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_99625:Import_L37_C0", "label": "tf import tf", "type": "import", "loc": [37, 37], "level": 0, "parent": null, "vector": [1, 0, 0.4253, 0.0115, 0, 0.66, 0.5455, 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_99625:Import_L38_C0", "label": "sys import sys", "type": "import", "loc": [38, 38], "level": 0, "parent": null, "vector": [1, 0, 0.4368, 0.0115, 0, 0.66, 0.6364, 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_99625:Import_L39_C0", "label": "tf_conversions.posemath import pm", "type": "import", "loc": [39, 39], "level": 0, "parent": null, "vector": [1, 0, 0.4483, 0.0115, 0, 0.66, 0.7273, 923, 0, 1, 0, 0, 923, 0, 0], "semantic": {"name": "tf_conversions.posemath", "arg_names": [], "import_names": ["pm"], "rhs_call_name": "", "annotation": ""}, "snippet": "import tf_conversions.posemath as pm"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99625:Import_L40_C0", "label": "numpy import np", "type": "import", "loc": [40, 40], "level": 0, "parent": null, "vector": [1, 0, 0.4598, 0.0115, 0, 0.66, 0.8182, 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_99625:ImportFrom_L41_C0", "label": "from geometry_msgs.msg import Pose", "type": "import", "loc": [41, 41], "level": 0, "parent": null, "vector": [1, 0, 0.4713, 0.0115, 0, 0.66, 0.9091, 951, 0, 1, 0, 0, 951, 0, 0], "semantic": {"name": "geometry_msgs.msg", "arg_names": [], "import_names": ["Pose"], "rhs_call_name": "", "annotation": ""}, "snippet": "from geometry_msgs.msg import Pose"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99625:If_L43_C0", "label": "if", "type": "if", "loc": [43, 84], "level": 0, "parent": null, "vector": [4, 0, 0.7299, 0.4828, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 32], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n rospy.init_node('playpen_calibration')\n\n listener = tf.TransformListener()\n trans_list = []\n rot_list = []\n\n rate = rospy.Rate(10.0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99625:Expr_L44_C4", "label": "init_node()", "type": "expression", "loc": [44, 44], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99625:If_L43_C0", "vector": [8, 1, 0.5057, 0.0115, 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('playpen_calibration')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99625:Assign_L46_C4", "label": "listener = TransformListener()", "type": "assigned_variable", "loc": [46, 46], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99625:If_L43_C0", "vector": [14, 1, 0.5287, 0.0115, 1, 0.7, 0.0667, 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_99625:Assign_L47_C4", "label": "trans_list =", "type": "assigned_variable", "loc": [47, 47], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99625:If_L43_C0", "vector": [14, 1, 0.5402, 0.0115, 1, 0.7, 0.1333, 367, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "trans_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " trans_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99625:Assign_L48_C4", "label": "rot_list =", "type": "assigned_variable", "loc": [48, 48], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99625:If_L43_C0", "vector": [14, 1, 0.5517, 0.0115, 1, 0.7, 0.2, 352, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "rot_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rot_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99625:Assign_L50_C4", "label": "rate = Rate()", "type": "assigned_variable", "loc": [50, 50], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99625:If_L43_C0", "vector": [14, 1, 0.5747, 0.0115, 1, 0.7, 0.2667, 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_99625:While_L51_C4", "label": "while", "type": "while", "loc": [51, 68], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99625:If_L43_C0", "vector": [5, 1, 0.6839, 0.2069, 1, 0.7, 0.3333, 0, 0, 0, 0, 0, 0, 0, 14], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while not rospy.is_shutdown():\n try:\n (trans, rot) = listener.lookupTransform(sys.argv[1], sys.argv[2], rospy.Time(0))\n (trans2, rot2) = listener.lookupTransform(sys.argv[3], sys.argv[4], rospy.Time(0))\n msg1 = Pose()\n msg2 = Pose()\n msg1.position.x, msg1.position.y, msg1.position.z = trans[0], trans[1], trans[2]\n msg2.position.x, msg2.position.y, msg2.position.z = trans2[0], trans2[1], trans2[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99625:Try_L52_C8", "label": "try", "type": "try", "loc": [52, 67], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99625:While_L51_C4", "vector": [7, 2, 0.6839, 0.1839, 2, 0.54, 0.0, 0, 0, 1, 0, 0, 0, 0, 12], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n (trans, rot) = listener.lookupTransform(sys.argv[1], sys.argv[2], rospy.Time(0))\n (trans2, rot2) = listener.lookupTransform(sys.argv[3], sys.argv[4], rospy.Time(0))\n msg1 = Pose()\n msg2 = Pose()\n msg1.position.x, msg1.position.y, msg1.position.z = trans[0], trans[1], trans[2]\n msg2.position.x, msg2.position.y, msg2.position.z = trans2[0], trans2[1], trans2[2]\n msg1.orientation.x, msg1.orientation.y, msg1.orientation.z, msg1.orientation.w = rot[0], rot[1], rot[2], rot[3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99625:Assign_L53_C12", "label": "trans, rot = lookupTransform()", "type": "assigned_variable", "loc": [53, 53], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99625:Try_L52_C8", "vector": [14, 3, 0.6092, 0.0115, 3, 0.6, 0.0, 330, 3, 3, 0, 0, 926, 10, 2], "semantic": {"name": "trans, rot", "arg_names": [], "import_names": [], "rhs_call_name": "lookupTransform", "annotation": ""}, "snippet": " (trans, rot) = listener.lookupTransform(sys.argv[1], sys.argv[2], rospy.Time(0))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99625:Assign_L54_C12", "label": "trans2, rot2 = lookupTransform()", "type": "assigned_variable", "loc": [54, 54], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99625:Try_L52_C8", "vector": [14, 3, 0.6207, 0.0115, 3, 0.6, 0.0909, 912, 3, 3, 0, 0, 926, 10, 2], "semantic": {"name": "trans2, rot2", "arg_names": [], "import_names": [], "rhs_call_name": "lookupTransform", "annotation": ""}, "snippet": " (trans2, rot2) = listener.lookupTransform(sys.argv[3], sys.argv[4], rospy.Time(0))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99625:Assign_L55_C12", "label": "msg1 = Pose()", "type": "assigned_variable", "loc": [55, 55], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99625:Try_L52_C8", "vector": [14, 3, 0.6322, 0.0115, 3, 0.6, 0.1818, 775, 3, 0, 0, 0, 902, 10, 1], "semantic": {"name": "msg1", "arg_names": [], "import_names": [], "rhs_call_name": "Pose", "annotation": ""}, "snippet": " msg1 = Pose()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99625:Assign_L56_C12", "label": "msg2 = Pose()", "type": "assigned_variable", "loc": [56, 56], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99625:Try_L52_C8", "vector": [14, 3, 0.6437, 0.0115, 3, 0.6, 0.2727, 687, 3, 0, 0, 0, 902, 10, 1], "semantic": {"name": "msg2", "arg_names": [], "import_names": [], "rhs_call_name": "Pose", "annotation": ""}, "snippet": " msg2 = Pose()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99625:Assign_L57_C12", "label": "assign", "type": "assigned_variable", "loc": [57, 57], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99625:Try_L52_C8", "vector": [14, 3, 0.6552, 0.0115, 3, 0.6, 0.3636, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " msg1.position.x, msg1.position.y, msg1.position.z = trans[0], trans[1], trans[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99625:Assign_L58_C12", "label": "assign", "type": "assigned_variable", "loc": [58, 58], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99625:Try_L52_C8", "vector": [14, 3, 0.6667, 0.0115, 3, 0.6, 0.4545, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " msg2.position.x, msg2.position.y, msg2.position.z = trans2[0], trans2[1], trans2[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99625:Assign_L59_C12", "label": "assign", "type": "assigned_variable", "loc": [59, 59], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99625:Try_L52_C8", "vector": [14, 3, 0.6782, 0.0115, 3, 0.6, 0.5455, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " msg1.orientation.x, msg1.orientation.y, msg1.orientation.z, msg1.orientation.w = rot[0], rot[1], rot[2], rot[3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99625:Assign_L60_C12", "label": "assign", "type": "assigned_variable", "loc": [60, 60], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99625:Try_L52_C8", "vector": [14, 3, 0.6897, 0.0115, 3, 0.6, 0.6364, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " msg2.orientation.x, msg2.orientation.y, msg2.orientation.z, msg2.orientation.w = rot2[0], rot2[1], rot2[2], rot2[3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99625:Assign_L61_C12", "label": "trans_tot, rot_tot = toTf()", "type": "assigned_variable", "loc": [61, 61], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99625:Try_L52_C8", "vector": [14, 3, 0.7011, 0.0115, 3, 0.6, 0.7273, 953, 3, 1, 0, 0, 548, 10, 3], "semantic": {"name": "trans_tot, rot_tot", "arg_names": [], "import_names": [], "rhs_call_name": "toTf", "annotation": ""}, "snippet": " (trans_tot, rot_tot) = pm.toTf(pm.fromMsg(msg1)*pm.fromMsg(msg2))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99625:Expr_L62_C12", "label": "print()", "type": "expression", "loc": [62, 62], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99625:Try_L52_C8", "vector": [8, 3, 0.7126, 0.0115, 3, 0.6, 0.8182, 535, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"translation: \", trans_tot, \", rotation :\", rot_tot)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99625:Expr_L63_C12", "label": "append()", "type": "expression", "loc": [63, 63], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99625:Try_L52_C8", "vector": [8, 3, 0.7241, 0.0115, 3, 0.6, 0.9091, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " trans_list.append(trans_tot)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99625:Expr_L64_C12", "label": "append()", "type": "expression", "loc": [64, 64], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99625:Try_L52_C8", "vector": [8, 3, 0.7356, 0.0115, 3, 0.6, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " rot_list.append(rot_tot)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99625:Expr_L68_C8", "label": "sleep()", "type": "expression", "loc": [68, 68], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99625:While_L51_C4", "vector": [8, 2, 0.7816, 0.0115, 2, 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()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99625:Assign_L69_C4", "label": "trans_str = str()", "type": "assigned_variable", "loc": [69, 69], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99625:If_L43_C0", "vector": [14, 1, 0.7931, 0.0115, 1, 0.7, 0.4, 643, 3, 1, 0, 0, 52, 10, 3], "semantic": {"name": "trans_str", "arg_names": [], "import_names": [], "rhs_call_name": "str", "annotation": ""}, "snippet": " trans_str = str(np.median(np.array(trans_list), axis = 0))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99625:Assign_L70_C4", "label": "rot_str = str()", "type": "assigned_variable", "loc": [70, 70], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99625:If_L43_C0", "vector": [14, 1, 0.8046, 0.0115, 1, 0.7, 0.4667, 640, 3, 1, 0, 0, 52, 10, 3], "semantic": {"name": "rot_str", "arg_names": [], "import_names": [], "rhs_call_name": "str", "annotation": ""}, "snippet": " rot_str = str(np.median(np.array(rot_list), axis = 0))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99625:Expr_L71_C4", "label": "print()", "type": "expression", "loc": [71, 71], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99625:If_L43_C0", "vector": [8, 1, 0.8161, 0.0115, 1, 0.7, 0.5333, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"median of translation :\", trans_str)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99625:Expr_L72_C4", "label": "print()", "type": "expression", "loc": [72, 72], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99625:If_L43_C0", "vector": [8, 1, 0.8276, 0.0115, 1, 0.7, 0.6, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"median of rotation :\", rot_str)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99625:Try_L74_C4", "label": "try", "type": "try", "loc": [74, 77], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99625:If_L43_C0", "vector": [7, 1, 0.8678, 0.046, 1, 0.7, 0.6667, 0, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n os.remove('../../launch/kinect_playpen_to_torso_lift_link.launch')\n except:\n print('no file to be removed, creating new file')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99625:Expr_L75_C8", "label": "remove()", "type": "expression", "loc": [75, 75], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99625:Try_L74_C4", "vector": [8, 2, 0.8621, 0.0115, 2, 0.1, 0.0, 185, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "remove", "arg_names": [], "import_names": [], "rhs_call_name": "remove", "annotation": ""}, "snippet": " os.remove('../../launch/kinect_playpen_to_torso_lift_link.launch')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99625:Expr_L77_C8", "label": "print()", "type": "expression", "loc": [77, 77], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99625:Try_L74_C4", "vector": [8, 2, 0.8851, 0.0115, 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('no file to be removed, creating new file')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99625:Assign_L78_C4", "label": "f = open()", "type": "assigned_variable", "loc": [78, 78], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99625:If_L43_C0", "vector": [14, 1, 0.8966, 0.0115, 1, 0.7, 0.7333, 899, 3, 2, 0, 0, 693, 10, 1], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": " f = open('../../launch/kinect_playpen_to_torso_lift_link.launch', 'w')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99625:Expr_L79_C4", "label": "write()", "type": "expression", "loc": [79, 79], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99625:If_L43_C0", "vector": [8, 1, 0.908, 0.0115, 1, 0.7, 0.8, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " f.write('<launch>\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99625:Expr_L82_C4", "label": "write()", "type": "expression", "loc": [82, 82], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99625:If_L43_C0", "vector": [8, 1, 0.9425, 0.0115, 1, 0.7, 0.8667, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " f.write('<node pkg=\"tf\" type=\"static_transform_publisher\" name=\"kinect_playpen_to_pr2_lift_link\" args=\" '+trans_str[1:-1]+' '+rot_str[1:-1]+' '+sys.argv[1]+' '+sys.argv[4]+' 30\" />\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99625:Expr_L83_C4", "label": "write()", "type": "expression", "loc": [83, 83], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99625:If_L43_C0", "vector": [8, 1, 0.954, 0.0115, 1, 0.7, 0.9333, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " f.write('</launch>')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99625:Expr_L84_C4", "label": "close()", "type": "expression", "loc": [84, 84], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99625:If_L43_C0", "vector": [8, 1, 0.9655, 0.0115, 1, 0.7, 1.0, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": " f.close()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99625:If_L43_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99625:Expr_L44_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99625:If_L43_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99625:Assign_L46_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99625:If_L43_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99625:Assign_L47_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99625:If_L43_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99625:Assign_L48_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99625:If_L43_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99625:Assign_L50_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99625:If_L43_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99625:While_L51_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99625:While_L51_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99625:Try_L52_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99625:Try_L52_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99625:Assign_L53_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99625:Try_L52_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99625:Assign_L54_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99625:Try_L52_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99625:Assign_L55_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99625:Try_L52_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99625:Assign_L56_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99625:Try_L52_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99625:Assign_L57_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99625:Try_L52_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99625:Assign_L58_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99625:Try_L52_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99625:Assign_L59_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99625:Try_L52_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99625:Assign_L60_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99625:Try_L52_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99625:Assign_L61_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99625:Try_L52_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99625:Expr_L62_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99625:Try_L52_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99625:Expr_L63_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99625:Try_L52_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99625:Expr_L64_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99625:While_L51_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99625:Expr_L68_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99625:If_L43_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99625:Assign_L69_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99625:If_L43_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99625:Assign_L70_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99625:If_L43_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99625:Expr_L71_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99625:If_L43_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99625:Expr_L72_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99625:If_L43_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99625:Try_L74_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99625:Try_L74_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99625:Expr_L75_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99625:Try_L74_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99625:Expr_L77_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99625:If_L43_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99625:Assign_L78_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99625:If_L43_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99625:Expr_L79_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99625:If_L43_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99625:Expr_L82_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99625:If_L43_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99625:Expr_L83_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99625:If_L43_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99625:Expr_L84_C4"}]
#!/usr/bin/env python import roslib roslib.load_manifest('pr2_playpen') import rospy import hrl_pr2_lib.pressure_listener as pl import cPickle class PressureWriter: def __init__(self): rospy.init_node('pressure_writer') self.r_grip_press = pl.PressureListener(topic='/pressure/r_gripper_motor') self.l_grip_press = pl.PressureListener(topic='/pressure/l_gripper_motor') self.r_grip_data = [] self.l_grip_data = [] self.status = None def zero(self): self.r_grip_press.rezero() self.l_grip_press.rezero() def record_pressures(self, file_name, arm, time = 10:) file_handle = open(file_name, 'w') self.zero() start = rospy.get_time() #might be better to do some condition, like gripper not moving or when arm is moved to side #while rospy.get_time()-start < time: while not self.status == 'moving somewhere again': print "saving data now ..." self.r_grip_data.append(self.r_grip_press.get_pressure_readings()) self.l_grip_data.append(self.l_grip_press.get_pressure_readings()) rospy.sleep(0.05) cPickle.dump(data, file_handle) file_handle.close() def print_pressures(self): self.r_grip_press.rezero() right_tuple = self.r_grip_press.get_pressure_readings() # print "here's the right gripper :\n", right_tuple # print "here's the raw values : \n", self.r_grip_press.rmat_raw def status_callback(self, data): print "here is the status :", data # self.status = data.feedback.state self.status = data if __name__ == '__main__': pw = PressureWriter() rospy.Subscriber('OverheadServer/actionlib/feedback/feedback/state', String, pw.status_callback) while not rospy.is_shutdown(): if pw.status == 'closing gripper': pw.record_pressures('test_file', 0) rospy.sleep(0.02)
ajibawa-2023/Python-Code-Large/train/row_99627
39
54
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99627:Import_L2_C0", "label": "roslib import roslib", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.037, 0.0185, 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_99627:Expr_L3_C0", "label": "load_manifest()", "type": "expression", "loc": [3, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0556, 0.0185, 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_playpen')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99627:Import_L4_C0", "label": "rospy import rospy", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0741, 0.0185, 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_99627:Import_L5_C0", "label": "hrl_pr2_lib.pressure_listener import pl", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0926, 0.0185, 0, 0.66, 0.5, 654, 0, 1, 0, 0, 654, 0, 0], "semantic": {"name": "hrl_pr2_lib.pressure_listener", "arg_names": [], "import_names": ["pl"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_pr2_lib.pressure_listener as pl"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99627:Import_L6_C0", "label": "cPickle import cPickle", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.1111, 0.0185, 0, 0.66, 0.6667, 279, 0, 1, 0, 0, 279, 0, 0], "semantic": {"name": "cPickle", "arg_names": [], "import_names": ["cPickle"], "rhs_call_name": "", "annotation": ""}, "snippet": "import cPickle"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99627:ClassDef_L8_C0", "label": "PressureWriter", "type": "class", "loc": [8, 44], "level": 0, "parent": null, "vector": [3, 0, 0.4815, 0.6852, 0, 0.66, 0.8333, 908, 0, 4, 0, 0, 0, 0, 19], "semantic": {"name": "PressureWriter", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class PressureWriter:\n\n def __init__(self):\n rospy.init_node('pressure_writer')\n self.r_grip_press = pl.PressureListener(topic='/pressure/r_gripper_motor')\n self.l_grip_press = pl.PressureListener(topic='/pressure/l_gripper_motor')\n self.r_grip_data = []\n self.l_grip_data = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99627:FunctionDef_L10_C4", "label": "__init__", "type": "function", "loc": [10, 16], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99627:ClassDef_L8_C0", "vector": [2, 1, 0.2407, 0.1296, 1, 0.43, 0.0, 555, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "__init__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self):\n rospy.init_node('pressure_writer')\n self.r_grip_press = pl.PressureListener(topic='/pressure/r_gripper_motor')\n self.l_grip_press = pl.PressureListener(topic='/pressure/l_gripper_motor')\n self.r_grip_data = []\n self.l_grip_data = []\n self.status = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99627:Expr_L11_C8", "label": "init_node()", "type": "expression", "loc": [11, 11], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99627:FunctionDef_L10_C4", "vector": [8, 2, 0.2037, 0.0185, 2, 0.73, 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('pressure_writer')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99627:Assign_L12_C8", "label": "self.r_grip_press = PressureListener()", "type": "assigned_variable", "loc": [12, 12], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99627:FunctionDef_L10_C4", "vector": [14, 2, 0.2222, 0.0185, 2, 0.73, 0.2, 192, 3, 1, 0, 0, 422, 10, 1], "semantic": {"name": "self.r_grip_press", "arg_names": [], "import_names": [], "rhs_call_name": "PressureListener", "annotation": ""}, "snippet": " self.r_grip_press = pl.PressureListener(topic='/pressure/r_gripper_motor')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99627:Assign_L13_C8", "label": "self.l_grip_press = PressureListener()", "type": "assigned_variable", "loc": [13, 13], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99627:FunctionDef_L10_C4", "vector": [14, 2, 0.2407, 0.0185, 2, 0.73, 0.4, 373, 3, 1, 0, 0, 422, 10, 1], "semantic": {"name": "self.l_grip_press", "arg_names": [], "import_names": [], "rhs_call_name": "PressureListener", "annotation": ""}, "snippet": " self.l_grip_press = pl.PressureListener(topic='/pressure/l_gripper_motor')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99627:Assign_L14_C8", "label": "self.r_grip_data =", "type": "assigned_variable", "loc": [14, 14], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99627:FunctionDef_L10_C4", "vector": [14, 2, 0.2593, 0.0185, 2, 0.73, 0.6, 338, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.r_grip_data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.r_grip_data = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99627:Assign_L15_C8", "label": "self.l_grip_data =", "type": "assigned_variable", "loc": [15, 15], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99627:FunctionDef_L10_C4", "vector": [14, 2, 0.2778, 0.0185, 2, 0.73, 0.8, 492, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.l_grip_data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.l_grip_data = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99627:Assign_L16_C8", "label": "self.status =", "type": "assigned_variable", "loc": [16, 16], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99627:FunctionDef_L10_C4", "vector": [14, 2, 0.2963, 0.0185, 2, 0.73, 1.0, 651, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.status", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.status = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99627:FunctionDef_L18_C4", "label": "zero", "type": "function", "loc": [18, 33], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99627:ClassDef_L8_C0", "vector": [2, 1, 0.4722, 0.2963, 1, 0.43, 0.3333, 14, 0, 1, 0, 0, 0, 0, 13], "semantic": {"name": "zero", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def zero(self):\n self.r_grip_press.rezero()\n self.l_grip_press.rezero()\n\n file_handle = open(file_name, 'w')\n self.zero()\n start = rospy.get_time()\n #might be better to do some condition, like gripper not moving or when arm is moved to side"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99627:Expr_L19_C8", "label": "rezero()", "type": "expression", "loc": [19, 19], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99627:FunctionDef_L18_C4", "vector": [8, 2, 0.3519, 0.0185, 2, 0.0, 0.0, 22, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "rezero", "arg_names": [], "import_names": [], "rhs_call_name": "rezero", "annotation": ""}, "snippet": " self.r_grip_press.rezero()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99627:Expr_L20_C8", "label": "rezero()", "type": "expression", "loc": [20, 20], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99627:FunctionDef_L18_C4", "vector": [8, 2, 0.3704, 0.0185, 2, 0.0, 0.1429, 22, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "rezero", "arg_names": [], "import_names": [], "rhs_call_name": "rezero", "annotation": ""}, "snippet": " self.l_grip_press.rezero()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99627:Assign_L22_C8", "label": "file_handle = open()", "type": "assigned_variable", "loc": [22, 22], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99627:FunctionDef_L18_C4", "vector": [14, 2, 0.4074, 0.0185, 2, 0.0, 0.2857, 445, 3, 2, 0, 0, 693, 10, 1], "semantic": {"name": "file_handle", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": " file_handle = open(file_name, 'w')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99627:Expr_L23_C8", "label": "zero()", "type": "expression", "loc": [23, 23], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99627:FunctionDef_L18_C4", "vector": [8, 2, 0.4259, 0.0185, 2, 0.0, 0.4286, 14, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "zero", "arg_names": [], "import_names": [], "rhs_call_name": "zero", "annotation": ""}, "snippet": " self.zero()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99627:Assign_L24_C8", "label": "start = get_time()", "type": "assigned_variable", "loc": [24, 24], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99627:FunctionDef_L18_C4", "vector": [14, 2, 0.4444, 0.0185, 2, 0.0, 0.5714, 511, 3, 0, 0, 0, 164, 10, 1], "semantic": {"name": "start", "arg_names": [], "import_names": [], "rhs_call_name": "get_time", "annotation": ""}, "snippet": " start = rospy.get_time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99627:While_L27_C8", "label": "while", "type": "while", "loc": [27, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99627:FunctionDef_L18_C4", "vector": [5, 2, 0.537, 0.0926, 2, 0.0, 0.7143, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while not self.status == 'moving somewhere again':\n print(\"saving data now ...\")\n self.r_grip_data.append(self.r_grip_press.get_pressure_readings())\n self.l_grip_data.append(self.l_grip_press.get_pressure_readings())\n rospy.sleep(0.05)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99627:Expr_L28_C12", "label": "print()", "type": "expression", "loc": [28, 28], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99627:While_L27_C8", "vector": [8, 3, 0.5185, 0.0185, 3, 0.51, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"saving data now ...\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99627:Expr_L29_C12", "label": "append()", "type": "expression", "loc": [29, 29], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99627:While_L27_C8", "vector": [8, 3, 0.537, 0.0185, 3, 0.51, 0.3333, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.r_grip_data.append(self.r_grip_press.get_pressure_readings())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99627:Expr_L30_C12", "label": "append()", "type": "expression", "loc": [30, 30], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99627:While_L27_C8", "vector": [8, 3, 0.5556, 0.0185, 3, 0.51, 0.6667, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.l_grip_data.append(self.l_grip_press.get_pressure_readings())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99627:Expr_L31_C12", "label": "sleep()", "type": "expression", "loc": [31, 31], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99627:While_L27_C8", "vector": [8, 3, 0.5741, 0.0185, 3, 0.51, 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_99627:Expr_L32_C8", "label": "dump()", "type": "expression", "loc": [32, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99627:FunctionDef_L18_C4", "vector": [8, 2, 0.5926, 0.0185, 2, 0.0, 0.8571, 952, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "dump", "arg_names": [], "import_names": [], "rhs_call_name": "dump", "annotation": ""}, "snippet": " cPickle.dump(data, file_handle)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99627:Expr_L33_C8", "label": "close()", "type": "expression", "loc": [33, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99627:FunctionDef_L18_C4", "vector": [8, 2, 0.6111, 0.0185, 2, 0.0, 1.0, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": " file_handle.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99627:FunctionDef_L35_C4", "label": "print_pressures", "type": "function", "loc": [35, 37], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99627:ClassDef_L8_C0", "vector": [2, 1, 0.6667, 0.0556, 1, 0.43, 0.6667, 285, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "print_pressures", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def print_pressures(self):\n self.r_grip_press.rezero()\n right_tuple = self.r_grip_press.get_pressure_readings()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99627:Expr_L36_C8", "label": "rezero()", "type": "expression", "loc": [36, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99627:FunctionDef_L35_C4", "vector": [8, 2, 0.6667, 0.0185, 2, 0.84, 0.0, 22, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "rezero", "arg_names": [], "import_names": [], "rhs_call_name": "rezero", "annotation": ""}, "snippet": " self.r_grip_press.rezero()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99627:Assign_L37_C8", "label": "right_tuple = get_pressure_readings()", "type": "assigned_variable", "loc": [37, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99627:FunctionDef_L35_C4", "vector": [14, 2, 0.6852, 0.0185, 2, 0.84, 1.0, 811, 3, 0, 0, 0, 767, 10, 1], "semantic": {"name": "right_tuple", "arg_names": [], "import_names": [], "rhs_call_name": "get_pressure_readings", "annotation": ""}, "snippet": " right_tuple = self.r_grip_press.get_pressure_readings()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99627:FunctionDef_L41_C4", "label": "status_callback", "type": "function", "loc": [41, 44], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99627:ClassDef_L8_C0", "vector": [2, 1, 0.787, 0.0741, 1, 0.43, 1.0, 865, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "status_callback", "arg_names": ["self", "data"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def status_callback(self, data):\n print(\"here is the status :\", data)\n# self.status = data.feedback.state\n self.status = data"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99627:Expr_L42_C8", "label": "print()", "type": "expression", "loc": [42, 42], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99627:FunctionDef_L41_C4", "vector": [8, 2, 0.7778, 0.0185, 2, 0.71, 0.0, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"here is the status :\", data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99627:Assign_L44_C8", "label": "self.status =", "type": "assigned_variable", "loc": [44, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99627:FunctionDef_L41_C4", "vector": [14, 2, 0.8148, 0.0185, 2, 0.71, 1.0, 651, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.status", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.status = data"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99627:If_L46_C0", "label": "if", "type": "if", "loc": [46, 53], "level": 0, "parent": null, "vector": [4, 0, 0.9167, 0.1481, 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 pw = PressureWriter()\n rospy.Subscriber('OverheadServer/actionlib/feedback/feedback/state', String, pw.status_callback)\n\n while not rospy.is_shutdown():\n if pw.status == 'closing gripper':\n pw.record_pressures('test_file', 0)\n rospy.sleep(0.02)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99627:Assign_L47_C4", "label": "pw = PressureWriter()", "type": "assigned_variable", "loc": [47, 47], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99627:If_L46_C0", "vector": [14, 1, 0.8704, 0.0185, 1, 0.67, 0.0, 18, 3, 0, 0, 0, 908, 10, 1], "semantic": {"name": "pw", "arg_names": [], "import_names": [], "rhs_call_name": "PressureWriter", "annotation": ""}, "snippet": " pw = PressureWriter()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99627:Expr_L48_C4", "label": "Subscriber()", "type": "expression", "loc": [48, 48], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99627:If_L46_C0", "vector": [8, 1, 0.8889, 0.0185, 1, 0.67, 0.5, 455, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "Subscriber", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " rospy.Subscriber('OverheadServer/actionlib/feedback/feedback/state', String, pw.status_callback)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99627:While_L50_C4", "label": "while", "type": "while", "loc": [50, 53], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99627:If_L46_C0", "vector": [5, 1, 0.9537, 0.0741, 1, 0.67, 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 if pw.status == 'closing gripper':\n pw.record_pressures('test_file', 0)\n rospy.sleep(0.02)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99627:If_L51_C8", "label": "if", "type": "if", "loc": [51, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99627:While_L50_C4", "vector": [4, 2, 0.9537, 0.037, 2, 0.98, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if pw.status == 'closing gripper':\n pw.record_pressures('test_file', 0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99627:Expr_L52_C12", "label": "record_pressures()", "type": "expression", "loc": [52, 52], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99627:If_L51_C8", "vector": [8, 3, 0.963, 0.0185, 3, 0.74, 0.0, 653, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "record_pressures", "arg_names": [], "import_names": [], "rhs_call_name": "record_pressures", "annotation": ""}, "snippet": " pw.record_pressures('test_file', 0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99627:Expr_L53_C8", "label": "sleep()", "type": "expression", "loc": [53, 53], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99627:While_L50_C4", "vector": [8, 2, 0.9815, 0.0185, 2, 0.98, 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)"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99627:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99627:FunctionDef_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99627:FunctionDef_L10_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99627:Expr_L11_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99627:FunctionDef_L10_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99627:Assign_L12_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99627:FunctionDef_L10_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99627:Assign_L13_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99627:FunctionDef_L10_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99627:Assign_L14_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99627:FunctionDef_L10_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99627:Assign_L15_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99627:FunctionDef_L10_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99627:Assign_L16_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99627:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99627:FunctionDef_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99627:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99627:Expr_L19_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99627:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99627:Expr_L20_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99627:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99627:Assign_L22_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99627:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99627:Expr_L23_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99627:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99627:Assign_L24_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99627:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99627:While_L27_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99627:While_L27_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99627:Expr_L28_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99627:While_L27_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99627:Expr_L29_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99627:While_L27_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99627:Expr_L30_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99627:While_L27_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99627:Expr_L31_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99627:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99627:Expr_L32_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99627:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99627:Expr_L33_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99627:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99627:FunctionDef_L35_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99627:FunctionDef_L35_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99627:Expr_L36_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99627:FunctionDef_L35_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99627:Assign_L37_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99627:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99627:FunctionDef_L41_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99627:FunctionDef_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99627:Expr_L42_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99627:FunctionDef_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99627:Assign_L44_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99627:If_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99627:Assign_L47_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99627:If_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99627:Expr_L48_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99627:If_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99627:While_L50_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99627:While_L50_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99627:If_L51_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99627:If_L51_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99627:Expr_L52_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99627:While_L50_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99627:Expr_L53_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. # #Based on some code by Kaijen, modified heavily by Marc Killpack import roslib roslib.load_manifest('pr2_playpen') import rospy from pr2_playpen.pick_and_place_manager import * from object_manipulator.convert_functions import * from pr2_playpen.srv import Playpen from pr2_playpen.srv import Conveyor from pr2_playpen.srv import Check from pr2_playpen.srv import Train from UI_segment_object.srv import Save import os import datetime import cPickle import math import numpy as np class SimplePickAndPlaceExample(): def __init__(self): rospy.loginfo("initializing pick and place manager") self.papm = PickAndPlaceManager() rospy.loginfo("finished initializing pick and place manager") rospy.wait_for_service('playpen') rospy.wait_for_service('conveyor') self.playpen = rospy.ServiceProxy('playpen', Playpen) self.conveyor = rospy.ServiceProxy('conveyor', Conveyor) self.objects_dist = [.135, .26-.135, .405-.26, .545-.405, .70-.545, .865-.70, .995-.865, 1.24-.995] self.tries = 0 self.successes = 0 #pick up the nearest object to PointStamped target_point with whicharm #(0=right, 1=left) def pick_up_object_near_point(self, target_point, whicharm): rospy.loginfo("moving the arms to the side") self.papm.move_arm_out_of_way(0) self.papm.move_arm_out_of_way(1) #############once is it positioned, we don't want to move the head at all !!!############# # rospy.loginfo("pointing the head at the target point") # self.papm.point_head(get_xyz(target_point.point), # target_point.header.frame_id) ######################################################################################### rospy.loginfo("detecting the table and objects") self.papm.call_tabletop_detection(take_static_collision_map = 1, update_table = 1, clear_attached_objects = 1) rospy.loginfo("picking up the nearest object to the target point") success = self.papm.pick_up_object_near_point(target_point, whicharm) if success: rospy.loginfo("pick-up was successful! Moving arm to side") #self.papm.move_arm_to_side(whicharm) self.papm.move_arm_out_of_way(whicharm) else: rospy.loginfo("pick-up failed.") return success #place the object held in whicharm (0=right, 1=left) down in the #place rectangle defined by place_rect_dims (x,y) #and place_rect_center (PoseStamped) def place_object(self, whicharm, place_rect_dims, place_rect_center): self.papm.set_place_area(place_rect_center, place_rect_dims) rospy.loginfo("putting down the object in the %s gripper"\ %self.papm.arm_dict[whicharm]) success = self.papm.put_down_object(whicharm, max_place_tries = 5, use_place_override = 1) if success: rospy.loginfo("place returned success") else: rospy.loginfo("place returned failure") self.papm.open_gripper(whicharm) return success if __name__ == "__main__": rospy.init_node('simple_pick_and_place_example') sppe = SimplePickAndPlaceExample() #adjust for your table table_height = 0.529 date = datetime.datetime.now() f_name = date.strftime("%Y-%m-%d_%H-%M-%S") save_dir = os.getcwd()+'/../../data/'+f_name playpen_dir = '/home/mkillpack/svn/gt-ros-pkg/hrl/pr2_playpen/data/' #should add way to sync os.mkdir(save_dir) print "CHECING FOR DIRECTORY : ", os.getcwd()+'/../../data/'+f_name #.5 m in front of robot, centered target_point_xyz = [.625, 0, table_height] #this is currently an approximation/hack should use ar tag target_point = create_point_stamped(target_point_xyz, 'base_link') arm = 0 rospy.wait_for_service('playpen_train_success') rospy.wait_for_service('playpen_check_success') rospy.wait_for_service('playpen_save_pt_cloud') rospy.wait_for_service('playpen_save_image') # rospy.wait_for_service('pr2_save_pt_cloud') try: train_success = rospy.ServiceProxy('playpen_train_success', Train) check_success = rospy.ServiceProxy('playpen_check_success', Check) # save_pr2_cloud = rospy.ServiceProxy('pr2_save_pt_cloud', Save) save_playpen_cloud = rospy.ServiceProxy('playpen_save_pt_cloud', Save) save_playpen_image = rospy.ServiceProxy('playpen_save_image', Save) except rospy.ServiceException, e: print "Service call failed: %s"%e num_samples = train_success() for i in xrange(len(sppe.objects_dist)): file_handle = open(save_dir+'/object'+str(i).zfill(3)+'.pkl', 'wb') data = {} sppe.playpen(0) sppe.conveyor(sppe.objects_dist[i]) # data['object'+str(i).zfill(3)] = {} # data['object'+str(i).zfill(3)]['success'] = [] # data['object'+str(i).zfill(3)]['frames'] = [] data['success'] = [] data['frames'] = [] while sppe.tries<6: print "arm is ", arm # print "target _point is ", target_point.x # save_pr2_cloud(save_dir+'/object'+str(i).zfill(3)+'_try'+str(sppe.tries).zfill(3)+'_before_pr2.pcd') save_playpen_cloud(playpen_dir+'object'+str(i).zfill(3)+'_try'+str(sppe.tries).zfill(3)+'_before_playpen.pcd') save_playpen_image(playpen_dir+'object'+str(i).zfill(3)+'_try'+str(sppe.tries).zfill(3)+'_before_playpen.png') success = sppe.pick_up_object_near_point(target_point, arm) result = [] rospy.sleep(5) for j in xrange(5): result.append(check_success('').result) rospy.sleep(5) result.sort() if result[2] == 'table': success = True elif result[2] == 'object': success = False # else: # success = False # sppe.tries = sppe.tries-1 # this is to compensate for failures in perception hopefully print "SUCCESS IS :", success, ' ', result data['success'].append(success) # save_pr2_cloud(save_dir+'/object'+str(i).zfill(3)+'try'+str(sppe.tries).zfill(3)+'_after_pr2.pcd') save_playpen_cloud(playpen_dir+'object'+str(i).zfill(3)+'_try'+str(sppe.tries).zfill(3)+'_after_playpen.pcd') save_playpen_image(playpen_dir+'object'+str(i).zfill(3)+'_try'+str(sppe.tries).zfill(3)+'_after_playpen.png') # save_playpen_cloud(save_dir+'/object'+str(i).zfill(3)+'try'+str(sppe.tries).zfill(3)+'_after_playpen.pcd') if success: sppe.successes=sppe.successes + 1 #square of size 30 cm by 30 cm place_rect_dims = [.1, .1] x = np.random.uniform(-0.18, 0.18, 1)[0] y = np.random.uniform(-0.18, 0.18, 1)[0] center_xyz = [.625+x, y, table_height+.10] #aligned with axes of frame_id center_quat = [0,0,0,1] place_rect_center = create_pose_stamped(center_xyz+center_quat, 'base_link') sppe.place_object(arm, place_rect_dims, place_rect_center) arm = arm.__xor__(1) sppe.tries = sppe.tries+1 sppe.playpen(1) sppe.successes = 0 sppe.tries = 0 cPickle.dump(data, file_handle) file_handle.close() # sppe.playpen(0)
ajibawa-2023/Python-Code-Large/train/row_99628
39
57
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99628:Import_L1_C0", "label": "roslib import roslib", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0175, 0.0175, 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_99628:Import_L2_C0", "label": "rospy import rospy", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0351, 0.0175, 0, 0.66, 0.0714, 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_99628:ImportFrom_L3_C0", "label": "from pr2_playpen.pick_and_place_manager import *", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0526, 0.0175, 0, 0.66, 0.1429, 737, 0, 1, 0, 0, 737, 0, 0], "semantic": {"name": "pr2_playpen.pick_and_place_manager", "arg_names": [], "import_names": ["*"], "rhs_call_name": "", "annotation": ""}, "snippet": "from pr2_playpen.pick_and_place_manager import *"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99628:ImportFrom_L4_C0", "label": "from object_manipulator.convert_functions import *", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0702, 0.0175, 0, 0.66, 0.2143, 7, 0, 1, 0, 0, 7, 0, 0], "semantic": {"name": "object_manipulator.convert_functions", "arg_names": [], "import_names": ["*"], "rhs_call_name": "", "annotation": ""}, "snippet": "from object_manipulator.convert_functions import *"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99628:ImportFrom_L5_C0", "label": "from pr2_playpen.srv import Playpen", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0877, 0.0175, 0, 0.66, 0.2857, 216, 0, 1, 0, 0, 216, 0, 0], "semantic": {"name": "pr2_playpen.srv", "arg_names": [], "import_names": ["Playpen"], "rhs_call_name": "", "annotation": ""}, "snippet": "from pr2_playpen.srv import Playpen"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99628:ImportFrom_L6_C0", "label": "from pr2_playpen.srv import Conveyor", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.1053, 0.0175, 0, 0.66, 0.3571, 216, 0, 1, 0, 0, 216, 0, 0], "semantic": {"name": "pr2_playpen.srv", "arg_names": [], "import_names": ["Conveyor"], "rhs_call_name": "", "annotation": ""}, "snippet": "from pr2_playpen.srv import Conveyor"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99628:ImportFrom_L7_C0", "label": "from pr2_playpen.srv import Check", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.1228, 0.0175, 0, 0.66, 0.4286, 216, 0, 1, 0, 0, 216, 0, 0], "semantic": {"name": "pr2_playpen.srv", "arg_names": [], "import_names": ["Check"], "rhs_call_name": "", "annotation": ""}, "snippet": "from pr2_playpen.srv import Check"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99628:ImportFrom_L8_C0", "label": "from pr2_playpen.srv import Train", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.1404, 0.0175, 0, 0.66, 0.5, 216, 0, 1, 0, 0, 216, 0, 0], "semantic": {"name": "pr2_playpen.srv", "arg_names": [], "import_names": ["Train"], "rhs_call_name": "", "annotation": ""}, "snippet": "from pr2_playpen.srv import Train"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99628:ImportFrom_L9_C0", "label": "from UI_segment_object.srv import Save", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.1579, 0.0175, 0, 0.66, 0.5714, 363, 0, 1, 0, 0, 363, 0, 0], "semantic": {"name": "UI_segment_object.srv", "arg_names": [], "import_names": ["Save"], "rhs_call_name": "", "annotation": ""}, "snippet": "from UI_segment_object.srv import Save"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99628:Import_L10_C0", "label": "os import os", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.1754, 0.0175, 0, 0.66, 0.6429, 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_99628:Import_L11_C0", "label": "datetime import datetime", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.193, 0.0175, 0, 0.66, 0.7143, 426, 0, 1, 0, 0, 426, 0, 0], "semantic": {"name": "datetime", "arg_names": [], "import_names": ["datetime"], "rhs_call_name": "", "annotation": ""}, "snippet": "import datetime"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99628:Import_L12_C0", "label": "cPickle import cPickle", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.2105, 0.0175, 0, 0.66, 0.7857, 279, 0, 1, 0, 0, 279, 0, 0], "semantic": {"name": "cPickle", "arg_names": [], "import_names": ["cPickle"], "rhs_call_name": "", "annotation": ""}, "snippet": "import cPickle"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99628:Import_L14_C0", "label": "math import math", "type": "import", "loc": [14, 14], "level": 0, "parent": null, "vector": [1, 0, 0.2456, 0.0175, 0, 0.66, 0.8571, 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_99628:Import_L15_C0", "label": "numpy import np", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.2632, 0.0175, 0, 0.66, 0.9286, 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_99628:ClassDef_L17_C0", "label": "SimplePickAndPlaceExample", "type": "class", "loc": [17, 55], "level": 0, "parent": null, "vector": [3, 0, 0.6316, 0.6842, 0, 0.66, 1.0, 919, 0, 3, 0, 0, 0, 0, 16], "semantic": {"name": "SimplePickAndPlaceExample", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class SimplePickAndPlaceExample():\n\n def __init__(self):\n\n rospy.loginfo(\"initializing pick and place manager\")\n self.papm = PickAndPlaceManager()\n rospy.loginfo(\"finished initializing pick and place manager\")\n rospy.wait_for_service('playpen')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99628:FunctionDef_L19_C4", "label": "__init__", "type": "function", "loc": [19, 31], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99628:ClassDef_L17_C0", "vector": [2, 1, 0.4386, 0.2281, 1, 0.53, 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\n rospy.loginfo(\"initializing pick and place manager\")\n self.papm = PickAndPlaceManager()\n rospy.loginfo(\"finished initializing pick and place manager\")\n rospy.wait_for_service('playpen')\n rospy.wait_for_service('conveyor')\n self.playpen = rospy.ServiceProxy('playpen', Playpen)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99628:Expr_L21_C8", "label": "loginfo()", "type": "expression", "loc": [21, 21], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99628:FunctionDef_L19_C4", "vector": [8, 2, 0.3684, 0.0175, 2, 0.27, 0.0, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo(\"initializing pick and place manager\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99628:Assign_L22_C8", "label": "self.papm = PickAndPlaceManager()", "type": "assigned_variable", "loc": [22, 22], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99628:FunctionDef_L19_C4", "vector": [14, 2, 0.386, 0.0175, 2, 0.27, 0.1111, 553, 3, 0, 0, 0, 53, 10, 1], "semantic": {"name": "self.papm", "arg_names": [], "import_names": [], "rhs_call_name": "PickAndPlaceManager", "annotation": ""}, "snippet": " self.papm = PickAndPlaceManager()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99628:Expr_L23_C8", "label": "loginfo()", "type": "expression", "loc": [23, 23], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99628:FunctionDef_L19_C4", "vector": [8, 2, 0.4035, 0.0175, 2, 0.27, 0.2222, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo(\"finished initializing pick and place manager\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99628:Expr_L24_C8", "label": "wait_for_service()", "type": "expression", "loc": [24, 24], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99628:FunctionDef_L19_C4", "vector": [8, 2, 0.4211, 0.0175, 2, 0.27, 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('playpen')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99628:Expr_L25_C8", "label": "wait_for_service()", "type": "expression", "loc": [25, 25], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99628:FunctionDef_L19_C4", "vector": [8, 2, 0.4386, 0.0175, 2, 0.27, 0.4444, 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('conveyor')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99628:Assign_L26_C8", "label": "self.playpen = ServiceProxy()", "type": "assigned_variable", "loc": [26, 26], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99628:FunctionDef_L19_C4", "vector": [14, 2, 0.4561, 0.0175, 2, 0.27, 0.5556, 293, 3, 2, 0, 0, 915, 10, 1], "semantic": {"name": "self.playpen", "arg_names": [], "import_names": [], "rhs_call_name": "ServiceProxy", "annotation": ""}, "snippet": " self.playpen = rospy.ServiceProxy('playpen', Playpen)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99628:Assign_L27_C8", "label": "self.conveyor = ServiceProxy()", "type": "assigned_variable", "loc": [27, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99628:FunctionDef_L19_C4", "vector": [14, 2, 0.4737, 0.0175, 2, 0.27, 0.6667, 17, 3, 2, 0, 0, 915, 10, 1], "semantic": {"name": "self.conveyor", "arg_names": [], "import_names": [], "rhs_call_name": "ServiceProxy", "annotation": ""}, "snippet": " self.conveyor = rospy.ServiceProxy('conveyor', Conveyor)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99628:Assign_L28_C8", "label": "self.objects_dist =", "type": "assigned_variable", "loc": [28, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99628:FunctionDef_L19_C4", "vector": [14, 2, 0.5, 0.0351, 2, 0.27, 0.7778, 298, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.objects_dist", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.objects_dist = [.135, .26-.135, .405-.26, .545-.405, \n .70-.545, .865-.70, .995-.865, 1.24-.995]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99628:Assign_L30_C8", "label": "self.tries =", "type": "assigned_variable", "loc": [30, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99628:FunctionDef_L19_C4", "vector": [14, 2, 0.5263, 0.0175, 2, 0.27, 0.8889, 4, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.tries", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.tries = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99628:Assign_L31_C8", "label": "self.successes =", "type": "assigned_variable", "loc": [31, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99628:FunctionDef_L19_C4", "vector": [14, 2, 0.5439, 0.0175, 2, 0.27, 1.0, 696, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.successes", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.successes = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99628:FunctionDef_L34_C4", "label": "pick_up_object_near_point", "type": "function", "loc": [34, 38], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99628:ClassDef_L17_C0", "vector": [2, 1, 0.6316, 0.0877, 1, 0.53, 0.5, 487, 0, 3, 0, 0, 0, 0, 3], "semantic": {"name": "pick_up_object_near_point", "arg_names": ["self", "target_point", "whicharm"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def pick_up_object_near_point(self, target_point, whicharm):\n\n rospy.loginfo(\"moving the arms to the side\")\n self.papm.move_arm_out_of_way(0)\n self.papm.move_arm_out_of_way(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99628:Expr_L36_C8", "label": "loginfo()", "type": "expression", "loc": [36, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99628:FunctionDef_L34_C4", "vector": [8, 2, 0.6316, 0.0175, 2, 0.18, 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 the arms to the side\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99628:Expr_L37_C8", "label": "move_arm_out_of_way()", "type": "expression", "loc": [37, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99628:FunctionDef_L34_C4", "vector": [8, 2, 0.6491, 0.0175, 2, 0.18, 0.5, 162, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "move_arm_out_of_way", "arg_names": [], "import_names": [], "rhs_call_name": "move_arm_out_of_way", "annotation": ""}, "snippet": " self.papm.move_arm_out_of_way(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99628:Expr_L38_C8", "label": "move_arm_out_of_way()", "type": "expression", "loc": [38, 38], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99628:FunctionDef_L34_C4", "vector": [8, 2, 0.6667, 0.0175, 2, 0.18, 1.0, 162, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "move_arm_out_of_way", "arg_names": [], "import_names": [], "rhs_call_name": "move_arm_out_of_way", "annotation": ""}, "snippet": " self.papm.move_arm_out_of_way(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99628:FunctionDef_L40_C4", "label": "place_object", "type": "function", "loc": [40, 55], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99628:ClassDef_L17_C0", "vector": [2, 1, 0.8333, 0.2807, 1, 0.53, 1.0, 262, 0, 4, 1, 0, 0, 0, 6], "semantic": {"name": "place_object", "arg_names": ["self", "whicharm", "place_rect_dims", "place_rect_center"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def place_object(self, whicharm, place_rect_dims, place_rect_center):\n\n self.papm.set_place_area(place_rect_center, place_rect_dims)\n\n rospy.loginfo(\"putting down the object in the %s gripper\"\\\n %self.papm.arm_dict[whicharm])\n success = self.papm.put_down_object(whicharm,\n max_place_tries = 5,"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99628:Expr_L42_C8", "label": "set_place_area()", "type": "expression", "loc": [42, 42], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99628:FunctionDef_L40_C4", "vector": [8, 2, 0.7368, 0.0175, 2, 0.82, 0.0, 491, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "set_place_area", "arg_names": [], "import_names": [], "rhs_call_name": "set_place_area", "annotation": ""}, "snippet": " self.papm.set_place_area(place_rect_center, place_rect_dims)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99628:Expr_L44_C8", "label": "loginfo()", "type": "expression", "loc": [44, 45], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99628:FunctionDef_L40_C4", "vector": [8, 2, 0.7807, 0.0351, 2, 0.82, 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(\"putting down the object in the %s gripper\"\\\n %self.papm.arm_dict[whicharm])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99628:Assign_L46_C8", "label": "success = put_down_object()", "type": "assigned_variable", "loc": [46, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99628:FunctionDef_L40_C4", "vector": [14, 2, 0.8246, 0.0526, 2, 0.82, 0.5, 761, 3, 3, 0, 0, 996, 10, 1], "semantic": {"name": "success", "arg_names": [], "import_names": [], "rhs_call_name": "put_down_object", "annotation": ""}, "snippet": " success = self.papm.put_down_object(whicharm,\n max_place_tries = 5,\n use_place_override = 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99628:If_L50_C8", "label": "if", "type": "if", "loc": [50, 54], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99628:FunctionDef_L40_C4", "vector": [4, 2, 0.9123, 0.0877, 2, 0.82, 0.75, 0, 2, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if success:\n rospy.loginfo(\"place returned success\")\n else:\n rospy.loginfo(\"place returned failure\")\n self.papm.open_gripper(whicharm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99628:Expr_L51_C12", "label": "loginfo()", "type": "expression", "loc": [51, 51], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99628:If_L50_C8", "vector": [8, 3, 0.8947, 0.0175, 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(\"place returned success\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99628:Expr_L53_C12", "label": "loginfo()", "type": "expression", "loc": [53, 53], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99628:If_L50_C8", "vector": [8, 3, 0.9298, 0.0175, 3, 0.24, 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(\"place returned failure\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99628:Expr_L54_C12", "label": "open_gripper()", "type": "expression", "loc": [54, 54], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99628:If_L50_C8", "vector": [8, 3, 0.9474, 0.0175, 3, 0.24, 1.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.papm.open_gripper(whicharm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99628:Return_L55_C8", "label": "return", "type": "return", "loc": [55, 55], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99628:FunctionDef_L40_C4", "vector": [13, 2, 0.9649, 0.0175, 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 success"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99628:ClassDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99628:FunctionDef_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99628:FunctionDef_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99628:Expr_L21_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99628:FunctionDef_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99628:Assign_L22_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99628:FunctionDef_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99628:Expr_L23_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99628:FunctionDef_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99628:Expr_L24_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99628:FunctionDef_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99628:Expr_L25_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99628:FunctionDef_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99628:Assign_L26_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99628:FunctionDef_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99628:Assign_L27_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99628:FunctionDef_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99628:Assign_L28_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99628:FunctionDef_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99628:Assign_L30_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99628:FunctionDef_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99628:Assign_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99628:ClassDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99628:FunctionDef_L34_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99628:FunctionDef_L34_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99628:Expr_L36_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99628:FunctionDef_L34_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99628:Expr_L37_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99628:FunctionDef_L34_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99628:Expr_L38_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99628:ClassDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99628:FunctionDef_L40_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99628:FunctionDef_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99628:Expr_L42_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99628:FunctionDef_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99628:Expr_L44_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99628:FunctionDef_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99628:Assign_L46_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99628:FunctionDef_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99628:If_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99628:If_L50_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99628:Expr_L51_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99628:If_L50_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99628:Expr_L53_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99628:If_L50_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99628:Expr_L54_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99628:FunctionDef_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99628:Return_L55_C8"}]
#! /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. # #Based on some code by Kaijen, modified heavily by Marc Killpack import roslib roslib.load_manifest('pr2_playpen') roslib.load_manifest('pr2_grasp_behaviors') import rospy import actionlib import hrl_pr2_lib.pressure_listener as pl from object_manipulator.convert_functions import * from pr2_playpen.srv import Playpen from pr2_playpen.srv import Conveyor from pr2_playpen.srv import Check from pr2_playpen.srv import Train from UI_segment_object.srv import Save #from pr2_overhead_grasping.msg import * from pr2_grasp_behaviors.msg import * import os import datetime import cPickle import math import numpy as np class HRLControllerPlaypen(): def __init__(self): print "waiting for conveyor" rospy.wait_for_service('playpen') rospy.wait_for_service('conveyor') print "started conveyor and playpen" self.playpen = rospy.ServiceProxy('playpen', Playpen) self.conveyor = rospy.ServiceProxy('conveyor', Conveyor) self.objects_dist = [0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13] self.tries = 0 self.successes = 0 self.r_grip_press = pl.PressureListener(topic='/pressure/r_gripper_motor') self.l_grip_press = pl.PressureListener(topic='/pressure/l_gripper_motor') self.grasp_client = [None, None] self.grasp_setup_client = [None, None] self.grasp_client[0] = actionlib.SimpleActionClient('r_overhead_grasp', OverheadGraspAction) self.grasp_client[0].wait_for_server() self.grasp_setup_client[0] = actionlib.SimpleActionClient('r_overhead_grasp_setup', OverheadGraspSetupAction) self.grasp_setup_client[0].wait_for_server() self.grasp_client[1] = actionlib.SimpleActionClient('l_overhead_grasp', OverheadGraspAction) self.grasp_client[1].wait_for_server() self.grasp_setup_client[1] = actionlib.SimpleActionClient('l_overhead_grasp_setup', OverheadGraspSetupAction) self.grasp_setup_client[1].wait_for_server() def move_to_side(self, whicharm, open_gripper=False): rospy.loginfo("moving the arms to the side") setup_goal = OverheadGraspSetupGoal() setup_goal.disable_head = True setup_goal.open_gripper = open_gripper self.grasp_setup_client[whicharm].send_goal(setup_goal) self.grasp_setup_client[whicharm].wait_for_result() #pick up the nearest object to PointStamped target_point with whicharm #(0=right, 1=left) def pick_up_object_near_point(self, target_point, whicharm): self.move_to_side(whicharm, False) #############once is it positioned, we don't want to move the head at all !!!############# # rospy.loginfo("pointing the head at the target point") # self.papm.point_head(get_xyz(target_point.point), # target_point.header.frame_id) ######################################################################################### rospy.loginfo("picking up the nearest object to the target point") ############################################################ # Creating grasp grasp_goal grasp_goal = OverheadGraspGoal() grasp_goal.is_grasp = True grasp_goal.disable_head = True grasp_goal.disable_coll = False grasp_goal.grasp_type=OverheadGraspGoal.VISION_GRASP grasp_goal.grasp_params = [0] * 3 grasp_goal.grasp_params[0] = target_point.point.x grasp_goal.grasp_params[1] = target_point.point.y grasp_goal.behavior_name = "overhead_grasp" grasp_goal.sig_level = 0.999 ############################################################ self.grasp_client[whicharm].send_goal(grasp_goal) self.grasp_client[whicharm].wait_for_result() result = self.grasp_client[whicharm].get_result() success = (result.grasp_result == "Object grasped") if success: rospy.loginfo("pick-up was successful! Moving arm to side") resetup_goal = OverheadGraspSetupGoal() resetup_goal.disable_head = True self.grasp_setup_client[whicharm].send_goal(resetup_goal) self.grasp_setup_client[whicharm].wait_for_result() else: rospy.loginfo("pick-up failed.") return success #place the object held in whicharm (0=right, 1=left) down in the #place rectangle defined by place_rect_dims (x,y) #and place_rect_center (PoseStamped) def place_object(self, whicharm, place_rect_dims, place_rect_center): rospy.loginfo("putting down the object in the r gripper") ############################################################ # Creating place goal grasp_goal = OverheadGraspGoal() grasp_goal.is_grasp = False grasp_goal.disable_head = True grasp_goal.disable_coll = False grasp_goal.grasp_type=OverheadGraspGoal.MANUAL_GRASP grasp_goal.grasp_params = [0] * 3 grasp_goal.grasp_params[0] = place_rect_center.pose.position.x grasp_goal.grasp_params[1] = place_rect_center.pose.position.y grasp_goal.behavior_name = "overhead_grasp" grasp_goal.sig_level = 0.999 ############################################################ self.grasp_client[whicharm].send_goal(grasp_goal) self.grasp_client[whicharm].wait_for_result() result = self.grasp_client[whicharm].get_result() success = (result.grasp_result == "Object placed") if success: rospy.loginfo("place returned success") else: rospy.loginfo("place returned failure") return success if __name__ == "__main__": import optparse p = optparse.OptionParser() p.add_option('--path', action='store', dest='path_save',type='string', default=None, help='this is path to directory for saving files') opt, args = p.parse_args() rospy.init_node('simple_pick_and_place_example') hcp = HRLControllerPlaypen() #adjust for your table table_height = 0.529 date = datetime.datetime.now() f_name = date.strftime("%Y-%m-%d_%H-%M-%S") if opt.path_save == None: print "Not logging or saving data from playpen" SAVE = False else: save_dir = opt.path_save+f_name print "Logging and saving playpen data in :", save_dir SAVE = True if SAVE == True: os.mkdir(save_dir) #print "CHECING FOR DIRECTORY : ", os.getcwd()+'/../../data/'+f_name #.5 m in front of robot, centered target_point_xyz = [.625, 0, table_height] #this is currently an approximation/hack should use ar tag target_point = create_point_stamped(target_point_xyz, 'base_link') arm = 0 rospy.wait_for_service('playpen_train') rospy.wait_for_service('playpen_check_success') if SAVE == True: # rospy.wait_for_service('playpen_save_pt_cloud') # rospy.wait_for_service('playpen_save_image') rospy.wait_for_service('pr2_save_pt_cloud') rospy.wait_for_service('pr2_save_image') try: train = rospy.ServiceProxy('playpen_train', Train) check_success = rospy.ServiceProxy('playpen_check_success', Check) if SAVE == True: save_pr2_cloud = rospy.ServiceProxy('pr2_save_pt_cloud', Save) save_pr2_image = rospy.ServiceProxy('pr2_save_image', Save) # save_playpen_cloud = rospy.ServiceProxy('playpen_save_pt_cloud', Save) # save_playpen_image = rospy.ServiceProxy('playpen_save_image', Save) except rospy.ServiceException, e: print "Service call failed: %s"%e print "moving arms to side" hcp.move_to_side(0, False) hcp.move_to_side(1, False) print "done moving arms, sleeping ..." rospy.sleep(15) print "done sleeping, now training for table top" num_samples = train('table') for i in xrange(len(hcp.objects_dist)): try: if SAVE==True: file_handle = open(save_dir+'/object'+str(i).zfill(3)+'.pkl', 'w') data = {} hcp.playpen(0) hcp.conveyor(hcp.objects_dist[i]) data['success'] = [] data['frames'] = [] data['pressure'] = {} data['pressure']['which_arm'] = [] data['pressure']['data'] = [] start_time = rospy.get_time() # while hcp.tries<3: while rospy.get_time()-start_time < 100.0: print "arm is ", arm hcp.move_to_side(arm, True) rospy.sleep(7) if SAVE == True: save_pr2_cloud(save_dir+'/object'+str(i).zfill(3)+'_try'+str(hcp.tries).zfill(3)+'_before_pr2.pcd') save_pr2_image(save_dir+'/object'+str(i).zfill(3)+'_try'+str(hcp.tries).zfill(3)+'_before_pr2.png') # save_playpen_cloud(playpen_dir+'object'+str(i).zfill(3)+'_try'+str(hcp.tries).zfill(3)+'_before_playpen.pcd') # save_playpen_image(playpen_dir+'object'+str(i).zfill(3)+'_try'+str(hcp.tries).zfill(3)+'_before_playpen.png') num_samples = train('object') print "attempting to pick up the object" success = hcp.pick_up_object_near_point(target_point, arm) print "starting to move arm to side at :", rospy.get_time() hcp.move_to_side(arm, False) print "moved past move to side arm command at :", rospy.get_time() results = [] print "sleeping for 10 seconds, is this necessary ..." rospy.sleep(10) num_samples = 7 for j in xrange(num_samples): results.append(check_success('').result) results.sort() print "results are :", results print "index into result is :", int(num_samples/2) if results[int(num_samples/2)] == 'table': success = True data['success'].append(success) elif results[int(num_samples/2)] == 'object': success = False data['success'].append(success) else: success = None #hcp.tries = hcp.tries-1 # this is to compensate for failures in perception hopefully print "SUCCESS IS :", success if SAVE == True: save_pr2_cloud(save_dir+'/object'+str(i).zfill(3)+'_try'+str(hcp.tries).zfill(3)+'_after_pr2.pcd') save_pr2_image(save_dir+'/object'+str(i).zfill(3)+'_try'+str(hcp.tries).zfill(3)+'_after_pr2.png') # save_playpen_cloud(playpen_dir+'object'+str(i).zfill(3)+'_try'+str(hcp.tries).zfill(3)+'_after_playpen.pcd') # save_playpen_image(playpen_dir+'object'+str(i).zfill(3)+'_try'+str(hcp.tries).zfill(3)+'_after_playpen.png') if success: hcp.successes=hcp.successes + 1 #square of size 30 cm by 30 cm place_rect_dims = [.1, .1] inside = False while inside == False: x = np.random.uniform(-0.18, 0.18, 1)[0] y = np.random.uniform(-0.18, 0.18, 1)[0] if math.sqrt(x*x+y*y) <= 0.18: inside = True center_xyz = [.625+x, y, table_height+.10] #aligned with axes of frame_id center_quat = [0,0,0,1] place_rect_center = create_pose_stamped(center_xyz+center_quat, 'base_link') hcp.place_object(arm, place_rect_dims, place_rect_center) hcp.move_to_side(arm, True) arm = arm.__xor__(1) hcp.tries = hcp.tries+1 hcp.playpen(1) hcp.successes = 0 hcp.tries = 0 cPickle.dump(data, file_handle) file_handle.close() hcp.playpen(0) except: print "failed for object"
ajibawa-2023/Python-Code-Large/train/row_99629
85
120
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99629:Import_L1_C0", "label": "roslib import roslib", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0083, 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_99629:Import_L2_C0", "label": "rospy import rospy", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0167, 0.0083, 0, 0.66, 0.0625, 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_99629:Import_L3_C0", "label": "actionlib import actionlib", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.025, 0.0083, 0, 0.66, 0.125, 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_99629:Import_L4_C0", "label": "hrl_pr2_lib.pressure_listener import pl", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0333, 0.0083, 0, 0.66, 0.1875, 654, 0, 1, 0, 0, 654, 0, 0], "semantic": {"name": "hrl_pr2_lib.pressure_listener", "arg_names": [], "import_names": ["pl"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_pr2_lib.pressure_listener as pl"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99629:ImportFrom_L5_C0", "label": "from object_manipulator.convert_functions import *", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0417, 0.0083, 0, 0.66, 0.25, 7, 0, 1, 0, 0, 7, 0, 0], "semantic": {"name": "object_manipulator.convert_functions", "arg_names": [], "import_names": ["*"], "rhs_call_name": "", "annotation": ""}, "snippet": "from object_manipulator.convert_functions import *"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99629:ImportFrom_L6_C0", "label": "from pr2_playpen.srv import Playpen", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.05, 0.0083, 0, 0.66, 0.3125, 216, 0, 1, 0, 0, 216, 0, 0], "semantic": {"name": "pr2_playpen.srv", "arg_names": [], "import_names": ["Playpen"], "rhs_call_name": "", "annotation": ""}, "snippet": "from pr2_playpen.srv import Playpen"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99629:ImportFrom_L7_C0", "label": "from pr2_playpen.srv import Conveyor", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.0583, 0.0083, 0, 0.66, 0.375, 216, 0, 1, 0, 0, 216, 0, 0], "semantic": {"name": "pr2_playpen.srv", "arg_names": [], "import_names": ["Conveyor"], "rhs_call_name": "", "annotation": ""}, "snippet": "from pr2_playpen.srv import Conveyor"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99629:ImportFrom_L8_C0", "label": "from pr2_playpen.srv import Check", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.0667, 0.0083, 0, 0.66, 0.4375, 216, 0, 1, 0, 0, 216, 0, 0], "semantic": {"name": "pr2_playpen.srv", "arg_names": [], "import_names": ["Check"], "rhs_call_name": "", "annotation": ""}, "snippet": "from pr2_playpen.srv import Check"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99629:ImportFrom_L9_C0", "label": "from pr2_playpen.srv import Train", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.075, 0.0083, 0, 0.66, 0.5, 216, 0, 1, 0, 0, 216, 0, 0], "semantic": {"name": "pr2_playpen.srv", "arg_names": [], "import_names": ["Train"], "rhs_call_name": "", "annotation": ""}, "snippet": "from pr2_playpen.srv import Train"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99629:ImportFrom_L10_C0", "label": "from UI_segment_object.srv import Save", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.0833, 0.0083, 0, 0.66, 0.5625, 363, 0, 1, 0, 0, 363, 0, 0], "semantic": {"name": "UI_segment_object.srv", "arg_names": [], "import_names": ["Save"], "rhs_call_name": "", "annotation": ""}, "snippet": "from UI_segment_object.srv import Save"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99629:ImportFrom_L11_C0", "label": "from pr2_grasp_behaviors.msg import *", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.0917, 0.0083, 0, 0.66, 0.625, 212, 0, 1, 0, 0, 212, 0, 0], "semantic": {"name": "pr2_grasp_behaviors.msg", "arg_names": [], "import_names": ["*"], "rhs_call_name": "", "annotation": ""}, "snippet": "from pr2_grasp_behaviors.msg import *"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99629:Import_L12_C0", "label": "os import os", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.1, 0.0083, 0, 0.66, 0.6875, 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_99629:Import_L13_C0", "label": "datetime import datetime", "type": "import", "loc": [13, 13], "level": 0, "parent": null, "vector": [1, 0, 0.1083, 0.0083, 0, 0.66, 0.75, 426, 0, 1, 0, 0, 426, 0, 0], "semantic": {"name": "datetime", "arg_names": [], "import_names": ["datetime"], "rhs_call_name": "", "annotation": ""}, "snippet": "import datetime"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99629:Import_L14_C0", "label": "cPickle import cPickle", "type": "import", "loc": [14, 14], "level": 0, "parent": null, "vector": [1, 0, 0.1167, 0.0083, 0, 0.66, 0.8125, 279, 0, 1, 0, 0, 279, 0, 0], "semantic": {"name": "cPickle", "arg_names": [], "import_names": ["cPickle"], "rhs_call_name": "", "annotation": ""}, "snippet": "import cPickle"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99629:Import_L16_C0", "label": "math import math", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.1333, 0.0083, 0, 0.66, 0.875, 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_99629:Import_L17_C0", "label": "numpy import np", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.1417, 0.0083, 0, 0.66, 0.9375, 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_99629:ClassDef_L19_C0", "label": "HRLControllerPlaypen", "type": "class", "loc": [19, 119], "level": 0, "parent": null, "vector": [3, 0, 0.575, 0.8417, 0, 0.66, 1.0, 721, 0, 4, 0, 0, 0, 0, 38], "semantic": {"name": "HRLControllerPlaypen", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class HRLControllerPlaypen():\n\n def __init__(self):\n print(\"waiting for conveyor\")\n rospy.wait_for_service('playpen')\n rospy.wait_for_service('conveyor')\n print(\"started conveyor and playpen\")\n self.playpen = rospy.ServiceProxy('playpen', Playpen)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99629:FunctionDef_L21_C4", "label": "__init__", "type": "function", "loc": [21, 48], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99629:ClassDef_L19_C0", "vector": [2, 1, 0.2875, 0.2333, 1, 0.42, 0.0, 555, 0, 1, 0, 0, 0, 0, 16], "semantic": {"name": "__init__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self):\n print(\"waiting for conveyor\")\n rospy.wait_for_service('playpen')\n rospy.wait_for_service('conveyor')\n print(\"started conveyor and playpen\")\n self.playpen = rospy.ServiceProxy('playpen', Playpen)\n self.conveyor = rospy.ServiceProxy('conveyor', Conveyor)\n self.objects_dist = [0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13,"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99629:Expr_L22_C8", "label": "print()", "type": "expression", "loc": [22, 22], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99629:FunctionDef_L21_C4", "vector": [8, 2, 0.1833, 0.0083, 2, 0.98, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"waiting for conveyor\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99629:Expr_L23_C8", "label": "wait_for_service()", "type": "expression", "loc": [23, 23], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99629:FunctionDef_L21_C4", "vector": [8, 2, 0.1917, 0.0083, 2, 0.98, 0.05, 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('playpen')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99629:Expr_L24_C8", "label": "wait_for_service()", "type": "expression", "loc": [24, 24], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99629:FunctionDef_L21_C4", "vector": [8, 2, 0.2, 0.0083, 2, 0.98, 0.1, 617, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "wait_for_service", "arg_names": [], "import_names": [], "rhs_call_name": "wait_for_service", "annotation": ""}, "snippet": " rospy.wait_for_service('conveyor')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99629:Expr_L25_C8", "label": "print()", "type": "expression", "loc": [25, 25], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99629:FunctionDef_L21_C4", "vector": [8, 2, 0.2083, 0.0083, 2, 0.98, 0.15, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"started conveyor and playpen\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99629:Assign_L26_C8", "label": "self.playpen = ServiceProxy()", "type": "assigned_variable", "loc": [26, 26], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99629:FunctionDef_L21_C4", "vector": [14, 2, 0.2167, 0.0083, 2, 0.98, 0.2, 293, 3, 2, 0, 0, 915, 10, 1], "semantic": {"name": "self.playpen", "arg_names": [], "import_names": [], "rhs_call_name": "ServiceProxy", "annotation": ""}, "snippet": " self.playpen = rospy.ServiceProxy('playpen', Playpen)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99629:Assign_L27_C8", "label": "self.conveyor = ServiceProxy()", "type": "assigned_variable", "loc": [27, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99629:FunctionDef_L21_C4", "vector": [14, 2, 0.225, 0.0083, 2, 0.98, 0.25, 17, 3, 2, 0, 0, 915, 10, 1], "semantic": {"name": "self.conveyor", "arg_names": [], "import_names": [], "rhs_call_name": "ServiceProxy", "annotation": ""}, "snippet": " self.conveyor = rospy.ServiceProxy('conveyor', Conveyor)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99629:Assign_L28_C8", "label": "self.objects_dist =", "type": "assigned_variable", "loc": [28, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99629:FunctionDef_L21_C4", "vector": [14, 2, 0.2375, 0.0167, 2, 0.98, 0.3, 298, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.objects_dist", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.objects_dist = [0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13,\n 0.13, 0.13, 0.13]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99629:Assign_L31_C8", "label": "self.tries =", "type": "assigned_variable", "loc": [31, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99629:FunctionDef_L21_C4", "vector": [14, 2, 0.2583, 0.0083, 2, 0.98, 0.35, 4, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.tries", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.tries = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99629:Assign_L32_C8", "label": "self.successes =", "type": "assigned_variable", "loc": [32, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99629:FunctionDef_L21_C4", "vector": [14, 2, 0.2667, 0.0083, 2, 0.98, 0.4, 696, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.successes", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.successes = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99629:Assign_L34_C8", "label": "self.r_grip_press = PressureListener()", "type": "assigned_variable", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99629:FunctionDef_L21_C4", "vector": [14, 2, 0.2833, 0.0083, 2, 0.98, 0.45, 192, 3, 1, 0, 0, 422, 10, 1], "semantic": {"name": "self.r_grip_press", "arg_names": [], "import_names": [], "rhs_call_name": "PressureListener", "annotation": ""}, "snippet": " self.r_grip_press = pl.PressureListener(topic='/pressure/r_gripper_motor')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99629:Assign_L35_C8", "label": "self.l_grip_press = PressureListener()", "type": "assigned_variable", "loc": [35, 35], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99629:FunctionDef_L21_C4", "vector": [14, 2, 0.2917, 0.0083, 2, 0.98, 0.5, 373, 3, 1, 0, 0, 422, 10, 1], "semantic": {"name": "self.l_grip_press", "arg_names": [], "import_names": [], "rhs_call_name": "PressureListener", "annotation": ""}, "snippet": " self.l_grip_press = pl.PressureListener(topic='/pressure/l_gripper_motor')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99629:Assign_L37_C8", "label": "self.grasp_client =", "type": "assigned_variable", "loc": [37, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99629:FunctionDef_L21_C4", "vector": [14, 2, 0.3083, 0.0083, 2, 0.98, 0.55, 186, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.grasp_client", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.grasp_client = [None, None]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99629:Assign_L38_C8", "label": "self.grasp_setup_client =", "type": "assigned_variable", "loc": [38, 38], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99629:FunctionDef_L21_C4", "vector": [14, 2, 0.3167, 0.0083, 2, 0.98, 0.6, 872, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.grasp_setup_client", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.grasp_setup_client = [None, None]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99629:Assign_L40_C8", "label": " = SimpleActionClient()", "type": "assigned_variable", "loc": [40, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99629:FunctionDef_L21_C4", "vector": [14, 2, 0.3333, 0.0083, 2, 0.98, 0.65, 0, 3, 2, 0, 0, 230, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "SimpleActionClient", "annotation": ""}, "snippet": " self.grasp_client[0] = actionlib.SimpleActionClient('r_overhead_grasp', OverheadGraspAction)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99629:Expr_L41_C8", "label": "wait_for_server()", "type": "expression", "loc": [41, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99629:FunctionDef_L21_C4", "vector": [8, 2, 0.3417, 0.0083, 2, 0.98, 0.7, 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[0].wait_for_server()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99629:Assign_L43_C8", "label": " = SimpleActionClient()", "type": "assigned_variable", "loc": [43, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99629:FunctionDef_L21_C4", "vector": [14, 2, 0.3583, 0.0083, 2, 0.98, 0.75, 0, 3, 2, 0, 0, 230, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "SimpleActionClient", "annotation": ""}, "snippet": " self.grasp_setup_client[0] = actionlib.SimpleActionClient('r_overhead_grasp_setup', OverheadGraspSetupAction)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99629:Expr_L44_C8", "label": "wait_for_server()", "type": "expression", "loc": [44, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99629:FunctionDef_L21_C4", "vector": [8, 2, 0.3667, 0.0083, 2, 0.98, 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.grasp_setup_client[0].wait_for_server()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99629:Assign_L45_C8", "label": " = SimpleActionClient()", "type": "assigned_variable", "loc": [45, 45], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99629:FunctionDef_L21_C4", "vector": [14, 2, 0.375, 0.0083, 2, 0.98, 0.85, 0, 3, 2, 0, 0, 230, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "SimpleActionClient", "annotation": ""}, "snippet": " self.grasp_client[1] = actionlib.SimpleActionClient('l_overhead_grasp', OverheadGraspAction)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99629:Expr_L46_C8", "label": "wait_for_server()", "type": "expression", "loc": [46, 46], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99629:FunctionDef_L21_C4", "vector": [8, 2, 0.3833, 0.0083, 2, 0.98, 0.9, 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[1].wait_for_server()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99629:Assign_L47_C8", "label": " = SimpleActionClient()", "type": "assigned_variable", "loc": [47, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99629:FunctionDef_L21_C4", "vector": [14, 2, 0.3917, 0.0083, 2, 0.98, 0.95, 0, 3, 2, 0, 0, 230, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "SimpleActionClient", "annotation": ""}, "snippet": " self.grasp_setup_client[1] = actionlib.SimpleActionClient('l_overhead_grasp_setup', OverheadGraspSetupAction)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99629:Expr_L48_C8", "label": "wait_for_server()", "type": "expression", "loc": [48, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99629:FunctionDef_L21_C4", "vector": [8, 2, 0.4, 0.0083, 2, 0.98, 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[1].wait_for_server()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99629:FunctionDef_L50_C4", "label": "move_to_side", "type": "function", "loc": [50, 56], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99629:ClassDef_L19_C0", "vector": [2, 1, 0.4417, 0.0583, 1, 0.42, 0.0714, 331, 0, 3, 0, 0, 0, 0, 4], "semantic": {"name": "move_to_side", "arg_names": ["self", "whicharm", "open_gripper"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def move_to_side(self, whicharm, open_gripper=False):\n rospy.loginfo(\"moving the arms to the side\")\n setup_goal = OverheadGraspSetupGoal()\n setup_goal.disable_head = True\n setup_goal.open_gripper = open_gripper\n self.grasp_setup_client[whicharm].send_goal(setup_goal)\n self.grasp_setup_client[whicharm].wait_for_result()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99629:Expr_L51_C8", "label": "loginfo()", "type": "expression", "loc": [51, 51], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99629:FunctionDef_L50_C4", "vector": [8, 2, 0.425, 0.0083, 2, 0.8, 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 the arms to the side\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99629:Assign_L52_C8", "label": "setup_goal = OverheadGraspSetupGoal()", "type": "assigned_variable", "loc": [52, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99629:FunctionDef_L50_C4", "vector": [14, 2, 0.4333, 0.0083, 2, 0.8, 0.2, 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_99629:Assign_L53_C8", "label": "setup_goal.disable_head =", "type": "assigned_variable", "loc": [53, 53], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99629:FunctionDef_L50_C4", "vector": [14, 2, 0.4417, 0.0083, 2, 0.8, 0.4, 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 = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99629:Assign_L54_C8", "label": "setup_goal.open_gripper =", "type": "assigned_variable", "loc": [54, 54], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99629:FunctionDef_L50_C4", "vector": [14, 2, 0.45, 0.0083, 2, 0.8, 0.6, 891, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "setup_goal.open_gripper", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " setup_goal.open_gripper = open_gripper"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99629:Expr_L55_C8", "label": "send_goal()", "type": "expression", "loc": [55, 55], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99629:FunctionDef_L50_C4", "vector": [8, 2, 0.4583, 0.0083, 2, 0.8, 0.8, 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[whicharm].send_goal(setup_goal)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99629:Expr_L56_C8", "label": "wait_for_result()", "type": "expression", "loc": [56, 56], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99629:FunctionDef_L50_C4", "vector": [8, 2, 0.4667, 0.0083, 2, 0.8, 1.0, 328, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "wait_for_result", "arg_names": [], "import_names": [], "rhs_call_name": "wait_for_result", "annotation": ""}, "snippet": " self.grasp_setup_client[whicharm].wait_for_result()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99629:FunctionDef_L60_C4", "label": "pick_up_object_near_point", "type": "function", "loc": [60, 61], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99629:ClassDef_L19_C0", "vector": [2, 1, 0.5042, 0.0167, 1, 0.42, 0.1429, 487, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "pick_up_object_near_point", "arg_names": ["self", "target_point", "whicharm"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def pick_up_object_near_point(self, target_point, whicharm):\n self.move_to_side(whicharm, False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99629:Expr_L61_C8", "label": "move_to_side()", "type": "expression", "loc": [61, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99629:FunctionDef_L60_C4", "vector": [8, 2, 0.5083, 0.0083, 2, 0.54, 0.0, 331, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "move_to_side", "arg_names": [], "import_names": [], "rhs_call_name": "move_to_side", "annotation": ""}, "snippet": " self.move_to_side(whicharm, False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99629:FunctionDef_L62_C4", "label": "place_object", "type": "function", "loc": [62, 89], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99629:ClassDef_L19_C0", "vector": [2, 1, 0.6292, 0.2333, 1, 0.42, 0.2143, 262, 0, 4, 1, 0, 0, 0, 7], "semantic": {"name": "place_object", "arg_names": ["self", "whicharm", "place_rect_dims", "place_rect_center"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def place_object(self, whicharm, place_rect_dims, place_rect_center):\n\n rospy.loginfo(\"putting down the object in the r gripper\")\n\n ############################################################\n # Creating place goal\n grasp_goal = OverheadGraspGoal()\n grasp_goal.is_grasp = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99629:Expr_L64_C8", "label": "loginfo()", "type": "expression", "loc": [64, 64], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99629:FunctionDef_L62_C4", "vector": [8, 2, 0.5333, 0.0083, 2, 0.25, 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(\"putting down the object in the r gripper\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99629:Assign_L68_C8", "label": "grasp_goal = OverheadGraspGoal()", "type": "assigned_variable", "loc": [68, 68], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99629:FunctionDef_L62_C4", "vector": [14, 2, 0.5667, 0.0083, 2, 0.25, 0.0625, 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_99629:Assign_L69_C8", "label": "grasp_goal.is_grasp =", "type": "assigned_variable", "loc": [69, 69], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99629:FunctionDef_L62_C4", "vector": [14, 2, 0.575, 0.0083, 2, 0.25, 0.125, 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_99629:Assign_L70_C8", "label": "grasp_goal.disable_head =", "type": "assigned_variable", "loc": [70, 70], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99629:FunctionDef_L62_C4", "vector": [14, 2, 0.5833, 0.0083, 2, 0.25, 0.1875, 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 = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99629:Assign_L71_C8", "label": "grasp_goal.disable_coll =", "type": "assigned_variable", "loc": [71, 71], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99629:FunctionDef_L62_C4", "vector": [14, 2, 0.5917, 0.0083, 2, 0.25, 0.25, 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_99629:Assign_L72_C8", "label": "grasp_goal.grasp_type =", "type": "assigned_variable", "loc": [72, 72], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99629:FunctionDef_L62_C4", "vector": [14, 2, 0.6, 0.0083, 2, 0.25, 0.3125, 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_99629:Assign_L73_C8", "label": "grasp_goal.grasp_params =", "type": "assigned_variable", "loc": [73, 73], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99629:FunctionDef_L62_C4", "vector": [14, 2, 0.6083, 0.0083, 2, 0.25, 0.375, 496, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "grasp_goal.grasp_params", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " grasp_goal.grasp_params = [0] * 3"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99629:Assign_L74_C8", "label": "assign", "type": "assigned_variable", "loc": [74, 74], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99629:FunctionDef_L62_C4", "vector": [14, 2, 0.6167, 0.0083, 2, 0.25, 0.4375, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " grasp_goal.grasp_params[0] = place_rect_center.pose.position.x"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99629:Assign_L75_C8", "label": "assign", "type": "assigned_variable", "loc": [75, 75], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99629:FunctionDef_L62_C4", "vector": [14, 2, 0.625, 0.0083, 2, 0.25, 0.5, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " grasp_goal.grasp_params[1] = place_rect_center.pose.position.y"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99629:Assign_L76_C8", "label": "grasp_goal.behavior_name =", "type": "assigned_variable", "loc": [76, 76], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99629:FunctionDef_L62_C4", "vector": [14, 2, 0.6333, 0.0083, 2, 0.25, 0.5625, 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_99629:Assign_L77_C8", "label": "grasp_goal.sig_level =", "type": "assigned_variable", "loc": [77, 77], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99629:FunctionDef_L62_C4", "vector": [14, 2, 0.6417, 0.0083, 2, 0.25, 0.625, 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_99629:Expr_L80_C8", "label": "send_goal()", "type": "expression", "loc": [80, 80], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99629:FunctionDef_L62_C4", "vector": [8, 2, 0.6667, 0.0083, 2, 0.25, 0.6875, 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[whicharm].send_goal(grasp_goal)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99629:Expr_L81_C8", "label": "wait_for_result()", "type": "expression", "loc": [81, 81], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99629:FunctionDef_L62_C4", "vector": [8, 2, 0.675, 0.0083, 2, 0.25, 0.75, 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[whicharm].wait_for_result()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99629:Assign_L82_C8", "label": "result = get_result()", "type": "assigned_variable", "loc": [82, 82], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99629:FunctionDef_L62_C4", "vector": [14, 2, 0.6833, 0.0083, 2, 0.25, 0.8125, 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[whicharm].get_result()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99629:Assign_L83_C8", "label": "success =", "type": "assigned_variable", "loc": [83, 83], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99629:FunctionDef_L62_C4", "vector": [14, 2, 0.6917, 0.0083, 2, 0.25, 0.875, 761, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "success", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " success = (result.grasp_result == \"Object placed\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99629:If_L85_C8", "label": "if", "type": "if", "loc": [85, 88], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99629:FunctionDef_L62_C4", "vector": [4, 2, 0.7208, 0.0333, 2, 0.25, 0.9375, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if success:\n rospy.loginfo(\"place returned success\")\n else:\n rospy.loginfo(\"place returned failure\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99629:Expr_L86_C12", "label": "loginfo()", "type": "expression", "loc": [86, 86], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99629:If_L85_C8", "vector": [8, 3, 0.7167, 0.0083, 3, 0.91, 0.0, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo(\"place returned success\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99629:Expr_L88_C12", "label": "loginfo()", "type": "expression", "loc": [88, 88], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99629:If_L85_C8", "vector": [8, 3, 0.7333, 0.0083, 3, 0.91, 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(\"place returned failure\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99629:Return_L89_C8", "label": "return", "type": "return", "loc": [89, 89], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99629:FunctionDef_L62_C4", "vector": [13, 2, 0.7417, 0.0083, 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 success"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99629:Import_L92_C4", "label": "optparse import optparse", "type": "import", "loc": [92, 92], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99629:ClassDef_L19_C0", "vector": [1, 1, 0.7667, 0.0083, 1, 0.42, 0.2857, 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_99629:Assign_L93_C4", "label": "p = OptionParser()", "type": "assigned_variable", "loc": [93, 93], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99629:ClassDef_L19_C0", "vector": [14, 1, 0.775, 0.0083, 1, 0.42, 0.3571, 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_99629:Expr_L95_C4", "label": "add_option()", "type": "expression", "loc": [95, 96], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99629:ClassDef_L19_C0", "vector": [8, 1, 0.7958, 0.0167, 1, 0.42, 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('--path', action='store', dest='path_save',type='string',\n default=None, help='this is path to directory for saving files')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99629:Assign_L98_C4", "label": "opt, args = parse_args()", "type": "assigned_variable", "loc": [98, 98], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99629:ClassDef_L19_C0", "vector": [14, 1, 0.8167, 0.0083, 1, 0.42, 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_99629:Expr_L100_C4", "label": "init_node()", "type": "expression", "loc": [100, 100], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99629:ClassDef_L19_C0", "vector": [8, 1, 0.8333, 0.0083, 1, 0.42, 0.5714, 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('simple_pick_and_place_example')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99629:Assign_L101_C4", "label": "hcp = HRLControllerPlaypen()", "type": "assigned_variable", "loc": [101, 101], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99629:ClassDef_L19_C0", "vector": [14, 1, 0.8417, 0.0083, 1, 0.42, 0.6429, 694, 3, 0, 0, 0, 721, 10, 1], "semantic": {"name": "hcp", "arg_names": [], "import_names": [], "rhs_call_name": "HRLControllerPlaypen", "annotation": ""}, "snippet": " hcp = HRLControllerPlaypen()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99629:Assign_L104_C4", "label": "table_height =", "type": "assigned_variable", "loc": [104, 104], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99629:ClassDef_L19_C0", "vector": [14, 1, 0.8667, 0.0083, 1, 0.42, 0.7143, 161, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "table_height", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " table_height = 0.529"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99629:Assign_L105_C4", "label": "date = now()", "type": "assigned_variable", "loc": [105, 105], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99629:ClassDef_L19_C0", "vector": [14, 1, 0.875, 0.0083, 1, 0.42, 0.7857, 56, 3, 0, 0, 0, 894, 10, 1], "semantic": {"name": "date", "arg_names": [], "import_names": [], "rhs_call_name": "now", "annotation": ""}, "snippet": " date = datetime.datetime.now()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99629:Assign_L107_C4", "label": "f_name = strftime()", "type": "assigned_variable", "loc": [107, 107], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99629:ClassDef_L19_C0", "vector": [14, 1, 0.8917, 0.0083, 1, 0.42, 0.8571, 178, 3, 1, 0, 0, 668, 10, 1], "semantic": {"name": "f_name", "arg_names": [], "import_names": [], "rhs_call_name": "strftime", "annotation": ""}, "snippet": " f_name = date.strftime(\"%Y-%m-%d_%H-%M-%S\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99629:If_L109_C4", "label": "if", "type": "if", "loc": [109, 115], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99629:ClassDef_L19_C0", "vector": [4, 1, 0.9333, 0.0583, 1, 0.42, 0.9286, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if opt.path_save == None:\n print(\"Not logging or saving data from playpen\")\n SAVE = False\n else:\n save_dir = opt.path_save+f_name\n print(\"Logging and saving playpen data in :\", save_dir)\n SAVE = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99629:Expr_L110_C8", "label": "print()", "type": "expression", "loc": [110, 110], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99629:If_L109_C4", "vector": [8, 2, 0.9167, 0.0083, 2, 0.43, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"Not logging or saving data from playpen\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99629:Assign_L111_C8", "label": "SAVE =", "type": "assigned_variable", "loc": [111, 111], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99629:If_L109_C4", "vector": [14, 2, 0.925, 0.0083, 2, 0.43, 0.25, 476, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "SAVE", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " SAVE = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99629:Assign_L113_C8", "label": "save_dir =", "type": "assigned_variable", "loc": [113, 113], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99629:If_L109_C4", "vector": [14, 2, 0.9417, 0.0083, 2, 0.43, 0.5, 201, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "save_dir", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " save_dir = opt.path_save+f_name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99629:Expr_L114_C8", "label": "print()", "type": "expression", "loc": [114, 114], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99629:If_L109_C4", "vector": [8, 2, 0.95, 0.0083, 2, 0.43, 0.75, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"Logging and saving playpen data in :\", save_dir)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99629:Assign_L115_C8", "label": "SAVE =", "type": "assigned_variable", "loc": [115, 115], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99629:If_L109_C4", "vector": [14, 2, 0.9583, 0.0083, 2, 0.43, 1.0, 476, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "SAVE", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " SAVE = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99629:If_L118_C4", "label": "if", "type": "if", "loc": [118, 119], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99629:ClassDef_L19_C0", "vector": [4, 1, 0.9875, 0.0167, 1, 0.42, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if SAVE == True:\n os.mkdir(save_dir)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99629:Expr_L119_C8", "label": "mkdir()", "type": "expression", "loc": [119, 119], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99629:If_L118_C4", "vector": [8, 2, 0.9917, 0.0083, 2, 0.76, 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(save_dir)"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99629:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99629:FunctionDef_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99629:FunctionDef_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99629:Expr_L22_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99629:FunctionDef_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99629:Expr_L23_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99629:FunctionDef_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99629:Expr_L24_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99629:FunctionDef_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99629:Expr_L25_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99629:FunctionDef_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99629:Assign_L26_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99629:FunctionDef_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99629:Assign_L27_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99629:FunctionDef_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99629:Assign_L28_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99629:FunctionDef_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99629:Assign_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99629:FunctionDef_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99629:Assign_L32_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99629:FunctionDef_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99629:Assign_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99629:FunctionDef_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99629:Assign_L35_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99629:FunctionDef_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99629:Assign_L37_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99629:FunctionDef_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99629:Assign_L38_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99629:FunctionDef_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99629:Assign_L40_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99629:FunctionDef_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99629:Expr_L41_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99629:FunctionDef_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99629:Assign_L43_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99629:FunctionDef_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99629:Expr_L44_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99629:FunctionDef_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99629:Assign_L45_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99629:FunctionDef_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99629:Expr_L46_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99629:FunctionDef_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99629:Assign_L47_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99629:FunctionDef_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99629:Expr_L48_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99629:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99629:FunctionDef_L50_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99629:FunctionDef_L50_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99629:Expr_L51_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99629:FunctionDef_L50_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99629:Assign_L52_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99629:FunctionDef_L50_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99629:Assign_L53_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99629:FunctionDef_L50_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99629:Assign_L54_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99629:FunctionDef_L50_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99629:Expr_L55_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99629:FunctionDef_L50_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99629:Expr_L56_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99629:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99629:FunctionDef_L60_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99629:FunctionDef_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99629:Expr_L61_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99629:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99629:FunctionDef_L62_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99629:FunctionDef_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99629:Expr_L64_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99629:FunctionDef_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99629:Assign_L68_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99629:FunctionDef_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99629:Assign_L69_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99629:FunctionDef_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99629:Assign_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99629:FunctionDef_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99629:Assign_L71_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99629:FunctionDef_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99629:Assign_L72_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99629:FunctionDef_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99629:Assign_L73_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99629:FunctionDef_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99629:Assign_L74_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99629:FunctionDef_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99629:Assign_L75_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99629:FunctionDef_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99629:Assign_L76_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99629:FunctionDef_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99629:Assign_L77_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99629:FunctionDef_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99629:Expr_L80_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99629:FunctionDef_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99629:Expr_L81_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99629:FunctionDef_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99629:Assign_L82_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99629:FunctionDef_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99629:Assign_L83_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99629:FunctionDef_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99629:If_L85_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99629:If_L85_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99629:Expr_L86_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99629:If_L85_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99629:Expr_L88_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99629:FunctionDef_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99629:Return_L89_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99629:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99629:Import_L92_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99629:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99629:Assign_L93_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99629:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99629:Expr_L95_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99629:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99629:Assign_L98_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99629:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99629:Expr_L100_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99629:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99629:Assign_L101_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99629:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99629:Assign_L104_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99629:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99629:Assign_L105_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99629:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99629:Assign_L107_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99629:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99629:If_L109_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99629:If_L109_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99629:Expr_L110_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99629:If_L109_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99629:Assign_L111_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99629:If_L109_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99629:Assign_L113_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99629:If_L109_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99629:Expr_L114_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99629:If_L109_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99629:Assign_L115_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99629:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99629:If_L118_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99629:If_L118_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99629:Expr_L119_C8"}]
#!/usr/bin/env python # Calculating and displaying 2D Hue-Saturation histogram of a color image import roslib roslib.load_manifest('opencv2') import sys import cv cv.NamedWindow("back_projection", cv.CV_WINDOW_AUTOSIZE) cv.NamedWindow("back_modified", cv.CV_WINDOW_AUTOSIZE) cv.NamedWindow("back_modified2", cv.CV_WINDOW_AUTOSIZE) def hs_histogram(src, patch): # Convert to HSV hsv = cv.CreateImage(cv.GetSize(src), 8, 3) cv.CvtColor(src, hsv, cv.CV_BGR2HSV) hsv_patch= cv.CreateImage(cv.GetSize(patch), 8, 3) # Extract the H and S planes h_plane = cv.CreateMat(src.rows, src.cols, cv.CV_8UC1) h_plane_img = cv.CreateImage(cv.GetSize(src), 8, 1) h_plane_patch = cv.CreateMat(patch.rows, patch.cols, cv.CV_8UC1) s_plane = cv.CreateMat(src.rows, src.cols, cv.CV_8UC1) s_plane_img = cv.CreateImage(cv.GetSize(src), 8, 1) s_plane_patch = cv.CreateMat(patch.rows, patch.cols, cv.CV_8UC1) v_plane = cv.CreateMat(src.rows, src.cols, cv.CV_8UC1) cv.Split(hsv, h_plane, s_plane, v_plane, None) cv.Split(hsv, h_plane_img, s_plane_img, None, None) cv.Split(hsv_patch, h_plane_patch, s_plane_patch, None, None) #cv.Split(src, h_plane, s_plane, v_plane, None) planes = [h_plane_patch, s_plane_patch]#, s_plane, v_plane] h_bins = 30 s_bins = 32 v_bins = 30 hist_size = [h_bins, s_bins] # hue varies from 0 (~0 deg red) to 180 (~360 deg red again */ h_ranges = [0, 180] # saturation varies from 0 (black-gray-white) to # 255 (pure spectrum color) s_ranges = [0, 255] v_ranges = [0, 255] ranges = [h_ranges, s_ranges]#, s_ranges, v_ranges] scale = 10 hist = cv.CreateHist([h_bins, s_bins], cv.CV_HIST_ARRAY, ranges, 1) cv.CalcHist([cv.GetImage(i) for i in planes], hist) (_, max_value, _, _) = cv.GetMinMaxHistValue(hist) hist_img = cv.CreateImage((h_bins*scale, s_bins*scale), 8, 3) back_proj_img = cv.CreateImage(cv.GetSize(src), 8, 1) cv.CalcBackProject([h_plane_img, s_plane_img], back_proj_img, hist) # for h in range(h_bins): # for s in range(s_bins): # bin_val = cv.QueryHistValue_2D(hist, h, s) # intensity = cv.Round(bin_val * 255 / max_value) # cv.Rectangle(hist_img, # (h*scale, s*scale), # ((h+1)*scale - 1, (s+1)*scale - 1), # cv.RGB(intensity, intensity, intensity), # cv.CV_FILLED) return back_proj_img, hist def back_project_hs(src, patch): # Convert to HSV hsv = cv.CreateImage(cv.GetSize(src), 8, 3) cv.CvtColor(src, hsv, cv.CV_BGR2HSV) hsv_patch= cv.CreateImage(cv.GetSize(patch), 8, 3) cv.CvtColor(patch, hsv_patch, cv.CV_BGR2HSV) # Extract the H and S planes h_plane = cv.CreateMat(src.rows, src.cols, cv.CV_8UC1) h_plane_img = cv.CreateImage(cv.GetSize(src), 8, 1) h_plane_patch = cv.CreateMat(patch.rows, patch.cols, cv.CV_8UC1) s_plane = cv.CreateMat(src.rows, src.cols, cv.CV_8UC1) s_plane_img = cv.CreateImage(cv.GetSize(src), 8, 1) s_plane_patch = cv.CreateMat(patch.rows, patch.cols, cv.CV_8UC1) v_plane = cv.CreateMat(src.rows, src.cols, cv.CV_8UC1) cv.Split(hsv, h_plane, s_plane, v_plane, None) cv.Split(hsv, h_plane_img, s_plane_img, None, None) cv.Split(hsv_patch, h_plane_patch, s_plane_patch, None, None) #cv.Split(src, h_plane, s_plane, v_plane, None) planes = [h_plane_patch, s_plane_patch]#, s_plane, v_plane] # planes = [s_plane_patch]#, s_plane, v_plane] h_bins = 30 s_bins = 32 hist_size = [h_bins, s_bins] # hue varies from 0 (~0 deg red) to 180 (~360 deg red again */ h_ranges = [0, 180] s_ranges = [0, 255] # saturation varies from 0 (black-gray-white) to # 255 (pure spectrum color) ranges = [h_ranges, s_ranges]#, s_ranges, v_ranges] #ranges = [s_ranges]#, s_ranges, v_ranges] scale = 1 hist = cv.CreateHist([h_bins, s_bins], cv.CV_HIST_ARRAY, ranges, 1) #hist = cv.CreateHist([s_bins], cv.CV_HIST_ARRAY, ranges, 1) cv.CalcHist([cv.GetImage(i) for i in planes], hist) (min_value, max_value, _, _) = cv.GetMinMaxHistValue(hist) #cv.NormalizeHist(hist, 20*250.0) print "min hist value is :", min_value print "max hist value is :", max_value back_proj_img = cv.CreateImage(cv.GetSize(src), 8, 1) #cv.NormalizeHist(hist, 2000) cv.CalcBackProject([h_plane_img, s_plane_img], back_proj_img, hist) back_modified = cv.CreateImage(cv.GetSize(src), 8, 1) back_modified2 = cv.CreateImage(cv.GetSize(src), 8, 1) # cv.Dilate(back_proj_img, back_proj_img) # cv.Erode(back_proj_img, back_proj_img) #cv.Smooth(back_proj_img, back_modified) #cv.AdaptiveThreshold(back_proj_img, back_modified, 255, adaptive_method=cv.CV_ADAPTIVE_THRESH_GAUSSIAN_C) #cv.Threshold(back_proj_img, back_modified, 250, 255, cv.CV_THRESH_BINARY) #cv.MorphologyEx(back_modified,back_modified2, None, None, cv.CV_MOP_CLOSE, 3) #cv.MorphologyEx(back_modified,back_modified2, None, None, cv.CV_MOP_CLOSE, 1) # cv.MorphologyEx(back_proj_img,back_modified2, None, None, cv.CV_MOP_CLOSE, 1) #cv.MorphologyEx(back_modified2,back_modified2, None, None, cv.CV_MOP_OPEN, 2) cv.MorphologyEx(back_proj_img,back_modified, None, None, cv.CV_MOP_OPEN, 1) cv.MorphologyEx(back_modified,back_modified, None, None, cv.CV_MOP_CLOSE, 2) cv.Threshold(back_modified, back_modified, 250, 255, cv.CV_THRESH_BINARY) # cv.MorphologyEx(back_proj_img,back_modified2, None, None, cv.CV_MOP_CLOSE, 1) # cv.MorphologyEx(back_modified2,back_modified2, None, None, cv.CV_MOP_OPEN, 2) #cv.FloodFill(back_modified, (320, 240), cv.Scalar(255), cv.Scalar(30), cv.Scalar(30), flags=8) # for i in xrange (10): # cv.MorphologyEx(back_modified,back_modified, None, None, cv.CV_MOP_OPEN, 3) # cv.MorphologyEx(back_modified,back_modified, None, None, cv.CV_MOP_CLOSE, 1) #cv.SubRS(back_modified, 255, back_modified) # cv.CalcBackProject([s_plane_img], back_proj_img, hist) # cv.Scale(back_proj_img, back_proj_img, 30000) cv.ShowImage("back_projection", back_proj_img) cv.ShowImage("back_modified", back_modified) cv.ShowImage("back_modified2", back_modified2) cv.WaitKey(0) #return back_proj_img, hist return back_modified, hist #return , hist if __name__ == '__main__': folder = sys.argv[1] cv.NamedWindow("Source", cv.CV_WINDOW_AUTOSIZE) cv.NamedWindow("final", cv.CV_WINDOW_AUTOSIZE) src2 = cv.LoadImageM(folder+'object'+str(0).zfill(3)+'_try'+str(0).zfill(3)+'_after_pr2.png') patch_images = [] avg_noise = cv.CreateImage(cv.GetSize(src2), 8, 1) cv.Zero(avg_noise) for k in xrange(1): patch_images.append(cv.LoadImageM('/home/mkillpack/Desktop/patch2.png')) #for i in [4]: for i in xrange(9): for j in xrange(100): print folder+'object'+str(i).zfill(3)+'_try'+str(j).zfill(3)+'_after_pr2.png' src = cv.LoadImageM(folder+'object'+str(i).zfill(3)+'_try'+str(j).zfill(3)+'_after_pr2.png') cv.ShowImage("Source", src) back_proj_img, hist1 = back_project_hs(src, patch_images[0]) back_proj_img2, hist2 = back_project_hs(src2, patch_images[0]) scratch = cv.CreateImage(cv.GetSize(back_proj_img2), 8, 1) scratch2 = cv.CreateImage(cv.GetSize(back_proj_img2), 8, 1) # do something clever with ands ors and diffs cv.Zero(scratch) cv.Zero(scratch2) #idea is to have a background model from back_proj_img2, or at least an emtpy single shot ###cv.Sub(back_proj_img, back_proj_img2, scratch) #cv.SubRS(back_proj_img, 255, scratch) ###cv.SubRS(back_proj_img2, 255, scratch2) #cv.Sub(back_proj_img, back_proj_img2, scratch2) #opposite noise, but excludes object cv.Sub(back_proj_img2, back_proj_img, scratch2) #noise, but includes object if failed, #would need to learn before then update selectively #Maybe want both added in the end. cv.Sub(scratch2, avg_noise, scratch) cv.Or(avg_noise, scratch2, avg_noise) ##adding this part fills in wherever the object has been too, heatmaps? #cv.Sub(back_proj_img2, back_proj_img, scratch) #cv.Or(avg_noise, scratch, avg_noise) # #cv.Sub(back_proj_img2, avg_noise, back_proj_img2) #cv.Sub(scratch,, back_proj_img2) cv.ShowImage("final", scratch) #cv.Sub(scratch, avg_noise, scratch2) #cv.And(scratch, back_proj_img2, scratch2) #cv.SubRS(scratch2, 255, scratch) #cv.ShowImage("final", back_proj_img) print cv.CompareHist(hist1, hist2, cv.CV_COMP_BHATTACHARYYA) #making a mask #mask = cv.CreateImage(cv.GetSize(back_proj_img2), 8, 1) #cv.SubRS(back_proj_img2, 255, back_proj_img2) #cv.SubRS(back_proj_img, 255, back_proj_img, mask=back_proj_img2) #cv.SubRS(back_proj_img, 255, back_proj_img) #cv.MorphologyEx(back_proj_img,back_proj_img, None, None, cv.CV_MOP_OPEN, 8) #cv.MorphologyEx(back_proj_img,back_proj_img, None, None, cv.CV_MOP_CLOSE, 8) #cv.ShowImage("back_projection", back_proj_img2) #cv.WaitKey(0) cv.Scale(back_proj_img, back_proj_img, 1/255.0) print "here's the sum :", cv.Sum(scratch2)
ajibawa-2023/Python-Code-Large/train/row_99630
106
239
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99630:Import_L3_C0", "label": "roslib import roslib", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0126, 0.0042, 0, 0.66, 0.0, 796, 0, 1, 0, 0, 796, 0, 0], "semantic": {"name": "roslib", "arg_names": [], "import_names": ["roslib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import roslib"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99630:Expr_L4_C0", "label": "load_manifest()", "type": "expression", "loc": [4, 4], "level": 0, "parent": null, "vector": [8, 0, 0.0167, 0.0042, 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('opencv2')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99630:Import_L5_C0", "label": "sys import sys", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0209, 0.0042, 0, 0.66, 0.2222, 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_99630:Import_L6_C0", "label": "cv import cv", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0251, 0.0042, 0, 0.66, 0.3333, 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_99630:Expr_L8_C0", "label": "NamedWindow()", "type": "expression", "loc": [8, 8], "level": 0, "parent": null, "vector": [8, 0, 0.0335, 0.0042, 0, 0.66, 0.4444, 60, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "NamedWindow", "arg_names": [], "import_names": [], "rhs_call_name": "NamedWindow", "annotation": ""}, "snippet": "cv.NamedWindow(\"back_projection\", cv.CV_WINDOW_AUTOSIZE)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99630:Expr_L9_C0", "label": "NamedWindow()", "type": "expression", "loc": [9, 9], "level": 0, "parent": null, "vector": [8, 0, 0.0377, 0.0042, 0, 0.66, 0.5556, 60, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "NamedWindow", "arg_names": [], "import_names": [], "rhs_call_name": "NamedWindow", "annotation": ""}, "snippet": "cv.NamedWindow(\"back_modified\", cv.CV_WINDOW_AUTOSIZE)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99630:Expr_L10_C0", "label": "NamedWindow()", "type": "expression", "loc": [10, 10], "level": 0, "parent": null, "vector": [8, 0, 0.0418, 0.0042, 0, 0.66, 0.6667, 60, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "NamedWindow", "arg_names": [], "import_names": [], "rhs_call_name": "NamedWindow", "annotation": ""}, "snippet": "cv.NamedWindow(\"back_modified2\", cv.CV_WINDOW_AUTOSIZE)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L12_C0", "label": "hs_histogram", "type": "function", "loc": [12, 63], "level": 0, "parent": null, "vector": [2, 0, 0.1569, 0.2176, 0, 0.66, 0.7778, 106, 0, 2, 1, 0, 0, 0, 25], "semantic": {"name": "hs_histogram", "arg_names": ["src", "patch"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def hs_histogram(src, patch):\n # Convert to HSV\n hsv = cv.CreateImage(cv.GetSize(src), 8, 3)\n cv.CvtColor(src, hsv, cv.CV_BGR2HSV)\n hsv_patch= cv.CreateImage(cv.GetSize(patch), 8, 3)\n\n # Extract the H and S planes\n h_plane = cv.CreateMat(src.rows, src.cols, cv.CV_8UC1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99630:Assign_L14_C4", "label": "hsv = CreateImage()", "type": "assigned_variable", "loc": [14, 14], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L12_C0", "vector": [14, 1, 0.0586, 0.0042, 1, 0.94, 0.0, 809, 3, 3, 0, 0, 288, 10, 2], "semantic": {"name": "hsv", "arg_names": [], "import_names": [], "rhs_call_name": "CreateImage", "annotation": ""}, "snippet": " hsv = cv.CreateImage(cv.GetSize(src), 8, 3)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99630:Expr_L15_C4", "label": "CvtColor()", "type": "expression", "loc": [15, 15], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L12_C0", "vector": [8, 1, 0.0628, 0.0042, 1, 0.94, 0.0345, 974, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "CvtColor", "arg_names": [], "import_names": [], "rhs_call_name": "CvtColor", "annotation": ""}, "snippet": " cv.CvtColor(src, hsv, cv.CV_BGR2HSV)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99630:Assign_L16_C4", "label": "hsv_patch = CreateImage()", "type": "assigned_variable", "loc": [16, 16], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L12_C0", "vector": [14, 1, 0.0669, 0.0042, 1, 0.94, 0.069, 893, 3, 3, 0, 0, 288, 10, 2], "semantic": {"name": "hsv_patch", "arg_names": [], "import_names": [], "rhs_call_name": "CreateImage", "annotation": ""}, "snippet": " hsv_patch= cv.CreateImage(cv.GetSize(patch), 8, 3)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99630:Assign_L19_C4", "label": "h_plane = CreateMat()", "type": "assigned_variable", "loc": [19, 19], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L12_C0", "vector": [14, 1, 0.0795, 0.0042, 1, 0.94, 0.1034, 970, 3, 3, 0, 0, 892, 10, 1], "semantic": {"name": "h_plane", "arg_names": [], "import_names": [], "rhs_call_name": "CreateMat", "annotation": ""}, "snippet": " h_plane = cv.CreateMat(src.rows, src.cols, cv.CV_8UC1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99630:Assign_L20_C4", "label": "h_plane_img = CreateImage()", "type": "assigned_variable", "loc": [20, 20], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L12_C0", "vector": [14, 1, 0.0837, 0.0042, 1, 0.94, 0.1379, 345, 3, 3, 0, 0, 288, 10, 2], "semantic": {"name": "h_plane_img", "arg_names": [], "import_names": [], "rhs_call_name": "CreateImage", "annotation": ""}, "snippet": " h_plane_img = cv.CreateImage(cv.GetSize(src), 8, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99630:Assign_L21_C4", "label": "h_plane_patch = CreateMat()", "type": "assigned_variable", "loc": [21, 21], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L12_C0", "vector": [14, 1, 0.0879, 0.0042, 1, 0.94, 0.1724, 482, 3, 3, 0, 0, 892, 10, 1], "semantic": {"name": "h_plane_patch", "arg_names": [], "import_names": [], "rhs_call_name": "CreateMat", "annotation": ""}, "snippet": " h_plane_patch = cv.CreateMat(patch.rows, patch.cols, cv.CV_8UC1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99630:Assign_L22_C4", "label": "s_plane = CreateMat()", "type": "assigned_variable", "loc": [22, 22], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L12_C0", "vector": [14, 1, 0.0921, 0.0042, 1, 0.94, 0.2069, 686, 3, 3, 0, 0, 892, 10, 1], "semantic": {"name": "s_plane", "arg_names": [], "import_names": [], "rhs_call_name": "CreateMat", "annotation": ""}, "snippet": " s_plane = cv.CreateMat(src.rows, src.cols, cv.CV_8UC1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99630:Assign_L23_C4", "label": "s_plane_img = CreateImage()", "type": "assigned_variable", "loc": [23, 23], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L12_C0", "vector": [14, 1, 0.0962, 0.0042, 1, 0.94, 0.2414, 669, 3, 3, 0, 0, 288, 10, 2], "semantic": {"name": "s_plane_img", "arg_names": [], "import_names": [], "rhs_call_name": "CreateImage", "annotation": ""}, "snippet": " s_plane_img = cv.CreateImage(cv.GetSize(src), 8, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99630:Assign_L24_C4", "label": "s_plane_patch = CreateMat()", "type": "assigned_variable", "loc": [24, 24], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L12_C0", "vector": [14, 1, 0.1004, 0.0042, 1, 0.94, 0.2759, 673, 3, 3, 0, 0, 892, 10, 1], "semantic": {"name": "s_plane_patch", "arg_names": [], "import_names": [], "rhs_call_name": "CreateMat", "annotation": ""}, "snippet": " s_plane_patch = cv.CreateMat(patch.rows, patch.cols, cv.CV_8UC1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99630:Assign_L25_C4", "label": "v_plane = CreateMat()", "type": "assigned_variable", "loc": [25, 25], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L12_C0", "vector": [14, 1, 0.1046, 0.0042, 1, 0.94, 0.3103, 815, 3, 3, 0, 0, 892, 10, 1], "semantic": {"name": "v_plane", "arg_names": [], "import_names": [], "rhs_call_name": "CreateMat", "annotation": ""}, "snippet": " v_plane = cv.CreateMat(src.rows, src.cols, cv.CV_8UC1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99630:Expr_L27_C4", "label": "Split()", "type": "expression", "loc": [27, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L12_C0", "vector": [8, 1, 0.113, 0.0042, 1, 0.94, 0.3448, 551, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "Split", "arg_names": [], "import_names": [], "rhs_call_name": "Split", "annotation": ""}, "snippet": " cv.Split(hsv, h_plane, s_plane, v_plane, None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99630:Expr_L28_C4", "label": "Split()", "type": "expression", "loc": [28, 28], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L12_C0", "vector": [8, 1, 0.1172, 0.0042, 1, 0.94, 0.3793, 551, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "Split", "arg_names": [], "import_names": [], "rhs_call_name": "Split", "annotation": ""}, "snippet": " cv.Split(hsv, h_plane_img, s_plane_img, None, None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99630:Expr_L29_C4", "label": "Split()", "type": "expression", "loc": [29, 29], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L12_C0", "vector": [8, 1, 0.1213, 0.0042, 1, 0.94, 0.4138, 551, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "Split", "arg_names": [], "import_names": [], "rhs_call_name": "Split", "annotation": ""}, "snippet": " cv.Split(hsv_patch, h_plane_patch, s_plane_patch, None, None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99630:Assign_L31_C4", "label": "planes =", "type": "assigned_variable", "loc": [31, 31], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L12_C0", "vector": [14, 1, 0.1297, 0.0042, 1, 0.94, 0.4483, 118, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "planes", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " planes = [h_plane_patch, s_plane_patch]#, s_plane, v_plane]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99630:Assign_L33_C4", "label": "h_bins =", "type": "assigned_variable", "loc": [33, 33], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L12_C0", "vector": [14, 1, 0.1381, 0.0042, 1, 0.94, 0.4828, 154, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "h_bins", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " h_bins = 30"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99630:Assign_L34_C4", "label": "s_bins =", "type": "assigned_variable", "loc": [34, 34], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L12_C0", "vector": [14, 1, 0.1423, 0.0042, 1, 0.94, 0.5172, 892, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "s_bins", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " s_bins = 32"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99630:Assign_L35_C4", "label": "v_bins =", "type": "assigned_variable", "loc": [35, 35], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L12_C0", "vector": [14, 1, 0.1464, 0.0042, 1, 0.94, 0.5517, 956, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "v_bins", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " v_bins = 30"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99630:Assign_L36_C4", "label": "hist_size =", "type": "assigned_variable", "loc": [36, 36], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L12_C0", "vector": [14, 1, 0.1506, 0.0042, 1, 0.94, 0.5862, 802, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "hist_size", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " hist_size = [h_bins, s_bins]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99630:Assign_L38_C4", "label": "h_ranges =", "type": "assigned_variable", "loc": [38, 38], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L12_C0", "vector": [14, 1, 0.159, 0.0042, 1, 0.94, 0.6207, 417, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "h_ranges", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " h_ranges = [0, 180]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99630:Assign_L41_C4", "label": "s_ranges =", "type": "assigned_variable", "loc": [41, 41], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L12_C0", "vector": [14, 1, 0.1715, 0.0042, 1, 0.94, 0.6552, 202, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "s_ranges", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " s_ranges = [0, 255]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99630:Assign_L42_C4", "label": "v_ranges =", "type": "assigned_variable", "loc": [42, 42], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L12_C0", "vector": [14, 1, 0.1757, 0.0042, 1, 0.94, 0.6897, 157, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "v_ranges", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " v_ranges = [0, 255]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99630:Assign_L43_C4", "label": "ranges =", "type": "assigned_variable", "loc": [43, 43], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L12_C0", "vector": [14, 1, 0.1799, 0.0042, 1, 0.94, 0.7241, 487, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "ranges", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ranges = [h_ranges, s_ranges]#, s_ranges, v_ranges]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99630:Assign_L44_C4", "label": "scale =", "type": "assigned_variable", "loc": [44, 44], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L12_C0", "vector": [14, 1, 0.1841, 0.0042, 1, 0.94, 0.7586, 18, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "scale", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " scale = 10"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99630:Assign_L45_C4", "label": "hist = CreateHist()", "type": "assigned_variable", "loc": [45, 45], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L12_C0", "vector": [14, 1, 0.1883, 0.0042, 1, 0.94, 0.7931, 353, 3, 4, 0, 0, 658, 10, 1], "semantic": {"name": "hist", "arg_names": [], "import_names": [], "rhs_call_name": "CreateHist", "annotation": ""}, "snippet": " hist = cv.CreateHist([h_bins, s_bins], cv.CV_HIST_ARRAY, ranges, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99630:Expr_L46_C4", "label": "CalcHist()", "type": "expression", "loc": [46, 46], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L12_C0", "vector": [8, 1, 0.1925, 0.0042, 1, 0.94, 0.8276, 809, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "CalcHist", "arg_names": [], "import_names": [], "rhs_call_name": "CalcHist", "annotation": ""}, "snippet": " cv.CalcHist([cv.GetImage(i) for i in planes], hist)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99630:Assign_L47_C4", "label": "_, max_value, _, _ = GetMinMaxHistValue()", "type": "assigned_variable", "loc": [47, 47], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L12_C0", "vector": [14, 1, 0.1967, 0.0042, 1, 0.94, 0.8621, 3, 3, 1, 0, 0, 971, 10, 1], "semantic": {"name": "_, max_value, _, _", "arg_names": [], "import_names": [], "rhs_call_name": "GetMinMaxHistValue", "annotation": ""}, "snippet": " (_, max_value, _, _) = cv.GetMinMaxHistValue(hist)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99630:Assign_L49_C4", "label": "hist_img = CreateImage()", "type": "assigned_variable", "loc": [49, 49], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L12_C0", "vector": [14, 1, 0.205, 0.0042, 1, 0.94, 0.8966, 870, 3, 3, 0, 0, 288, 10, 1], "semantic": {"name": "hist_img", "arg_names": [], "import_names": [], "rhs_call_name": "CreateImage", "annotation": ""}, "snippet": " hist_img = cv.CreateImage((h_bins*scale, s_bins*scale), 8, 3)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99630:Assign_L51_C4", "label": "back_proj_img = CreateImage()", "type": "assigned_variable", "loc": [51, 51], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L12_C0", "vector": [14, 1, 0.2134, 0.0042, 1, 0.94, 0.931, 526, 3, 3, 0, 0, 288, 10, 2], "semantic": {"name": "back_proj_img", "arg_names": [], "import_names": [], "rhs_call_name": "CreateImage", "annotation": ""}, "snippet": " back_proj_img = cv.CreateImage(cv.GetSize(src), 8, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99630:Expr_L52_C4", "label": "CalcBackProject()", "type": "expression", "loc": [52, 52], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L12_C0", "vector": [8, 1, 0.2176, 0.0042, 1, 0.94, 0.9655, 139, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "CalcBackProject", "arg_names": [], "import_names": [], "rhs_call_name": "CalcBackProject", "annotation": ""}, "snippet": " cv.CalcBackProject([h_plane_img, s_plane_img], back_proj_img, hist)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99630:Return_L63_C4", "label": "return", "type": "return", "loc": [63, 63], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L12_C0", "vector": [13, 1, 0.2636, 0.0042, 1, 0.94, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return back_proj_img, hist"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L65_C0", "label": "back_project_hs", "type": "function", "loc": [65, 161], "level": 0, "parent": null, "vector": [2, 0, 0.4728, 0.4059, 0, 0.66, 0.8889, 363, 0, 2, 1, 0, 0, 0, 38], "semantic": {"name": "back_project_hs", "arg_names": ["src", "patch"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def back_project_hs(src, patch):\n # Convert to HSV\n hsv = cv.CreateImage(cv.GetSize(src), 8, 3)\n cv.CvtColor(src, hsv, cv.CV_BGR2HSV)\n hsv_patch= cv.CreateImage(cv.GetSize(patch), 8, 3)\n cv.CvtColor(patch, hsv_patch, cv.CV_BGR2HSV)\n\n # Extract the H and S planes"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99630:Assign_L67_C4", "label": "hsv = CreateImage()", "type": "assigned_variable", "loc": [67, 67], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L65_C0", "vector": [14, 1, 0.2803, 0.0042, 1, 0.1, 0.0, 809, 3, 3, 0, 0, 288, 10, 2], "semantic": {"name": "hsv", "arg_names": [], "import_names": [], "rhs_call_name": "CreateImage", "annotation": ""}, "snippet": " hsv = cv.CreateImage(cv.GetSize(src), 8, 3)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99630:Expr_L68_C4", "label": "CvtColor()", "type": "expression", "loc": [68, 68], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L65_C0", "vector": [8, 1, 0.2845, 0.0042, 1, 0.1, 0.0263, 974, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "CvtColor", "arg_names": [], "import_names": [], "rhs_call_name": "CvtColor", "annotation": ""}, "snippet": " cv.CvtColor(src, hsv, cv.CV_BGR2HSV)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99630:Assign_L69_C4", "label": "hsv_patch = CreateImage()", "type": "assigned_variable", "loc": [69, 69], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L65_C0", "vector": [14, 1, 0.2887, 0.0042, 1, 0.1, 0.0526, 893, 3, 3, 0, 0, 288, 10, 2], "semantic": {"name": "hsv_patch", "arg_names": [], "import_names": [], "rhs_call_name": "CreateImage", "annotation": ""}, "snippet": " hsv_patch= cv.CreateImage(cv.GetSize(patch), 8, 3)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99630:Expr_L70_C4", "label": "CvtColor()", "type": "expression", "loc": [70, 70], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L65_C0", "vector": [8, 1, 0.2929, 0.0042, 1, 0.1, 0.0789, 974, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "CvtColor", "arg_names": [], "import_names": [], "rhs_call_name": "CvtColor", "annotation": ""}, "snippet": " cv.CvtColor(patch, hsv_patch, cv.CV_BGR2HSV)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99630:Assign_L73_C4", "label": "h_plane = CreateMat()", "type": "assigned_variable", "loc": [73, 73], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L65_C0", "vector": [14, 1, 0.3054, 0.0042, 1, 0.1, 0.1053, 970, 3, 3, 0, 0, 892, 10, 1], "semantic": {"name": "h_plane", "arg_names": [], "import_names": [], "rhs_call_name": "CreateMat", "annotation": ""}, "snippet": " h_plane = cv.CreateMat(src.rows, src.cols, cv.CV_8UC1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99630:Assign_L74_C4", "label": "h_plane_img = CreateImage()", "type": "assigned_variable", "loc": [74, 74], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L65_C0", "vector": [14, 1, 0.3096, 0.0042, 1, 0.1, 0.1316, 345, 3, 3, 0, 0, 288, 10, 2], "semantic": {"name": "h_plane_img", "arg_names": [], "import_names": [], "rhs_call_name": "CreateImage", "annotation": ""}, "snippet": " h_plane_img = cv.CreateImage(cv.GetSize(src), 8, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99630:Assign_L75_C4", "label": "h_plane_patch = CreateMat()", "type": "assigned_variable", "loc": [75, 75], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L65_C0", "vector": [14, 1, 0.3138, 0.0042, 1, 0.1, 0.1579, 482, 3, 3, 0, 0, 892, 10, 1], "semantic": {"name": "h_plane_patch", "arg_names": [], "import_names": [], "rhs_call_name": "CreateMat", "annotation": ""}, "snippet": " h_plane_patch = cv.CreateMat(patch.rows, patch.cols, cv.CV_8UC1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99630:Assign_L76_C4", "label": "s_plane = CreateMat()", "type": "assigned_variable", "loc": [76, 76], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L65_C0", "vector": [14, 1, 0.318, 0.0042, 1, 0.1, 0.1842, 686, 3, 3, 0, 0, 892, 10, 1], "semantic": {"name": "s_plane", "arg_names": [], "import_names": [], "rhs_call_name": "CreateMat", "annotation": ""}, "snippet": " s_plane = cv.CreateMat(src.rows, src.cols, cv.CV_8UC1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99630:Assign_L77_C4", "label": "s_plane_img = CreateImage()", "type": "assigned_variable", "loc": [77, 77], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L65_C0", "vector": [14, 1, 0.3222, 0.0042, 1, 0.1, 0.2105, 669, 3, 3, 0, 0, 288, 10, 2], "semantic": {"name": "s_plane_img", "arg_names": [], "import_names": [], "rhs_call_name": "CreateImage", "annotation": ""}, "snippet": " s_plane_img = cv.CreateImage(cv.GetSize(src), 8, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99630:Assign_L78_C4", "label": "s_plane_patch = CreateMat()", "type": "assigned_variable", "loc": [78, 78], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L65_C0", "vector": [14, 1, 0.3264, 0.0042, 1, 0.1, 0.2368, 673, 3, 3, 0, 0, 892, 10, 1], "semantic": {"name": "s_plane_patch", "arg_names": [], "import_names": [], "rhs_call_name": "CreateMat", "annotation": ""}, "snippet": " s_plane_patch = cv.CreateMat(patch.rows, patch.cols, cv.CV_8UC1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99630:Assign_L79_C4", "label": "v_plane = CreateMat()", "type": "assigned_variable", "loc": [79, 79], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L65_C0", "vector": [14, 1, 0.3305, 0.0042, 1, 0.1, 0.2632, 815, 3, 3, 0, 0, 892, 10, 1], "semantic": {"name": "v_plane", "arg_names": [], "import_names": [], "rhs_call_name": "CreateMat", "annotation": ""}, "snippet": " v_plane = cv.CreateMat(src.rows, src.cols, cv.CV_8UC1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99630:Expr_L81_C4", "label": "Split()", "type": "expression", "loc": [81, 81], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L65_C0", "vector": [8, 1, 0.3389, 0.0042, 1, 0.1, 0.2895, 551, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "Split", "arg_names": [], "import_names": [], "rhs_call_name": "Split", "annotation": ""}, "snippet": " cv.Split(hsv, h_plane, s_plane, v_plane, None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99630:Expr_L82_C4", "label": "Split()", "type": "expression", "loc": [82, 82], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L65_C0", "vector": [8, 1, 0.3431, 0.0042, 1, 0.1, 0.3158, 551, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "Split", "arg_names": [], "import_names": [], "rhs_call_name": "Split", "annotation": ""}, "snippet": " cv.Split(hsv, h_plane_img, s_plane_img, None, None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99630:Expr_L83_C4", "label": "Split()", "type": "expression", "loc": [83, 83], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L65_C0", "vector": [8, 1, 0.3473, 0.0042, 1, 0.1, 0.3421, 551, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "Split", "arg_names": [], "import_names": [], "rhs_call_name": "Split", "annotation": ""}, "snippet": " cv.Split(hsv_patch, h_plane_patch, s_plane_patch, None, None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99630:Assign_L85_C4", "label": "planes =", "type": "assigned_variable", "loc": [85, 85], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L65_C0", "vector": [14, 1, 0.3556, 0.0042, 1, 0.1, 0.3684, 118, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "planes", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " planes = [h_plane_patch, s_plane_patch]#, s_plane, v_plane]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99630:Assign_L88_C4", "label": "h_bins =", "type": "assigned_variable", "loc": [88, 88], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L65_C0", "vector": [14, 1, 0.3682, 0.0042, 1, 0.1, 0.3947, 154, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "h_bins", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " h_bins = 30"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99630:Assign_L89_C4", "label": "s_bins =", "type": "assigned_variable", "loc": [89, 89], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L65_C0", "vector": [14, 1, 0.3724, 0.0042, 1, 0.1, 0.4211, 892, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "s_bins", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " s_bins = 32"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99630:Assign_L90_C4", "label": "hist_size =", "type": "assigned_variable", "loc": [90, 90], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L65_C0", "vector": [14, 1, 0.3766, 0.0042, 1, 0.1, 0.4474, 802, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "hist_size", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " hist_size = [h_bins, s_bins]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99630:Assign_L92_C4", "label": "h_ranges =", "type": "assigned_variable", "loc": [92, 92], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L65_C0", "vector": [14, 1, 0.3849, 0.0042, 1, 0.1, 0.4737, 417, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "h_ranges", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " h_ranges = [0, 180]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99630:Assign_L93_C4", "label": "s_ranges =", "type": "assigned_variable", "loc": [93, 93], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L65_C0", "vector": [14, 1, 0.3891, 0.0042, 1, 0.1, 0.5, 202, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "s_ranges", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " s_ranges = [0, 255]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99630:Assign_L96_C4", "label": "ranges =", "type": "assigned_variable", "loc": [96, 96], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L65_C0", "vector": [14, 1, 0.4017, 0.0042, 1, 0.1, 0.5263, 487, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "ranges", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ranges = [h_ranges, s_ranges]#, s_ranges, v_ranges]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99630:Assign_L98_C4", "label": "scale =", "type": "assigned_variable", "loc": [98, 98], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L65_C0", "vector": [14, 1, 0.41, 0.0042, 1, 0.1, 0.5526, 18, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "scale", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " scale = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99630:Assign_L99_C4", "label": "hist = CreateHist()", "type": "assigned_variable", "loc": [99, 99], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L65_C0", "vector": [14, 1, 0.4142, 0.0042, 1, 0.1, 0.5789, 353, 3, 4, 0, 0, 658, 10, 1], "semantic": {"name": "hist", "arg_names": [], "import_names": [], "rhs_call_name": "CreateHist", "annotation": ""}, "snippet": " hist = cv.CreateHist([h_bins, s_bins], cv.CV_HIST_ARRAY, ranges, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99630:Expr_L101_C4", "label": "CalcHist()", "type": "expression", "loc": [101, 101], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L65_C0", "vector": [8, 1, 0.4226, 0.0042, 1, 0.1, 0.6053, 809, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "CalcHist", "arg_names": [], "import_names": [], "rhs_call_name": "CalcHist", "annotation": ""}, "snippet": " cv.CalcHist([cv.GetImage(i) for i in planes], hist)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99630:Assign_L103_C4", "label": "min_value, max_value, _, _ = GetMinMaxHistValue()", "type": "assigned_variable", "loc": [103, 103], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L65_C0", "vector": [14, 1, 0.431, 0.0042, 1, 0.1, 0.6316, 713, 3, 1, 0, 0, 971, 10, 1], "semantic": {"name": "min_value, max_value, _, _", "arg_names": [], "import_names": [], "rhs_call_name": "GetMinMaxHistValue", "annotation": ""}, "snippet": " (min_value, max_value, _, _) = cv.GetMinMaxHistValue(hist)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99630:Expr_L106_C4", "label": "print()", "type": "expression", "loc": [106, 106], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L65_C0", "vector": [8, 1, 0.4435, 0.0042, 1, 0.1, 0.6579, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"min hist value is :\", min_value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99630:Expr_L107_C4", "label": "print()", "type": "expression", "loc": [107, 107], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L65_C0", "vector": [8, 1, 0.4477, 0.0042, 1, 0.1, 0.6842, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"max hist value is :\", max_value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99630:Assign_L109_C4", "label": "back_proj_img = CreateImage()", "type": "assigned_variable", "loc": [109, 109], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L65_C0", "vector": [14, 1, 0.4561, 0.0042, 1, 0.1, 0.7105, 526, 3, 3, 0, 0, 288, 10, 2], "semantic": {"name": "back_proj_img", "arg_names": [], "import_names": [], "rhs_call_name": "CreateImage", "annotation": ""}, "snippet": " back_proj_img = cv.CreateImage(cv.GetSize(src), 8, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99630:Expr_L113_C4", "label": "CalcBackProject()", "type": "expression", "loc": [113, 113], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L65_C0", "vector": [8, 1, 0.4728, 0.0042, 1, 0.1, 0.7368, 139, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "CalcBackProject", "arg_names": [], "import_names": [], "rhs_call_name": "CalcBackProject", "annotation": ""}, "snippet": " cv.CalcBackProject([h_plane_img, s_plane_img], back_proj_img, hist)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99630:Assign_L114_C4", "label": "back_modified = CreateImage()", "type": "assigned_variable", "loc": [114, 114], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L65_C0", "vector": [14, 1, 0.477, 0.0042, 1, 0.1, 0.7632, 873, 3, 3, 0, 0, 288, 10, 2], "semantic": {"name": "back_modified", "arg_names": [], "import_names": [], "rhs_call_name": "CreateImage", "annotation": ""}, "snippet": " back_modified = cv.CreateImage(cv.GetSize(src), 8, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99630:Assign_L115_C4", "label": "back_modified2 = CreateImage()", "type": "assigned_variable", "loc": [115, 115], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L65_C0", "vector": [14, 1, 0.4812, 0.0042, 1, 0.1, 0.7895, 939, 3, 3, 0, 0, 288, 10, 2], "semantic": {"name": "back_modified2", "arg_names": [], "import_names": [], "rhs_call_name": "CreateImage", "annotation": ""}, "snippet": " back_modified2 = cv.CreateImage(cv.GetSize(src), 8, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99630:Expr_L131_C4", "label": "MorphologyEx()", "type": "expression", "loc": [131, 131], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L65_C0", "vector": [8, 1, 0.5481, 0.0042, 1, 0.1, 0.8158, 597, 3, 6, 0, 0, 0, 0, 1], "semantic": {"name": "MorphologyEx", "arg_names": [], "import_names": [], "rhs_call_name": "MorphologyEx", "annotation": ""}, "snippet": " cv.MorphologyEx(back_proj_img,back_modified, None, None, cv.CV_MOP_OPEN, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99630:Expr_L132_C4", "label": "MorphologyEx()", "type": "expression", "loc": [132, 132], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L65_C0", "vector": [8, 1, 0.5523, 0.0042, 1, 0.1, 0.8421, 597, 3, 6, 0, 0, 0, 0, 1], "semantic": {"name": "MorphologyEx", "arg_names": [], "import_names": [], "rhs_call_name": "MorphologyEx", "annotation": ""}, "snippet": " cv.MorphologyEx(back_modified,back_modified, None, None, cv.CV_MOP_CLOSE, 2) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99630:Expr_L133_C4", "label": "Threshold()", "type": "expression", "loc": [133, 133], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L65_C0", "vector": [8, 1, 0.5565, 0.0042, 1, 0.1, 0.8684, 302, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "Threshold", "arg_names": [], "import_names": [], "rhs_call_name": "Threshold", "annotation": ""}, "snippet": " cv.Threshold(back_modified, back_modified, 250, 255, cv.CV_THRESH_BINARY)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99630:Expr_L152_C4", "label": "ShowImage()", "type": "expression", "loc": [152, 152], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L65_C0", "vector": [8, 1, 0.636, 0.0042, 1, 0.1, 0.8947, 896, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "ShowImage", "arg_names": [], "import_names": [], "rhs_call_name": "ShowImage", "annotation": ""}, "snippet": " cv.ShowImage(\"back_projection\", back_proj_img)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99630:Expr_L153_C4", "label": "ShowImage()", "type": "expression", "loc": [153, 153], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L65_C0", "vector": [8, 1, 0.6402, 0.0042, 1, 0.1, 0.9211, 896, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "ShowImage", "arg_names": [], "import_names": [], "rhs_call_name": "ShowImage", "annotation": ""}, "snippet": " cv.ShowImage(\"back_modified\", back_modified)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99630:Expr_L154_C4", "label": "ShowImage()", "type": "expression", "loc": [154, 154], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L65_C0", "vector": [8, 1, 0.6444, 0.0042, 1, 0.1, 0.9474, 896, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "ShowImage", "arg_names": [], "import_names": [], "rhs_call_name": "ShowImage", "annotation": ""}, "snippet": " cv.ShowImage(\"back_modified2\", back_modified2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99630:Expr_L156_C4", "label": "WaitKey()", "type": "expression", "loc": [156, 156], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L65_C0", "vector": [8, 1, 0.6527, 0.0042, 1, 0.1, 0.9737, 885, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "WaitKey", "arg_names": [], "import_names": [], "rhs_call_name": "WaitKey", "annotation": ""}, "snippet": " cv.WaitKey(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99630:Return_L161_C4", "label": "return", "type": "return", "loc": [161, 161], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L65_C0", "vector": [13, 1, 0.6736, 0.0042, 1, 0.1, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return back_modified, hist"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99630:If_L164_C0", "label": "if", "type": "if", "loc": [164, 238], "level": 0, "parent": null, "vector": [4, 0, 0.841, 0.3138, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 43], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n folder = sys.argv[1]\n \n cv.NamedWindow(\"Source\", cv.CV_WINDOW_AUTOSIZE)\n cv.NamedWindow(\"final\", cv.CV_WINDOW_AUTOSIZE)\n src2 = cv.LoadImageM(folder+'object'+str(0).zfill(3)+'_try'+str(0).zfill(3)+'_after_pr2.png')\n patch_images = []\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99630:Assign_L165_C4", "label": "folder =", "type": "assigned_variable", "loc": [165, 165], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99630:If_L164_C0", "vector": [14, 1, 0.6904, 0.0042, 1, 0.58, 0.0, 841, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "folder", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " folder = sys.argv[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99630:Expr_L167_C4", "label": "NamedWindow()", "type": "expression", "loc": [167, 167], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99630:If_L164_C0", "vector": [8, 1, 0.6987, 0.0042, 1, 0.58, 0.125, 60, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "NamedWindow", "arg_names": [], "import_names": [], "rhs_call_name": "NamedWindow", "annotation": ""}, "snippet": " cv.NamedWindow(\"Source\", cv.CV_WINDOW_AUTOSIZE)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99630:Expr_L168_C4", "label": "NamedWindow()", "type": "expression", "loc": [168, 168], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99630:If_L164_C0", "vector": [8, 1, 0.7029, 0.0042, 1, 0.58, 0.25, 60, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "NamedWindow", "arg_names": [], "import_names": [], "rhs_call_name": "NamedWindow", "annotation": ""}, "snippet": " cv.NamedWindow(\"final\", cv.CV_WINDOW_AUTOSIZE)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99630:Assign_L169_C4", "label": "src2 = LoadImageM()", "type": "assigned_variable", "loc": [169, 169], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99630:If_L164_C0", "vector": [14, 1, 0.7071, 0.0042, 1, 0.58, 0.375, 456, 3, 1, 0, 0, 859, 10, 5], "semantic": {"name": "src2", "arg_names": [], "import_names": [], "rhs_call_name": "LoadImageM", "annotation": ""}, "snippet": " src2 = cv.LoadImageM(folder+'object'+str(0).zfill(3)+'_try'+str(0).zfill(3)+'_after_pr2.png')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99630:Assign_L170_C4", "label": "patch_images =", "type": "assigned_variable", "loc": [170, 170], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99630:If_L164_C0", "vector": [14, 1, 0.7113, 0.0042, 1, 0.58, 0.5, 535, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "patch_images", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " patch_images = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99630:Assign_L172_C4", "label": "avg_noise = CreateImage()", "type": "assigned_variable", "loc": [172, 172], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99630:If_L164_C0", "vector": [14, 1, 0.7197, 0.0042, 1, 0.58, 0.625, 938, 3, 3, 0, 0, 288, 10, 2], "semantic": {"name": "avg_noise", "arg_names": [], "import_names": [], "rhs_call_name": "CreateImage", "annotation": ""}, "snippet": " avg_noise = cv.CreateImage(cv.GetSize(src2), 8, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99630:Expr_L173_C4", "label": "Zero()", "type": "expression", "loc": [173, 173], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99630:If_L164_C0", "vector": [8, 1, 0.7238, 0.0042, 1, 0.58, 0.75, 895, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "Zero", "arg_names": [], "import_names": [], "rhs_call_name": "Zero", "annotation": ""}, "snippet": " cv.Zero(avg_noise)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99630:For_L174_C4", "label": "for k", "type": "for", "loc": [174, 175], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99630:If_L164_C0", "vector": [6, 1, 0.7301, 0.0084, 1, 0.58, 0.875, 954, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "k", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for k in xrange(1):\n patch_images.append(cv.LoadImageM('/home/mkillpack/Desktop/patch2.png'))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99630:Expr_L175_C8", "label": "append()", "type": "expression", "loc": [175, 175], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99630:For_L174_C4", "vector": [8, 2, 0.7322, 0.0042, 2, 0.75, 0.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " patch_images.append(cv.LoadImageM('/home/mkillpack/Desktop/patch2.png'))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99630:For_L177_C4", "label": "for i", "type": "for", "loc": [177, 238], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99630:If_L164_C0", "vector": [6, 1, 0.8682, 0.2594, 1, 0.58, 1.0, 826, 3, 0, 0, 0, 0, 0, 30], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in xrange(9):\n for j in xrange(100):\n print(folder+'object'+str(i).zfill(3)+'_try'+str(j).zfill(3)+'_after_pr2.png')\n src = cv.LoadImageM(folder+'object'+str(i).zfill(3)+'_try'+str(j).zfill(3)+'_after_pr2.png')\n cv.ShowImage(\"Source\", src)\n\n back_proj_img, hist1 = back_project_hs(src, patch_images[0])\n back_proj_img2, hist2 = back_project_hs(src2, patch_images[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99630:For_L178_C8", "label": "for j", "type": "for", "loc": [178, 238], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99630:For_L177_C4", "vector": [6, 2, 0.8703, 0.2552, 2, 0.35, 0.0, 100, 3, 0, 0, 0, 0, 0, 29], "semantic": {"name": "j", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for j in xrange(100):\n print(folder+'object'+str(i).zfill(3)+'_try'+str(j).zfill(3)+'_after_pr2.png')\n src = cv.LoadImageM(folder+'object'+str(i).zfill(3)+'_try'+str(j).zfill(3)+'_after_pr2.png')\n cv.ShowImage(\"Source\", src)\n\n back_proj_img, hist1 = back_project_hs(src, patch_images[0])\n back_proj_img2, hist2 = back_project_hs(src2, patch_images[0])\n scratch = cv.CreateImage(cv.GetSize(back_proj_img2), 8, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99630:Expr_L179_C12", "label": "print()", "type": "expression", "loc": [179, 179], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99630:For_L178_C8", "vector": [8, 3, 0.749, 0.0042, 3, 0.61, 0.0, 535, 3, 1, 0, 0, 0, 0, 5], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(folder+'object'+str(i).zfill(3)+'_try'+str(j).zfill(3)+'_after_pr2.png')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99630:Assign_L180_C12", "label": "src = LoadImageM()", "type": "assigned_variable", "loc": [180, 180], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99630:For_L178_C8", "vector": [14, 3, 0.7531, 0.0042, 3, 0.61, 0.0667, 345, 3, 1, 0, 0, 859, 10, 5], "semantic": {"name": "src", "arg_names": [], "import_names": [], "rhs_call_name": "LoadImageM", "annotation": ""}, "snippet": " src = cv.LoadImageM(folder+'object'+str(i).zfill(3)+'_try'+str(j).zfill(3)+'_after_pr2.png')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99630:Expr_L181_C12", "label": "ShowImage()", "type": "expression", "loc": [181, 181], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99630:For_L178_C8", "vector": [8, 3, 0.7573, 0.0042, 3, 0.61, 0.1333, 896, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "ShowImage", "arg_names": [], "import_names": [], "rhs_call_name": "ShowImage", "annotation": ""}, "snippet": " cv.ShowImage(\"Source\", src)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99630:Assign_L183_C12", "label": "back_proj_img, hist1 = back_project_hs()", "type": "assigned_variable", "loc": [183, 183], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99630:For_L178_C8", "vector": [14, 3, 0.7657, 0.0042, 3, 0.61, 0.2, 865, 3, 2, 0, 0, 363, 10, 1], "semantic": {"name": "back_proj_img, hist1", "arg_names": [], "import_names": [], "rhs_call_name": "back_project_hs", "annotation": ""}, "snippet": " back_proj_img, hist1 = back_project_hs(src, patch_images[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99630:Assign_L184_C12", "label": "back_proj_img2, hist2 = back_project_hs()", "type": "assigned_variable", "loc": [184, 184], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99630:For_L178_C8", "vector": [14, 3, 0.7699, 0.0042, 3, 0.61, 0.2667, 164, 3, 2, 0, 0, 363, 10, 1], "semantic": {"name": "back_proj_img2, hist2", "arg_names": [], "import_names": [], "rhs_call_name": "back_project_hs", "annotation": ""}, "snippet": " back_proj_img2, hist2 = back_project_hs(src2, patch_images[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99630:Assign_L185_C12", "label": "scratch = CreateImage()", "type": "assigned_variable", "loc": [185, 185], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99630:For_L178_C8", "vector": [14, 3, 0.7741, 0.0042, 3, 0.61, 0.3333, 320, 3, 3, 0, 0, 288, 10, 2], "semantic": {"name": "scratch", "arg_names": [], "import_names": [], "rhs_call_name": "CreateImage", "annotation": ""}, "snippet": " scratch = cv.CreateImage(cv.GetSize(back_proj_img2), 8, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99630:Assign_L186_C12", "label": "scratch2 = CreateImage()", "type": "assigned_variable", "loc": [186, 186], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99630:For_L178_C8", "vector": [14, 3, 0.7782, 0.0042, 3, 0.61, 0.4, 705, 3, 3, 0, 0, 288, 10, 2], "semantic": {"name": "scratch2", "arg_names": [], "import_names": [], "rhs_call_name": "CreateImage", "annotation": ""}, "snippet": " scratch2 = cv.CreateImage(cv.GetSize(back_proj_img2), 8, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99630:Expr_L189_C12", "label": "Zero()", "type": "expression", "loc": [189, 189], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99630:For_L178_C8", "vector": [8, 3, 0.7908, 0.0042, 3, 0.61, 0.4667, 895, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "Zero", "arg_names": [], "import_names": [], "rhs_call_name": "Zero", "annotation": ""}, "snippet": " cv.Zero(scratch)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99630:Expr_L190_C12", "label": "Zero()", "type": "expression", "loc": [190, 190], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99630:For_L178_C8", "vector": [8, 3, 0.795, 0.0042, 3, 0.61, 0.5333, 895, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "Zero", "arg_names": [], "import_names": [], "rhs_call_name": "Zero", "annotation": ""}, "snippet": " cv.Zero(scratch2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99630:Expr_L200_C12", "label": "Sub()", "type": "expression", "loc": [200, 200], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99630:For_L178_C8", "vector": [8, 3, 0.8368, 0.0042, 3, 0.61, 0.6, 570, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "Sub", "arg_names": [], "import_names": [], "rhs_call_name": "Sub", "annotation": ""}, "snippet": " cv.Sub(back_proj_img2, back_proj_img, scratch2) #noise, but includes object if failed, "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99630:Expr_L203_C12", "label": "Sub()", "type": "expression", "loc": [203, 203], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99630:For_L178_C8", "vector": [8, 3, 0.8494, 0.0042, 3, 0.61, 0.6667, 570, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "Sub", "arg_names": [], "import_names": [], "rhs_call_name": "Sub", "annotation": ""}, "snippet": " cv.Sub(scratch2, avg_noise, scratch) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99630:Expr_L204_C12", "label": "Or()", "type": "expression", "loc": [204, 204], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99630:For_L178_C8", "vector": [8, 3, 0.8536, 0.0042, 3, 0.61, 0.7333, 914, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "Or", "arg_names": [], "import_names": [], "rhs_call_name": "Or", "annotation": ""}, "snippet": " cv.Or(avg_noise, scratch2, avg_noise)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99630:Expr_L214_C12", "label": "ShowImage()", "type": "expression", "loc": [214, 214], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99630:For_L178_C8", "vector": [8, 3, 0.8954, 0.0042, 3, 0.61, 0.8, 896, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "ShowImage", "arg_names": [], "import_names": [], "rhs_call_name": "ShowImage", "annotation": ""}, "snippet": " cv.ShowImage(\"final\", scratch)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99630:Expr_L223_C12", "label": "print()", "type": "expression", "loc": [223, 223], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99630:For_L178_C8", "vector": [8, 3, 0.9331, 0.0042, 3, 0.61, 0.8667, 535, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(cv.CompareHist(hist1, hist2, cv.CV_COMP_BHATTACHARYYA))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99630:Expr_L237_C12", "label": "Scale()", "type": "expression", "loc": [237, 237], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99630:For_L178_C8", "vector": [8, 3, 0.9916, 0.0042, 3, 0.61, 0.9333, 556, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "Scale", "arg_names": [], "import_names": [], "rhs_call_name": "Scale", "annotation": ""}, "snippet": " cv.Scale(back_proj_img, back_proj_img, 1/255.0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99630:Expr_L238_C12", "label": "print()", "type": "expression", "loc": [238, 238], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99630:For_L178_C8", "vector": [8, 3, 0.9958, 0.0042, 3, 0.61, 1.0, 535, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"here's the sum :\", cv.Sum(scratch2))"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99630:Assign_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99630:Expr_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99630:Assign_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99630:Assign_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99630:Assign_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99630:Assign_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99630:Assign_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99630:Assign_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99630:Assign_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99630:Assign_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99630:Expr_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99630:Expr_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99630:Expr_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99630:Assign_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99630:Assign_L33_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99630:Assign_L34_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99630:Assign_L35_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99630:Assign_L36_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99630:Assign_L38_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99630:Assign_L41_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99630:Assign_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99630:Assign_L43_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99630:Assign_L44_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99630:Assign_L45_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99630:Expr_L46_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99630:Assign_L47_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99630:Assign_L49_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99630:Assign_L51_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99630:Expr_L52_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99630:Return_L63_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L65_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99630:Assign_L67_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L65_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99630:Expr_L68_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L65_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99630:Assign_L69_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L65_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99630:Expr_L70_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L65_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99630:Assign_L73_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L65_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99630:Assign_L74_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L65_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99630:Assign_L75_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L65_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99630:Assign_L76_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L65_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99630:Assign_L77_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L65_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99630:Assign_L78_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L65_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99630:Assign_L79_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L65_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99630:Expr_L81_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L65_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99630:Expr_L82_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L65_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99630:Expr_L83_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L65_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99630:Assign_L85_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L65_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99630:Assign_L88_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L65_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99630:Assign_L89_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L65_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99630:Assign_L90_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L65_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99630:Assign_L92_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L65_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99630:Assign_L93_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L65_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99630:Assign_L96_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L65_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99630:Assign_L98_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L65_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99630:Assign_L99_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L65_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99630:Expr_L101_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L65_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99630:Assign_L103_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L65_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99630:Expr_L106_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L65_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99630:Expr_L107_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L65_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99630:Assign_L109_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L65_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99630:Expr_L113_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L65_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99630:Assign_L114_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L65_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99630:Assign_L115_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L65_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99630:Expr_L131_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L65_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99630:Expr_L132_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L65_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99630:Expr_L133_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L65_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99630:Expr_L152_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L65_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99630:Expr_L153_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L65_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99630:Expr_L154_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L65_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99630:Expr_L156_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99630:FunctionDef_L65_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99630:Return_L161_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99630:If_L164_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99630:Assign_L165_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99630:If_L164_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99630:Expr_L167_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99630:If_L164_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99630:Expr_L168_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99630:If_L164_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99630:Assign_L169_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99630:If_L164_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99630:Assign_L170_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99630:If_L164_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99630:Assign_L172_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99630:If_L164_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99630:Expr_L173_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99630:If_L164_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99630:For_L174_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99630:For_L174_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99630:Expr_L175_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99630:If_L164_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99630:For_L177_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99630:For_L177_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99630:For_L178_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99630:For_L178_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99630:Expr_L179_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99630:For_L178_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99630:Assign_L180_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99630:For_L178_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99630:Expr_L181_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99630:For_L178_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99630:Assign_L183_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99630:For_L178_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99630:Assign_L184_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99630:For_L178_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99630:Assign_L185_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99630:For_L178_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99630:Assign_L186_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99630:For_L178_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99630:Expr_L189_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99630:For_L178_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99630:Expr_L190_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99630:For_L178_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99630:Expr_L200_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99630:For_L178_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99630:Expr_L203_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99630:For_L178_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99630:Expr_L204_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99630:For_L178_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99630:Expr_L214_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99630:For_L178_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99630:Expr_L223_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99630:For_L178_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99630:Expr_L237_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99630:For_L178_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99630:Expr_L238_C12"}]
#!/usr/bin/env python # Calculating and displaying 2D Hue-Saturation histogram of a color image import roslib roslib.load_manifest('opencv2') import sys import cv import numpy as np from collections import deque cv.NamedWindow("avg_noise", cv.CV_WINDOW_AUTOSIZE) cv.NamedWindow("back_modified", cv.CV_WINDOW_AUTOSIZE) cv.NamedWindow("back_modified2", cv.CV_WINDOW_AUTOSIZE) class HistAnalyzer: def __init__(self, background_noise, mask): self.background_noise = background_noise self.h_bins = 30 self.s_bins = 32 self.h_ranges = [0, 180] self.s_ranges = [0, 255] self.ranges = [self.h_ranges, self.s_ranges] self.hist = None self.mask = mask self.avg_noise = None def calc_hist(self): self.hist = cv.CreateHist([self.h_bins, self.s_bins], cv.CV_HIST_ARRAY, self.ranges, 1) hsv = cv.CreateImage(cv.GetSize(self.background_noise[0]), 8, 3) h_plane = cv.CreateMat(self.background_noise[0].height, self.background_noise[0].width, cv.CV_8UC1) s_plane = cv.CreateMat(self.background_noise[0].height, self.background_noise[0].width, cv.CV_8UC1) for i in xrange(len(self.background_noise)): cv.CvtColor(self.background_noise[i], hsv, cv.CV_BGR2HSV) cv.Split(hsv, h_plane, s_plane, None, None) planes = [h_plane, s_plane]#, s_plane, v_plane] cv.CalcHist([cv.GetImage(i) for i in planes], self.hist, True, self.mask) #cv.NormalizeHist(self.hist, 1.0) def check_for_hist(self): if self.hist == None: print "YOU CAN'T CALCULATE NOISE WITH HIST MODEL OF TABLETOP" exit def calc_noise(self): self.check_for_hist() self.avg_noise = cv.CreateImage(cv.GetSize(self.background_noise[0]), 8, 1) cv.Zero(self.avg_noise) for i in xrange(len(self.background_noise)-1): back_proj_img1, hist1 = self.back_project_hs(self.background_noise[i]) back_proj_img2, hist2 = self.back_project_hs(self.background_noise[i+1]) scratch = cv.CreateImage(cv.GetSize(back_proj_img2), 8, 1) scratch2 = cv.CreateImage(cv.GetSize(back_proj_img2), 8, 1) # do something clever with ands ors and diffs cv.Zero(scratch) cv.Zero(scratch2) cv.Sub(back_proj_img2, back_proj_img1, scratch2) #noise, but includes object if failed, cv.Sub(scratch2, self.avg_noise, scratch) cv.Or(self.avg_noise, scratch2, self.avg_noise) cv.WaitKey(100) def compare_imgs(self, img1, img2): back_proj_img, hist1 = self.back_project_hs(img1) back_proj_img2, hist2 = self.back_project_hs(img2) scratch = cv.CreateImage(cv.GetSize(back_proj_img2), 8, 1) scratch2 = cv.CreateImage(cv.GetSize(back_proj_img2), 8, 1) cv.Zero(scratch) cv.Zero(scratch2) #cv.Sub(back_proj_img, back_proj_img2, scratch2) #opposite noise, but excludes object cv.Sub(back_proj_img2, back_proj_img, scratch2) #noise, but includes object if failed, cv.Sub(scratch2, ha.avg_noise, scratch) return scratch def back_project_hs(self, img): self.check_for_hist() hsv = cv.CreateImage(cv.GetSize(img), 8, 3) scratch = cv.CreateImage(cv.GetSize(img), 8, 1) back_proj_img = cv.CreateImage(cv.GetSize(img), 8, 1) cv.CvtColor(img, hsv, cv.CV_BGR2HSV) h_plane_img = cv.CreateImage(cv.GetSize(img), 8, 1) s_plane_img = cv.CreateImage(cv.GetSize(img), 8, 1) cv.Split(hsv, h_plane_img, s_plane_img, None, None) cv.CalcBackProject([h_plane_img, s_plane_img], back_proj_img, self.hist) cv.MorphologyEx(back_proj_img, back_proj_img, None, None, cv.CV_MOP_OPEN, 1) cv.MorphologyEx(back_proj_img, back_proj_img, None, None, cv.CV_MOP_CLOSE, 2) cv.Threshold(back_proj_img, back_proj_img, 250, 255, cv.CV_THRESH_BINARY) return back_proj_img, self.hist if __name__ == '__main__': folder = sys.argv[1]+'/background_noise/' background_noise = deque() #[] cv.NamedWindow("Source", cv.CV_WINDOW_AUTOSIZE) cv.NamedWindow("final", cv.CV_WINDOW_AUTOSIZE) for i in xrange(130): background_noise.append(cv.LoadImage(folder+'file'+str(i).zfill(3)+'.png')) mask = cv.LoadImage(sys.argv[2], 0) ha = HistAnalyzer(background_noise, mask) ha.calc_hist() ha.calc_noise() back_sum_ls = deque() #[] for i in xrange(130): img = cv.LoadImage(folder+'file'+str(i).zfill(3)+'.png') result = ha.compare_imgs(img, ha.background_noise[0]) back_sum_ls.append(float(cv.Sum(result)[0])) avg = np.mean(back_sum_ls) std = np.std(back_sum_ls) print "avg and std are :", avg, std n = 0 sum_val = 0 #test_sum_ls = [] for i in xrange(9): for j in xrange(100): #print sys.argv[1]+'/object'+str(i).zfill(3)+'_try'+str(j).zfill(3) try: img = cv.LoadImageM(sys.argv[1]+'/object'+str(i).zfill(3)+'_try'+str(j).zfill(3)+'_after_pr2.png') #img = cv.LoadImageM(sys.argv[1]+'/object'+str(i).zfill(3)+'_try'+str(j).zfill(3)+'_before_pr2.png') result = ha.compare_imgs(img, ha.background_noise[-1]) n = n+1 sum_val = sum_val + float(cv.Sum(result)[0]) #print "here's the sum :", cv.Sum(result)[0] cv.ShowImage("Source", img) cv.ShowImage("final", result) cv.WaitKey(-1) loc_sum = float(cv.Sum(result)[0]) #if loc_sum > avg-5*std and loc_sum < avg+5*std: if loc_sum < avg+5*std: print "success ! \t:", loc_sum, "\t compared to \t", avg, 5*std #ha.background_noise.popleft() #ha.background_noise.append(img) else: print "epic fail ! \t:", loc_sum, "\t compared to \t", avg, 5*std except: print "no file like that, probably outside of index range" print "recalculating hist and noise..." #ha.calc_hist() #ha.calc_noise() print "done!" print "average error for objects present :", sum_val/n
ajibawa-2023/Python-Code-Large/train/row_99631
112
161
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99631:Import_L3_C0", "label": "roslib import roslib", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0186, 0.0062, 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_99631:Expr_L4_C0", "label": "load_manifest()", "type": "expression", "loc": [4, 4], "level": 0, "parent": null, "vector": [8, 0, 0.0248, 0.0062, 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('opencv2')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99631:Import_L5_C0", "label": "sys import sys", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0311, 0.0062, 0, 0.66, 0.2, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99631:Import_L6_C0", "label": "cv import cv", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0373, 0.0062, 0, 0.66, 0.3, 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_99631:Import_L7_C0", "label": "numpy import np", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.0435, 0.0062, 0, 0.66, 0.4, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np"], "rhs_call_name": "", "annotation": ""}, "snippet": "import numpy as np"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99631:ImportFrom_L8_C0", "label": "from collections import deque", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.0497, 0.0062, 0, 0.66, 0.5, 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_99631:Expr_L10_C0", "label": "NamedWindow()", "type": "expression", "loc": [10, 10], "level": 0, "parent": null, "vector": [8, 0, 0.0621, 0.0062, 0, 0.66, 0.6, 60, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "NamedWindow", "arg_names": [], "import_names": [], "rhs_call_name": "NamedWindow", "annotation": ""}, "snippet": "cv.NamedWindow(\"avg_noise\", cv.CV_WINDOW_AUTOSIZE)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99631:Expr_L11_C0", "label": "NamedWindow()", "type": "expression", "loc": [11, 11], "level": 0, "parent": null, "vector": [8, 0, 0.0683, 0.0062, 0, 0.66, 0.7, 60, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "NamedWindow", "arg_names": [], "import_names": [], "rhs_call_name": "NamedWindow", "annotation": ""}, "snippet": "cv.NamedWindow(\"back_modified\", cv.CV_WINDOW_AUTOSIZE)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99631:Expr_L12_C0", "label": "NamedWindow()", "type": "expression", "loc": [12, 12], "level": 0, "parent": null, "vector": [8, 0, 0.0745, 0.0062, 0, 0.66, 0.8, 60, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "NamedWindow", "arg_names": [], "import_names": [], "rhs_call_name": "NamedWindow", "annotation": ""}, "snippet": "cv.NamedWindow(\"back_modified2\", cv.CV_WINDOW_AUTOSIZE)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99631:ClassDef_L14_C0", "label": "HistAnalyzer", "type": "class", "loc": [14, 95], "level": 0, "parent": null, "vector": [3, 0, 0.3385, 0.5093, 0, 0.66, 0.9, 804, 0, 6, 0, 0, 0, 0, 57], "semantic": {"name": "HistAnalyzer", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class HistAnalyzer:\n\n def __init__(self, background_noise, mask):\n self.background_noise = background_noise\n self.h_bins = 30\n self.s_bins = 32\n self.h_ranges = [0, 180]\n self.s_ranges = [0, 255]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99631:FunctionDef_L16_C4", "label": "__init__", "type": "function", "loc": [16, 25], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99631:ClassDef_L14_C0", "vector": [2, 1, 0.1273, 0.0621, 1, 0.15, 0.0, 555, 0, 3, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "background_noise", "mask"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, background_noise, mask):\n self.background_noise = background_noise\n self.h_bins = 30\n self.s_bins = 32\n self.h_ranges = [0, 180]\n self.s_ranges = [0, 255]\n self.ranges = [self.h_ranges, self.s_ranges]\n self.hist = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99631:Assign_L17_C8", "label": "self.background_noise =", "type": "assigned_variable", "loc": [17, 17], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99631:FunctionDef_L16_C4", "vector": [14, 2, 0.1056, 0.0062, 2, 0.69, 0.0, 269, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.background_noise", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.background_noise = background_noise"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99631:Assign_L18_C8", "label": "self.h_bins =", "type": "assigned_variable", "loc": [18, 18], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99631:FunctionDef_L16_C4", "vector": [14, 2, 0.1118, 0.0062, 2, 0.69, 0.125, 432, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.h_bins", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.h_bins = 30"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99631:Assign_L19_C8", "label": "self.s_bins =", "type": "assigned_variable", "loc": [19, 19], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99631:FunctionDef_L16_C4", "vector": [14, 2, 0.118, 0.0062, 2, 0.69, 0.25, 986, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.s_bins", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.s_bins = 32"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99631:Assign_L20_C8", "label": "self.h_ranges =", "type": "assigned_variable", "loc": [20, 20], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99631:FunctionDef_L16_C4", "vector": [14, 2, 0.1242, 0.0062, 2, 0.69, 0.375, 371, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.h_ranges", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.h_ranges = [0, 180]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99631:Assign_L21_C8", "label": "self.s_ranges =", "type": "assigned_variable", "loc": [21, 21], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99631:FunctionDef_L16_C4", "vector": [14, 2, 0.1304, 0.0062, 2, 0.69, 0.5, 357, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.s_ranges", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.s_ranges = [0, 255]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99631:Assign_L22_C8", "label": "self.ranges =", "type": "assigned_variable", "loc": [22, 22], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99631:FunctionDef_L16_C4", "vector": [14, 2, 0.1366, 0.0062, 2, 0.69, 0.625, 27, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.ranges", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.ranges = [self.h_ranges, self.s_ranges]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99631:Assign_L23_C8", "label": "self.hist =", "type": "assigned_variable", "loc": [23, 23], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99631:FunctionDef_L16_C4", "vector": [14, 2, 0.1429, 0.0062, 2, 0.69, 0.75, 486, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.hist", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.hist = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99631:Assign_L24_C8", "label": "self.mask =", "type": "assigned_variable", "loc": [24, 24], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99631:FunctionDef_L16_C4", "vector": [14, 2, 0.1491, 0.0062, 2, 0.69, 0.875, 251, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.mask", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.mask = mask"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99631:Assign_L25_C8", "label": "self.avg_noise =", "type": "assigned_variable", "loc": [25, 25], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99631:FunctionDef_L16_C4", "vector": [14, 2, 0.1553, 0.0062, 2, 0.69, 1.0, 721, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.avg_noise", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.avg_noise = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99631:FunctionDef_L27_C4", "label": "calc_hist", "type": "function", "loc": [27, 36], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99631:ClassDef_L14_C0", "vector": [2, 1, 0.1957, 0.0621, 1, 0.15, 0.2, 172, 0, 1, 0, 0, 0, 0, 11], "semantic": {"name": "calc_hist", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def calc_hist(self):\n self.hist = cv.CreateHist([self.h_bins, self.s_bins], cv.CV_HIST_ARRAY, self.ranges, 1)\n hsv = cv.CreateImage(cv.GetSize(self.background_noise[0]), 8, 3)\n h_plane = cv.CreateMat(self.background_noise[0].height, self.background_noise[0].width, cv.CV_8UC1)\n s_plane = cv.CreateMat(self.background_noise[0].height, self.background_noise[0].width, cv.CV_8UC1)\n for i in xrange(len(self.background_noise)):\n cv.CvtColor(self.background_noise[i], hsv, cv.CV_BGR2HSV)\n cv.Split(hsv, h_plane, s_plane, None, None) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99631:Assign_L28_C8", "label": "self.hist = CreateHist()", "type": "assigned_variable", "loc": [28, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99631:FunctionDef_L27_C4", "vector": [14, 2, 0.1739, 0.0062, 2, 0.46, 0.0, 486, 3, 4, 0, 0, 658, 10, 1], "semantic": {"name": "self.hist", "arg_names": [], "import_names": [], "rhs_call_name": "CreateHist", "annotation": ""}, "snippet": " self.hist = cv.CreateHist([self.h_bins, self.s_bins], cv.CV_HIST_ARRAY, self.ranges, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99631:Assign_L29_C8", "label": "hsv = CreateImage()", "type": "assigned_variable", "loc": [29, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99631:FunctionDef_L27_C4", "vector": [14, 2, 0.1801, 0.0062, 2, 0.46, 0.25, 809, 3, 3, 0, 0, 288, 10, 2], "semantic": {"name": "hsv", "arg_names": [], "import_names": [], "rhs_call_name": "CreateImage", "annotation": ""}, "snippet": " hsv = cv.CreateImage(cv.GetSize(self.background_noise[0]), 8, 3)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99631:Assign_L30_C8", "label": "h_plane = CreateMat()", "type": "assigned_variable", "loc": [30, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99631:FunctionDef_L27_C4", "vector": [14, 2, 0.1863, 0.0062, 2, 0.46, 0.5, 970, 3, 3, 0, 0, 892, 10, 1], "semantic": {"name": "h_plane", "arg_names": [], "import_names": [], "rhs_call_name": "CreateMat", "annotation": ""}, "snippet": " h_plane = cv.CreateMat(self.background_noise[0].height, self.background_noise[0].width, cv.CV_8UC1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99631:Assign_L31_C8", "label": "s_plane = CreateMat()", "type": "assigned_variable", "loc": [31, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99631:FunctionDef_L27_C4", "vector": [14, 2, 0.1925, 0.0062, 2, 0.46, 0.75, 686, 3, 3, 0, 0, 892, 10, 1], "semantic": {"name": "s_plane", "arg_names": [], "import_names": [], "rhs_call_name": "CreateMat", "annotation": ""}, "snippet": " s_plane = cv.CreateMat(self.background_noise[0].height, self.background_noise[0].width, cv.CV_8UC1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99631:For_L32_C8", "label": "for i", "type": "for", "loc": [32, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99631:FunctionDef_L27_C4", "vector": [6, 2, 0.2112, 0.0311, 2, 0.46, 1.0, 826, 3, 0, 0, 0, 0, 0, 6], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in xrange(len(self.background_noise)):\n cv.CvtColor(self.background_noise[i], hsv, cv.CV_BGR2HSV)\n cv.Split(hsv, h_plane, s_plane, None, None) \n planes = [h_plane, s_plane]#, s_plane, v_plane]\n cv.CalcHist([cv.GetImage(i) for i in planes], self.hist, True, self.mask) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99631:Expr_L33_C12", "label": "CvtColor()", "type": "expression", "loc": [33, 33], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99631:For_L32_C8", "vector": [8, 3, 0.205, 0.0062, 3, 0.12, 0.0, 974, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "CvtColor", "arg_names": [], "import_names": [], "rhs_call_name": "CvtColor", "annotation": ""}, "snippet": " cv.CvtColor(self.background_noise[i], hsv, cv.CV_BGR2HSV)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99631:Expr_L34_C12", "label": "Split()", "type": "expression", "loc": [34, 34], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99631:For_L32_C8", "vector": [8, 3, 0.2112, 0.0062, 3, 0.12, 0.3333, 551, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "Split", "arg_names": [], "import_names": [], "rhs_call_name": "Split", "annotation": ""}, "snippet": " cv.Split(hsv, h_plane, s_plane, None, None) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99631:Assign_L35_C12", "label": "planes =", "type": "assigned_variable", "loc": [35, 35], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99631:For_L32_C8", "vector": [14, 3, 0.2174, 0.0062, 3, 0.12, 0.6667, 118, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "planes", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " planes = [h_plane, s_plane]#, s_plane, v_plane]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99631:Expr_L36_C12", "label": "CalcHist()", "type": "expression", "loc": [36, 36], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99631:For_L32_C8", "vector": [8, 3, 0.2236, 0.0062, 3, 0.12, 1.0, 809, 3, 4, 0, 0, 0, 0, 2], "semantic": {"name": "CalcHist", "arg_names": [], "import_names": [], "rhs_call_name": "CalcHist", "annotation": ""}, "snippet": " cv.CalcHist([cv.GetImage(i) for i in planes], self.hist, True, self.mask) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99631:FunctionDef_L39_C4", "label": "check_for_hist", "type": "function", "loc": [39, 42], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99631:ClassDef_L14_C0", "vector": [2, 1, 0.2516, 0.0248, 1, 0.15, 0.4, 218, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "check_for_hist", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def check_for_hist(self):\n if self.hist == None:\n print(\"YOU CAN'T CALCULATE NOISE WITH HIST MODEL OF TABLETOP\")\n exit"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99631:If_L40_C8", "label": "if", "type": "if", "loc": [40, 42], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99631:FunctionDef_L39_C4", "vector": [4, 2, 0.2547, 0.0186, 2, 0.64, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.hist == None:\n print(\"YOU CAN'T CALCULATE NOISE WITH HIST MODEL OF TABLETOP\")\n exit"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99631:Expr_L41_C12", "label": "print()", "type": "expression", "loc": [41, 41], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99631:If_L40_C8", "vector": [8, 3, 0.2547, 0.0062, 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(\"YOU CAN'T CALCULATE NOISE WITH HIST MODEL OF TABLETOP\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99631:Expr_L42_C12", "label": "expression", "type": "expression", "loc": [42, 42], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99631:If_L40_C8", "vector": [8, 3, 0.2609, 0.0062, 3, 0.08, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " exit"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99631:FunctionDef_L44_C4", "label": "calc_noise", "type": "function", "loc": [44, 63], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99631:ClassDef_L14_C0", "vector": [2, 1, 0.3323, 0.1242, 1, 0.15, 0.6, 295, 0, 1, 0, 0, 0, 0, 18], "semantic": {"name": "calc_noise", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def calc_noise(self):\n self.check_for_hist()\n self.avg_noise = cv.CreateImage(cv.GetSize(self.background_noise[0]), 8, 1)\n cv.Zero(self.avg_noise)\n\n for i in xrange(len(self.background_noise)-1):\n back_proj_img1, hist1 = self.back_project_hs(self.background_noise[i])\n back_proj_img2, hist2 = self.back_project_hs(self.background_noise[i+1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99631:Expr_L45_C8", "label": "check_for_hist()", "type": "expression", "loc": [45, 45], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99631:FunctionDef_L44_C4", "vector": [8, 2, 0.2795, 0.0062, 2, 0.85, 0.0, 218, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "check_for_hist", "arg_names": [], "import_names": [], "rhs_call_name": "check_for_hist", "annotation": ""}, "snippet": " self.check_for_hist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99631:Assign_L46_C8", "label": "self.avg_noise = CreateImage()", "type": "assigned_variable", "loc": [46, 46], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99631:FunctionDef_L44_C4", "vector": [14, 2, 0.2857, 0.0062, 2, 0.85, 0.3333, 721, 3, 3, 0, 0, 288, 10, 2], "semantic": {"name": "self.avg_noise", "arg_names": [], "import_names": [], "rhs_call_name": "CreateImage", "annotation": ""}, "snippet": " self.avg_noise = cv.CreateImage(cv.GetSize(self.background_noise[0]), 8, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99631:Expr_L47_C8", "label": "Zero()", "type": "expression", "loc": [47, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99631:FunctionDef_L44_C4", "vector": [8, 2, 0.2919, 0.0062, 2, 0.85, 0.6667, 895, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "Zero", "arg_names": [], "import_names": [], "rhs_call_name": "Zero", "annotation": ""}, "snippet": " cv.Zero(self.avg_noise)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99631:For_L49_C8", "label": "for i", "type": "for", "loc": [49, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99631:FunctionDef_L44_C4", "vector": [6, 2, 0.3478, 0.0932, 2, 0.85, 1.0, 826, 3, 0, 0, 0, 0, 0, 14], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in xrange(len(self.background_noise)-1):\n back_proj_img1, hist1 = self.back_project_hs(self.background_noise[i])\n back_proj_img2, hist2 = self.back_project_hs(self.background_noise[i+1])\n\n scratch = cv.CreateImage(cv.GetSize(back_proj_img2), 8, 1)\n scratch2 = cv.CreateImage(cv.GetSize(back_proj_img2), 8, 1)\n \n # do something clever with ands ors and diffs "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99631:Assign_L50_C12", "label": "back_proj_img1, hist1 = back_project_hs()", "type": "assigned_variable", "loc": [50, 50], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99631:For_L49_C8", "vector": [14, 3, 0.3106, 0.0062, 3, 0.86, 0.0, 625, 3, 1, 0, 0, 363, 10, 1], "semantic": {"name": "back_proj_img1, hist1", "arg_names": [], "import_names": [], "rhs_call_name": "back_project_hs", "annotation": ""}, "snippet": " back_proj_img1, hist1 = self.back_project_hs(self.background_noise[i])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99631:Assign_L51_C12", "label": "back_proj_img2, hist2 = back_project_hs()", "type": "assigned_variable", "loc": [51, 51], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99631:For_L49_C8", "vector": [14, 3, 0.3168, 0.0062, 3, 0.86, 0.1111, 164, 3, 1, 0, 0, 363, 10, 1], "semantic": {"name": "back_proj_img2, hist2", "arg_names": [], "import_names": [], "rhs_call_name": "back_project_hs", "annotation": ""}, "snippet": " back_proj_img2, hist2 = self.back_project_hs(self.background_noise[i+1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99631:Assign_L53_C12", "label": "scratch = CreateImage()", "type": "assigned_variable", "loc": [53, 53], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99631:For_L49_C8", "vector": [14, 3, 0.3292, 0.0062, 3, 0.86, 0.2222, 320, 3, 3, 0, 0, 288, 10, 2], "semantic": {"name": "scratch", "arg_names": [], "import_names": [], "rhs_call_name": "CreateImage", "annotation": ""}, "snippet": " scratch = cv.CreateImage(cv.GetSize(back_proj_img2), 8, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99631:Assign_L54_C12", "label": "scratch2 = CreateImage()", "type": "assigned_variable", "loc": [54, 54], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99631:For_L49_C8", "vector": [14, 3, 0.3354, 0.0062, 3, 0.86, 0.3333, 705, 3, 3, 0, 0, 288, 10, 2], "semantic": {"name": "scratch2", "arg_names": [], "import_names": [], "rhs_call_name": "CreateImage", "annotation": ""}, "snippet": " scratch2 = cv.CreateImage(cv.GetSize(back_proj_img2), 8, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99631:Expr_L57_C12", "label": "Zero()", "type": "expression", "loc": [57, 57], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99631:For_L49_C8", "vector": [8, 3, 0.354, 0.0062, 3, 0.86, 0.4444, 895, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "Zero", "arg_names": [], "import_names": [], "rhs_call_name": "Zero", "annotation": ""}, "snippet": " cv.Zero(scratch)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99631:Expr_L58_C12", "label": "Zero()", "type": "expression", "loc": [58, 58], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99631:For_L49_C8", "vector": [8, 3, 0.3602, 0.0062, 3, 0.86, 0.5556, 895, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "Zero", "arg_names": [], "import_names": [], "rhs_call_name": "Zero", "annotation": ""}, "snippet": " cv.Zero(scratch2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99631:Expr_L59_C12", "label": "Sub()", "type": "expression", "loc": [59, 59], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99631:For_L49_C8", "vector": [8, 3, 0.3665, 0.0062, 3, 0.86, 0.6667, 570, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "Sub", "arg_names": [], "import_names": [], "rhs_call_name": "Sub", "annotation": ""}, "snippet": " cv.Sub(back_proj_img2, back_proj_img1, scratch2) #noise, but includes object if failed, "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99631:Expr_L61_C12", "label": "Sub()", "type": "expression", "loc": [61, 61], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99631:For_L49_C8", "vector": [8, 3, 0.3789, 0.0062, 3, 0.86, 0.7778, 570, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "Sub", "arg_names": [], "import_names": [], "rhs_call_name": "Sub", "annotation": ""}, "snippet": " cv.Sub(scratch2, self.avg_noise, scratch) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99631:Expr_L62_C12", "label": "Or()", "type": "expression", "loc": [62, 62], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99631:For_L49_C8", "vector": [8, 3, 0.3851, 0.0062, 3, 0.86, 0.8889, 914, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "Or", "arg_names": [], "import_names": [], "rhs_call_name": "Or", "annotation": ""}, "snippet": " cv.Or(self.avg_noise, scratch2, self.avg_noise)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99631:Expr_L63_C12", "label": "WaitKey()", "type": "expression", "loc": [63, 63], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99631:For_L49_C8", "vector": [8, 3, 0.3913, 0.0062, 3, 0.86, 1.0, 885, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "WaitKey", "arg_names": [], "import_names": [], "rhs_call_name": "WaitKey", "annotation": ""}, "snippet": " cv.WaitKey(100)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99631:FunctionDef_L65_C4", "label": "compare_imgs", "type": "function", "loc": [65, 78], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99631:ClassDef_L14_C0", "vector": [2, 1, 0.4441, 0.087, 1, 0.15, 0.8, 874, 0, 3, 1, 0, 0, 0, 10], "semantic": {"name": "compare_imgs", "arg_names": ["self", "img1", "img2"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def compare_imgs(self, img1, img2):\n back_proj_img, hist1 = self.back_project_hs(img1)\n back_proj_img2, hist2 = self.back_project_hs(img2)\n\n scratch = cv.CreateImage(cv.GetSize(back_proj_img2), 8, 1)\n scratch2 = cv.CreateImage(cv.GetSize(back_proj_img2), 8, 1)\n cv.Zero(scratch)\n cv.Zero(scratch2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99631:Assign_L66_C8", "label": "back_proj_img, hist1 = back_project_hs()", "type": "assigned_variable", "loc": [66, 66], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99631:FunctionDef_L65_C4", "vector": [14, 2, 0.4099, 0.0062, 2, 0.9, 0.0, 865, 3, 1, 0, 0, 363, 10, 1], "semantic": {"name": "back_proj_img, hist1", "arg_names": [], "import_names": [], "rhs_call_name": "back_project_hs", "annotation": ""}, "snippet": " back_proj_img, hist1 = self.back_project_hs(img1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99631:Assign_L67_C8", "label": "back_proj_img2, hist2 = back_project_hs()", "type": "assigned_variable", "loc": [67, 67], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99631:FunctionDef_L65_C4", "vector": [14, 2, 0.4161, 0.0062, 2, 0.9, 0.125, 164, 3, 1, 0, 0, 363, 10, 1], "semantic": {"name": "back_proj_img2, hist2", "arg_names": [], "import_names": [], "rhs_call_name": "back_project_hs", "annotation": ""}, "snippet": " back_proj_img2, hist2 = self.back_project_hs(img2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99631:Assign_L69_C8", "label": "scratch = CreateImage()", "type": "assigned_variable", "loc": [69, 69], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99631:FunctionDef_L65_C4", "vector": [14, 2, 0.4286, 0.0062, 2, 0.9, 0.25, 320, 3, 3, 0, 0, 288, 10, 2], "semantic": {"name": "scratch", "arg_names": [], "import_names": [], "rhs_call_name": "CreateImage", "annotation": ""}, "snippet": " scratch = cv.CreateImage(cv.GetSize(back_proj_img2), 8, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99631:Assign_L70_C8", "label": "scratch2 = CreateImage()", "type": "assigned_variable", "loc": [70, 70], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99631:FunctionDef_L65_C4", "vector": [14, 2, 0.4348, 0.0062, 2, 0.9, 0.375, 705, 3, 3, 0, 0, 288, 10, 2], "semantic": {"name": "scratch2", "arg_names": [], "import_names": [], "rhs_call_name": "CreateImage", "annotation": ""}, "snippet": " scratch2 = cv.CreateImage(cv.GetSize(back_proj_img2), 8, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99631:Expr_L71_C8", "label": "Zero()", "type": "expression", "loc": [71, 71], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99631:FunctionDef_L65_C4", "vector": [8, 2, 0.441, 0.0062, 2, 0.9, 0.5, 895, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "Zero", "arg_names": [], "import_names": [], "rhs_call_name": "Zero", "annotation": ""}, "snippet": " cv.Zero(scratch)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99631:Expr_L72_C8", "label": "Zero()", "type": "expression", "loc": [72, 72], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99631:FunctionDef_L65_C4", "vector": [8, 2, 0.4472, 0.0062, 2, 0.9, 0.625, 895, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "Zero", "arg_names": [], "import_names": [], "rhs_call_name": "Zero", "annotation": ""}, "snippet": " cv.Zero(scratch2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99631:Expr_L75_C8", "label": "Sub()", "type": "expression", "loc": [75, 75], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99631:FunctionDef_L65_C4", "vector": [8, 2, 0.4658, 0.0062, 2, 0.9, 0.75, 570, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "Sub", "arg_names": [], "import_names": [], "rhs_call_name": "Sub", "annotation": ""}, "snippet": " cv.Sub(back_proj_img2, back_proj_img, scratch2) #noise, but includes object if failed, "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99631:Expr_L76_C8", "label": "Sub()", "type": "expression", "loc": [76, 76], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99631:FunctionDef_L65_C4", "vector": [8, 2, 0.472, 0.0062, 2, 0.9, 0.875, 570, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "Sub", "arg_names": [], "import_names": [], "rhs_call_name": "Sub", "annotation": ""}, "snippet": " cv.Sub(scratch2, ha.avg_noise, scratch)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99631:Return_L78_C8", "label": "return", "type": "return", "loc": [78, 78], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99631:FunctionDef_L65_C4", "vector": [13, 2, 0.4845, 0.0062, 2, 0.9, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return scratch"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99631:FunctionDef_L81_C4", "label": "back_project_hs", "type": "function", "loc": [81, 95], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99631:ClassDef_L14_C0", "vector": [2, 1, 0.5466, 0.0932, 1, 0.15, 1.0, 363, 0, 2, 1, 0, 0, 0, 17], "semantic": {"name": "back_project_hs", "arg_names": ["self", "img"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def back_project_hs(self, img):\n self.check_for_hist()\n hsv = cv.CreateImage(cv.GetSize(img), 8, 3)\n scratch = cv.CreateImage(cv.GetSize(img), 8, 1)\n back_proj_img = cv.CreateImage(cv.GetSize(img), 8, 1)\n cv.CvtColor(img, hsv, cv.CV_BGR2HSV)\n h_plane_img = cv.CreateImage(cv.GetSize(img), 8, 1)\n s_plane_img = cv.CreateImage(cv.GetSize(img), 8, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99631:Expr_L82_C8", "label": "check_for_hist()", "type": "expression", "loc": [82, 82], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99631:FunctionDef_L81_C4", "vector": [8, 2, 0.5093, 0.0062, 2, 0.76, 0.0, 218, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "check_for_hist", "arg_names": [], "import_names": [], "rhs_call_name": "check_for_hist", "annotation": ""}, "snippet": " self.check_for_hist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99631:Assign_L83_C8", "label": "hsv = CreateImage()", "type": "assigned_variable", "loc": [83, 83], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99631:FunctionDef_L81_C4", "vector": [14, 2, 0.5155, 0.0062, 2, 0.76, 0.0833, 809, 3, 3, 0, 0, 288, 10, 2], "semantic": {"name": "hsv", "arg_names": [], "import_names": [], "rhs_call_name": "CreateImage", "annotation": ""}, "snippet": " hsv = cv.CreateImage(cv.GetSize(img), 8, 3)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99631:Assign_L84_C8", "label": "scratch = CreateImage()", "type": "assigned_variable", "loc": [84, 84], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99631:FunctionDef_L81_C4", "vector": [14, 2, 0.5217, 0.0062, 2, 0.76, 0.1667, 320, 3, 3, 0, 0, 288, 10, 2], "semantic": {"name": "scratch", "arg_names": [], "import_names": [], "rhs_call_name": "CreateImage", "annotation": ""}, "snippet": " scratch = cv.CreateImage(cv.GetSize(img), 8, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99631:Assign_L85_C8", "label": "back_proj_img = CreateImage()", "type": "assigned_variable", "loc": [85, 85], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99631:FunctionDef_L81_C4", "vector": [14, 2, 0.528, 0.0062, 2, 0.76, 0.25, 526, 3, 3, 0, 0, 288, 10, 2], "semantic": {"name": "back_proj_img", "arg_names": [], "import_names": [], "rhs_call_name": "CreateImage", "annotation": ""}, "snippet": " back_proj_img = cv.CreateImage(cv.GetSize(img), 8, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99631:Expr_L86_C8", "label": "CvtColor()", "type": "expression", "loc": [86, 86], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99631:FunctionDef_L81_C4", "vector": [8, 2, 0.5342, 0.0062, 2, 0.76, 0.3333, 974, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "CvtColor", "arg_names": [], "import_names": [], "rhs_call_name": "CvtColor", "annotation": ""}, "snippet": " cv.CvtColor(img, hsv, cv.CV_BGR2HSV)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99631:Assign_L87_C8", "label": "h_plane_img = CreateImage()", "type": "assigned_variable", "loc": [87, 87], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99631:FunctionDef_L81_C4", "vector": [14, 2, 0.5404, 0.0062, 2, 0.76, 0.4167, 345, 3, 3, 0, 0, 288, 10, 2], "semantic": {"name": "h_plane_img", "arg_names": [], "import_names": [], "rhs_call_name": "CreateImage", "annotation": ""}, "snippet": " h_plane_img = cv.CreateImage(cv.GetSize(img), 8, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99631:Assign_L88_C8", "label": "s_plane_img = CreateImage()", "type": "assigned_variable", "loc": [88, 88], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99631:FunctionDef_L81_C4", "vector": [14, 2, 0.5466, 0.0062, 2, 0.76, 0.5, 669, 3, 3, 0, 0, 288, 10, 2], "semantic": {"name": "s_plane_img", "arg_names": [], "import_names": [], "rhs_call_name": "CreateImage", "annotation": ""}, "snippet": " s_plane_img = cv.CreateImage(cv.GetSize(img), 8, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99631:Expr_L89_C8", "label": "Split()", "type": "expression", "loc": [89, 89], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99631:FunctionDef_L81_C4", "vector": [8, 2, 0.5528, 0.0062, 2, 0.76, 0.5833, 551, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "Split", "arg_names": [], "import_names": [], "rhs_call_name": "Split", "annotation": ""}, "snippet": " cv.Split(hsv, h_plane_img, s_plane_img, None, None) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99631:Expr_L90_C8", "label": "CalcBackProject()", "type": "expression", "loc": [90, 90], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99631:FunctionDef_L81_C4", "vector": [8, 2, 0.559, 0.0062, 2, 0.76, 0.6667, 139, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "CalcBackProject", "arg_names": [], "import_names": [], "rhs_call_name": "CalcBackProject", "annotation": ""}, "snippet": " cv.CalcBackProject([h_plane_img, s_plane_img], back_proj_img, self.hist)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99631:Expr_L91_C8", "label": "MorphologyEx()", "type": "expression", "loc": [91, 91], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99631:FunctionDef_L81_C4", "vector": [8, 2, 0.5652, 0.0062, 2, 0.76, 0.75, 597, 3, 6, 0, 0, 0, 0, 1], "semantic": {"name": "MorphologyEx", "arg_names": [], "import_names": [], "rhs_call_name": "MorphologyEx", "annotation": ""}, "snippet": " cv.MorphologyEx(back_proj_img, back_proj_img, None, None, cv.CV_MOP_OPEN, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99631:Expr_L92_C8", "label": "MorphologyEx()", "type": "expression", "loc": [92, 92], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99631:FunctionDef_L81_C4", "vector": [8, 2, 0.5714, 0.0062, 2, 0.76, 0.8333, 597, 3, 6, 0, 0, 0, 0, 1], "semantic": {"name": "MorphologyEx", "arg_names": [], "import_names": [], "rhs_call_name": "MorphologyEx", "annotation": ""}, "snippet": " cv.MorphologyEx(back_proj_img, back_proj_img, None, None, cv.CV_MOP_CLOSE, 2) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99631:Expr_L93_C8", "label": "Threshold()", "type": "expression", "loc": [93, 93], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99631:FunctionDef_L81_C4", "vector": [8, 2, 0.5776, 0.0062, 2, 0.76, 0.9167, 302, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "Threshold", "arg_names": [], "import_names": [], "rhs_call_name": "Threshold", "annotation": ""}, "snippet": " cv.Threshold(back_proj_img, back_proj_img, 250, 255, cv.CV_THRESH_BINARY)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99631:Return_L95_C8", "label": "return", "type": "return", "loc": [95, 95], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99631:FunctionDef_L81_C4", "vector": [13, 2, 0.5901, 0.0062, 2, 0.76, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return back_proj_img, self.hist"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99631:If_L97_C0", "label": "if", "type": "if", "loc": [97, 161], "level": 0, "parent": null, "vector": [4, 0, 0.8012, 0.4037, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 45], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n folder = sys.argv[1]+'/background_noise/'\n background_noise = deque() #[]\n\n cv.NamedWindow(\"Source\", cv.CV_WINDOW_AUTOSIZE)\n cv.NamedWindow(\"final\", cv.CV_WINDOW_AUTOSIZE)\n\n for i in xrange(130):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99631:Assign_L98_C4", "label": "folder =", "type": "assigned_variable", "loc": [98, 98], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99631:If_L97_C0", "vector": [14, 1, 0.6087, 0.0062, 1, 0.68, 0.0, 841, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "folder", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " folder = sys.argv[1]+'/background_noise/'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99631:Assign_L99_C4", "label": "background_noise = deque()", "type": "assigned_variable", "loc": [99, 99], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99631:If_L97_C0", "vector": [14, 1, 0.6149, 0.0062, 1, 0.68, 0.0588, 254, 3, 0, 0, 0, 650, 10, 1], "semantic": {"name": "background_noise", "arg_names": [], "import_names": [], "rhs_call_name": "deque", "annotation": ""}, "snippet": " background_noise = deque() #[]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99631:Expr_L101_C4", "label": "NamedWindow()", "type": "expression", "loc": [101, 101], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99631:If_L97_C0", "vector": [8, 1, 0.6273, 0.0062, 1, 0.68, 0.1176, 60, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "NamedWindow", "arg_names": [], "import_names": [], "rhs_call_name": "NamedWindow", "annotation": ""}, "snippet": " cv.NamedWindow(\"Source\", cv.CV_WINDOW_AUTOSIZE)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99631:Expr_L102_C4", "label": "NamedWindow()", "type": "expression", "loc": [102, 102], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99631:If_L97_C0", "vector": [8, 1, 0.6335, 0.0062, 1, 0.68, 0.1765, 60, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "NamedWindow", "arg_names": [], "import_names": [], "rhs_call_name": "NamedWindow", "annotation": ""}, "snippet": " cv.NamedWindow(\"final\", cv.CV_WINDOW_AUTOSIZE)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99631:For_L104_C4", "label": "for i", "type": "for", "loc": [104, 105], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99631:If_L97_C0", "vector": [6, 1, 0.6491, 0.0124, 1, 0.68, 0.2353, 826, 3, 0, 0, 0, 0, 0, 5], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in xrange(130):\n background_noise.append(cv.LoadImage(folder+'file'+str(i).zfill(3)+'.png'))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99631:Expr_L105_C8", "label": "append()", "type": "expression", "loc": [105, 105], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99631:For_L104_C4", "vector": [8, 2, 0.6522, 0.0062, 2, 0.97, 0.0, 243, 3, 1, 0, 0, 0, 0, 4], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " background_noise.append(cv.LoadImage(folder+'file'+str(i).zfill(3)+'.png'))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99631:Assign_L106_C4", "label": "mask = LoadImage()", "type": "assigned_variable", "loc": [106, 106], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99631:If_L97_C0", "vector": [14, 1, 0.6584, 0.0062, 1, 0.68, 0.2941, 904, 3, 2, 0, 0, 512, 10, 1], "semantic": {"name": "mask", "arg_names": [], "import_names": [], "rhs_call_name": "LoadImage", "annotation": ""}, "snippet": " mask = cv.LoadImage(sys.argv[2], 0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99631:Assign_L108_C4", "label": "ha = HistAnalyzer()", "type": "assigned_variable", "loc": [108, 108], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99631:If_L97_C0", "vector": [14, 1, 0.6708, 0.0062, 1, 0.68, 0.3529, 499, 3, 2, 0, 0, 804, 10, 1], "semantic": {"name": "ha", "arg_names": [], "import_names": [], "rhs_call_name": "HistAnalyzer", "annotation": ""}, "snippet": " ha = HistAnalyzer(background_noise, mask)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99631:Expr_L109_C4", "label": "calc_hist()", "type": "expression", "loc": [109, 109], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99631:If_L97_C0", "vector": [8, 1, 0.677, 0.0062, 1, 0.68, 0.4118, 172, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "calc_hist", "arg_names": [], "import_names": [], "rhs_call_name": "calc_hist", "annotation": ""}, "snippet": " ha.calc_hist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99631:Expr_L110_C4", "label": "calc_noise()", "type": "expression", "loc": [110, 110], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99631:If_L97_C0", "vector": [8, 1, 0.6832, 0.0062, 1, 0.68, 0.4706, 295, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "calc_noise", "arg_names": [], "import_names": [], "rhs_call_name": "calc_noise", "annotation": ""}, "snippet": " ha.calc_noise()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99631:Assign_L112_C4", "label": "back_sum_ls = deque()", "type": "assigned_variable", "loc": [112, 112], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99631:If_L97_C0", "vector": [14, 1, 0.6957, 0.0062, 1, 0.68, 0.5294, 507, 3, 0, 0, 0, 650, 10, 1], "semantic": {"name": "back_sum_ls", "arg_names": [], "import_names": [], "rhs_call_name": "deque", "annotation": ""}, "snippet": " back_sum_ls = deque() #[]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99631:For_L114_C4", "label": "for i", "type": "for", "loc": [114, 117], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99631:If_L97_C0", "vector": [6, 1, 0.7174, 0.0248, 1, 0.68, 0.5882, 826, 3, 0, 0, 0, 0, 0, 8], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in xrange(130):\n img = cv.LoadImage(folder+'file'+str(i).zfill(3)+'.png')\n result = ha.compare_imgs(img, ha.background_noise[0])\n back_sum_ls.append(float(cv.Sum(result)[0]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99631:Assign_L115_C8", "label": "img = LoadImage()", "type": "assigned_variable", "loc": [115, 115], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99631:For_L114_C4", "vector": [14, 2, 0.7143, 0.0062, 2, 0.79, 0.0, 200, 3, 1, 0, 0, 512, 10, 3], "semantic": {"name": "img", "arg_names": [], "import_names": [], "rhs_call_name": "LoadImage", "annotation": ""}, "snippet": " img = cv.LoadImage(folder+'file'+str(i).zfill(3)+'.png')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99631:Assign_L116_C8", "label": "result = compare_imgs()", "type": "assigned_variable", "loc": [116, 116], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99631:For_L114_C4", "vector": [14, 2, 0.7205, 0.0062, 2, 0.79, 0.5, 51, 3, 2, 0, 0, 874, 10, 1], "semantic": {"name": "result", "arg_names": [], "import_names": [], "rhs_call_name": "compare_imgs", "annotation": ""}, "snippet": " result = ha.compare_imgs(img, ha.background_noise[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99631:Expr_L117_C8", "label": "append()", "type": "expression", "loc": [117, 117], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99631:For_L114_C4", "vector": [8, 2, 0.7267, 0.0062, 2, 0.79, 1.0, 243, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " back_sum_ls.append(float(cv.Sum(result)[0]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99631:Assign_L119_C4", "label": "avg = mean()", "type": "assigned_variable", "loc": [119, 119], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99631:If_L97_C0", "vector": [14, 1, 0.7391, 0.0062, 1, 0.68, 0.6471, 61, 3, 1, 0, 0, 856, 10, 1], "semantic": {"name": "avg", "arg_names": [], "import_names": [], "rhs_call_name": "mean", "annotation": ""}, "snippet": " avg = np.mean(back_sum_ls)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99631:Assign_L120_C4", "label": "std = std()", "type": "assigned_variable", "loc": [120, 120], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99631:If_L97_C0", "vector": [14, 1, 0.7453, 0.0062, 1, 0.68, 0.7059, 616, 3, 1, 0, 0, 616, 10, 1], "semantic": {"name": "std", "arg_names": [], "import_names": [], "rhs_call_name": "std", "annotation": ""}, "snippet": " std = np.std(back_sum_ls)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99631:Expr_L122_C4", "label": "print()", "type": "expression", "loc": [122, 122], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99631:If_L97_C0", "vector": [8, 1, 0.7578, 0.0062, 1, 0.68, 0.7647, 535, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"avg and std are :\", avg, std)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99631:Assign_L124_C4", "label": "n =", "type": "assigned_variable", "loc": [124, 124], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99631:If_L97_C0", "vector": [14, 1, 0.7702, 0.0062, 1, 0.68, 0.8235, 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_99631:Assign_L125_C4", "label": "sum_val =", "type": "assigned_variable", "loc": [125, 125], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99631:If_L97_C0", "vector": [14, 1, 0.7764, 0.0062, 1, 0.68, 0.8824, 483, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "sum_val", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " sum_val = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99631:For_L128_C4", "label": "for i", "type": "for", "loc": [128, 158], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99631:If_L97_C0", "vector": [6, 1, 0.8882, 0.1925, 1, 0.68, 0.9412, 826, 3, 0, 0, 0, 0, 0, 20], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in xrange(9):\n for j in xrange(100):\n #print sys.argv[1]+'/object'+str(i).zfill(3)+'_try'+str(j).zfill(3)\n try:\n img = cv.LoadImageM(sys.argv[1]+'/object'+str(i).zfill(3)+'_try'+str(j).zfill(3)+'_after_pr2.png')\n #img = cv.LoadImageM(sys.argv[1]+'/object'+str(i).zfill(3)+'_try'+str(j).zfill(3)+'_before_pr2.png')\n result = ha.compare_imgs(img, ha.background_noise[-1])\n n = n+1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99631:For_L129_C8", "label": "for j", "type": "for", "loc": [129, 154], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99631:For_L128_C4", "vector": [6, 2, 0.8789, 0.1615, 2, 0.09, 0.0, 100, 3, 0, 0, 0, 0, 0, 17], "semantic": {"name": "j", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for j in xrange(100):\n #print sys.argv[1]+'/object'+str(i).zfill(3)+'_try'+str(j).zfill(3)\n try:\n img = cv.LoadImageM(sys.argv[1]+'/object'+str(i).zfill(3)+'_try'+str(j).zfill(3)+'_after_pr2.png')\n #img = cv.LoadImageM(sys.argv[1]+'/object'+str(i).zfill(3)+'_try'+str(j).zfill(3)+'_before_pr2.png')\n result = ha.compare_imgs(img, ha.background_noise[-1])\n n = n+1\n sum_val = sum_val + float(cv.Sum(result)[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99631:Try_L131_C12", "label": "try", "type": "try", "loc": [131, 154], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99631:For_L129_C8", "vector": [7, 3, 0.8851, 0.1491, 3, 0.17, 0.0, 0, 0, 1, 0, 0, 0, 0, 16], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n img = cv.LoadImageM(sys.argv[1]+'/object'+str(i).zfill(3)+'_try'+str(j).zfill(3)+'_after_pr2.png')\n #img = cv.LoadImageM(sys.argv[1]+'/object'+str(i).zfill(3)+'_try'+str(j).zfill(3)+'_before_pr2.png')\n result = ha.compare_imgs(img, ha.background_noise[-1])\n n = n+1\n sum_val = sum_val + float(cv.Sum(result)[0])\n\n #print \"here's the sum :\", cv.Sum(result)[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99631:Assign_L132_C16", "label": "img = LoadImageM()", "type": "assigned_variable", "loc": [132, 132], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99631:Try_L131_C12", "vector": [14, 4, 0.8199, 0.0062, 4, 0.28, 0.0, 200, 3, 1, 0, 0, 859, 10, 5], "semantic": {"name": "img", "arg_names": [], "import_names": [], "rhs_call_name": "LoadImageM", "annotation": ""}, "snippet": " img = cv.LoadImageM(sys.argv[1]+'/object'+str(i).zfill(3)+'_try'+str(j).zfill(3)+'_after_pr2.png')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99631:Assign_L134_C16", "label": "result = compare_imgs()", "type": "assigned_variable", "loc": [134, 134], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99631:Try_L131_C12", "vector": [14, 4, 0.8323, 0.0062, 4, 0.28, 0.125, 51, 3, 2, 0, 0, 874, 10, 1], "semantic": {"name": "result", "arg_names": [], "import_names": [], "rhs_call_name": "compare_imgs", "annotation": ""}, "snippet": " result = ha.compare_imgs(img, ha.background_noise[-1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99631:Assign_L135_C16", "label": "n =", "type": "assigned_variable", "loc": [135, 135], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99631:Try_L131_C12", "vector": [14, 4, 0.8385, 0.0062, 4, 0.28, 0.25, 773, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "n", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " n = n+1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99631:Assign_L136_C16", "label": "sum_val =", "type": "assigned_variable", "loc": [136, 136], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99631:Try_L131_C12", "vector": [14, 4, 0.8447, 0.0062, 4, 0.28, 0.375, 483, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "sum_val", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " sum_val = sum_val + float(cv.Sum(result)[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99631:Expr_L139_C16", "label": "ShowImage()", "type": "expression", "loc": [139, 139], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99631:Try_L131_C12", "vector": [8, 4, 0.8634, 0.0062, 4, 0.28, 0.5, 896, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "ShowImage", "arg_names": [], "import_names": [], "rhs_call_name": "ShowImage", "annotation": ""}, "snippet": " cv.ShowImage(\"Source\", img)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99631:Expr_L140_C16", "label": "ShowImage()", "type": "expression", "loc": [140, 140], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99631:Try_L131_C12", "vector": [8, 4, 0.8696, 0.0062, 4, 0.28, 0.625, 896, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "ShowImage", "arg_names": [], "import_names": [], "rhs_call_name": "ShowImage", "annotation": ""}, "snippet": " cv.ShowImage(\"final\", result)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99631:Expr_L142_C16", "label": "WaitKey()", "type": "expression", "loc": [142, 142], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99631:Try_L131_C12", "vector": [8, 4, 0.882, 0.0062, 4, 0.28, 0.75, 885, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "WaitKey", "arg_names": [], "import_names": [], "rhs_call_name": "WaitKey", "annotation": ""}, "snippet": " cv.WaitKey(-1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99631:Assign_L144_C16", "label": "loc_sum = float()", "type": "assigned_variable", "loc": [144, 144], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99631:Try_L131_C12", "vector": [14, 4, 0.8944, 0.0062, 4, 0.28, 0.875, 910, 3, 1, 0, 0, 639, 10, 2], "semantic": {"name": "loc_sum", "arg_names": [], "import_names": [], "rhs_call_name": "float", "annotation": ""}, "snippet": " loc_sum = float(cv.Sum(result)[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99631:If_L146_C16", "label": "if", "type": "if", "loc": [146, 151], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99631:Try_L131_C12", "vector": [4, 4, 0.9224, 0.0373, 4, 0.28, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if loc_sum < avg+5*std:\n print(\"success ! \\t:\", loc_sum, \"\\t compared to \\t\", avg, 5*std)\n #ha.background_noise.popleft()\n #ha.background_noise.append(img)\n else:\n print(\"epic fail ! \\t:\", loc_sum, \"\\t compared to \\t\", avg, 5*std)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99631:Expr_L147_C20", "label": "print()", "type": "expression", "loc": [147, 147], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99631:If_L146_C16", "vector": [8, 5, 0.913, 0.0062, 5, 0.12, 0.0, 535, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"success ! \\t:\", loc_sum, \"\\t compared to \\t\", avg, 5*std)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99631:Expr_L151_C20", "label": "print()", "type": "expression", "loc": [151, 151], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99631:If_L146_C16", "vector": [8, 5, 0.9379, 0.0062, 5, 0.12, 1.0, 535, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"epic fail ! \\t:\", loc_sum, \"\\t compared to \\t\", avg, 5*std)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99631:Expr_L154_C16", "label": "print()", "type": "expression", "loc": [154, 154], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99631:Try_L131_C12", "vector": [8, 4, 0.9565, 0.0062, 4, 0.28, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"no file like that, probably outside of index range\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99631:Expr_L155_C8", "label": "print()", "type": "expression", "loc": [155, 155], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99631:For_L128_C4", "vector": [8, 2, 0.9627, 0.0062, 2, 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(\"recalculating hist and noise...\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99631:Expr_L158_C8", "label": "print()", "type": "expression", "loc": [158, 158], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99631:For_L128_C4", "vector": [8, 2, 0.9814, 0.0062, 2, 0.09, 1.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"done!\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99631:Expr_L161_C4", "label": "print()", "type": "expression", "loc": [161, 161], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99631:If_L97_C0", "vector": [8, 1, 1.0, 0.0062, 1, 0.68, 1.0, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"average error for objects present :\", sum_val/n)"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99631:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99631:FunctionDef_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99631:FunctionDef_L16_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99631:Assign_L17_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99631:FunctionDef_L16_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99631:Assign_L18_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99631:FunctionDef_L16_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99631:Assign_L19_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99631:FunctionDef_L16_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99631:Assign_L20_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99631:FunctionDef_L16_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99631:Assign_L21_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99631:FunctionDef_L16_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99631:Assign_L22_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99631:FunctionDef_L16_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99631:Assign_L23_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99631:FunctionDef_L16_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99631:Assign_L24_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99631:FunctionDef_L16_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99631:Assign_L25_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99631:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99631:FunctionDef_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99631:FunctionDef_L27_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99631:Assign_L28_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99631:FunctionDef_L27_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99631:Assign_L29_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99631:FunctionDef_L27_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99631:Assign_L30_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99631:FunctionDef_L27_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99631:Assign_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99631:FunctionDef_L27_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99631:For_L32_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99631:For_L32_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99631:Expr_L33_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99631:For_L32_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99631:Expr_L34_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99631:For_L32_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99631:Assign_L35_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99631:For_L32_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99631:Expr_L36_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99631:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99631:FunctionDef_L39_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99631:FunctionDef_L39_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99631:If_L40_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99631:If_L40_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99631:Expr_L41_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99631:If_L40_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99631:Expr_L42_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99631:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99631:FunctionDef_L44_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99631:FunctionDef_L44_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99631:Expr_L45_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99631:FunctionDef_L44_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99631:Assign_L46_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99631:FunctionDef_L44_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99631:Expr_L47_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99631:FunctionDef_L44_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99631:For_L49_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99631:For_L49_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99631:Assign_L50_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99631:For_L49_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99631:Assign_L51_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99631:For_L49_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99631:Assign_L53_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99631:For_L49_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99631:Assign_L54_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99631:For_L49_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99631:Expr_L57_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99631:For_L49_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99631:Expr_L58_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99631:For_L49_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99631:Expr_L59_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99631:For_L49_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99631:Expr_L61_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99631:For_L49_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99631:Expr_L62_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99631:For_L49_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99631:Expr_L63_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99631:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99631:FunctionDef_L65_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99631:FunctionDef_L65_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99631:Assign_L66_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99631:FunctionDef_L65_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99631:Assign_L67_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99631:FunctionDef_L65_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99631:Assign_L69_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99631:FunctionDef_L65_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99631:Assign_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99631:FunctionDef_L65_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99631:Expr_L71_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99631:FunctionDef_L65_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99631:Expr_L72_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99631:FunctionDef_L65_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99631:Expr_L75_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99631:FunctionDef_L65_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99631:Expr_L76_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99631:FunctionDef_L65_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99631:Return_L78_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99631:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99631:FunctionDef_L81_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99631:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99631:Expr_L82_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99631:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99631:Assign_L83_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99631:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99631:Assign_L84_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99631:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99631:Assign_L85_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99631:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99631:Expr_L86_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99631:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99631:Assign_L87_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99631:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99631:Assign_L88_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99631:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99631:Expr_L89_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99631:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99631:Expr_L90_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99631:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99631:Expr_L91_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99631:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99631:Expr_L92_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99631:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99631:Expr_L93_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99631:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99631:Return_L95_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99631:If_L97_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99631:Assign_L98_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99631:If_L97_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99631:Assign_L99_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99631:If_L97_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99631:Expr_L101_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99631:If_L97_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99631:Expr_L102_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99631:If_L97_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99631:For_L104_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99631:For_L104_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99631:Expr_L105_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99631:If_L97_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99631:Assign_L106_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99631:If_L97_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99631:Assign_L108_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99631:If_L97_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99631:Expr_L109_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99631:If_L97_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99631:Expr_L110_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99631:If_L97_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99631:Assign_L112_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99631:If_L97_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99631:For_L114_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99631:For_L114_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99631:Assign_L115_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99631:For_L114_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99631:Assign_L116_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99631:For_L114_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99631:Expr_L117_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99631:If_L97_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99631:Assign_L119_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99631:If_L97_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99631:Assign_L120_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99631:If_L97_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99631:Expr_L122_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99631:If_L97_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99631:Assign_L124_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99631:If_L97_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99631:Assign_L125_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99631:If_L97_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99631:For_L128_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99631:For_L128_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99631:For_L129_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99631:For_L129_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99631:Try_L131_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99631:Try_L131_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99631:Assign_L132_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99631:Try_L131_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99631:Assign_L134_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99631:Try_L131_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99631:Assign_L135_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99631:Try_L131_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99631:Assign_L136_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99631:Try_L131_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99631:Expr_L139_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99631:Try_L131_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99631:Expr_L140_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99631:Try_L131_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99631:Expr_L142_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99631:Try_L131_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99631:Assign_L144_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99631:Try_L131_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99631:If_L146_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99631:If_L146_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99631:Expr_L147_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99631:If_L146_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99631:Expr_L151_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99631:Try_L131_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99631:Expr_L154_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99631:For_L128_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99631:Expr_L155_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99631:For_L128_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99631:Expr_L158_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99631:If_L97_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99631:Expr_L161_C4"}]
#!/usr/bin/env python import roslib roslib.load_manifest('pr2_playpen') import rospy import math import tf import numpy as np import os import sys import cPickle as pkl def is_topic_pub(topic): flag = False for item in rospy.get_published_topics(): for thing in item: if topic in thing: flag = True else: pass return flag def get_data(listener, rate): right = False left = False dist_ls = [] time_ls = [] while is_topic_pub('/r_overhead_grasp/feedback') == False and is_topic_pub('/l_overhead_grasp/feedback') == False: print "waiting for bag file" rate.sleep() if is_topic_pub('/r_overhead_grasp/feedback'): right = True elif is_topic_pub('/l_overhead_grasp/feedback'): left = True if left == True: prefix = 'l_' elif right == True: prefix = 'r_' frame1 = prefix+'gripper_l_finger_tip_link' frame2 = prefix+'gripper_r_finger_tip_link' #run = True while is_topic_pub('/clock') == True: #run == True:#not rospy.is_shutdown(): try: (trans,rot) = listener.lookupTransform(frame1, frame2, rospy.Time(0)) dist = math.sqrt((np.matrix(trans)*np.matrix(trans).T)[0,0]) time = rospy.get_time() dist_ls.append(dist) time_ls.append(time) except (tf.LookupException, tf.ConnectivityException): #run = False continue rate.sleep() return dist_ls, time_ls if __name__ == '__main__': rospy.init_node('get_gripper_position') listener = tf.TransformListener() rate = rospy.Rate(100.0) path = sys.argv[1] print "path is :", path for i in xrange(9): j = 0 dist_dict = {} f_hand = open(path+'/object'+str(i).zfill(3)+'_gripper_dist.pkl', 'w') while os.path.isfile(path + '/object'+str(i).zfill(3)+'_try'+str(j).zfill(3)+'.bag') == True: #j < 999: f_path = path + '/object'+str(i).zfill(3)+'_try'+str(j).zfill(3)+'.bag' os.system('rosbag play -r 2 '+ f_path + ' &') dist_ls, time_ls = get_data(listener, rate) dist_dict['try'+str(j).zfill(3)] = {'dist':dist_ls, 'time':time_ls} j = j+1 pkl.dump(dist_dict, f_hand) f_hand.close()
ajibawa-2023/Python-Code-Large/train/row_99632
61
83
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99632:Import_L2_C0", "label": "roslib import roslib", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0241, 0.012, 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_99632:Expr_L3_C0", "label": "load_manifest()", "type": "expression", "loc": [3, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0361, 0.012, 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('pr2_playpen')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99632:Import_L4_C0", "label": "rospy import rospy", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0482, 0.012, 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_99632:Import_L5_C0", "label": "math import math", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0602, 0.012, 0, 0.66, 0.2727, 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_99632:Import_L6_C0", "label": "tf import tf", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0723, 0.012, 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_99632:Import_L7_C0", "label": "numpy import np", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.0843, 0.012, 0, 0.66, 0.4545, 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_99632:Import_L8_C0", "label": "os import os", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.0964, 0.012, 0, 0.66, 0.5455, 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_99632:Import_L9_C0", "label": "sys import sys", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.1084, 0.012, 0, 0.66, 0.6364, 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_99632:Import_L10_C0", "label": "cPickle import pkl", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.1205, 0.012, 0, 0.66, 0.7273, 279, 0, 1, 0, 0, 279, 0, 0], "semantic": {"name": "cPickle", "arg_names": [], "import_names": ["pkl"], "rhs_call_name": "", "annotation": ""}, "snippet": "import cPickle as pkl"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99632:FunctionDef_L12_C0", "label": "is_topic_pub", "type": "function", "loc": [12, 20], "level": 0, "parent": null, "vector": [2, 0, 0.1928, 0.1084, 0, 0.66, 0.8182, 18, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "is_topic_pub", "arg_names": ["topic"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def is_topic_pub(topic):\n flag = False\n for item in rospy.get_published_topics():\n for thing in item:\n if topic in thing:\n flag = True\n else:\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99632:Assign_L13_C4", "label": "flag =", "type": "assigned_variable", "loc": [13, 13], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99632:FunctionDef_L12_C0", "vector": [14, 1, 0.1566, 0.012, 1, 0.97, 0.0, 756, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "flag", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " flag = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99632:For_L14_C4", "label": "for item", "type": "for", "loc": [14, 19], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99632:FunctionDef_L12_C0", "vector": [6, 1, 0.1988, 0.0723, 1, 0.97, 0.5, 434, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "item", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for item in rospy.get_published_topics():\n for thing in item:\n if topic in thing:\n flag = True\n else:\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99632:For_L15_C8", "label": "for thing", "type": "for", "loc": [15, 19], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99632:For_L14_C4", "vector": [6, 2, 0.2048, 0.0602, 2, 0.25, 0.0, 741, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "thing", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for thing in item:\n if topic in thing:\n flag = True\n else:\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99632:If_L16_C12", "label": "if", "type": "if", "loc": [16, 19], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99632:For_L15_C8", "vector": [4, 3, 0.2108, 0.0482, 3, 0.42, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if topic in thing:\n flag = True\n else:\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99632:Assign_L17_C16", "label": "flag =", "type": "assigned_variable", "loc": [17, 17], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99632:If_L16_C12", "vector": [14, 4, 0.2048, 0.012, 4, 0.73, 0.0, 756, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "flag", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " flag = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99632:Return_L20_C4", "label": "return", "type": "return", "loc": [20, 20], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99632:FunctionDef_L12_C0", "vector": [13, 1, 0.241, 0.012, 1, 0.97, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return flag"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99632:FunctionDef_L22_C0", "label": "get_data", "type": "function", "loc": [22, 62], "level": 0, "parent": null, "vector": [2, 0, 0.506, 0.494, 0, 0.66, 0.9091, 721, 0, 2, 1, 0, 0, 0, 16], "semantic": {"name": "get_data", "arg_names": ["listener", "rate"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def get_data(listener, rate):\n right = False\n left = False\n\n dist_ls = []\n time_ls = []\n\n while is_topic_pub('/r_overhead_grasp/feedback') == False and is_topic_pub('/l_overhead_grasp/feedback') == False:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99632:Assign_L23_C4", "label": "right =", "type": "assigned_variable", "loc": [23, 23], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99632:FunctionDef_L22_C0", "vector": [14, 1, 0.2771, 0.012, 1, 0.84, 0.0, 724, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "right", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " right = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99632:Assign_L24_C4", "label": "left =", "type": "assigned_variable", "loc": [24, 24], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99632:FunctionDef_L22_C0", "vector": [14, 1, 0.2892, 0.012, 1, 0.84, 0.1, 605, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "left", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " left = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99632:Assign_L26_C4", "label": "dist_ls =", "type": "assigned_variable", "loc": [26, 26], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99632:FunctionDef_L22_C0", "vector": [14, 1, 0.3133, 0.012, 1, 0.84, 0.2, 860, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "dist_ls", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " dist_ls = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99632:Assign_L27_C4", "label": "time_ls =", "type": "assigned_variable", "loc": [27, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99632:FunctionDef_L22_C0", "vector": [14, 1, 0.3253, 0.012, 1, 0.84, 0.3, 812, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "time_ls", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " time_ls = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99632:While_L29_C4", "label": "while", "type": "while", "loc": [29, 31], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99632:FunctionDef_L22_C0", "vector": [5, 1, 0.3614, 0.0361, 1, 0.84, 0.4, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while is_topic_pub('/r_overhead_grasp/feedback') == False and is_topic_pub('/l_overhead_grasp/feedback') == False:\n print(\"waiting for bag file\")\n rate.sleep()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99632:Expr_L30_C8", "label": "print()", "type": "expression", "loc": [30, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99632:While_L29_C4", "vector": [8, 2, 0.3614, 0.012, 2, 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(\"waiting for bag file\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99632:Expr_L31_C8", "label": "sleep()", "type": "expression", "loc": [31, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99632:While_L29_C4", "vector": [8, 2, 0.3735, 0.012, 2, 0.83, 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_99632:If_L33_C4", "label": "if", "type": "if", "loc": [33, 36], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99632:FunctionDef_L22_C0", "vector": [4, 1, 0.4157, 0.0482, 1, 0.84, 0.5, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if is_topic_pub('/r_overhead_grasp/feedback'):\n right = True\n elif is_topic_pub('/l_overhead_grasp/feedback'):\n left = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99632:Assign_L34_C8", "label": "right =", "type": "assigned_variable", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99632:If_L33_C4", "vector": [14, 2, 0.4096, 0.012, 2, 0.84, 0.0, 724, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "right", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " right = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99632:If_L35_C4", "label": "if", "type": "if", "loc": [35, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99632:If_L33_C4", "vector": [4, 2, 0.4277, 0.0241, 2, 0.84, 1.0, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif is_topic_pub('/l_overhead_grasp/feedback'):\n left = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99632:Assign_L36_C8", "label": "left =", "type": "assigned_variable", "loc": [36, 36], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99632:If_L35_C4", "vector": [14, 3, 0.4337, 0.012, 3, 0.53, 0.0, 605, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "left", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " left = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99632:If_L38_C4", "label": "if", "type": "if", "loc": [38, 41], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99632:FunctionDef_L22_C0", "vector": [4, 1, 0.4759, 0.0482, 1, 0.84, 0.6, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if left == True:\n prefix = 'l_'\n elif right == True:\n prefix = 'r_'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99632:Assign_L39_C8", "label": "prefix =", "type": "assigned_variable", "loc": [39, 39], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99632:If_L38_C4", "vector": [14, 2, 0.4699, 0.012, 2, 0.17, 0.0, 284, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "prefix", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " prefix = 'l_'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99632:If_L40_C4", "label": "if", "type": "if", "loc": [40, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99632:If_L38_C4", "vector": [4, 2, 0.488, 0.0241, 2, 0.17, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif right == True:\n prefix = 'r_'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99632:Assign_L41_C8", "label": "prefix =", "type": "assigned_variable", "loc": [41, 41], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99632:If_L40_C4", "vector": [14, 3, 0.494, 0.012, 3, 0.08, 0.0, 284, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "prefix", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " prefix = 'r_'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99632:Assign_L43_C4", "label": "frame1 =", "type": "assigned_variable", "loc": [43, 43], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99632:FunctionDef_L22_C0", "vector": [14, 1, 0.5181, 0.012, 1, 0.84, 0.7, 584, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "frame1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " frame1 = prefix+'gripper_l_finger_tip_link'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99632:Assign_L44_C4", "label": "frame2 =", "type": "assigned_variable", "loc": [44, 44], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99632:FunctionDef_L22_C0", "vector": [14, 1, 0.5301, 0.012, 1, 0.84, 0.8, 773, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "frame2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " frame2 = prefix+'gripper_r_finger_tip_link'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99632:While_L47_C4", "label": "while", "type": "while", "loc": [47, 60], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99632:FunctionDef_L22_C0", "vector": [5, 1, 0.6446, 0.1687, 1, 0.84, 0.9, 0, 0, 0, 0, 0, 0, 0, 10], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while is_topic_pub('/clock') == True: #run == True:#not rospy.is_shutdown():\n try:\n (trans,rot) = listener.lookupTransform(frame1, frame2, rospy.Time(0))\n dist = math.sqrt((np.matrix(trans)*np.matrix(trans).T)[0,0])\n time = rospy.get_time()\n dist_ls.append(dist)\n time_ls.append(time)\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99632:Try_L48_C8", "label": "try", "type": "try", "loc": [48, 57], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99632:While_L47_C4", "vector": [7, 2, 0.6325, 0.1205, 2, 0.32, 0.0, 0, 0, 1, 0, 0, 0, 0, 8], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n (trans,rot) = listener.lookupTransform(frame1, frame2, rospy.Time(0))\n dist = math.sqrt((np.matrix(trans)*np.matrix(trans).T)[0,0])\n time = rospy.get_time()\n dist_ls.append(dist)\n time_ls.append(time)\n\n except (tf.LookupException, tf.ConnectivityException):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99632:Assign_L49_C12", "label": "trans, rot = lookupTransform()", "type": "assigned_variable", "loc": [49, 49], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99632:Try_L48_C8", "vector": [14, 3, 0.5904, 0.012, 3, 0.72, 0.0, 330, 3, 3, 0, 0, 926, 10, 2], "semantic": {"name": "trans, rot", "arg_names": [], "import_names": [], "rhs_call_name": "lookupTransform", "annotation": ""}, "snippet": " (trans,rot) = listener.lookupTransform(frame1, frame2, rospy.Time(0))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99632:Assign_L50_C12", "label": "dist = sqrt()", "type": "assigned_variable", "loc": [50, 50], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99632:Try_L48_C8", "vector": [14, 3, 0.6024, 0.012, 3, 0.72, 0.25, 673, 3, 1, 0, 0, 259, 10, 3], "semantic": {"name": "dist", "arg_names": [], "import_names": [], "rhs_call_name": "sqrt", "annotation": ""}, "snippet": " dist = math.sqrt((np.matrix(trans)*np.matrix(trans).T)[0,0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99632:Assign_L51_C12", "label": "time = get_time()", "type": "assigned_variable", "loc": [51, 51], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99632:Try_L48_C8", "vector": [14, 3, 0.6145, 0.012, 3, 0.72, 0.5, 654, 3, 0, 0, 0, 164, 10, 1], "semantic": {"name": "time", "arg_names": [], "import_names": [], "rhs_call_name": "get_time", "annotation": ""}, "snippet": " time = rospy.get_time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99632:Expr_L52_C12", "label": "append()", "type": "expression", "loc": [52, 52], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99632:Try_L48_C8", "vector": [8, 3, 0.6265, 0.012, 3, 0.72, 0.75, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " dist_ls.append(dist)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99632:Expr_L53_C12", "label": "append()", "type": "expression", "loc": [53, 53], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99632:Try_L48_C8", "vector": [8, 3, 0.6386, 0.012, 3, 0.72, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " time_ls.append(time)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99632:Expr_L60_C8", "label": "sleep()", "type": "expression", "loc": [60, 60], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99632:While_L47_C4", "vector": [8, 2, 0.7229, 0.012, 2, 0.32, 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_99632:Return_L62_C4", "label": "return", "type": "return", "loc": [62, 62], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99632:FunctionDef_L22_C0", "vector": [13, 1, 0.747, 0.012, 1, 0.84, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return dist_ls, time_ls"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99632:If_L64_C0", "label": "if", "type": "if", "loc": [64, 83], "level": 0, "parent": null, "vector": [4, 0, 0.8855, 0.241, 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 rospy.init_node('get_gripper_position')\n listener = tf.TransformListener() \n rate = rospy.Rate(100.0)\n \n path = sys.argv[1]\n print(\"path is :\", path)\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99632:Expr_L65_C4", "label": "init_node()", "type": "expression", "loc": [65, 65], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99632:If_L64_C0", "vector": [8, 1, 0.7831, 0.012, 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('get_gripper_position')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99632:Assign_L66_C4", "label": "listener = TransformListener()", "type": "assigned_variable", "loc": [66, 66], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99632:If_L64_C0", "vector": [14, 1, 0.7952, 0.012, 1, 0.29, 0.2, 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_99632:Assign_L67_C4", "label": "rate = Rate()", "type": "assigned_variable", "loc": [67, 67], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99632:If_L64_C0", "vector": [14, 1, 0.8072, 0.012, 1, 0.29, 0.4, 477, 3, 1, 0, 0, 543, 10, 1], "semantic": {"name": "rate", "arg_names": [], "import_names": [], "rhs_call_name": "Rate", "annotation": ""}, "snippet": " rate = rospy.Rate(100.0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99632:Assign_L69_C4", "label": "path =", "type": "assigned_variable", "loc": [69, 69], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99632:If_L64_C0", "vector": [14, 1, 0.8313, 0.012, 1, 0.29, 0.6, 358, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "path", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " path = sys.argv[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99632:Expr_L70_C4", "label": "print()", "type": "expression", "loc": [70, 70], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99632:If_L64_C0", "vector": [8, 1, 0.8434, 0.012, 1, 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(\"path is :\", path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99632:For_L72_C4", "label": "for i", "type": "for", "loc": [72, 83], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99632:If_L64_C0", "vector": [6, 1, 0.9337, 0.1446, 1, 0.29, 1.0, 826, 3, 0, 0, 0, 0, 0, 19], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in xrange(9):\n j = 0\n dist_dict = {}\n f_hand = open(path+'/object'+str(i).zfill(3)+'_gripper_dist.pkl', 'w')\n while os.path.isfile(path + '/object'+str(i).zfill(3)+'_try'+str(j).zfill(3)+'.bag') == True: #j < 999:\n f_path = path + '/object'+str(i).zfill(3)+'_try'+str(j).zfill(3)+'.bag'\n os.system('rosbag play -r 2 '+ f_path + ' &')\n dist_ls, time_ls = get_data(listener, rate)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99632:Assign_L73_C8", "label": "j =", "type": "assigned_variable", "loc": [73, 73], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99632:For_L72_C4", "vector": [14, 2, 0.8795, 0.012, 2, 0.65, 0.0, 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_99632:Assign_L74_C8", "label": "dist_dict =", "type": "assigned_variable", "loc": [74, 74], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99632:For_L72_C4", "vector": [14, 2, 0.8916, 0.012, 2, 0.65, 0.2, 650, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "dist_dict", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " dist_dict = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99632:Assign_L75_C8", "label": "f_hand = open()", "type": "assigned_variable", "loc": [75, 75], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99632:For_L72_C4", "vector": [14, 2, 0.9036, 0.012, 2, 0.65, 0.4, 469, 3, 2, 0, 0, 693, 10, 3], "semantic": {"name": "f_hand", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": " f_hand = open(path+'/object'+str(i).zfill(3)+'_gripper_dist.pkl', 'w')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99632:While_L76_C8", "label": "while", "type": "while", "loc": [76, 81], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99632:For_L72_C4", "vector": [5, 2, 0.9458, 0.0723, 2, 0.65, 0.6, 0, 0, 0, 0, 0, 0, 0, 13], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while os.path.isfile(path + '/object'+str(i).zfill(3)+'_try'+str(j).zfill(3)+'.bag') == True: #j < 999:\n f_path = path + '/object'+str(i).zfill(3)+'_try'+str(j).zfill(3)+'.bag'\n os.system('rosbag play -r 2 '+ f_path + ' &')\n dist_ls, time_ls = get_data(listener, rate)\n dist_dict['try'+str(j).zfill(3)] = {'dist':dist_ls, 'time':time_ls} \n j = j+1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99632:Assign_L77_C12", "label": "f_path =", "type": "assigned_variable", "loc": [77, 77], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99632:While_L76_C8", "vector": [14, 3, 0.9277, 0.012, 3, 0.55, 0.0, 561, 4, 0, 0, 0, 0, 0, 4], "semantic": {"name": "f_path", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " f_path = path + '/object'+str(i).zfill(3)+'_try'+str(j).zfill(3)+'.bag'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99632:Expr_L78_C12", "label": "system()", "type": "expression", "loc": [78, 78], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99632:While_L76_C8", "vector": [8, 3, 0.9398, 0.012, 3, 0.55, 0.25, 856, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "system", "arg_names": [], "import_names": [], "rhs_call_name": "system", "annotation": ""}, "snippet": " os.system('rosbag play -r 2 '+ f_path + ' &')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99632:Assign_L79_C12", "label": "dist_ls, time_ls = get_data()", "type": "assigned_variable", "loc": [79, 79], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99632:While_L76_C8", "vector": [14, 3, 0.9518, 0.012, 3, 0.55, 0.5, 386, 3, 2, 0, 0, 721, 10, 1], "semantic": {"name": "dist_ls, time_ls", "arg_names": [], "import_names": [], "rhs_call_name": "get_data", "annotation": ""}, "snippet": " dist_ls, time_ls = get_data(listener, rate)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99632:Assign_L80_C12", "label": "assign", "type": "assigned_variable", "loc": [80, 80], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99632:While_L76_C8", "vector": [14, 3, 0.9639, 0.012, 3, 0.55, 0.75, 0, 0, 0, 0, 0, 0, 6, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " dist_dict['try'+str(j).zfill(3)] = {'dist':dist_ls, 'time':time_ls} "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99632:Assign_L81_C12", "label": "j =", "type": "assigned_variable", "loc": [81, 81], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99632:While_L76_C8", "vector": [14, 3, 0.9759, 0.012, 3, 0.55, 1.0, 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_99632:Expr_L82_C8", "label": "dump()", "type": "expression", "loc": [82, 82], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99632:For_L72_C4", "vector": [8, 2, 0.988, 0.012, 2, 0.65, 0.8, 952, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "dump", "arg_names": [], "import_names": [], "rhs_call_name": "dump", "annotation": ""}, "snippet": " pkl.dump(dist_dict, f_hand)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99632:Expr_L83_C8", "label": "close()", "type": "expression", "loc": [83, 83], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99632:For_L72_C4", "vector": [8, 2, 1.0, 0.012, 2, 0.65, 1.0, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": " f_hand.close()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99632:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99632:Assign_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99632:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99632:For_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99632:For_L14_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99632:For_L15_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99632:For_L15_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99632:If_L16_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99632:If_L16_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99632:Assign_L17_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99632:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99632:Return_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99632:FunctionDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99632:Assign_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99632:FunctionDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99632:Assign_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99632:FunctionDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99632:Assign_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99632:FunctionDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99632:Assign_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99632:FunctionDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99632:While_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99632:While_L29_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99632:Expr_L30_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99632:While_L29_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99632:Expr_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99632:FunctionDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99632:If_L33_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99632:If_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99632:Assign_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99632:If_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99632:If_L35_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99632:If_L35_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99632:Assign_L36_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99632:FunctionDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99632:If_L38_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99632:If_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99632:Assign_L39_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99632:If_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99632:If_L40_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99632:If_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99632:Assign_L41_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99632:FunctionDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99632:Assign_L43_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99632:FunctionDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99632:Assign_L44_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99632:FunctionDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99632:While_L47_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99632:While_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99632:Try_L48_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99632:Try_L48_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99632:Assign_L49_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99632:Try_L48_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99632:Assign_L50_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99632:Try_L48_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99632:Assign_L51_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99632:Try_L48_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99632:Expr_L52_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99632:Try_L48_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99632:Expr_L53_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99632:While_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99632:Expr_L60_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99632:FunctionDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99632:Return_L62_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99632:If_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99632:Expr_L65_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99632:If_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99632:Assign_L66_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99632:If_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99632:Assign_L67_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99632:If_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99632:Assign_L69_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99632:If_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99632:Expr_L70_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99632:If_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99632:For_L72_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99632:For_L72_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99632:Assign_L73_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99632:For_L72_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99632:Assign_L74_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99632:For_L72_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99632:Assign_L75_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99632:For_L72_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99632:While_L76_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99632:While_L76_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99632:Assign_L77_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99632:While_L76_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99632:Expr_L78_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99632:While_L76_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99632:Assign_L79_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99632:While_L76_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99632:Assign_L80_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99632:While_L76_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99632:Assign_L81_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99632:For_L72_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99632:Expr_L82_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99632:For_L72_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99632:Expr_L83_C8"}]
#!/usr/bin/env python import roslib roslib.load_manifest('pr2_playpen') import rospy from sensor_msgs.msg import PointCloud2 import point_cloud_python as pc2py import numpy as np from matplotlib import pylab as pl import draw_scene as ds import math from pr2_playpen.srv import * #this is for Train and Check import threading class ResultsAnalyzer: def __init__(self): rospy.init_node('playpen_results') self.draw = ds.SceneDraw() self.cloud = None rospy.Subscriber("pr2_segment_region", PointCloud2, self.callback) # rospy.Subscriber("playpen_segment_object", PointCloud2, self.callback) self.check = rospy.Service("playpen_check_success", Check, self.serv_success) self.train_empty = rospy.Service("playpen_train", Train, self.serv_train) self.table_mean = None self.table_cov = None self.object_mean = None self.object_cov = None self.mean_ls =[] self.cov_ls = [] self.start_time = rospy.get_time() self.lock = threading.RLock() self.new_cloud = False self.start = 0 def callback(self, data): self.lock.acquire() self.cloud = list(pc2py.points(data, ['x', 'y', 'z'])) self.new_cloud = True print rospy.get_time()-self.start, "time in between call backs" self.start = rospy.get_time() self.lock.release() # self.get_cloud_stats() def serv_success(self, req): result = "none" while self.new_cloud == False: rospy.sleep(0.01) self.new_cloud = False self.lock.acquire() if self.table_mean == None or self.object_mean == None: print "you haven't initialized yet!!" return CheckResponse(result) np_array_cloud = np.array(self.cloud) f_ind = np.array(~np.isnan(np_array_cloud).any(1)).flatten() f_np_array_cloud = np_array_cloud[f_ind, :] if np.max(f_np_array_cloud.shape)>200: mean_3d = np.mean(f_np_array_cloud, axis = 0) cov_3d = np.cov(f_np_array_cloud.T) v, d = np.linalg.eig(cov_3d) max_var = d[:, v == np.max(v)] mean_dist_table = (np.matrix(mean_3d).reshape(3,1)-self.table_mean) mean_dist_object = (np.matrix(mean_3d).reshape(3,1)-self.object_mean) mahal_dist_table = mean_dist_table.T*0.5*np.matrix(np.linalg.inv(cov_3d)+np.linalg.inv(self.table_cov))*mean_dist_table mahal_dist_object = mean_dist_object.T*0.5*np.matrix(np.linalg.inv(cov_3d)+np.linalg.inv(self.object_cov))*mean_dist_object print "table distance = ", mahal_dist_table print "object distance = ", mahal_dist_object # print "d = ", d # print "v = ", v #made a simple change so that I only look if table is empty or not #comparison is made from the user selected region with a base model #of mean covariance of the empty tabletop if np.max(f_np_array_cloud.shape)<200: result = "no_cloud" elif mahal_dist_table<mahal_dist_object: result = "table" else: result = "object" # if req.exp_state == 'empty': # if np.max(f_np_array_cloud.shape)<200: # result = "success" # elif mahal_dist<5*self.nom_dist: # result = "success" # else: # result = "fail" # elif req.exp_state == 'object': # if np.max(f_np_array_cloud.shape)<200: # result = "fail" # elif mahal_dist<5*self.nom_dist: # result = "success" # else: # result = "fail" # elif req.exp_state == 'objects': # print "multiple objects is not yet supported" self.lock.release() return CheckResponse(result) def serv_train(self, req): num_samples = 0 if req.expected == 'table': self.table_mean = None self.table_cov = None print "training for empty table top" elif req.expected == 'object': self.object_mean = None self.object_cov = None print "training for object on table top" self.mean_ls = [] self.cov_ls = [] while num_samples < 11: start_time = rospy.get_time() while self.new_cloud == False: rospy.sleep(0.01) self.lock.acquire() np_array_cloud = np.array(self.cloud) f_ind = np.array(~np.isnan(np_array_cloud).any(1)).flatten() f_np_array_cloud = np_array_cloud[f_ind, :] if np.max(f_np_array_cloud.shape)>200: mean_3d = np.mean(f_np_array_cloud, axis = 0) cov_3d = np.cov(f_np_array_cloud.T) v, d = np.linalg.eig(cov_3d) max_var = d[:, v == np.max(v)] self.mean_ls.append(np.matrix(mean_3d).reshape(3,1)) self.cov_ls.append(np.matrix(cov_3d)) num_samples = num_samples + 1 self.new_cloud = False print "still initializing" self.lock.release() buf_mean = np.matrix(np.zeros((3,1))) buf_cov = np.matrix(np.zeros((3,3))) print "here is the mean list :", self.mean_ls mean_arr = np.array(self.mean_ls) mean_arr.sort(axis=0) print "here is th sorted mean array :", mean_arr print "here is the mean cov :\n", self.cov_ls cov_arr = np.array(self.cov_ls) cov_arr.sort(axis=0) print "here is the sorted cov :\n", cov_arr # for i in xrange(10): # buf_mean = buf_mean + self.mean_ls[i] # buf_cov = buf_cov + self.cov_ls[i] #this is not exactly correct if populations #have different # of points, but it should be approximately right if req.expected == 'table': self.table_mean = mean_arr[5] self.table_cov = cov_arr[5] # self.table_mean = buf_mean*1/10.0 # self.table_cov = buf_cov*1/10.0 elif req.expected == 'object': self.object_mean = mean_arr[5] self.object_cov = cov_arr[5] # self.object_mean = buf_mean*1/10.0 # self.object_cov = buf_cov*1/10.0 return TrainResponse(num_samples) def run(self): print 'Ready to calculate results' rospy.spin() def get_cloud_stats(self): np_array_cloud = np.array(self.cloud) f_ind = np.array(~np.isnan(np_array_cloud).any(1)).flatten() f_np_array_cloud = np_array_cloud[f_ind, :] print 'size of remaining point cloud :', np.max(f_np_array_cloud.shape) if np.max(f_np_array_cloud.shape)>200: mean_3d = np.mean(f_np_array_cloud, axis = 0) cov_3d = np.cov(f_np_array_cloud.T) v, d = np.linalg.eig(cov_3d) max_var = d[:, v == np.max(v)] mean_dist = (np.matrix(mean_3d).reshape(3,1)-self.nom_mean) mahal_dist = mean_dist.T*0.5*np.matrix(np.linalg.inv(cov_3d)+np.linalg.inv(self.nom_cov))*mean_dist print "distance = ", mahal_dist if rospy.get_time()-self.start_time < 10: self.nom_mean = np.matrix(mean_3d).reshape(3,1) self.nom_cov = np.matrix(cov_3d) print "still initializing" else: print "real distance now" else: print "not doing anything since point cloud is too small" # print "mean :\n", mean_3d # print "cov matrix :\n", cov_3d # print "eig of cov :\n", v # print d # print "max direction of var :\n", max_var # hs.draw.pub_body((0, 0, 0), (0, 0, 0, 1), # (0.2, 0.2, 0.2), (1, 0,0,1), 1000000, hs.draw.Marker.SPHERE) # self.draw.pub_body((mean_3d[2], -1*mean_3d[0], -1*mean_3d[1]), (0, 0, 0, 1), # (0.2, 0.2, 0.2), (0, 1,0,1), 1000001, self.draw.Marker.SPHERE) if __name__ == '__main__': ra = ResultsAnalyzer() ra.run() # import roslib # roslib.load_manifest('my_package') # import sys # import rospy # import cv # from std_msgs.msg import String # from sensor_msgs.msg import Image # from cv_bridge import CvBridge, CvBridgeError # class image_converter: # def __init__(self): # self.image_pub = rospy.Publisher("image_topic_2",Image) # cv.NamedWindow("Image window", 1) # self.bridge = CvBridge() # self.image_sub = rospy.Subscriber("image_topic",Image,self.callback) # def callback(self,data): # try: # cv_image = self.bridge.imgmsg_to_cv(data, "bgr8") # except CvBridgeError, e: # print e # (cols,rows) = cv.GetSize(cv_image) # if cols > 60 and rows > 60 : # cv.Circle(cv_image, (50,50), 10, 255) # cv.ShowImage("Image window", cv_image) # cv.WaitKey(3) # try: # self.image_pub.publish(self.bridge.cv_to_imgmsg(cv_image, "bgr8")) # except CvBridgeError, e: # print e # def main(args): # ic = image_converter() # rospy.init_node('image_converter', anonymous=True) # try: # rospy.spin() # except KeyboardInterrupt: # print "Shutting down" # cv.DestroyAllWindows() # if __name__ == '__main__': # main(sys.argv)
ajibawa-2023/Python-Code-Large/train/row_99633
139
262
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99633:Import_L2_C0", "label": "roslib import roslib", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0076, 0.0038, 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_99633:Expr_L3_C0", "label": "load_manifest()", "type": "expression", "loc": [3, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0115, 0.0038, 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('pr2_playpen')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:Import_L4_C0", "label": "rospy import rospy", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0153, 0.0038, 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_99633:ImportFrom_L5_C0", "label": "from sensor_msgs.msg import PointCloud2", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0191, 0.0038, 0, 0.66, 0.25, 531, 0, 1, 0, 0, 531, 0, 0], "semantic": {"name": "sensor_msgs.msg", "arg_names": [], "import_names": ["PointCloud2"], "rhs_call_name": "", "annotation": ""}, "snippet": "from sensor_msgs.msg import PointCloud2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:Import_L6_C0", "label": "point_cloud_python import pc2py", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0229, 0.0038, 0, 0.66, 0.3333, 859, 0, 1, 0, 0, 859, 0, 0], "semantic": {"name": "point_cloud_python", "arg_names": [], "import_names": ["pc2py"], "rhs_call_name": "", "annotation": ""}, "snippet": "import point_cloud_python as pc2py"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:Import_L7_C0", "label": "numpy import np", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.0267, 0.0038, 0, 0.66, 0.4167, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np"], "rhs_call_name": "", "annotation": ""}, "snippet": "import numpy as np"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:ImportFrom_L8_C0", "label": "from matplotlib import pl", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.0305, 0.0038, 0, 0.66, 0.5, 75, 0, 1, 0, 0, 75, 0, 0], "semantic": {"name": "matplotlib", "arg_names": [], "import_names": ["pl"], "rhs_call_name": "", "annotation": ""}, "snippet": "from matplotlib import pylab as pl"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:Import_L9_C0", "label": "draw_scene import ds", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.0344, 0.0038, 0, 0.66, 0.5833, 564, 0, 1, 0, 0, 564, 0, 0], "semantic": {"name": "draw_scene", "arg_names": [], "import_names": ["ds"], "rhs_call_name": "", "annotation": ""}, "snippet": "import draw_scene as ds"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:Import_L10_C0", "label": "math import math", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.0382, 0.0038, 0, 0.66, 0.6667, 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_99633:ImportFrom_L11_C0", "label": "from pr2_playpen.srv import *", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.042, 0.0038, 0, 0.66, 0.75, 216, 0, 1, 0, 0, 216, 0, 0], "semantic": {"name": "pr2_playpen.srv", "arg_names": [], "import_names": ["*"], "rhs_call_name": "", "annotation": ""}, "snippet": "from pr2_playpen.srv import * #this is for Train and Check"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:Import_L12_C0", "label": "threading import threading", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.0458, 0.0038, 0, 0.66, 0.8333, 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_99633:ClassDef_L14_C0", "label": "ResultsAnalyzer", "type": "class", "loc": [14, 199], "level": 0, "parent": null, "vector": [3, 0, 0.4065, 0.7099, 0, 0.66, 0.9167, 126, 0, 6, 0, 0, 0, 0, 99], "semantic": {"name": "ResultsAnalyzer", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ResultsAnalyzer:\n\n def __init__(self):\n rospy.init_node('playpen_results')\n self.draw = ds.SceneDraw()\n self.cloud = None\n rospy.Subscriber(\"pr2_segment_region\", PointCloud2, self.callback)\n# rospy.Subscriber(\"playpen_segment_object\", PointCloud2, self.callback)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L16_C4", "label": "__init__", "type": "function", "loc": [16, 36], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:ClassDef_L14_C0", "vector": [2, 1, 0.0992, 0.0802, 1, 0.53, 0.0, 555, 0, 1, 0, 0, 0, 0, 7], "semantic": {"name": "__init__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self):\n rospy.init_node('playpen_results')\n self.draw = ds.SceneDraw()\n self.cloud = None\n rospy.Subscriber(\"pr2_segment_region\", PointCloud2, self.callback)\n# rospy.Subscriber(\"playpen_segment_object\", PointCloud2, self.callback)\n self.check = rospy.Service(\"playpen_check_success\", Check, self.serv_success)\n self.train_empty = rospy.Service(\"playpen_train\", Train, self.serv_train)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:Expr_L17_C8", "label": "init_node()", "type": "expression", "loc": [17, 17], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L16_C4", "vector": [8, 2, 0.0649, 0.0038, 2, 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('playpen_results')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L18_C8", "label": "self.draw = SceneDraw()", "type": "assigned_variable", "loc": [18, 18], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L16_C4", "vector": [14, 2, 0.0687, 0.0038, 2, 0.45, 0.0667, 110, 3, 0, 0, 0, 319, 10, 1], "semantic": {"name": "self.draw", "arg_names": [], "import_names": [], "rhs_call_name": "SceneDraw", "annotation": ""}, "snippet": " self.draw = ds.SceneDraw()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L19_C8", "label": "self.cloud =", "type": "assigned_variable", "loc": [19, 19], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L16_C4", "vector": [14, 2, 0.0725, 0.0038, 2, 0.45, 0.1333, 789, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.cloud", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.cloud = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:Expr_L20_C8", "label": "Subscriber()", "type": "expression", "loc": [20, 20], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L16_C4", "vector": [8, 2, 0.0763, 0.0038, 2, 0.45, 0.2, 455, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "Subscriber", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " rospy.Subscriber(\"pr2_segment_region\", PointCloud2, self.callback)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L22_C8", "label": "self.check = Service()", "type": "assigned_variable", "loc": [22, 22], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L16_C4", "vector": [14, 2, 0.084, 0.0038, 2, 0.45, 0.2667, 361, 3, 3, 0, 0, 451, 10, 1], "semantic": {"name": "self.check", "arg_names": [], "import_names": [], "rhs_call_name": "Service", "annotation": ""}, "snippet": " self.check = rospy.Service(\"playpen_check_success\", Check, self.serv_success)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L23_C8", "label": "self.train_empty = Service()", "type": "assigned_variable", "loc": [23, 23], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L16_C4", "vector": [14, 2, 0.0878, 0.0038, 2, 0.45, 0.3333, 434, 3, 3, 0, 0, 451, 10, 1], "semantic": {"name": "self.train_empty", "arg_names": [], "import_names": [], "rhs_call_name": "Service", "annotation": ""}, "snippet": " self.train_empty = rospy.Service(\"playpen_train\", Train, self.serv_train)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L24_C8", "label": "self.table_mean =", "type": "assigned_variable", "loc": [24, 24], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L16_C4", "vector": [14, 2, 0.0916, 0.0038, 2, 0.45, 0.4, 934, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.table_mean", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.table_mean = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L25_C8", "label": "self.table_cov =", "type": "assigned_variable", "loc": [25, 25], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L16_C4", "vector": [14, 2, 0.0954, 0.0038, 2, 0.45, 0.4667, 518, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.table_cov", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.table_cov = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L26_C8", "label": "self.object_mean =", "type": "assigned_variable", "loc": [26, 26], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L16_C4", "vector": [14, 2, 0.0992, 0.0038, 2, 0.45, 0.5333, 422, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.object_mean", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.object_mean = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L27_C8", "label": "self.object_cov =", "type": "assigned_variable", "loc": [27, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L16_C4", "vector": [14, 2, 0.1031, 0.0038, 2, 0.45, 0.6, 171, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.object_cov", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.object_cov = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L28_C8", "label": "self.mean_ls =", "type": "assigned_variable", "loc": [28, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L16_C4", "vector": [14, 2, 0.1069, 0.0038, 2, 0.45, 0.6667, 443, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.mean_ls", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.mean_ls =[]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L29_C8", "label": "self.cov_ls =", "type": "assigned_variable", "loc": [29, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L16_C4", "vector": [14, 2, 0.1107, 0.0038, 2, 0.45, 0.7333, 82, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.cov_ls", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.cov_ls = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L33_C8", "label": "self.start_time = get_time()", "type": "assigned_variable", "loc": [33, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L16_C4", "vector": [14, 2, 0.126, 0.0038, 2, 0.45, 0.8, 387, 3, 0, 0, 0, 164, 10, 1], "semantic": {"name": "self.start_time", "arg_names": [], "import_names": [], "rhs_call_name": "get_time", "annotation": ""}, "snippet": " self.start_time = rospy.get_time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L34_C8", "label": "self.lock = RLock()", "type": "assigned_variable", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L16_C4", "vector": [14, 2, 0.1298, 0.0038, 2, 0.45, 0.8667, 45, 3, 0, 0, 0, 207, 10, 1], "semantic": {"name": "self.lock", "arg_names": [], "import_names": [], "rhs_call_name": "RLock", "annotation": ""}, "snippet": " self.lock = threading.RLock()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L35_C8", "label": "self.new_cloud =", "type": "assigned_variable", "loc": [35, 35], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L16_C4", "vector": [14, 2, 0.1336, 0.0038, 2, 0.45, 0.9333, 914, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.new_cloud", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.new_cloud = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L36_C8", "label": "self.start =", "type": "assigned_variable", "loc": [36, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L16_C4", "vector": [14, 2, 0.1374, 0.0038, 2, 0.45, 1.0, 45, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.start", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.start = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L39_C4", "label": "callback", "type": "function", "loc": [39, 45], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:ClassDef_L14_C0", "vector": [2, 1, 0.1603, 0.0267, 1, 0.53, 0.2, 342, 0, 2, 0, 0, 0, 0, 7], "semantic": {"name": "callback", "arg_names": ["self", "data"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def callback(self, data):\n self.lock.acquire()\n self.cloud = list(pc2py.points(data, ['x', 'y', 'z']))\n self.new_cloud = True\n print(rospy.get_time()-self.start, \"time in between call backs\")\n self.start = rospy.get_time()\n self.lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:Expr_L40_C8", "label": "acquire()", "type": "expression", "loc": [40, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L39_C4", "vector": [8, 2, 0.1527, 0.0038, 2, 0.32, 0.0, 229, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "acquire", "arg_names": [], "import_names": [], "rhs_call_name": "acquire", "annotation": ""}, "snippet": " self.lock.acquire()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L41_C8", "label": "self.cloud = list()", "type": "assigned_variable", "loc": [41, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L39_C4", "vector": [14, 2, 0.1565, 0.0038, 2, 0.32, 0.2, 789, 3, 1, 0, 0, 430, 10, 2], "semantic": {"name": "self.cloud", "arg_names": [], "import_names": [], "rhs_call_name": "list", "annotation": ""}, "snippet": " self.cloud = list(pc2py.points(data, ['x', 'y', 'z']))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L42_C8", "label": "self.new_cloud =", "type": "assigned_variable", "loc": [42, 42], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L39_C4", "vector": [14, 2, 0.1603, 0.0038, 2, 0.32, 0.4, 914, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.new_cloud", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.new_cloud = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:Expr_L43_C8", "label": "print()", "type": "expression", "loc": [43, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L39_C4", "vector": [8, 2, 0.1641, 0.0038, 2, 0.32, 0.6, 535, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(rospy.get_time()-self.start, \"time in between call backs\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L44_C8", "label": "self.start = get_time()", "type": "assigned_variable", "loc": [44, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L39_C4", "vector": [14, 2, 0.1679, 0.0038, 2, 0.32, 0.8, 45, 3, 0, 0, 0, 164, 10, 1], "semantic": {"name": "self.start", "arg_names": [], "import_names": [], "rhs_call_name": "get_time", "annotation": ""}, "snippet": " self.start = rospy.get_time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:Expr_L45_C8", "label": "release()", "type": "expression", "loc": [45, 45], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L39_C4", "vector": [8, 2, 0.1718, 0.0038, 2, 0.32, 1.0, 784, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "release", "arg_names": [], "import_names": [], "rhs_call_name": "release", "annotation": ""}, "snippet": " self.lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L48_C4", "label": "serv_success", "type": "function", "loc": [48, 103], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:ClassDef_L14_C0", "vector": [2, 1, 0.2882, 0.2137, 1, 0.53, 0.4, 257, 0, 2, 1, 0, 0, 0, 29], "semantic": {"name": "serv_success", "arg_names": ["self", "req"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def serv_success(self, req):\n result = \"none\"\n while self.new_cloud == False:\n rospy.sleep(0.01)\n self.new_cloud = False\n self.lock.acquire()\n if self.table_mean == None or self.object_mean == None:\n print(\"you haven't initialized yet!!\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L49_C8", "label": "result =", "type": "assigned_variable", "loc": [49, 49], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L48_C4", "vector": [14, 2, 0.187, 0.0038, 2, 0.38, 0.0, 51, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "result", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " result = \"none\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:While_L50_C8", "label": "while", "type": "while", "loc": [50, 51], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L48_C4", "vector": [5, 2, 0.1927, 0.0076, 2, 0.38, 0.0909, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while self.new_cloud == False:\n rospy.sleep(0.01)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:Expr_L51_C12", "label": "sleep()", "type": "expression", "loc": [51, 51], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:While_L50_C8", "vector": [8, 3, 0.1947, 0.0038, 3, 0.82, 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_99633:Assign_L52_C8", "label": "self.new_cloud =", "type": "assigned_variable", "loc": [52, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L48_C4", "vector": [14, 2, 0.1985, 0.0038, 2, 0.38, 0.1818, 914, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.new_cloud", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.new_cloud = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:Expr_L53_C8", "label": "acquire()", "type": "expression", "loc": [53, 53], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L48_C4", "vector": [8, 2, 0.2023, 0.0038, 2, 0.38, 0.2727, 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_99633:If_L54_C8", "label": "if", "type": "if", "loc": [54, 56], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L48_C4", "vector": [4, 2, 0.2099, 0.0115, 2, 0.38, 0.3636, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.table_mean == None or self.object_mean == None:\n print(\"you haven't initialized yet!!\")\n return CheckResponse(result)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:Expr_L55_C12", "label": "print()", "type": "expression", "loc": [55, 55], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L54_C8", "vector": [8, 3, 0.2099, 0.0038, 3, 0.95, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"you haven't initialized yet!!\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:Return_L56_C12", "label": "return", "type": "return", "loc": [56, 56], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L54_C8", "vector": [13, 3, 0.2137, 0.0038, 3, 0.95, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return CheckResponse(result)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L58_C8", "label": "np_array_cloud = array()", "type": "assigned_variable", "loc": [58, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L48_C4", "vector": [14, 2, 0.2214, 0.0038, 2, 0.38, 0.4545, 871, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "np_array_cloud", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " np_array_cloud = np.array(self.cloud)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L59_C8", "label": "f_ind = flatten()", "type": "assigned_variable", "loc": [59, 59], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L48_C4", "vector": [14, 2, 0.2252, 0.0038, 2, 0.38, 0.5455, 898, 3, 0, 0, 0, 893, 10, 4], "semantic": {"name": "f_ind", "arg_names": [], "import_names": [], "rhs_call_name": "flatten", "annotation": ""}, "snippet": " f_ind = np.array(~np.isnan(np_array_cloud).any(1)).flatten()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L60_C8", "label": "f_np_array_cloud =", "type": "assigned_variable", "loc": [60, 60], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L48_C4", "vector": [14, 2, 0.229, 0.0038, 2, 0.38, 0.6364, 888, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "f_np_array_cloud", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " f_np_array_cloud = np_array_cloud[f_ind, :]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L61_C8", "label": "if", "type": "if", "loc": [61, 71], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L48_C4", "vector": [4, 2, 0.2519, 0.042, 2, 0.38, 0.7273, 0, 0, 0, 0, 0, 0, 0, 17], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if np.max(f_np_array_cloud.shape)>200:\n mean_3d = np.mean(f_np_array_cloud, axis = 0)\n cov_3d = np.cov(f_np_array_cloud.T)\n v, d = np.linalg.eig(cov_3d)\n max_var = d[:, v == np.max(v)]\n mean_dist_table = (np.matrix(mean_3d).reshape(3,1)-self.table_mean)\n mean_dist_object = (np.matrix(mean_3d).reshape(3,1)-self.object_mean)\n mahal_dist_table = mean_dist_table.T*0.5*np.matrix(np.linalg.inv(cov_3d)+np.linalg.inv(self.table_cov))*mean_dist_table"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L62_C12", "label": "mean_3d = mean()", "type": "assigned_variable", "loc": [62, 62], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L61_C8", "vector": [14, 3, 0.2366, 0.0038, 3, 0.23, 0.0, 958, 3, 2, 0, 0, 856, 10, 1], "semantic": {"name": "mean_3d", "arg_names": [], "import_names": [], "rhs_call_name": "mean", "annotation": ""}, "snippet": " mean_3d = np.mean(f_np_array_cloud, axis = 0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L63_C12", "label": "cov_3d = cov()", "type": "assigned_variable", "loc": [63, 63], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L61_C8", "vector": [14, 3, 0.2405, 0.0038, 3, 0.23, 0.1111, 421, 3, 1, 0, 0, 251, 10, 1], "semantic": {"name": "cov_3d", "arg_names": [], "import_names": [], "rhs_call_name": "cov", "annotation": ""}, "snippet": " cov_3d = np.cov(f_np_array_cloud.T)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L64_C12", "label": "v, d = eig()", "type": "assigned_variable", "loc": [64, 64], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L61_C8", "vector": [14, 3, 0.2443, 0.0038, 3, 0.23, 0.2222, 831, 3, 1, 0, 0, 971, 10, 1], "semantic": {"name": "v, d", "arg_names": [], "import_names": [], "rhs_call_name": "eig", "annotation": ""}, "snippet": " v, d = np.linalg.eig(cov_3d)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L65_C12", "label": "max_var =", "type": "assigned_variable", "loc": [65, 65], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L61_C8", "vector": [14, 3, 0.2481, 0.0038, 3, 0.23, 0.3333, 80, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "max_var", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " max_var = d[:, v == np.max(v)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L66_C12", "label": "mean_dist_table =", "type": "assigned_variable", "loc": [66, 66], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L61_C8", "vector": [14, 3, 0.2519, 0.0038, 3, 0.23, 0.4444, 924, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "mean_dist_table", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mean_dist_table = (np.matrix(mean_3d).reshape(3,1)-self.table_mean)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L67_C12", "label": "mean_dist_object =", "type": "assigned_variable", "loc": [67, 67], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L61_C8", "vector": [14, 3, 0.2557, 0.0038, 3, 0.23, 0.5556, 220, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "mean_dist_object", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mean_dist_object = (np.matrix(mean_3d).reshape(3,1)-self.object_mean)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L68_C12", "label": "mahal_dist_table =", "type": "assigned_variable", "loc": [68, 68], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L61_C8", "vector": [14, 3, 0.2595, 0.0038, 3, 0.23, 0.6667, 649, 4, 0, 0, 0, 0, 0, 3], "semantic": {"name": "mahal_dist_table", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mahal_dist_table = mean_dist_table.T*0.5*np.matrix(np.linalg.inv(cov_3d)+np.linalg.inv(self.table_cov))*mean_dist_table"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L69_C12", "label": "mahal_dist_object =", "type": "assigned_variable", "loc": [69, 69], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L61_C8", "vector": [14, 3, 0.2634, 0.0038, 3, 0.23, 0.7778, 809, 4, 0, 0, 0, 0, 0, 3], "semantic": {"name": "mahal_dist_object", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mahal_dist_object = mean_dist_object.T*0.5*np.matrix(np.linalg.inv(cov_3d)+np.linalg.inv(self.object_cov))*mean_dist_object"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:Expr_L70_C12", "label": "print()", "type": "expression", "loc": [70, 70], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L61_C8", "vector": [8, 3, 0.2672, 0.0038, 3, 0.23, 0.8889, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"table distance = \", mahal_dist_table)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:Expr_L71_C12", "label": "print()", "type": "expression", "loc": [71, 71], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L61_C8", "vector": [8, 3, 0.271, 0.0038, 3, 0.23, 1.0, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"object distance = \", mahal_dist_object)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L78_C8", "label": "if", "type": "if", "loc": [78, 83], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L48_C4", "vector": [4, 2, 0.3073, 0.0229, 2, 0.38, 0.8182, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if np.max(f_np_array_cloud.shape)<200:\n result = \"no_cloud\"\n elif mahal_dist_table<mahal_dist_object:\n result = \"table\"\n else:\n result = \"object\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L79_C12", "label": "result =", "type": "assigned_variable", "loc": [79, 79], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L78_C8", "vector": [14, 3, 0.3015, 0.0038, 3, 0.8, 0.0, 51, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "result", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " result = \"no_cloud\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L80_C8", "label": "if", "type": "if", "loc": [80, 83], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L78_C8", "vector": [4, 3, 0.3111, 0.0153, 3, 0.8, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif mahal_dist_table<mahal_dist_object:\n result = \"table\"\n else:\n result = \"object\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L81_C12", "label": "result =", "type": "assigned_variable", "loc": [81, 81], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L80_C8", "vector": [14, 4, 0.3092, 0.0038, 4, 0.79, 0.0, 51, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "result", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " result = \"table\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L83_C12", "label": "result =", "type": "assigned_variable", "loc": [83, 83], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L80_C8", "vector": [14, 4, 0.3168, 0.0038, 4, 0.79, 1.0, 51, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "result", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " result = \"object\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:Expr_L102_C8", "label": "release()", "type": "expression", "loc": [102, 102], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L48_C4", "vector": [8, 2, 0.3893, 0.0038, 2, 0.38, 0.9091, 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_99633:Return_L103_C8", "label": "return", "type": "return", "loc": [103, 103], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L48_C4", "vector": [13, 2, 0.3931, 0.0038, 2, 0.38, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return CheckResponse(result)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L105_C4", "label": "serv_train", "type": "function", "loc": [105, 170], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:ClassDef_L14_C0", "vector": [2, 1, 0.5248, 0.2519, 1, 0.53, 0.6, 627, 0, 2, 1, 0, 0, 0, 35], "semantic": {"name": "serv_train", "arg_names": ["self", "req"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def serv_train(self, req):\n num_samples = 0\n if req.expected == 'table':\n self.table_mean = None\n self.table_cov = None\n print(\"training for empty table top\")\n elif req.expected == 'object':\n self.object_mean = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L106_C8", "label": "num_samples =", "type": "assigned_variable", "loc": [106, 106], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L105_C4", "vector": [14, 2, 0.4046, 0.0038, 2, 0.14, 0.0, 764, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "num_samples", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " num_samples = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L107_C8", "label": "if", "type": "if", "loc": [107, 114], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L105_C4", "vector": [4, 2, 0.4218, 0.0305, 2, 0.14, 0.0625, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if req.expected == 'table':\n self.table_mean = None\n self.table_cov = None\n print(\"training for empty table top\")\n elif req.expected == 'object':\n self.object_mean = None\n self.object_cov = None\n print(\"training for object on table top\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L108_C12", "label": "self.table_mean =", "type": "assigned_variable", "loc": [108, 108], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L107_C8", "vector": [14, 3, 0.4122, 0.0038, 3, 0.57, 0.0, 934, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.table_mean", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.table_mean = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L109_C12", "label": "self.table_cov =", "type": "assigned_variable", "loc": [109, 109], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L107_C8", "vector": [14, 3, 0.416, 0.0038, 3, 0.57, 0.3333, 518, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.table_cov", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.table_cov = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:Expr_L110_C12", "label": "print()", "type": "expression", "loc": [110, 110], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L107_C8", "vector": [8, 3, 0.4198, 0.0038, 3, 0.57, 0.6667, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"training for empty table top\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L111_C8", "label": "if", "type": "if", "loc": [111, 114], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L107_C8", "vector": [4, 3, 0.4294, 0.0153, 3, 0.57, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif req.expected == 'object':\n self.object_mean = None\n self.object_cov = None\n print(\"training for object on table top\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L112_C12", "label": "self.object_mean =", "type": "assigned_variable", "loc": [112, 112], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L111_C8", "vector": [14, 4, 0.4275, 0.0038, 4, 0.84, 0.0, 422, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.object_mean", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.object_mean = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L113_C12", "label": "self.object_cov =", "type": "assigned_variable", "loc": [113, 113], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L111_C8", "vector": [14, 4, 0.4313, 0.0038, 4, 0.84, 0.5, 171, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.object_cov", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.object_cov = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:Expr_L114_C12", "label": "print()", "type": "expression", "loc": [114, 114], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L111_C8", "vector": [8, 4, 0.4351, 0.0038, 4, 0.84, 1.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"training for object on table top\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L116_C8", "label": "self.mean_ls =", "type": "assigned_variable", "loc": [116, 116], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L105_C4", "vector": [14, 2, 0.4427, 0.0038, 2, 0.14, 0.125, 443, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.mean_ls", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.mean_ls = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L117_C8", "label": "self.cov_ls =", "type": "assigned_variable", "loc": [117, 117], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L105_C4", "vector": [14, 2, 0.4466, 0.0038, 2, 0.14, 0.1875, 82, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.cov_ls", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.cov_ls = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:While_L119_C8", "label": "while", "type": "while", "loc": [119, 139], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L105_C4", "vector": [5, 2, 0.4924, 0.0802, 2, 0.14, 0.25, 0, 0, 0, 0, 0, 0, 0, 20], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while num_samples < 11:\n start_time = rospy.get_time()\n while self.new_cloud == False:\n rospy.sleep(0.01)\n self.lock.acquire()\n np_array_cloud = np.array(self.cloud)\n f_ind = np.array(~np.isnan(np_array_cloud).any(1)).flatten()\n f_np_array_cloud = np_array_cloud[f_ind, :]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L120_C12", "label": "start_time = get_time()", "type": "assigned_variable", "loc": [120, 120], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:While_L119_C8", "vector": [14, 3, 0.458, 0.0038, 3, 0.01, 0.0, 511, 3, 0, 0, 0, 164, 10, 1], "semantic": {"name": "start_time", "arg_names": [], "import_names": [], "rhs_call_name": "get_time", "annotation": ""}, "snippet": " start_time = rospy.get_time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:While_L121_C12", "label": "while", "type": "while", "loc": [121, 122], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:While_L119_C8", "vector": [5, 3, 0.4637, 0.0076, 3, 0.01, 0.1111, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while self.new_cloud == False:\n rospy.sleep(0.01)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:Expr_L122_C16", "label": "sleep()", "type": "expression", "loc": [122, 122], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:While_L121_C12", "vector": [8, 4, 0.4656, 0.0038, 4, 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_99633:Expr_L123_C12", "label": "acquire()", "type": "expression", "loc": [123, 123], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:While_L119_C8", "vector": [8, 3, 0.4695, 0.0038, 3, 0.01, 0.2222, 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_99633:Assign_L124_C12", "label": "np_array_cloud = array()", "type": "assigned_variable", "loc": [124, 124], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:While_L119_C8", "vector": [14, 3, 0.4733, 0.0038, 3, 0.01, 0.3333, 871, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "np_array_cloud", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " np_array_cloud = np.array(self.cloud)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L125_C12", "label": "f_ind = flatten()", "type": "assigned_variable", "loc": [125, 125], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:While_L119_C8", "vector": [14, 3, 0.4771, 0.0038, 3, 0.01, 0.4444, 898, 3, 0, 0, 0, 893, 10, 4], "semantic": {"name": "f_ind", "arg_names": [], "import_names": [], "rhs_call_name": "flatten", "annotation": ""}, "snippet": " f_ind = np.array(~np.isnan(np_array_cloud).any(1)).flatten()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L126_C12", "label": "f_np_array_cloud =", "type": "assigned_variable", "loc": [126, 126], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:While_L119_C8", "vector": [14, 3, 0.4809, 0.0038, 3, 0.01, 0.5556, 888, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "f_np_array_cloud", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " f_np_array_cloud = np_array_cloud[f_ind, :]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L128_C12", "label": "if", "type": "if", "loc": [128, 135], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:While_L119_C8", "vector": [4, 3, 0.5019, 0.0305, 3, 0.01, 0.6667, 0, 0, 0, 0, 0, 0, 0, 10], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if np.max(f_np_array_cloud.shape)>200:\n mean_3d = np.mean(f_np_array_cloud, axis = 0)\n cov_3d = np.cov(f_np_array_cloud.T)\n v, d = np.linalg.eig(cov_3d)\n max_var = d[:, v == np.max(v)]\n self.mean_ls.append(np.matrix(mean_3d).reshape(3,1))\n self.cov_ls.append(np.matrix(cov_3d))\n num_samples = num_samples + 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L129_C16", "label": "mean_3d = mean()", "type": "assigned_variable", "loc": [129, 129], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L128_C12", "vector": [14, 4, 0.4924, 0.0038, 4, 0.06, 0.0, 958, 3, 2, 0, 0, 856, 10, 1], "semantic": {"name": "mean_3d", "arg_names": [], "import_names": [], "rhs_call_name": "mean", "annotation": ""}, "snippet": " mean_3d = np.mean(f_np_array_cloud, axis = 0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L130_C16", "label": "cov_3d = cov()", "type": "assigned_variable", "loc": [130, 130], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L128_C12", "vector": [14, 4, 0.4962, 0.0038, 4, 0.06, 0.1667, 421, 3, 1, 0, 0, 251, 10, 1], "semantic": {"name": "cov_3d", "arg_names": [], "import_names": [], "rhs_call_name": "cov", "annotation": ""}, "snippet": " cov_3d = np.cov(f_np_array_cloud.T)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L131_C16", "label": "v, d = eig()", "type": "assigned_variable", "loc": [131, 131], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L128_C12", "vector": [14, 4, 0.5, 0.0038, 4, 0.06, 0.3333, 831, 3, 1, 0, 0, 971, 10, 1], "semantic": {"name": "v, d", "arg_names": [], "import_names": [], "rhs_call_name": "eig", "annotation": ""}, "snippet": " v, d = np.linalg.eig(cov_3d)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L132_C16", "label": "max_var =", "type": "assigned_variable", "loc": [132, 132], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L128_C12", "vector": [14, 4, 0.5038, 0.0038, 4, 0.06, 0.5, 80, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "max_var", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " max_var = d[:, v == np.max(v)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:Expr_L133_C16", "label": "append()", "type": "expression", "loc": [133, 133], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L128_C12", "vector": [8, 4, 0.5076, 0.0038, 4, 0.06, 0.6667, 243, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.mean_ls.append(np.matrix(mean_3d).reshape(3,1))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:Expr_L134_C16", "label": "append()", "type": "expression", "loc": [134, 134], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L128_C12", "vector": [8, 4, 0.5115, 0.0038, 4, 0.06, 0.8333, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.cov_ls.append(np.matrix(cov_3d))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L135_C16", "label": "num_samples =", "type": "assigned_variable", "loc": [135, 135], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L128_C12", "vector": [14, 4, 0.5153, 0.0038, 4, 0.06, 1.0, 764, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "num_samples", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " num_samples = num_samples + 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L137_C12", "label": "self.new_cloud =", "type": "assigned_variable", "loc": [137, 137], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:While_L119_C8", "vector": [14, 3, 0.5229, 0.0038, 3, 0.01, 0.7778, 914, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.new_cloud", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.new_cloud = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:Expr_L138_C12", "label": "print()", "type": "expression", "loc": [138, 138], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:While_L119_C8", "vector": [8, 3, 0.5267, 0.0038, 3, 0.01, 0.8889, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"still initializing\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:Expr_L139_C12", "label": "release()", "type": "expression", "loc": [139, 139], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:While_L119_C8", "vector": [8, 3, 0.5305, 0.0038, 3, 0.01, 1.0, 784, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "release", "arg_names": [], "import_names": [], "rhs_call_name": "release", "annotation": ""}, "snippet": " self.lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L140_C8", "label": "buf_mean = matrix()", "type": "assigned_variable", "loc": [140, 140], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L105_C4", "vector": [14, 2, 0.5344, 0.0038, 2, 0.14, 0.3125, 750, 3, 1, 0, 0, 162, 10, 2], "semantic": {"name": "buf_mean", "arg_names": [], "import_names": [], "rhs_call_name": "matrix", "annotation": ""}, "snippet": " buf_mean = np.matrix(np.zeros((3,1)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L141_C8", "label": "buf_cov = matrix()", "type": "assigned_variable", "loc": [141, 141], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L105_C4", "vector": [14, 2, 0.5382, 0.0038, 2, 0.14, 0.375, 311, 3, 1, 0, 0, 162, 10, 2], "semantic": {"name": "buf_cov", "arg_names": [], "import_names": [], "rhs_call_name": "matrix", "annotation": ""}, "snippet": " buf_cov = np.matrix(np.zeros((3,3)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:Expr_L143_C8", "label": "print()", "type": "expression", "loc": [143, 143], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L105_C4", "vector": [8, 2, 0.5458, 0.0038, 2, 0.14, 0.4375, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"here is the mean list :\", self.mean_ls)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L144_C8", "label": "mean_arr = array()", "type": "assigned_variable", "loc": [144, 144], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L105_C4", "vector": [14, 2, 0.5496, 0.0038, 2, 0.14, 0.5, 698, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "mean_arr", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " mean_arr = np.array(self.mean_ls)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:Expr_L145_C8", "label": "sort()", "type": "expression", "loc": [145, 145], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L105_C4", "vector": [8, 2, 0.5534, 0.0038, 2, 0.14, 0.5625, 489, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sort", "arg_names": [], "import_names": [], "rhs_call_name": "sort", "annotation": ""}, "snippet": " mean_arr.sort(axis=0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:Expr_L146_C8", "label": "print()", "type": "expression", "loc": [146, 146], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L105_C4", "vector": [8, 2, 0.5573, 0.0038, 2, 0.14, 0.625, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"here is th sorted mean array :\", mean_arr)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:Expr_L148_C8", "label": "print()", "type": "expression", "loc": [148, 148], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L105_C4", "vector": [8, 2, 0.5649, 0.0038, 2, 0.14, 0.6875, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"here is the mean cov :\\n\", self.cov_ls)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L149_C8", "label": "cov_arr = array()", "type": "assigned_variable", "loc": [149, 149], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L105_C4", "vector": [14, 2, 0.5687, 0.0038, 2, 0.14, 0.75, 140, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "cov_arr", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " cov_arr = np.array(self.cov_ls)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:Expr_L150_C8", "label": "sort()", "type": "expression", "loc": [150, 150], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L105_C4", "vector": [8, 2, 0.5725, 0.0038, 2, 0.14, 0.8125, 489, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sort", "arg_names": [], "import_names": [], "rhs_call_name": "sort", "annotation": ""}, "snippet": " cov_arr.sort(axis=0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:Expr_L151_C8", "label": "print()", "type": "expression", "loc": [151, 151], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L105_C4", "vector": [8, 2, 0.5763, 0.0038, 2, 0.14, 0.875, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"here is the sorted cov :\\n\", cov_arr)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L157_C8", "label": "if", "type": "if", "loc": [157, 164], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L105_C4", "vector": [4, 2, 0.6126, 0.0305, 2, 0.14, 0.9375, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if req.expected == 'table':\n self.table_mean = mean_arr[5]\n self.table_cov = cov_arr[5]\n # self.table_mean = buf_mean*1/10.0\n # self.table_cov = buf_cov*1/10.0\n elif req.expected == 'object':\n self.object_mean = mean_arr[5]\n self.object_cov = cov_arr[5]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L158_C12", "label": "self.table_mean =", "type": "assigned_variable", "loc": [158, 158], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L157_C8", "vector": [14, 3, 0.6031, 0.0038, 3, 0.2, 0.0, 934, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.table_mean", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.table_mean = mean_arr[5]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L159_C12", "label": "self.table_cov =", "type": "assigned_variable", "loc": [159, 159], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L157_C8", "vector": [14, 3, 0.6069, 0.0038, 3, 0.2, 0.5, 518, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.table_cov", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.table_cov = cov_arr[5]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L162_C8", "label": "if", "type": "if", "loc": [162, 164], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L157_C8", "vector": [4, 3, 0.6221, 0.0115, 3, 0.2, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif req.expected == 'object':\n self.object_mean = mean_arr[5]\n self.object_cov = cov_arr[5]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L163_C12", "label": "self.object_mean =", "type": "assigned_variable", "loc": [163, 163], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L162_C8", "vector": [14, 4, 0.6221, 0.0038, 4, 0.48, 0.0, 422, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.object_mean", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.object_mean = mean_arr[5]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L164_C12", "label": "self.object_cov =", "type": "assigned_variable", "loc": [164, 164], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L162_C8", "vector": [14, 4, 0.626, 0.0038, 4, 0.48, 1.0, 171, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.object_cov", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.object_cov = cov_arr[5]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:Return_L170_C8", "label": "return", "type": "return", "loc": [170, 170], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L105_C4", "vector": [13, 2, 0.6489, 0.0038, 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 TrainResponse(num_samples)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L172_C4", "label": "run", "type": "function", "loc": [172, 174], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:ClassDef_L14_C0", "vector": [2, 1, 0.6603, 0.0115, 1, 0.53, 0.8, 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 print('Ready to calculate results')\n rospy.spin()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:Expr_L173_C8", "label": "print()", "type": "expression", "loc": [173, 173], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L172_C4", "vector": [8, 2, 0.6603, 0.0038, 2, 0.15, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Ready to calculate results')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:Expr_L174_C8", "label": "spin()", "type": "expression", "loc": [174, 174], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L172_C4", "vector": [8, 2, 0.6641, 0.0038, 2, 0.15, 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_99633:FunctionDef_L176_C4", "label": "get_cloud_stats", "type": "function", "loc": [176, 199], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:ClassDef_L14_C0", "vector": [2, 1, 0.7156, 0.0916, 1, 0.53, 1.0, 323, 0, 1, 0, 0, 0, 0, 25], "semantic": {"name": "get_cloud_stats", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_cloud_stats(self):\n np_array_cloud = np.array(self.cloud)\n f_ind = np.array(~np.isnan(np_array_cloud).any(1)).flatten()\n f_np_array_cloud = np_array_cloud[f_ind, :]\n\n print('size of remaining point cloud :', np.max(f_np_array_cloud.shape))\n if np.max(f_np_array_cloud.shape)>200:\n mean_3d = np.mean(f_np_array_cloud, axis = 0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L177_C8", "label": "np_array_cloud = array()", "type": "assigned_variable", "loc": [177, 177], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L176_C4", "vector": [14, 2, 0.6756, 0.0038, 2, 0.79, 0.0, 871, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "np_array_cloud", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " np_array_cloud = np.array(self.cloud)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L178_C8", "label": "f_ind = flatten()", "type": "assigned_variable", "loc": [178, 178], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L176_C4", "vector": [14, 2, 0.6794, 0.0038, 2, 0.79, 0.25, 898, 3, 0, 0, 0, 893, 10, 4], "semantic": {"name": "f_ind", "arg_names": [], "import_names": [], "rhs_call_name": "flatten", "annotation": ""}, "snippet": " f_ind = np.array(~np.isnan(np_array_cloud).any(1)).flatten()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L179_C8", "label": "f_np_array_cloud =", "type": "assigned_variable", "loc": [179, 179], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L176_C4", "vector": [14, 2, 0.6832, 0.0038, 2, 0.79, 0.5, 888, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "f_np_array_cloud", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " f_np_array_cloud = np_array_cloud[f_ind, :]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:Expr_L181_C8", "label": "print()", "type": "expression", "loc": [181, 181], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L176_C4", "vector": [8, 2, 0.6908, 0.0038, 2, 0.79, 0.75, 535, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('size of remaining point cloud :', np.max(f_np_array_cloud.shape))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L182_C8", "label": "if", "type": "if", "loc": [182, 199], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L176_C4", "vector": [4, 2, 0.7271, 0.0687, 2, 0.79, 1.0, 0, 0, 0, 0, 0, 0, 0, 18], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if np.max(f_np_array_cloud.shape)>200:\n mean_3d = np.mean(f_np_array_cloud, axis = 0)\n cov_3d = np.cov(f_np_array_cloud.T)\n v, d = np.linalg.eig(cov_3d)\n max_var = d[:, v == np.max(v)]\n mean_dist = (np.matrix(mean_3d).reshape(3,1)-self.nom_mean)\n\n mahal_dist = mean_dist.T*0.5*np.matrix(np.linalg.inv(cov_3d)+np.linalg.inv(self.nom_cov))*mean_dist"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L183_C12", "label": "mean_3d = mean()", "type": "assigned_variable", "loc": [183, 183], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L182_C8", "vector": [14, 3, 0.6985, 0.0038, 3, 0.85, 0.0, 958, 3, 2, 0, 0, 856, 10, 1], "semantic": {"name": "mean_3d", "arg_names": [], "import_names": [], "rhs_call_name": "mean", "annotation": ""}, "snippet": " mean_3d = np.mean(f_np_array_cloud, axis = 0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L184_C12", "label": "cov_3d = cov()", "type": "assigned_variable", "loc": [184, 184], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L182_C8", "vector": [14, 3, 0.7023, 0.0038, 3, 0.85, 0.125, 421, 3, 1, 0, 0, 251, 10, 1], "semantic": {"name": "cov_3d", "arg_names": [], "import_names": [], "rhs_call_name": "cov", "annotation": ""}, "snippet": " cov_3d = np.cov(f_np_array_cloud.T)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L185_C12", "label": "v, d = eig()", "type": "assigned_variable", "loc": [185, 185], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L182_C8", "vector": [14, 3, 0.7061, 0.0038, 3, 0.85, 0.25, 831, 3, 1, 0, 0, 971, 10, 1], "semantic": {"name": "v, d", "arg_names": [], "import_names": [], "rhs_call_name": "eig", "annotation": ""}, "snippet": " v, d = np.linalg.eig(cov_3d)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L186_C12", "label": "max_var =", "type": "assigned_variable", "loc": [186, 186], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L182_C8", "vector": [14, 3, 0.7099, 0.0038, 3, 0.85, 0.375, 80, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "max_var", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " max_var = d[:, v == np.max(v)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L187_C12", "label": "mean_dist =", "type": "assigned_variable", "loc": [187, 187], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L182_C8", "vector": [14, 3, 0.7137, 0.0038, 3, 0.85, 0.5, 836, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "mean_dist", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mean_dist = (np.matrix(mean_3d).reshape(3,1)-self.nom_mean)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L189_C12", "label": "mahal_dist =", "type": "assigned_variable", "loc": [189, 189], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L182_C8", "vector": [14, 3, 0.7214, 0.0038, 3, 0.85, 0.625, 775, 4, 0, 0, 0, 0, 0, 3], "semantic": {"name": "mahal_dist", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mahal_dist = mean_dist.T*0.5*np.matrix(np.linalg.inv(cov_3d)+np.linalg.inv(self.nom_cov))*mean_dist"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:Expr_L190_C12", "label": "print()", "type": "expression", "loc": [190, 190], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L182_C8", "vector": [8, 3, 0.7252, 0.0038, 3, 0.85, 0.75, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"distance = \", mahal_dist)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L192_C12", "label": "if", "type": "if", "loc": [192, 197], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L182_C8", "vector": [4, 3, 0.7424, 0.0229, 3, 0.85, 0.875, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if rospy.get_time()-self.start_time < 10:\n self.nom_mean = np.matrix(mean_3d).reshape(3,1)\n self.nom_cov = np.matrix(cov_3d)\n print(\"still initializing\")\n else:\n print(\"real distance now\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L193_C16", "label": "self.nom_mean = reshape()", "type": "assigned_variable", "loc": [193, 193], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L192_C12", "vector": [14, 4, 0.7366, 0.0038, 4, 0.76, 0.0, 571, 3, 2, 0, 0, 276, 10, 2], "semantic": {"name": "self.nom_mean", "arg_names": [], "import_names": [], "rhs_call_name": "reshape", "annotation": ""}, "snippet": " self.nom_mean = np.matrix(mean_3d).reshape(3,1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L194_C16", "label": "self.nom_cov = matrix()", "type": "assigned_variable", "loc": [194, 194], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L192_C12", "vector": [14, 4, 0.7405, 0.0038, 4, 0.76, 0.3333, 432, 3, 1, 0, 0, 162, 10, 1], "semantic": {"name": "self.nom_cov", "arg_names": [], "import_names": [], "rhs_call_name": "matrix", "annotation": ""}, "snippet": " self.nom_cov = np.matrix(cov_3d)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:Expr_L195_C16", "label": "print()", "type": "expression", "loc": [195, 195], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L192_C12", "vector": [8, 4, 0.7443, 0.0038, 4, 0.76, 0.6667, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"still initializing\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:Expr_L197_C16", "label": "print()", "type": "expression", "loc": [197, 197], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L192_C12", "vector": [8, 4, 0.7519, 0.0038, 4, 0.76, 1.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"real distance now\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:Expr_L199_C12", "label": "print()", "type": "expression", "loc": [199, 199], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L182_C8", "vector": [8, 3, 0.7595, 0.0038, 3, 0.85, 1.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"not doing anything since point cloud is too small\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L210_C0", "label": "if", "type": "if", "loc": [210, 212], "level": 0, "parent": null, "vector": [4, 0, 0.8053, 0.0115, 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 ra = ResultsAnalyzer()\n ra.run()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L211_C4", "label": "ra = ResultsAnalyzer()", "type": "assigned_variable", "loc": [211, 211], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L210_C0", "vector": [14, 1, 0.8053, 0.0038, 1, 0.03, 0.0, 33, 3, 0, 0, 0, 126, 10, 1], "semantic": {"name": "ra", "arg_names": [], "import_names": [], "rhs_call_name": "ResultsAnalyzer", "annotation": ""}, "snippet": " ra = ResultsAnalyzer()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99633:Expr_L212_C4", "label": "run()", "type": "expression", "loc": [212, 212], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L210_C0", "vector": [8, 1, 0.8092, 0.0038, 1, 0.03, 1.0, 679, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "run", "arg_names": [], "import_names": [], "rhs_call_name": "run", "annotation": ""}, "snippet": " ra.run()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99633:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L16_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:Expr_L17_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L16_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L18_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L16_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L19_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L16_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:Expr_L20_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L16_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L22_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L16_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L23_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L16_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L24_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L16_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L25_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L16_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L26_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L16_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L27_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L16_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L28_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L16_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L29_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L16_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L33_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L16_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L16_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L35_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L16_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L36_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L39_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L39_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:Expr_L40_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L39_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L41_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L39_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L42_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L39_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:Expr_L43_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L39_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L44_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L39_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:Expr_L45_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L48_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L49_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:While_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:While_L50_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:Expr_L51_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L52_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:Expr_L53_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L54_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L54_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:Expr_L55_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L54_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:Return_L56_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L58_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L59_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L60_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L61_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L61_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L62_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L61_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L63_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L61_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L64_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L61_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L65_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L61_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L66_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L61_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L67_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L61_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L68_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L61_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L69_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L61_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:Expr_L70_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L61_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:Expr_L71_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L78_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L78_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L79_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L78_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L80_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L80_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L81_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L80_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L83_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:Expr_L102_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:Return_L103_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L105_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L105_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L106_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L105_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L107_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L107_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L108_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L107_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L109_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L107_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:Expr_L110_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L107_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L111_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L111_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L112_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L111_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L113_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L111_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:Expr_L114_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L105_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L116_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L105_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L117_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L105_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:While_L119_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:While_L119_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L120_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:While_L119_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:While_L121_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:While_L121_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:Expr_L122_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:While_L119_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:Expr_L123_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:While_L119_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L124_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:While_L119_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L125_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:While_L119_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L126_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:While_L119_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L128_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L128_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L129_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L128_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L130_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L128_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L131_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L128_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L132_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L128_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:Expr_L133_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L128_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:Expr_L134_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L128_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L135_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:While_L119_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L137_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:While_L119_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:Expr_L138_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:While_L119_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:Expr_L139_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L105_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L140_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L105_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L141_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L105_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:Expr_L143_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L105_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L144_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L105_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:Expr_L145_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L105_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:Expr_L146_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L105_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:Expr_L148_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L105_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L149_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L105_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:Expr_L150_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L105_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:Expr_L151_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L105_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L157_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L157_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L158_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L157_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L159_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L157_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L162_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L162_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L163_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L162_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L164_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L105_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:Return_L170_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L172_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L172_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:Expr_L173_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L172_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:Expr_L174_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L176_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L176_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L177_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L176_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L178_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L176_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L179_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L176_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:Expr_L181_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:FunctionDef_L176_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L182_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L182_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L183_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L182_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L184_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L182_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L185_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L182_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L186_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L182_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L187_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L182_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L189_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L182_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:Expr_L190_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L182_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L192_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L192_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L193_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L192_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L194_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L192_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:Expr_L195_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L192_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:Expr_L197_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L182_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:Expr_L199_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L210_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:Assign_L211_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99633:If_L210_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99633:Expr_L212_C4"}]
import roslib roslib.load_manifest('opencv2') import cv a = cv.LoadImage('/home/mkillpack/hrl_file_server/playpen_data_sets/2011-06-30_19-01-02/object000_try011_before_pr2.png', 0) b = cv.LoadImage('/home/mkillpack/hrl_file_server/playpen_data_sets/2011-06-30_19-01-02/object000_try011_after_pr2.png', 0) foreground = cv.CreateImage((640,480), 8, 1) size = cv.GetSize(a) IavgF = cv.CreateImage(size, cv.IPL_DEPTH_32F, 3) IdiffF = cv.CreateImage(size, cv.IPL_DEPTH_32F, 3) IprevF = cv.CreateImage(size, cv.IPL_DEPTH_32F, 3) IhiF = cv.CreateImage(size, cv.IPL_DEPTH_32F, 3) IlowF = cv.CreateImage(size, cv.IPL_DEPTH_32F, 3) Ilow1 = cv.CreateImage(size, cv.IPL_DEPTH_32F, 1) Ilow2 = cv.CreateImage(size, cv.IPL_DEPTH_32F, 1) Ilow3 = cv.CreateImage(size, cv.IPL_DEPTH_32F, 1) Ihi1 = cv.CreateImage(size, cv.IPL_DEPTH_32F, 1) Ihi2 = cv.CreateImage(size, cv.IPL_DEPTH_32F, 1) Ihi3 = cv.CreateImage(size, cv.IPL_DEPTH_32F, 1) cv.Zero(IavgF) cv.Zero(IdiffF) cv.Zero(IprevF) cv.Zero(IhiF) cv.Zero(IlowF) Icount = 0.00001 Iscratch = cv.CreateImage(size, cv.IPL_DEPTH_32F, 3) Iscratch2 = cv.CreateImage(size, cv.IPL_DEPTH_32F, 3) Igray1 = cv.CreateImage(size, cv.IPL_DEPTH_32F, 1) Igray2 = cv.CreateImage(size, cv.IPL_DEPTH_32F, 1) Igray3 = cv.CreateImage(size, cv.IPL_DEPTH_32F, 1) Imaskt = cv.CreateImage(size, cv.IPL_DEPTH_8U, 1) cv.Zero(Iscratch) cv.Zero(Iscratch2) first = 1 def accumulateBackground(img): global first, Icount cv.CvtScale(img, Iscratch, 1, 0) if (not first): cv.Acc(Iscratch, IavgF) cv.AbsDiff(Iscratch, IprevF, Iscratch2) cv.Acc(Iscratch2, IdiffF) Icount += 1.0 first = 0 cv.Copy(Iscratch, IprevF) def setHighThresh(thresh): cv.ConvertScale(IdiffF, Iscratch, thresh) cv.Add(Iscratch, IavgF, IhiF) cv.Split(IhiF, Ihi1, Ihi2, Ihi3, None) def setLowThresh(thresh): cv.ConvertScale(IdiffF, Iscratch, thresh) cv.Sub(IavgF, Iscratch, IlowF) cv.Split(IlowF, Ilow1, Ilow2, Ilow3, None) def createModelsfromStats(): cv.ConvertScale(IavgF, IavgF, float(1.0/Icount)) cv.ConvertScale(IdiffF, IdiffF, float(1.0/Icount)) cv.AddS(IdiffF, cv.Scalar(1.0, 1.0, 1.0), IdiffF) setHighThresh(10.0) setLowThresh(10.0) def backgroundDiff(img, Imask): cv.CvtScale(img, Iscratch, 1, 0) cv.Split(Iscratch, Igray1, Igray2, Igray3, None) cv.InRange(Igray1, Ilow1, Ihi1, Imask) cv.InRange(Igray2, Ilow2, Ihi2, Imaskt) cv.Or(Imask, Imaskt, Imask) cv.InRange(Igray3, Ilow3, Ihi3, Imaskt) cv.Or(Imask, Imaskt, Imask) cv.SubRS(Imask, 255, Imask) cv.SaveImage('/home/mkillpack/Desktop/mask.png', Imask) #cv.Erode(Imask, Imask) print "here is the sum of the non-zero pixels", cv.Sum(Imask) return Imask if __name__ == '__main__': folder = '/home/mkillpack/hrl_file_server/playpen_data_sets/2011-06-30_19-01-02/' for j in [3]: #[0, 3, 4, 5, 6] for i in xrange(200): try: file_name = folder+'object'+str(j).zfill(3)+'_try'+str(i).zfill(3)+'_after_pr2.png' img = cv.LoadImage(file_name, 1) print "reading ", file_name, '...' except: print file_name, " doesn't exist" if not img == None: accumulateBackground(img) #c = cv.LoadImage('/home/mkillpack/hrl_file_server/playpen_data_sets/2011-06-30_19-01-02/object000_try012_after_pr2.png', 1) createModelsfromStats() file_name = folder+'object006_try'+str(0).zfill(3)+'_before_pr2.png' img = cv.LoadImage(file_name, 3) Imask = cv.CreateImage(size, cv.IPL_DEPTH_8U, 1) cv.Zero(Imask) cv.Zero(Imaskt) Imask = backgroundDiff(img, Imask)
ajibawa-2023/Python-Code-Large/train/row_99634
85
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_99634:Import_L1_C0", "label": "roslib import roslib", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0093, 0.0093, 0, 0.66, 0.0, 796, 0, 1, 0, 0, 796, 0, 0], "semantic": {"name": "roslib", "arg_names": [], "import_names": ["roslib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import roslib"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99634:Expr_L2_C0", "label": "load_manifest()", "type": "expression", "loc": [2, 2], "level": 0, "parent": null, "vector": [8, 0, 0.0185, 0.0093, 0, 0.66, 0.0263, 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('opencv2')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99634:Import_L3_C0", "label": "cv import cv", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0278, 0.0093, 0, 0.66, 0.0526, 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_99634:Assign_L5_C0", "label": "a = LoadImage()", "type": "assigned_variable", "loc": [5, 5], "level": 0, "parent": null, "vector": [14, 0, 0.0463, 0.0093, 0, 0.66, 0.0789, 475, 3, 2, 0, 0, 512, 10, 1], "semantic": {"name": "a", "arg_names": [], "import_names": [], "rhs_call_name": "LoadImage", "annotation": ""}, "snippet": "a = cv.LoadImage('/home/mkillpack/hrl_file_server/playpen_data_sets/2011-06-30_19-01-02/object000_try011_before_pr2.png', 0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99634:Assign_L6_C0", "label": "b = LoadImage()", "type": "assigned_variable", "loc": [6, 6], "level": 0, "parent": null, "vector": [14, 0, 0.0556, 0.0093, 0, 0.66, 0.1053, 756, 3, 2, 0, 0, 512, 10, 1], "semantic": {"name": "b", "arg_names": [], "import_names": [], "rhs_call_name": "LoadImage", "annotation": ""}, "snippet": "b = cv.LoadImage('/home/mkillpack/hrl_file_server/playpen_data_sets/2011-06-30_19-01-02/object000_try011_after_pr2.png', 0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99634:Assign_L7_C0", "label": "foreground = CreateImage()", "type": "assigned_variable", "loc": [7, 7], "level": 0, "parent": null, "vector": [14, 0, 0.0648, 0.0093, 0, 0.66, 0.1316, 808, 3, 3, 0, 0, 288, 10, 1], "semantic": {"name": "foreground", "arg_names": [], "import_names": [], "rhs_call_name": "CreateImage", "annotation": ""}, "snippet": "foreground = cv.CreateImage((640,480), 8, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99634:Assign_L8_C0", "label": "size = GetSize()", "type": "assigned_variable", "loc": [8, 8], "level": 0, "parent": null, "vector": [14, 0, 0.0741, 0.0093, 0, 0.66, 0.1579, 714, 3, 1, 0, 0, 139, 10, 1], "semantic": {"name": "size", "arg_names": [], "import_names": [], "rhs_call_name": "GetSize", "annotation": ""}, "snippet": "size = cv.GetSize(a)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99634:Assign_L9_C0", "label": "IavgF = CreateImage()", "type": "assigned_variable", "loc": [9, 9], "level": 0, "parent": null, "vector": [14, 0, 0.0833, 0.0093, 0, 0.66, 0.1842, 689, 3, 3, 0, 0, 288, 10, 1], "semantic": {"name": "IavgF", "arg_names": [], "import_names": [], "rhs_call_name": "CreateImage", "annotation": ""}, "snippet": "IavgF = cv.CreateImage(size, cv.IPL_DEPTH_32F, 3)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99634:Assign_L10_C0", "label": "IdiffF = CreateImage()", "type": "assigned_variable", "loc": [10, 10], "level": 0, "parent": null, "vector": [14, 0, 0.0926, 0.0093, 0, 0.66, 0.2105, 913, 3, 3, 0, 0, 288, 10, 1], "semantic": {"name": "IdiffF", "arg_names": [], "import_names": [], "rhs_call_name": "CreateImage", "annotation": ""}, "snippet": "IdiffF = cv.CreateImage(size, cv.IPL_DEPTH_32F, 3)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99634:Assign_L11_C0", "label": "IprevF = CreateImage()", "type": "assigned_variable", "loc": [11, 11], "level": 0, "parent": null, "vector": [14, 0, 0.1019, 0.0093, 0, 0.66, 0.2368, 523, 3, 3, 0, 0, 288, 10, 1], "semantic": {"name": "IprevF", "arg_names": [], "import_names": [], "rhs_call_name": "CreateImage", "annotation": ""}, "snippet": "IprevF = cv.CreateImage(size, cv.IPL_DEPTH_32F, 3)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99634:Assign_L12_C0", "label": "IhiF = CreateImage()", "type": "assigned_variable", "loc": [12, 12], "level": 0, "parent": null, "vector": [14, 0, 0.1111, 0.0093, 0, 0.66, 0.2632, 637, 3, 3, 0, 0, 288, 10, 1], "semantic": {"name": "IhiF", "arg_names": [], "import_names": [], "rhs_call_name": "CreateImage", "annotation": ""}, "snippet": "IhiF = cv.CreateImage(size, cv.IPL_DEPTH_32F, 3)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99634:Assign_L13_C0", "label": "IlowF = CreateImage()", "type": "assigned_variable", "loc": [13, 13], "level": 0, "parent": null, "vector": [14, 0, 0.1204, 0.0093, 0, 0.66, 0.2895, 243, 3, 3, 0, 0, 288, 10, 1], "semantic": {"name": "IlowF", "arg_names": [], "import_names": [], "rhs_call_name": "CreateImage", "annotation": ""}, "snippet": "IlowF = cv.CreateImage(size, cv.IPL_DEPTH_32F, 3)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99634:Assign_L14_C0", "label": "Ilow1 = CreateImage()", "type": "assigned_variable", "loc": [14, 14], "level": 0, "parent": null, "vector": [14, 0, 0.1296, 0.0093, 0, 0.66, 0.3158, 382, 3, 3, 0, 0, 288, 10, 1], "semantic": {"name": "Ilow1", "arg_names": [], "import_names": [], "rhs_call_name": "CreateImage", "annotation": ""}, "snippet": "Ilow1 = cv.CreateImage(size, cv.IPL_DEPTH_32F, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99634:Assign_L15_C0", "label": "Ilow2 = CreateImage()", "type": "assigned_variable", "loc": [15, 15], "level": 0, "parent": null, "vector": [14, 0, 0.1389, 0.0093, 0, 0.66, 0.3421, 109, 3, 3, 0, 0, 288, 10, 1], "semantic": {"name": "Ilow2", "arg_names": [], "import_names": [], "rhs_call_name": "CreateImage", "annotation": ""}, "snippet": "Ilow2 = cv.CreateImage(size, cv.IPL_DEPTH_32F, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99634:Assign_L16_C0", "label": "Ilow3 = CreateImage()", "type": "assigned_variable", "loc": [16, 16], "level": 0, "parent": null, "vector": [14, 0, 0.1481, 0.0093, 0, 0.66, 0.3684, 765, 3, 3, 0, 0, 288, 10, 1], "semantic": {"name": "Ilow3", "arg_names": [], "import_names": [], "rhs_call_name": "CreateImage", "annotation": ""}, "snippet": "Ilow3 = cv.CreateImage(size, cv.IPL_DEPTH_32F, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99634:Assign_L17_C0", "label": "Ihi1 = CreateImage()", "type": "assigned_variable", "loc": [17, 17], "level": 0, "parent": null, "vector": [14, 0, 0.1574, 0.0093, 0, 0.66, 0.3947, 250, 3, 3, 0, 0, 288, 10, 1], "semantic": {"name": "Ihi1", "arg_names": [], "import_names": [], "rhs_call_name": "CreateImage", "annotation": ""}, "snippet": "Ihi1 = cv.CreateImage(size, cv.IPL_DEPTH_32F, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99634:Assign_L18_C0", "label": "Ihi2 = CreateImage()", "type": "assigned_variable", "loc": [18, 18], "level": 0, "parent": null, "vector": [14, 0, 0.1667, 0.0093, 0, 0.66, 0.4211, 436, 3, 3, 0, 0, 288, 10, 1], "semantic": {"name": "Ihi2", "arg_names": [], "import_names": [], "rhs_call_name": "CreateImage", "annotation": ""}, "snippet": "Ihi2 = cv.CreateImage(size, cv.IPL_DEPTH_32F, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99634:Assign_L19_C0", "label": "Ihi3 = CreateImage()", "type": "assigned_variable", "loc": [19, 19], "level": 0, "parent": null, "vector": [14, 0, 0.1759, 0.0093, 0, 0.66, 0.4474, 572, 3, 3, 0, 0, 288, 10, 1], "semantic": {"name": "Ihi3", "arg_names": [], "import_names": [], "rhs_call_name": "CreateImage", "annotation": ""}, "snippet": "Ihi3 = cv.CreateImage(size, cv.IPL_DEPTH_32F, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99634:Expr_L20_C0", "label": "Zero()", "type": "expression", "loc": [20, 20], "level": 0, "parent": null, "vector": [8, 0, 0.1852, 0.0093, 0, 0.66, 0.4737, 895, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "Zero", "arg_names": [], "import_names": [], "rhs_call_name": "Zero", "annotation": ""}, "snippet": "cv.Zero(IavgF)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99634:Expr_L21_C0", "label": "Zero()", "type": "expression", "loc": [21, 21], "level": 0, "parent": null, "vector": [8, 0, 0.1944, 0.0093, 0, 0.66, 0.5, 895, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "Zero", "arg_names": [], "import_names": [], "rhs_call_name": "Zero", "annotation": ""}, "snippet": "cv.Zero(IdiffF)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99634:Expr_L22_C0", "label": "Zero()", "type": "expression", "loc": [22, 22], "level": 0, "parent": null, "vector": [8, 0, 0.2037, 0.0093, 0, 0.66, 0.5263, 895, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "Zero", "arg_names": [], "import_names": [], "rhs_call_name": "Zero", "annotation": ""}, "snippet": "cv.Zero(IprevF)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99634:Expr_L23_C0", "label": "Zero()", "type": "expression", "loc": [23, 23], "level": 0, "parent": null, "vector": [8, 0, 0.213, 0.0093, 0, 0.66, 0.5526, 895, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "Zero", "arg_names": [], "import_names": [], "rhs_call_name": "Zero", "annotation": ""}, "snippet": "cv.Zero(IhiF)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99634:Expr_L24_C0", "label": "Zero()", "type": "expression", "loc": [24, 24], "level": 0, "parent": null, "vector": [8, 0, 0.2222, 0.0093, 0, 0.66, 0.5789, 895, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "Zero", "arg_names": [], "import_names": [], "rhs_call_name": "Zero", "annotation": ""}, "snippet": "cv.Zero(IlowF)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99634:Assign_L26_C0", "label": "Icount =", "type": "assigned_variable", "loc": [26, 26], "level": 0, "parent": null, "vector": [14, 0, 0.2407, 0.0093, 0, 0.66, 0.6053, 979, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "Icount", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "Icount = 0.00001"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99634:Assign_L28_C0", "label": "Iscratch = CreateImage()", "type": "assigned_variable", "loc": [28, 28], "level": 0, "parent": null, "vector": [14, 0, 0.2593, 0.0093, 0, 0.66, 0.6316, 528, 3, 3, 0, 0, 288, 10, 1], "semantic": {"name": "Iscratch", "arg_names": [], "import_names": [], "rhs_call_name": "CreateImage", "annotation": ""}, "snippet": "Iscratch = cv.CreateImage(size, cv.IPL_DEPTH_32F, 3)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99634:Assign_L29_C0", "label": "Iscratch2 = CreateImage()", "type": "assigned_variable", "loc": [29, 29], "level": 0, "parent": null, "vector": [14, 0, 0.2685, 0.0093, 0, 0.66, 0.6579, 853, 3, 3, 0, 0, 288, 10, 1], "semantic": {"name": "Iscratch2", "arg_names": [], "import_names": [], "rhs_call_name": "CreateImage", "annotation": ""}, "snippet": "Iscratch2 = cv.CreateImage(size, cv.IPL_DEPTH_32F, 3)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99634:Assign_L30_C0", "label": "Igray1 = CreateImage()", "type": "assigned_variable", "loc": [30, 30], "level": 0, "parent": null, "vector": [14, 0, 0.2778, 0.0093, 0, 0.66, 0.6842, 452, 3, 3, 0, 0, 288, 10, 1], "semantic": {"name": "Igray1", "arg_names": [], "import_names": [], "rhs_call_name": "CreateImage", "annotation": ""}, "snippet": "Igray1 = cv.CreateImage(size, cv.IPL_DEPTH_32F, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99634:Assign_L31_C0", "label": "Igray2 = CreateImage()", "type": "assigned_variable", "loc": [31, 31], "level": 0, "parent": null, "vector": [14, 0, 0.287, 0.0093, 0, 0.66, 0.7105, 52, 3, 3, 0, 0, 288, 10, 1], "semantic": {"name": "Igray2", "arg_names": [], "import_names": [], "rhs_call_name": "CreateImage", "annotation": ""}, "snippet": "Igray2 = cv.CreateImage(size, cv.IPL_DEPTH_32F, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99634:Assign_L32_C0", "label": "Igray3 = CreateImage()", "type": "assigned_variable", "loc": [32, 32], "level": 0, "parent": null, "vector": [14, 0, 0.2963, 0.0093, 0, 0.66, 0.7368, 572, 3, 3, 0, 0, 288, 10, 1], "semantic": {"name": "Igray3", "arg_names": [], "import_names": [], "rhs_call_name": "CreateImage", "annotation": ""}, "snippet": "Igray3 = cv.CreateImage(size, cv.IPL_DEPTH_32F, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99634:Assign_L33_C0", "label": "Imaskt = CreateImage()", "type": "assigned_variable", "loc": [33, 33], "level": 0, "parent": null, "vector": [14, 0, 0.3056, 0.0093, 0, 0.66, 0.7632, 655, 3, 3, 0, 0, 288, 10, 1], "semantic": {"name": "Imaskt", "arg_names": [], "import_names": [], "rhs_call_name": "CreateImage", "annotation": ""}, "snippet": "Imaskt = cv.CreateImage(size, cv.IPL_DEPTH_8U, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99634:Expr_L34_C0", "label": "Zero()", "type": "expression", "loc": [34, 34], "level": 0, "parent": null, "vector": [8, 0, 0.3148, 0.0093, 0, 0.66, 0.7895, 895, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "Zero", "arg_names": [], "import_names": [], "rhs_call_name": "Zero", "annotation": ""}, "snippet": "cv.Zero(Iscratch)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99634:Expr_L35_C0", "label": "Zero()", "type": "expression", "loc": [35, 35], "level": 0, "parent": null, "vector": [8, 0, 0.3241, 0.0093, 0, 0.66, 0.8158, 895, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "Zero", "arg_names": [], "import_names": [], "rhs_call_name": "Zero", "annotation": ""}, "snippet": "cv.Zero(Iscratch2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99634:Assign_L36_C0", "label": "first =", "type": "assigned_variable", "loc": [36, 36], "level": 0, "parent": null, "vector": [14, 0, 0.3333, 0.0093, 0, 0.66, 0.8421, 199, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "first", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "first = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99634:FunctionDef_L39_C0", "label": "accumulateBackground", "type": "function", "loc": [39, 48], "level": 0, "parent": null, "vector": [2, 0, 0.4028, 0.0926, 0, 0.66, 0.8684, 225, 0, 1, 0, 0, 0, 0, 5], "semantic": {"name": "accumulateBackground", "arg_names": ["img"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def accumulateBackground(img):\n global first, Icount\n cv.CvtScale(img, Iscratch, 1, 0)\n if (not first):\n cv.Acc(Iscratch, IavgF)\n cv.AbsDiff(Iscratch, IprevF, Iscratch2)\n cv.Acc(Iscratch2, IdiffF)\n Icount += 1.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99634:Expr_L41_C4", "label": "CvtScale()", "type": "expression", "loc": [41, 41], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99634:FunctionDef_L39_C0", "vector": [8, 1, 0.3796, 0.0093, 1, 0.96, 0.0, 582, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "CvtScale", "arg_names": [], "import_names": [], "rhs_call_name": "CvtScale", "annotation": ""}, "snippet": " cv.CvtScale(img, Iscratch, 1, 0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99634:If_L42_C4", "label": "if", "type": "if", "loc": [42, 46], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99634:FunctionDef_L39_C0", "vector": [4, 1, 0.4074, 0.0463, 1, 0.96, 0.3333, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (not first):\n cv.Acc(Iscratch, IavgF)\n cv.AbsDiff(Iscratch, IprevF, Iscratch2)\n cv.Acc(Iscratch2, IdiffF)\n Icount += 1.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99634:Expr_L43_C8", "label": "Acc()", "type": "expression", "loc": [43, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99634:If_L42_C4", "vector": [8, 2, 0.3981, 0.0093, 2, 0.15, 0.0, 81, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "Acc", "arg_names": [], "import_names": [], "rhs_call_name": "Acc", "annotation": ""}, "snippet": " cv.Acc(Iscratch, IavgF)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99634:Expr_L44_C8", "label": "AbsDiff()", "type": "expression", "loc": [44, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99634:If_L42_C4", "vector": [8, 2, 0.4074, 0.0093, 2, 0.15, 0.5, 813, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "AbsDiff", "arg_names": [], "import_names": [], "rhs_call_name": "AbsDiff", "annotation": ""}, "snippet": " cv.AbsDiff(Iscratch, IprevF, Iscratch2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99634:Expr_L45_C8", "label": "Acc()", "type": "expression", "loc": [45, 45], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99634:If_L42_C4", "vector": [8, 2, 0.4167, 0.0093, 2, 0.15, 1.0, 81, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "Acc", "arg_names": [], "import_names": [], "rhs_call_name": "Acc", "annotation": ""}, "snippet": " cv.Acc(Iscratch2, IdiffF)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99634:Assign_L47_C4", "label": "first =", "type": "assigned_variable", "loc": [47, 47], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99634:FunctionDef_L39_C0", "vector": [14, 1, 0.4352, 0.0093, 1, 0.96, 0.6667, 199, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "first", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " first = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99634:Expr_L48_C4", "label": "Copy()", "type": "expression", "loc": [48, 48], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99634:FunctionDef_L39_C0", "vector": [8, 1, 0.4444, 0.0093, 1, 0.96, 1.0, 295, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "Copy", "arg_names": [], "import_names": [], "rhs_call_name": "Copy", "annotation": ""}, "snippet": " cv.Copy(Iscratch, IprevF)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99634:FunctionDef_L50_C0", "label": "setHighThresh", "type": "function", "loc": [50, 53], "level": 0, "parent": null, "vector": [2, 0, 0.4769, 0.037, 0, 0.66, 0.8947, 334, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "setHighThresh", "arg_names": ["thresh"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def setHighThresh(thresh):\n cv.ConvertScale(IdiffF, Iscratch, thresh)\n cv.Add(Iscratch, IavgF, IhiF)\n cv.Split(IhiF, Ihi1, Ihi2, Ihi3, None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99634:Expr_L51_C4", "label": "ConvertScale()", "type": "expression", "loc": [51, 51], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99634:FunctionDef_L50_C0", "vector": [8, 1, 0.4722, 0.0093, 1, 0.16, 0.0, 841, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "ConvertScale", "arg_names": [], "import_names": [], "rhs_call_name": "ConvertScale", "annotation": ""}, "snippet": " cv.ConvertScale(IdiffF, Iscratch, thresh)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99634:Expr_L52_C4", "label": "Add()", "type": "expression", "loc": [52, 52], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99634:FunctionDef_L50_C0", "vector": [8, 1, 0.4815, 0.0093, 1, 0.16, 0.5, 241, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "Add", "arg_names": [], "import_names": [], "rhs_call_name": "Add", "annotation": ""}, "snippet": " cv.Add(Iscratch, IavgF, IhiF)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99634:Expr_L53_C4", "label": "Split()", "type": "expression", "loc": [53, 53], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99634:FunctionDef_L50_C0", "vector": [8, 1, 0.4907, 0.0093, 1, 0.16, 1.0, 551, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "Split", "arg_names": [], "import_names": [], "rhs_call_name": "Split", "annotation": ""}, "snippet": " cv.Split(IhiF, Ihi1, Ihi2, Ihi3, None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99634:FunctionDef_L55_C0", "label": "setLowThresh", "type": "function", "loc": [55, 58], "level": 0, "parent": null, "vector": [2, 0, 0.5231, 0.037, 0, 0.66, 0.9211, 758, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "setLowThresh", "arg_names": ["thresh"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def setLowThresh(thresh):\n cv.ConvertScale(IdiffF, Iscratch, thresh)\n cv.Sub(IavgF, Iscratch, IlowF)\n cv.Split(IlowF, Ilow1, Ilow2, Ilow3, None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99634:Expr_L56_C4", "label": "ConvertScale()", "type": "expression", "loc": [56, 56], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99634:FunctionDef_L55_C0", "vector": [8, 1, 0.5185, 0.0093, 1, 0.06, 0.0, 841, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "ConvertScale", "arg_names": [], "import_names": [], "rhs_call_name": "ConvertScale", "annotation": ""}, "snippet": " cv.ConvertScale(IdiffF, Iscratch, thresh)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99634:Expr_L57_C4", "label": "Sub()", "type": "expression", "loc": [57, 57], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99634:FunctionDef_L55_C0", "vector": [8, 1, 0.5278, 0.0093, 1, 0.06, 0.5, 570, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "Sub", "arg_names": [], "import_names": [], "rhs_call_name": "Sub", "annotation": ""}, "snippet": " cv.Sub(IavgF, Iscratch, IlowF)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99634:Expr_L58_C4", "label": "Split()", "type": "expression", "loc": [58, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99634:FunctionDef_L55_C0", "vector": [8, 1, 0.537, 0.0093, 1, 0.06, 1.0, 551, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "Split", "arg_names": [], "import_names": [], "rhs_call_name": "Split", "annotation": ""}, "snippet": " cv.Split(IlowF, Ilow1, Ilow2, Ilow3, None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99634:FunctionDef_L61_C0", "label": "createModelsfromStats", "type": "function", "loc": [61, 67], "level": 0, "parent": null, "vector": [2, 0, 0.5926, 0.0648, 0, 0.66, 0.9474, 669, 0, 0, 0, 0, 0, 0, 8], "semantic": {"name": "createModelsfromStats", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def createModelsfromStats():\n cv.ConvertScale(IavgF, IavgF, float(1.0/Icount))\n cv.ConvertScale(IdiffF, IdiffF, float(1.0/Icount))\n\n cv.AddS(IdiffF, cv.Scalar(1.0, 1.0, 1.0), IdiffF)\n setHighThresh(10.0)\n setLowThresh(10.0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99634:Expr_L62_C4", "label": "ConvertScale()", "type": "expression", "loc": [62, 62], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99634:FunctionDef_L61_C0", "vector": [8, 1, 0.5741, 0.0093, 1, 0.76, 0.0, 841, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "ConvertScale", "arg_names": [], "import_names": [], "rhs_call_name": "ConvertScale", "annotation": ""}, "snippet": " cv.ConvertScale(IavgF, IavgF, float(1.0/Icount))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99634:Expr_L63_C4", "label": "ConvertScale()", "type": "expression", "loc": [63, 63], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99634:FunctionDef_L61_C0", "vector": [8, 1, 0.5833, 0.0093, 1, 0.76, 0.25, 841, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "ConvertScale", "arg_names": [], "import_names": [], "rhs_call_name": "ConvertScale", "annotation": ""}, "snippet": " cv.ConvertScale(IdiffF, IdiffF, float(1.0/Icount))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99634:Expr_L65_C4", "label": "AddS()", "type": "expression", "loc": [65, 65], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99634:FunctionDef_L61_C0", "vector": [8, 1, 0.6019, 0.0093, 1, 0.76, 0.5, 748, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "AddS", "arg_names": [], "import_names": [], "rhs_call_name": "AddS", "annotation": ""}, "snippet": " cv.AddS(IdiffF, cv.Scalar(1.0, 1.0, 1.0), IdiffF)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99634:Expr_L66_C4", "label": "setHighThresh()", "type": "expression", "loc": [66, 66], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99634:FunctionDef_L61_C0", "vector": [8, 1, 0.6111, 0.0093, 1, 0.76, 0.75, 334, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setHighThresh", "arg_names": [], "import_names": [], "rhs_call_name": "setHighThresh", "annotation": ""}, "snippet": " setHighThresh(10.0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99634:Expr_L67_C4", "label": "setLowThresh()", "type": "expression", "loc": [67, 67], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99634:FunctionDef_L61_C0", "vector": [8, 1, 0.6204, 0.0093, 1, 0.76, 1.0, 758, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setLowThresh", "arg_names": [], "import_names": [], "rhs_call_name": "setLowThresh", "annotation": ""}, "snippet": " setLowThresh(10.0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99634:FunctionDef_L69_C0", "label": "backgroundDiff", "type": "function", "loc": [69, 84], "level": 0, "parent": null, "vector": [2, 0, 0.7083, 0.1481, 0, 0.66, 0.9737, 268, 0, 2, 1, 0, 0, 0, 11], "semantic": {"name": "backgroundDiff", "arg_names": ["img", "Imask"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def backgroundDiff(img, Imask):\n cv.CvtScale(img, Iscratch, 1, 0)\n cv.Split(Iscratch, Igray1, Igray2, Igray3, None)\n cv.InRange(Igray1, Ilow1, Ihi1, Imask)\n\n cv.InRange(Igray2, Ilow2, Ihi2, Imaskt)\n cv.Or(Imask, Imaskt, Imask)\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99634:Expr_L70_C4", "label": "CvtScale()", "type": "expression", "loc": [70, 70], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99634:FunctionDef_L69_C0", "vector": [8, 1, 0.6481, 0.0093, 1, 0.4, 0.0, 582, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "CvtScale", "arg_names": [], "import_names": [], "rhs_call_name": "CvtScale", "annotation": ""}, "snippet": " cv.CvtScale(img, Iscratch, 1, 0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99634:Expr_L71_C4", "label": "Split()", "type": "expression", "loc": [71, 71], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99634:FunctionDef_L69_C0", "vector": [8, 1, 0.6574, 0.0093, 1, 0.4, 0.1, 551, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "Split", "arg_names": [], "import_names": [], "rhs_call_name": "Split", "annotation": ""}, "snippet": " cv.Split(Iscratch, Igray1, Igray2, Igray3, None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99634:Expr_L72_C4", "label": "InRange()", "type": "expression", "loc": [72, 72], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99634:FunctionDef_L69_C0", "vector": [8, 1, 0.6667, 0.0093, 1, 0.4, 0.2, 359, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "InRange", "arg_names": [], "import_names": [], "rhs_call_name": "InRange", "annotation": ""}, "snippet": " cv.InRange(Igray1, Ilow1, Ihi1, Imask)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99634:Expr_L74_C4", "label": "InRange()", "type": "expression", "loc": [74, 74], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99634:FunctionDef_L69_C0", "vector": [8, 1, 0.6852, 0.0093, 1, 0.4, 0.3, 359, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "InRange", "arg_names": [], "import_names": [], "rhs_call_name": "InRange", "annotation": ""}, "snippet": " cv.InRange(Igray2, Ilow2, Ihi2, Imaskt)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99634:Expr_L75_C4", "label": "Or()", "type": "expression", "loc": [75, 75], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99634:FunctionDef_L69_C0", "vector": [8, 1, 0.6944, 0.0093, 1, 0.4, 0.4, 914, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "Or", "arg_names": [], "import_names": [], "rhs_call_name": "Or", "annotation": ""}, "snippet": " cv.Or(Imask, Imaskt, Imask)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99634:Expr_L77_C4", "label": "InRange()", "type": "expression", "loc": [77, 77], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99634:FunctionDef_L69_C0", "vector": [8, 1, 0.713, 0.0093, 1, 0.4, 0.5, 359, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "InRange", "arg_names": [], "import_names": [], "rhs_call_name": "InRange", "annotation": ""}, "snippet": " cv.InRange(Igray3, Ilow3, Ihi3, Imaskt)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99634:Expr_L78_C4", "label": "Or()", "type": "expression", "loc": [78, 78], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99634:FunctionDef_L69_C0", "vector": [8, 1, 0.7222, 0.0093, 1, 0.4, 0.6, 914, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "Or", "arg_names": [], "import_names": [], "rhs_call_name": "Or", "annotation": ""}, "snippet": " cv.Or(Imask, Imaskt, Imask)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99634:Expr_L80_C4", "label": "SubRS()", "type": "expression", "loc": [80, 80], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99634:FunctionDef_L69_C0", "vector": [8, 1, 0.7407, 0.0093, 1, 0.4, 0.7, 67, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "SubRS", "arg_names": [], "import_names": [], "rhs_call_name": "SubRS", "annotation": ""}, "snippet": " cv.SubRS(Imask, 255, Imask)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99634:Expr_L81_C4", "label": "SaveImage()", "type": "expression", "loc": [81, 81], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99634:FunctionDef_L69_C0", "vector": [8, 1, 0.75, 0.0093, 1, 0.4, 0.8, 91, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "SaveImage", "arg_names": [], "import_names": [], "rhs_call_name": "SaveImage", "annotation": ""}, "snippet": " cv.SaveImage('/home/mkillpack/Desktop/mask.png', Imask)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99634:Expr_L83_C4", "label": "print()", "type": "expression", "loc": [83, 83], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99634:FunctionDef_L69_C0", "vector": [8, 1, 0.7685, 0.0093, 1, 0.4, 0.9, 535, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"here is the sum of the non-zero pixels\", cv.Sum(Imask))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99634:Return_L84_C4", "label": "return", "type": "return", "loc": [84, 84], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99634:FunctionDef_L69_C0", "vector": [13, 1, 0.7778, 0.0093, 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 Imask"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99634:If_L87_C0", "label": "if", "type": "if", "loc": [87, 108], "level": 0, "parent": null, "vector": [4, 0, 0.9028, 0.2037, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 17], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n folder = '/home/mkillpack/hrl_file_server/playpen_data_sets/2011-06-30_19-01-02/'\n\n for j in [3]: #[0, 3, 4, 5, 6]\n for i in xrange(200):\n try:\n file_name = folder+'object'+str(j).zfill(3)+'_try'+str(i).zfill(3)+'_after_pr2.png'\n img = cv.LoadImage(file_name, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99634:Assign_L88_C4", "label": "folder =", "type": "assigned_variable", "loc": [88, 88], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99634:If_L87_C0", "vector": [14, 1, 0.8148, 0.0093, 1, 0.4, 0.0, 841, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "folder", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " folder = '/home/mkillpack/hrl_file_server/playpen_data_sets/2011-06-30_19-01-02/'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99634:For_L90_C4", "label": "for j", "type": "for", "loc": [90, 99], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99634:If_L87_C0", "vector": [6, 1, 0.875, 0.0926, 1, 0.4, 0.125, 100, 0, 0, 0, 0, 0, 0, 9], "semantic": {"name": "j", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for j in [3]: #[0, 3, 4, 5, 6]\n for i in xrange(200):\n try:\n file_name = folder+'object'+str(j).zfill(3)+'_try'+str(i).zfill(3)+'_after_pr2.png'\n img = cv.LoadImage(file_name, 1)\n print(\"reading \", file_name, '...')\n except:\n print(file_name, \" doesn't exist\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99634:For_L91_C8", "label": "for i", "type": "for", "loc": [91, 99], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99634:For_L90_C4", "vector": [6, 2, 0.8796, 0.0833, 2, 0.4, 0.0, 826, 3, 0, 0, 0, 0, 0, 9], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in xrange(200):\n try:\n file_name = folder+'object'+str(j).zfill(3)+'_try'+str(i).zfill(3)+'_after_pr2.png'\n img = cv.LoadImage(file_name, 1)\n print(\"reading \", file_name, '...')\n except:\n print(file_name, \" doesn't exist\")\n if not img == None:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99634:Try_L92_C12", "label": "try", "type": "try", "loc": [92, 97], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99634:For_L91_C8", "vector": [7, 3, 0.875, 0.0556, 3, 0.4, 0.0, 0, 0, 1, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n file_name = folder+'object'+str(j).zfill(3)+'_try'+str(i).zfill(3)+'_after_pr2.png'\n img = cv.LoadImage(file_name, 1)\n print(\"reading \", file_name, '...')\n except:\n print(file_name, \" doesn't exist\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99634:Assign_L93_C16", "label": "file_name =", "type": "assigned_variable", "loc": [93, 93], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99634:Try_L92_C12", "vector": [14, 4, 0.8611, 0.0093, 4, 0.73, 0.0, 991, 4, 0, 0, 0, 0, 0, 4], "semantic": {"name": "file_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " file_name = folder+'object'+str(j).zfill(3)+'_try'+str(i).zfill(3)+'_after_pr2.png'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99634:Assign_L94_C16", "label": "img = LoadImage()", "type": "assigned_variable", "loc": [94, 94], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99634:Try_L92_C12", "vector": [14, 4, 0.8704, 0.0093, 4, 0.73, 0.5, 200, 3, 2, 0, 0, 512, 10, 1], "semantic": {"name": "img", "arg_names": [], "import_names": [], "rhs_call_name": "LoadImage", "annotation": ""}, "snippet": " img = cv.LoadImage(file_name, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99634:Expr_L95_C16", "label": "print()", "type": "expression", "loc": [95, 95], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99634:Try_L92_C12", "vector": [8, 4, 0.8796, 0.0093, 4, 0.73, 1.0, 535, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"reading \", file_name, '...')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99634:Expr_L97_C16", "label": "print()", "type": "expression", "loc": [97, 97], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99634:Try_L92_C12", "vector": [8, 4, 0.8981, 0.0093, 4, 0.73, 0.0, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(file_name, \" doesn't exist\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99634:If_L98_C12", "label": "if", "type": "if", "loc": [98, 99], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99634:For_L91_C8", "vector": [4, 3, 0.912, 0.0185, 3, 0.4, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not img == None:\n accumulateBackground(img)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99634:Expr_L99_C16", "label": "accumulateBackground()", "type": "expression", "loc": [99, 99], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99634:If_L98_C12", "vector": [8, 4, 0.9167, 0.0093, 4, 0.03, 0.0, 225, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "accumulateBackground", "arg_names": [], "import_names": [], "rhs_call_name": "accumulateBackground", "annotation": ""}, "snippet": " accumulateBackground(img)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99634:Expr_L102_C4", "label": "createModelsfromStats()", "type": "expression", "loc": [102, 102], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99634:If_L87_C0", "vector": [8, 1, 0.9444, 0.0093, 1, 0.4, 0.25, 669, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "createModelsfromStats", "arg_names": [], "import_names": [], "rhs_call_name": "createModelsfromStats", "annotation": ""}, "snippet": " createModelsfromStats()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99634:Assign_L103_C4", "label": "file_name =", "type": "assigned_variable", "loc": [103, 103], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99634:If_L87_C0", "vector": [14, 1, 0.9537, 0.0093, 1, 0.4, 0.375, 991, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "file_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " file_name = folder+'object006_try'+str(0).zfill(3)+'_before_pr2.png'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99634:Assign_L104_C4", "label": "img = LoadImage()", "type": "assigned_variable", "loc": [104, 104], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99634:If_L87_C0", "vector": [14, 1, 0.963, 0.0093, 1, 0.4, 0.5, 200, 3, 2, 0, 0, 512, 10, 1], "semantic": {"name": "img", "arg_names": [], "import_names": [], "rhs_call_name": "LoadImage", "annotation": ""}, "snippet": " img = cv.LoadImage(file_name, 3) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99634:Assign_L105_C4", "label": "Imask = CreateImage()", "type": "assigned_variable", "loc": [105, 105], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99634:If_L87_C0", "vector": [14, 1, 0.9722, 0.0093, 1, 0.4, 0.625, 494, 3, 3, 0, 0, 288, 10, 1], "semantic": {"name": "Imask", "arg_names": [], "import_names": [], "rhs_call_name": "CreateImage", "annotation": ""}, "snippet": " Imask = cv.CreateImage(size, cv.IPL_DEPTH_8U, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99634:Expr_L106_C4", "label": "Zero()", "type": "expression", "loc": [106, 106], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99634:If_L87_C0", "vector": [8, 1, 0.9815, 0.0093, 1, 0.4, 0.75, 895, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "Zero", "arg_names": [], "import_names": [], "rhs_call_name": "Zero", "annotation": ""}, "snippet": " cv.Zero(Imask)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99634:Expr_L107_C4", "label": "Zero()", "type": "expression", "loc": [107, 107], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99634:If_L87_C0", "vector": [8, 1, 0.9907, 0.0093, 1, 0.4, 0.875, 895, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "Zero", "arg_names": [], "import_names": [], "rhs_call_name": "Zero", "annotation": ""}, "snippet": " cv.Zero(Imaskt)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99634:Assign_L108_C4", "label": "Imask = backgroundDiff()", "type": "assigned_variable", "loc": [108, 108], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99634:If_L87_C0", "vector": [14, 1, 1.0, 0.0093, 1, 0.4, 1.0, 494, 3, 2, 0, 0, 268, 10, 1], "semantic": {"name": "Imask", "arg_names": [], "import_names": [], "rhs_call_name": "backgroundDiff", "annotation": ""}, "snippet": " Imask = backgroundDiff(img, Imask)"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99634:FunctionDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99634:Expr_L41_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99634:FunctionDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99634:If_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99634:If_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99634:Expr_L43_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99634:If_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99634:Expr_L44_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99634:If_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99634:Expr_L45_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99634:FunctionDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99634:Assign_L47_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99634:FunctionDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99634:Expr_L48_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99634:FunctionDef_L50_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99634:Expr_L51_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99634:FunctionDef_L50_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99634:Expr_L52_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99634:FunctionDef_L50_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99634:Expr_L53_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99634:FunctionDef_L55_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99634:Expr_L56_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99634:FunctionDef_L55_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99634:Expr_L57_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99634:FunctionDef_L55_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99634:Expr_L58_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99634:FunctionDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99634:Expr_L62_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99634:FunctionDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99634:Expr_L63_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99634:FunctionDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99634:Expr_L65_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99634:FunctionDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99634:Expr_L66_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99634:FunctionDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99634:Expr_L67_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99634:FunctionDef_L69_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99634:Expr_L70_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99634:FunctionDef_L69_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99634:Expr_L71_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99634:FunctionDef_L69_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99634:Expr_L72_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99634:FunctionDef_L69_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99634:Expr_L74_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99634:FunctionDef_L69_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99634:Expr_L75_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99634:FunctionDef_L69_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99634:Expr_L77_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99634:FunctionDef_L69_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99634:Expr_L78_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99634:FunctionDef_L69_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99634:Expr_L80_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99634:FunctionDef_L69_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99634:Expr_L81_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99634:FunctionDef_L69_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99634:Expr_L83_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99634:FunctionDef_L69_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99634:Return_L84_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99634:If_L87_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99634:Assign_L88_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99634:If_L87_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99634:For_L90_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99634:For_L90_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99634:For_L91_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99634:For_L91_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99634:Try_L92_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99634:Try_L92_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99634:Assign_L93_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99634:Try_L92_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99634:Assign_L94_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99634:Try_L92_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99634:Expr_L95_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99634:Try_L92_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99634:Expr_L97_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99634:For_L91_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99634:If_L98_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99634:If_L98_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99634:Expr_L99_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99634:If_L87_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99634:Expr_L102_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99634:If_L87_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99634:Assign_L103_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99634:If_L87_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99634:Assign_L104_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99634:If_L87_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99634:Assign_L105_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99634:If_L87_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99634:Expr_L106_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99634:If_L87_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99634:Expr_L107_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99634:If_L87_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99634:Assign_L108_C4"}]
####################################################################### # # USE pr2_object_manipulation/pr2_gripper_reactive_approach/controller_manager.py # That code has much of the ideas at the bottom, with more. # ####################################################################### # TODO Update code to throw points one at a time. Sections are labled: "Hack" import numpy as np, math from threading import RLock, Timer import sys import roslib; roslib.load_manifest('hrl_pr2_lib') import tf import rospy import actionlib from actionlib_msgs.msg import GoalStatus from pr2_controllers_msgs.msg import Pr2GripperCommandGoal, Pr2GripperCommandAction, Pr2GripperCommand from geometry_msgs.msg import PoseStamped from teleop_controllers.msg import JTTeleopControllerState from std_msgs.msg import Float64 from sensor_msgs.msg import JointState import hrl_lib.transforms as tr import time import tf.transformations as tftrans import types node_name = "pr2_arms" def log(str): rospy.loginfo(node_name + ": " + str) ## # Class for simple management of the arms and grippers. # Provides functionality for moving the arms, opening and closing # the grippers, performing IK, and other functionality as it is # developed. class PR2Arms(object): ## # Initializes all of the servers, clients, and variables # # @param send_delay send trajectory points send_delay nanoseconds into the future # @param gripper_point given the frame of the wrist_roll_link, this point offsets # the location used in FK and IK, preferably to the tip of the # gripper def __init__(self, send_delay=50000000, gripper_point=(0.23,0.0,0.0), force_torque = False): log("Loading PR2Arms") self.send_delay = send_delay self.off_point = gripper_point self.gripper_action_client = [actionlib.SimpleActionClient('r_gripper_controller/gripper_action', Pr2GripperCommandAction),actionlib.SimpleActionClient('l_gripper_controller/gripper_action', Pr2GripperCommandAction)] self.gripper_action_client[0].wait_for_server() self.gripper_action_client[1].wait_for_server() self.arm_state_lock = [RLock(), RLock()] self.r_arm_cart_pub = rospy.Publisher('/r_cart/command_pose', PoseStamped) self.l_arm_cart_pub = rospy.Publisher('/l_cart/command_pose', PoseStamped) rospy.Subscriber('/r_cart/state', JTTeleopControllerState, self.r_cart_state_cb) rospy.Subscriber('/l_cart/state', JTTeleopControllerState, self.l_cart_state_cb) self.tf_lstnr = tf.TransformListener() rospy.sleep(1.) log("Finished loading SimpleArmManger") def r_cart_state_cb(self, msg): trans, quat = self.tf_lstnr.lookupTransform('/torso_lift_link', 'r_gripper_tool_frame', rospy.Time(0)) rot = tr.quaternion_to_matrix(quat) tip = np.matrix([0.12, 0., 0.]).T self.r_ee_pos = rot*tip + np.matrix(trans).T self.r_ee_rot = rot ros_pt = msg.x_desi_filtered.pose.position x, y, z = ros_pt.x, ros_pt.y, ros_pt.z self.r_cep_pos = np.matrix([x, y, z]).T pt = rot.T * (np.matrix([x,y,z]).T - np.matrix(trans).T) pt = pt + tip self.r_cep_pos_hooktip = rot*pt + np.matrix(trans).T ros_quat = msg.x_desi_filtered.pose.orientation quat = (ros_quat.x, ros_quat.y, ros_quat.z, ros_quat.w) self.r_cep_rot = tr.quaternion_to_matrix(quat) def l_cart_state_cb(self, msg): ros_pt = msg.x_desi_filtered.pose.position self.l_cep_pos = np.matrix([ros_pt.x, ros_pt.y, ros_pt.z]).T ros_quat = msg.x_desi_filtered.pose.orientation quat = (ros_quat.x, ros_quat.y, ros_quat.z, ros_quat.w) self.l_cep_rot = tr.quaternion_to_matrix(quat) def get_ee_jtt(self, arm): if arm == 0: return self.r_ee_pos, self.r_ee_rot else: return self.l_ee_pos, self.l_ee_rot def get_cep_jtt(self, arm, hook_tip = False): if arm == 0: if hook_tip: return self.r_cep_pos_hooktip, self.r_cep_rot else: return self.r_cep_pos, self.r_cep_rot else: return self.l_cep_pos, self.l_cep_rot # set a cep using the Jacobian Transpose controller. def set_cep_jtt(self, arm, p, rot=None): if arm != 1: arm = 0 ps = PoseStamped() ps.header.stamp = rospy.rostime.get_rostime() ps.header.frame_id = 'torso_lift_link' ps.pose.position.x = p[0,0] ps.pose.position.y = p[1,0] ps.pose.position.z = p[2,0] if rot == None: if arm == 0: rot = self.r_cep_rot else: rot = self.l_cep_rot quat = tr.matrix_to_quaternion(rot) ps.pose.orientation.x = quat[0] ps.pose.orientation.y = quat[1] ps.pose.orientation.z = quat[2] ps.pose.orientation.w = quat[3] if arm == 0: self.r_arm_cart_pub.publish(ps) else: self.l_arm_cart_pub.publish(ps) # rotational interpolation unimplemented. def go_cep_jtt(self, arm, p): step_size = 0.01 sleep_time = 0.1 cep_p, cep_rot = self.get_cep_jtt(arm) unit_vec = (p-cep_p) unit_vec = unit_vec / np.linalg.norm(unit_vec) while np.linalg.norm(p-cep_p) > step_size: cep_p += unit_vec * step_size self.set_cep_jtt(arm, cep_p) rospy.sleep(sleep_time) self.set_cep_jtt(arm, p) rospy.sleep(sleep_time) # TODO Evaluate gripper functions and parameters ## # Move the gripper the given amount with given amount of effort # # @param arm 0 for right, 1 for left # @param amount the amount the gripper should be opened # @param effort - supposed to be in Newtons. (-ve number => max effort) def move_gripper(self, arm, amount=0.08, effort = 15): self.gripper_action_client[arm].send_goal(Pr2GripperCommandGoal(Pr2GripperCommand(position=amount, max_effort = effort))) ## # Open the gripper # # @param arm 0 for right, 1 for left def open_gripper(self, arm): self.move_gripper(arm, 0.08, -1) ## # Close the gripper # # @param arm 0 for right, 1 for left def close_gripper(self, arm, effort = 15): self.move_gripper(arm, 0.0, effort) # def get_wrist_force(self, arm): # pass ###################################################### # More specific functionality ###################################################### if __name__ == '__main__': rospy.init_node(node_name, anonymous = True) log("Node initialized") pr2_arm = PR2Arms() # #------- testing set JEP --------------- # raw_input('Hit ENTER to begin') r_arm, l_arm = 0, 1 # cep_p, cep_rot = pr2_arm.get_cep_jtt(r_arm) # print 'cep_p:', cep_p.A1 # # for i in range(5): # cep_p[0,0] += 0.01 # raw_input('Hit ENTER to move') # pr2_arm.set_cep_jtt(r_arm, cep_p) raw_input('Hit ENTER to move') p1 = np.matrix([0.62, 0.0, 0.16]).T pr2_arm.go_cep_jtt(r_arm, p1) #rospy.sleep(10) #pr2_arm.close_gripper(r_arm, effort = -1) raw_input('Hit ENTER to move') p2 = np.matrix([0.600+0.06, 0.106, -0.32]).T pr2_arm.go_cep_jtt(r_arm, p2) raw_input('Hit ENTER to move') pr2_arm.go_cep_jtt(r_arm, p1) raw_input('Hit ENTER to go home') home = np.matrix([0.23, -0.6, -0.05]).T pr2_arm.go_cep_jtt(r_arm, home)
ajibawa-2023/Python-Code-Large/train/row_99636
122
236
15
["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99636:Import_L15_C0", "label": "numpy import np, math", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.0636, 0.0042, 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_99636:ImportFrom_L16_C0", "label": "from threading import RLock, Timer", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.0678, 0.0042, 0, 0.66, 0.0476, 83, 0, 2, 0, 0, 83, 0, 0], "semantic": {"name": "threading", "arg_names": [], "import_names": ["RLock", "Timer"], "rhs_call_name": "", "annotation": ""}, "snippet": "from threading import RLock, Timer"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99636:Import_L17_C0", "label": "sys import sys", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.072, 0.0042, 0, 0.66, 0.0952, 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_99636:Import_L19_C0", "label": "roslib import roslib", "type": "import", "loc": [19, 19], "level": 0, "parent": null, "vector": [1, 0, 0.0805, 0.0042, 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; roslib.load_manifest('hrl_pr2_lib')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99636:Expr_L19_C15", "label": "load_manifest()", "type": "expression", "loc": [19, 19], "level": 0, "parent": null, "vector": [8, 0, 0.0805, 0.0042, 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": "import roslib; roslib.load_manifest('hrl_pr2_lib')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99636:Import_L20_C0", "label": "tf import tf", "type": "import", "loc": [20, 20], "level": 0, "parent": null, "vector": [1, 0, 0.0847, 0.0042, 0, 0.66, 0.2381, 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_99636:Import_L22_C0", "label": "rospy import rospy", "type": "import", "loc": [22, 22], "level": 0, "parent": null, "vector": [1, 0, 0.0932, 0.0042, 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_99636:Import_L24_C0", "label": "actionlib import actionlib", "type": "import", "loc": [24, 24], "level": 0, "parent": null, "vector": [1, 0, 0.1017, 0.0042, 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_99636:ImportFrom_L25_C0", "label": "from actionlib_msgs.msg import GoalStatus", "type": "import", "loc": [25, 25], "level": 0, "parent": null, "vector": [1, 0, 0.1059, 0.0042, 0, 0.66, 0.381, 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_99636:ImportFrom_L27_C0", "label": "from pr2_controllers_msgs.msg import Pr2GripperCommandGoal, Pr2GripperCommandAction, Pr2GripperCommand", "type": "import", "loc": [27, 27], "level": 0, "parent": null, "vector": [1, 0, 0.1144, 0.0042, 0, 0.66, 0.4286, 457, 0, 3, 0, 0, 457, 0, 0], "semantic": {"name": "pr2_controllers_msgs.msg", "arg_names": [], "import_names": ["Pr2GripperCommandGoal", "Pr2GripperCommandAction", "Pr2GripperCommand"], "rhs_call_name": "", "annotation": ""}, "snippet": "from pr2_controllers_msgs.msg import Pr2GripperCommandGoal, Pr2GripperCommandAction, Pr2GripperCommand"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99636:ImportFrom_L28_C0", "label": "from geometry_msgs.msg import PoseStamped", "type": "import", "loc": [28, 28], "level": 0, "parent": null, "vector": [1, 0, 0.1186, 0.0042, 0, 0.66, 0.4762, 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_99636:ImportFrom_L30_C0", "label": "from teleop_controllers.msg import JTTeleopControllerState", "type": "import", "loc": [30, 30], "level": 0, "parent": null, "vector": [1, 0, 0.1271, 0.0042, 0, 0.66, 0.5238, 185, 0, 1, 0, 0, 185, 0, 0], "semantic": {"name": "teleop_controllers.msg", "arg_names": [], "import_names": ["JTTeleopControllerState"], "rhs_call_name": "", "annotation": ""}, "snippet": "from teleop_controllers.msg import JTTeleopControllerState"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99636:ImportFrom_L32_C0", "label": "from std_msgs.msg import Float64", "type": "import", "loc": [32, 32], "level": 0, "parent": null, "vector": [1, 0, 0.1356, 0.0042, 0, 0.66, 0.5714, 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_99636:ImportFrom_L33_C0", "label": "from sensor_msgs.msg import JointState", "type": "import", "loc": [33, 33], "level": 0, "parent": null, "vector": [1, 0, 0.1398, 0.0042, 0, 0.66, 0.619, 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_99636:Import_L35_C0", "label": "hrl_lib.transforms import tr", "type": "import", "loc": [35, 35], "level": 0, "parent": null, "vector": [1, 0, 0.1483, 0.0042, 0, 0.66, 0.6667, 82, 0, 1, 0, 0, 82, 0, 0], "semantic": {"name": "hrl_lib.transforms", "arg_names": [], "import_names": ["tr"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.transforms as tr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99636:Import_L36_C0", "label": "time import time", "type": "import", "loc": [36, 36], "level": 0, "parent": null, "vector": [1, 0, 0.1525, 0.0042, 0, 0.66, 0.7143, 654, 0, 1, 0, 0, 654, 0, 0], "semantic": {"name": "time", "arg_names": [], "import_names": ["time"], "rhs_call_name": "", "annotation": ""}, "snippet": "import time"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99636:Import_L38_C0", "label": "tf.transformations import tftrans", "type": "import", "loc": [38, 38], "level": 0, "parent": null, "vector": [1, 0, 0.161, 0.0042, 0, 0.66, 0.7619, 762, 0, 1, 0, 0, 762, 0, 0], "semantic": {"name": "tf.transformations", "arg_names": [], "import_names": ["tftrans"], "rhs_call_name": "", "annotation": ""}, "snippet": "import tf.transformations as tftrans"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99636:Import_L39_C0", "label": "types import types", "type": "import", "loc": [39, 39], "level": 0, "parent": null, "vector": [1, 0, 0.1653, 0.0042, 0, 0.66, 0.8095, 209, 0, 1, 0, 0, 209, 0, 0], "semantic": {"name": "types", "arg_names": [], "import_names": ["types"], "rhs_call_name": "", "annotation": ""}, "snippet": "import types"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99636:Assign_L42_C0", "label": "node_name =", "type": "assigned_variable", "loc": [42, 42], "level": 0, "parent": null, "vector": [14, 0, 0.178, 0.0042, 0, 0.66, 0.8571, 516, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "node_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "node_name = \"pr2_arms\" "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L44_C0", "label": "log", "type": "function", "loc": [44, 45], "level": 0, "parent": null, "vector": [2, 0, 0.1886, 0.0085, 0, 0.66, 0.9048, 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_99636:Expr_L45_C4", "label": "loginfo()", "type": "expression", "loc": [45, 45], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L44_C0", "vector": [8, 1, 0.1907, 0.0042, 1, 0.02, 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_99636:ClassDef_L52_C0", "label": "PR2Arms", "type": "class", "loc": [52, 192], "level": 0, "parent": null, "vector": [3, 0, 0.5169, 0.5975, 0, 0.66, 0.9524, 694, 0, 10, 0, 0, 186, 0, 43], "semantic": {"name": "PR2Arms", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class PR2Arms(object):\n\n ##\n # Initializes all of the servers, clients, and variables\n #\n # @param send_delay send trajectory points send_delay nanoseconds into the future\n # @param gripper_point given the frame of the wrist_roll_link, this point offsets\n # the location used in FK and IK, preferably to the tip of the"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L61_C4", "label": "__init__", "type": "function", "loc": [61, 83], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99636:ClassDef_L52_C0", "vector": [2, 1, 0.3051, 0.0975, 1, 0.02, 0.0, 555, 0, 4, 0, 0, 0, 0, 14], "semantic": {"name": "__init__", "arg_names": ["self", "send_delay", "gripper_point", "force_torque"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, send_delay=50000000, gripper_point=(0.23,0.0,0.0),\n force_torque = False):\n log(\"Loading PR2Arms\")\n\n self.send_delay = send_delay\n self.off_point = gripper_point\n self.gripper_action_client = [actionlib.SimpleActionClient('r_gripper_controller/gripper_action', Pr2GripperCommandAction),actionlib.SimpleActionClient('l_gripper_controller/gripper_action', Pr2GripperCommandAction)]\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99636:Expr_L63_C8", "label": "log()", "type": "expression", "loc": [63, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L61_C4", "vector": [8, 2, 0.2669, 0.0042, 2, 0.59, 0.0, 432, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "log", "arg_names": [], "import_names": [], "rhs_call_name": "log", "annotation": ""}, "snippet": " log(\"Loading PR2Arms\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99636:Assign_L65_C8", "label": "self.send_delay =", "type": "assigned_variable", "loc": [65, 65], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L61_C4", "vector": [14, 2, 0.2754, 0.0042, 2, 0.59, 0.0769, 644, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.send_delay", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.send_delay = send_delay"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99636:Assign_L66_C8", "label": "self.off_point =", "type": "assigned_variable", "loc": [66, 66], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L61_C4", "vector": [14, 2, 0.2797, 0.0042, 2, 0.59, 0.1538, 795, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.off_point", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.off_point = gripper_point"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99636:Assign_L67_C8", "label": "self.gripper_action_client =", "type": "assigned_variable", "loc": [67, 67], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L61_C4", "vector": [14, 2, 0.2839, 0.0042, 2, 0.59, 0.2308, 87, 0, 0, 0, 0, 0, 5, 2], "semantic": {"name": "self.gripper_action_client", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.gripper_action_client = [actionlib.SimpleActionClient('r_gripper_controller/gripper_action', Pr2GripperCommandAction),actionlib.SimpleActionClient('l_gripper_controller/gripper_action', Pr2GripperCommandAction)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99636:Expr_L69_C8", "label": "wait_for_server()", "type": "expression", "loc": [69, 69], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L61_C4", "vector": [8, 2, 0.2924, 0.0042, 2, 0.59, 0.3077, 784, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "wait_for_server", "arg_names": [], "import_names": [], "rhs_call_name": "wait_for_server", "annotation": ""}, "snippet": " self.gripper_action_client[0].wait_for_server()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99636:Expr_L70_C8", "label": "wait_for_server()", "type": "expression", "loc": [70, 70], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L61_C4", "vector": [8, 2, 0.2966, 0.0042, 2, 0.59, 0.3846, 784, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "wait_for_server", "arg_names": [], "import_names": [], "rhs_call_name": "wait_for_server", "annotation": ""}, "snippet": " self.gripper_action_client[1].wait_for_server()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99636:Assign_L72_C8", "label": "self.arm_state_lock =", "type": "assigned_variable", "loc": [72, 72], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L61_C4", "vector": [14, 2, 0.3051, 0.0042, 2, 0.59, 0.4615, 845, 0, 0, 0, 0, 0, 5, 2], "semantic": {"name": "self.arm_state_lock", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.arm_state_lock = [RLock(), RLock()]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99636:Assign_L73_C8", "label": "self.r_arm_cart_pub = Publisher()", "type": "assigned_variable", "loc": [73, 73], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L61_C4", "vector": [14, 2, 0.3093, 0.0042, 2, 0.59, 0.5385, 7, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "self.r_arm_cart_pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " self.r_arm_cart_pub = rospy.Publisher('/r_cart/command_pose', PoseStamped)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99636:Assign_L74_C8", "label": "self.l_arm_cart_pub = Publisher()", "type": "assigned_variable", "loc": [74, 74], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L61_C4", "vector": [14, 2, 0.3136, 0.0042, 2, 0.59, 0.6154, 808, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "self.l_arm_cart_pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " self.l_arm_cart_pub = rospy.Publisher('/l_cart/command_pose', PoseStamped)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99636:Expr_L76_C8", "label": "Subscriber()", "type": "expression", "loc": [76, 76], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L61_C4", "vector": [8, 2, 0.322, 0.0042, 2, 0.59, 0.6923, 455, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "Subscriber", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " rospy.Subscriber('/r_cart/state', JTTeleopControllerState, self.r_cart_state_cb)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99636:Expr_L77_C8", "label": "Subscriber()", "type": "expression", "loc": [77, 77], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L61_C4", "vector": [8, 2, 0.3263, 0.0042, 2, 0.59, 0.7692, 455, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "Subscriber", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " rospy.Subscriber('/l_cart/state', JTTeleopControllerState, self.l_cart_state_cb)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99636:Assign_L79_C8", "label": "self.tf_lstnr = TransformListener()", "type": "assigned_variable", "loc": [79, 79], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L61_C4", "vector": [14, 2, 0.3347, 0.0042, 2, 0.59, 0.8462, 699, 3, 0, 0, 0, 108, 10, 1], "semantic": {"name": "self.tf_lstnr", "arg_names": [], "import_names": [], "rhs_call_name": "TransformListener", "annotation": ""}, "snippet": " self.tf_lstnr = tf.TransformListener()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99636:Expr_L81_C8", "label": "sleep()", "type": "expression", "loc": [81, 81], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L61_C4", "vector": [8, 2, 0.3432, 0.0042, 2, 0.59, 0.9231, 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_99636:Expr_L83_C8", "label": "log()", "type": "expression", "loc": [83, 83], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L61_C4", "vector": [8, 2, 0.3517, 0.0042, 2, 0.59, 1.0, 432, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "log", "arg_names": [], "import_names": [], "rhs_call_name": "log", "annotation": ""}, "snippet": " log(\"Finished loading SimpleArmManger\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L85_C4", "label": "r_cart_state_cb", "type": "function", "loc": [85, 101], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99636:ClassDef_L52_C0", "vector": [2, 1, 0.3941, 0.072, 1, 0.02, 0.1111, 925, 0, 2, 0, 0, 0, 0, 10], "semantic": {"name": "r_cart_state_cb", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def r_cart_state_cb(self, msg):\n trans, quat = self.tf_lstnr.lookupTransform('/torso_lift_link',\n 'r_gripper_tool_frame', rospy.Time(0))\n rot = tr.quaternion_to_matrix(quat)\n tip = np.matrix([0.12, 0., 0.]).T\n self.r_ee_pos = rot*tip + np.matrix(trans).T\n self.r_ee_rot = rot\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99636:Assign_L86_C8", "label": "trans, quat = lookupTransform()", "type": "assigned_variable", "loc": [86, 87], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L85_C4", "vector": [14, 2, 0.3665, 0.0085, 2, 0.36, 0.0, 441, 3, 3, 0, 0, 926, 10, 2], "semantic": {"name": "trans, quat", "arg_names": [], "import_names": [], "rhs_call_name": "lookupTransform", "annotation": ""}, "snippet": " trans, quat = self.tf_lstnr.lookupTransform('/torso_lift_link',\n 'r_gripper_tool_frame', rospy.Time(0))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99636:Assign_L88_C8", "label": "rot = quaternion_to_matrix()", "type": "assigned_variable", "loc": [88, 88], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L85_C4", "vector": [14, 2, 0.3729, 0.0042, 2, 0.36, 0.0769, 812, 3, 1, 0, 0, 149, 10, 1], "semantic": {"name": "rot", "arg_names": [], "import_names": [], "rhs_call_name": "quaternion_to_matrix", "annotation": ""}, "snippet": " rot = tr.quaternion_to_matrix(quat)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99636:Assign_L89_C8", "label": "tip =", "type": "assigned_variable", "loc": [89, 89], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L85_C4", "vector": [14, 2, 0.3771, 0.0042, 2, 0.36, 0.1538, 726, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "tip", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tip = np.matrix([0.12, 0., 0.]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99636:Assign_L90_C8", "label": "self.r_ee_pos =", "type": "assigned_variable", "loc": [90, 90], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L85_C4", "vector": [14, 2, 0.3814, 0.0042, 2, 0.36, 0.2308, 506, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.r_ee_pos", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.r_ee_pos = rot*tip + np.matrix(trans).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99636:Assign_L91_C8", "label": "self.r_ee_rot =", "type": "assigned_variable", "loc": [91, 91], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L85_C4", "vector": [14, 2, 0.3856, 0.0042, 2, 0.36, 0.3077, 375, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.r_ee_rot", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.r_ee_rot = rot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99636:Assign_L93_C8", "label": "ros_pt =", "type": "assigned_variable", "loc": [93, 93], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L85_C4", "vector": [14, 2, 0.3941, 0.0042, 2, 0.36, 0.3846, 874, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ros_pt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ros_pt = msg.x_desi_filtered.pose.position"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99636:Assign_L94_C8", "label": "x, y, z =", "type": "assigned_variable", "loc": [94, 94], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L85_C4", "vector": [14, 2, 0.3983, 0.0042, 2, 0.36, 0.4615, 971, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "x, y, z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " x, y, z = ros_pt.x, ros_pt.y, ros_pt.z"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99636:Assign_L95_C8", "label": "self.r_cep_pos =", "type": "assigned_variable", "loc": [95, 95], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L85_C4", "vector": [14, 2, 0.4025, 0.0042, 2, 0.36, 0.5385, 277, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.r_cep_pos", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.r_cep_pos = np.matrix([x, y, z]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99636:Assign_L96_C8", "label": "pt =", "type": "assigned_variable", "loc": [96, 96], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L85_C4", "vector": [14, 2, 0.4068, 0.0042, 2, 0.36, 0.6154, 989, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "pt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pt = rot.T * (np.matrix([x,y,z]).T - np.matrix(trans).T)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99636:Assign_L97_C8", "label": "pt =", "type": "assigned_variable", "loc": [97, 97], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L85_C4", "vector": [14, 2, 0.411, 0.0042, 2, 0.36, 0.6923, 989, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pt = pt + tip"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99636:Assign_L98_C8", "label": "self.r_cep_pos_hooktip =", "type": "assigned_variable", "loc": [98, 98], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L85_C4", "vector": [14, 2, 0.4153, 0.0042, 2, 0.36, 0.7692, 508, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.r_cep_pos_hooktip", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.r_cep_pos_hooktip = rot*pt + np.matrix(trans).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99636:Assign_L99_C8", "label": "ros_quat =", "type": "assigned_variable", "loc": [99, 99], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L85_C4", "vector": [14, 2, 0.4195, 0.0042, 2, 0.36, 0.8462, 920, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ros_quat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ros_quat = msg.x_desi_filtered.pose.orientation"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99636:Assign_L100_C8", "label": "quat =", "type": "assigned_variable", "loc": [100, 100], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L85_C4", "vector": [14, 2, 0.4237, 0.0042, 2, 0.36, 0.9231, 367, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "quat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " quat = (ros_quat.x, ros_quat.y, ros_quat.z, ros_quat.w)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99636:Assign_L101_C8", "label": "self.r_cep_rot = quaternion_to_matrix()", "type": "assigned_variable", "loc": [101, 101], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L85_C4", "vector": [14, 2, 0.428, 0.0042, 2, 0.36, 1.0, 764, 3, 1, 0, 0, 149, 10, 1], "semantic": {"name": "self.r_cep_rot", "arg_names": [], "import_names": [], "rhs_call_name": "quaternion_to_matrix", "annotation": ""}, "snippet": " self.r_cep_rot = tr.quaternion_to_matrix(quat)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L103_C4", "label": "l_cart_state_cb", "type": "function", "loc": [103, 108], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99636:ClassDef_L52_C0", "vector": [2, 1, 0.447, 0.0254, 1, 0.02, 0.2222, 1, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "l_cart_state_cb", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def l_cart_state_cb(self, msg):\n ros_pt = msg.x_desi_filtered.pose.position\n self.l_cep_pos = np.matrix([ros_pt.x, ros_pt.y, ros_pt.z]).T\n ros_quat = msg.x_desi_filtered.pose.orientation\n quat = (ros_quat.x, ros_quat.y, ros_quat.z, ros_quat.w)\n self.l_cep_rot = tr.quaternion_to_matrix(quat)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99636:Assign_L104_C8", "label": "ros_pt =", "type": "assigned_variable", "loc": [104, 104], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L103_C4", "vector": [14, 2, 0.4407, 0.0042, 2, 0.4, 0.0, 874, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ros_pt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ros_pt = msg.x_desi_filtered.pose.position"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99636:Assign_L105_C8", "label": "self.l_cep_pos =", "type": "assigned_variable", "loc": [105, 105], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L103_C4", "vector": [14, 2, 0.4449, 0.0042, 2, 0.4, 0.25, 973, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.l_cep_pos", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.l_cep_pos = np.matrix([ros_pt.x, ros_pt.y, ros_pt.z]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99636:Assign_L106_C8", "label": "ros_quat =", "type": "assigned_variable", "loc": [106, 106], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L103_C4", "vector": [14, 2, 0.4492, 0.0042, 2, 0.4, 0.5, 920, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ros_quat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ros_quat = msg.x_desi_filtered.pose.orientation"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99636:Assign_L107_C8", "label": "quat =", "type": "assigned_variable", "loc": [107, 107], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L103_C4", "vector": [14, 2, 0.4534, 0.0042, 2, 0.4, 0.75, 367, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "quat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " quat = (ros_quat.x, ros_quat.y, ros_quat.z, ros_quat.w)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99636:Assign_L108_C8", "label": "self.l_cep_rot = quaternion_to_matrix()", "type": "assigned_variable", "loc": [108, 108], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L103_C4", "vector": [14, 2, 0.4576, 0.0042, 2, 0.4, 1.0, 385, 3, 1, 0, 0, 149, 10, 1], "semantic": {"name": "self.l_cep_rot", "arg_names": [], "import_names": [], "rhs_call_name": "quaternion_to_matrix", "annotation": ""}, "snippet": " self.l_cep_rot = tr.quaternion_to_matrix(quat)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L110_C4", "label": "get_ee_jtt", "type": "function", "loc": [110, 114], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99636:ClassDef_L52_C0", "vector": [2, 1, 0.4746, 0.0212, 1, 0.02, 0.3333, 15, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "get_ee_jtt", "arg_names": ["self", "arm"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_ee_jtt(self, arm):\n if arm == 0:\n return self.r_ee_pos, self.r_ee_rot\n else:\n return self.l_ee_pos, self.l_ee_rot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99636:If_L111_C8", "label": "if", "type": "if", "loc": [111, 114], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L110_C4", "vector": [4, 2, 0.4767, 0.0169, 2, 0.44, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if arm == 0:\n return self.r_ee_pos, self.r_ee_rot\n else:\n return self.l_ee_pos, self.l_ee_rot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99636:Return_L112_C12", "label": "return", "type": "return", "loc": [112, 112], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99636:If_L111_C8", "vector": [13, 3, 0.4746, 0.0042, 3, 0.88, 0.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.r_ee_pos, self.r_ee_rot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99636:Return_L114_C12", "label": "return", "type": "return", "loc": [114, 114], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99636:If_L111_C8", "vector": [13, 3, 0.4831, 0.0042, 3, 0.88, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.l_ee_pos, self.l_ee_rot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L116_C4", "label": "get_cep_jtt", "type": "function", "loc": [116, 123], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99636:ClassDef_L52_C0", "vector": [2, 1, 0.5064, 0.0339, 1, 0.02, 0.4444, 532, 0, 3, 1, 0, 0, 0, 0], "semantic": {"name": "get_cep_jtt", "arg_names": ["self", "arm", "hook_tip"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_cep_jtt(self, arm, hook_tip = False):\n if arm == 0:\n if hook_tip:\n return self.r_cep_pos_hooktip, self.r_cep_rot\n else:\n return self.r_cep_pos, self.r_cep_rot\n else:\n return self.l_cep_pos, self.l_cep_rot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99636:If_L117_C8", "label": "if", "type": "if", "loc": [117, 123], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L116_C4", "vector": [4, 2, 0.5085, 0.0297, 2, 0.93, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if arm == 0:\n if hook_tip:\n return self.r_cep_pos_hooktip, self.r_cep_rot\n else:\n return self.r_cep_pos, self.r_cep_rot\n else:\n return self.l_cep_pos, self.l_cep_rot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99636:If_L118_C12", "label": "if", "type": "if", "loc": [118, 121], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99636:If_L117_C8", "vector": [4, 3, 0.5064, 0.0169, 3, 0.73, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if hook_tip:\n return self.r_cep_pos_hooktip, self.r_cep_rot\n else:\n return self.r_cep_pos, self.r_cep_rot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99636:Return_L119_C16", "label": "return", "type": "return", "loc": [119, 119], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99636:If_L118_C12", "vector": [13, 4, 0.5042, 0.0042, 4, 0.64, 0.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.r_cep_pos_hooktip, self.r_cep_rot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99636:Return_L121_C16", "label": "return", "type": "return", "loc": [121, 121], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99636:If_L118_C12", "vector": [13, 4, 0.5127, 0.0042, 4, 0.64, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.r_cep_pos, self.r_cep_rot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99636:Return_L123_C12", "label": "return", "type": "return", "loc": [123, 123], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99636:If_L117_C8", "vector": [13, 3, 0.5212, 0.0042, 3, 0.73, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.l_cep_pos, self.l_cep_rot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L126_C4", "label": "set_cep_jtt", "type": "function", "loc": [126, 151], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99636:ClassDef_L52_C0", "vector": [2, 1, 0.5869, 0.1102, 1, 0.02, 0.5556, 820, 0, 4, 0, 0, 0, 0, 5], "semantic": {"name": "set_cep_jtt", "arg_names": ["self", "arm", "p", "rot"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def set_cep_jtt(self, arm, p, rot=None):\n if arm != 1:\n arm = 0\n ps = PoseStamped()\n ps.header.stamp = rospy.rostime.get_rostime()\n ps.header.frame_id = 'torso_lift_link'\n \n ps.pose.position.x = p[0,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99636:If_L127_C8", "label": "if", "type": "if", "loc": [127, 128], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L126_C4", "vector": [4, 2, 0.5403, 0.0085, 2, 0.34, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if arm != 1:\n arm = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99636:Assign_L128_C12", "label": "arm =", "type": "assigned_variable", "loc": [128, 128], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99636:If_L127_C8", "vector": [14, 3, 0.5424, 0.0042, 3, 0.31, 0.0, 413, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "arm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " arm = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99636:Assign_L129_C8", "label": "ps = PoseStamped()", "type": "assigned_variable", "loc": [129, 129], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L126_C4", "vector": [14, 2, 0.5466, 0.0042, 2, 0.34, 0.0769, 232, 3, 0, 0, 0, 226, 10, 1], "semantic": {"name": "ps", "arg_names": [], "import_names": [], "rhs_call_name": "PoseStamped", "annotation": ""}, "snippet": " ps = PoseStamped()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99636:Assign_L130_C8", "label": "ps.header.stamp = get_rostime()", "type": "assigned_variable", "loc": [130, 130], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L126_C4", "vector": [14, 2, 0.5508, 0.0042, 2, 0.34, 0.1538, 161, 3, 0, 0, 0, 173, 10, 1], "semantic": {"name": "ps.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "get_rostime", "annotation": ""}, "snippet": " ps.header.stamp = rospy.rostime.get_rostime()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99636:Assign_L131_C8", "label": "ps.header.frame_id =", "type": "assigned_variable", "loc": [131, 131], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L126_C4", "vector": [14, 2, 0.5551, 0.0042, 2, 0.34, 0.2308, 293, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "ps.header.frame_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ps.header.frame_id = 'torso_lift_link'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99636:Assign_L133_C8", "label": "ps.pose.position.x =", "type": "assigned_variable", "loc": [133, 133], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L126_C4", "vector": [14, 2, 0.5636, 0.0042, 2, 0.34, 0.3077, 782, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ps.pose.position.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ps.pose.position.x = p[0,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99636:Assign_L134_C8", "label": "ps.pose.position.y =", "type": "assigned_variable", "loc": [134, 134], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L126_C4", "vector": [14, 2, 0.5678, 0.0042, 2, 0.34, 0.3846, 661, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ps.pose.position.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ps.pose.position.y = p[1,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99636:Assign_L135_C8", "label": "ps.pose.position.z =", "type": "assigned_variable", "loc": [135, 135], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L126_C4", "vector": [14, 2, 0.572, 0.0042, 2, 0.34, 0.4615, 771, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ps.pose.position.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ps.pose.position.z = p[2,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99636:If_L137_C8", "label": "if", "type": "if", "loc": [137, 141], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L126_C4", "vector": [4, 2, 0.589, 0.0212, 2, 0.34, 0.5385, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if rot == None:\n if arm == 0:\n rot = self.r_cep_rot\n else:\n rot = self.l_cep_rot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99636:If_L138_C12", "label": "if", "type": "if", "loc": [138, 141], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99636:If_L137_C8", "vector": [4, 3, 0.5911, 0.0169, 3, 0.65, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if arm == 0:\n rot = self.r_cep_rot\n else:\n rot = self.l_cep_rot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99636:Assign_L139_C16", "label": "rot =", "type": "assigned_variable", "loc": [139, 139], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99636:If_L138_C12", "vector": [14, 4, 0.589, 0.0042, 4, 0.21, 0.0, 812, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "rot", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rot = self.r_cep_rot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99636:Assign_L141_C16", "label": "rot =", "type": "assigned_variable", "loc": [141, 141], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99636:If_L138_C12", "vector": [14, 4, 0.5975, 0.0042, 4, 0.21, 1.0, 812, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "rot", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rot = self.l_cep_rot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99636:Assign_L143_C8", "label": "quat = matrix_to_quaternion()", "type": "assigned_variable", "loc": [143, 143], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L126_C4", "vector": [14, 2, 0.6059, 0.0042, 2, 0.34, 0.6154, 367, 3, 1, 0, 0, 615, 10, 1], "semantic": {"name": "quat", "arg_names": [], "import_names": [], "rhs_call_name": "matrix_to_quaternion", "annotation": ""}, "snippet": " quat = tr.matrix_to_quaternion(rot)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99636:Assign_L144_C8", "label": "ps.pose.orientation.x =", "type": "assigned_variable", "loc": [144, 144], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L126_C4", "vector": [14, 2, 0.6102, 0.0042, 2, 0.34, 0.6923, 628, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ps.pose.orientation.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ps.pose.orientation.x = quat[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99636:Assign_L145_C8", "label": "ps.pose.orientation.y =", "type": "assigned_variable", "loc": [145, 145], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L126_C4", "vector": [14, 2, 0.6144, 0.0042, 2, 0.34, 0.7692, 848, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ps.pose.orientation.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ps.pose.orientation.y = quat[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99636:Assign_L146_C8", "label": "ps.pose.orientation.z =", "type": "assigned_variable", "loc": [146, 146], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L126_C4", "vector": [14, 2, 0.6186, 0.0042, 2, 0.34, 0.8462, 126, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ps.pose.orientation.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ps.pose.orientation.z = quat[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99636:Assign_L147_C8", "label": "ps.pose.orientation.w =", "type": "assigned_variable", "loc": [147, 147], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L126_C4", "vector": [14, 2, 0.6229, 0.0042, 2, 0.34, 0.9231, 163, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ps.pose.orientation.w", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ps.pose.orientation.w = quat[3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99636:If_L148_C8", "label": "if", "type": "if", "loc": [148, 151], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L126_C4", "vector": [4, 2, 0.6335, 0.0169, 2, 0.34, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if arm == 0:\n self.r_arm_cart_pub.publish(ps)\n else:\n self.l_arm_cart_pub.publish(ps)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99636:Expr_L149_C12", "label": "publish()", "type": "expression", "loc": [149, 149], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99636:If_L148_C8", "vector": [8, 3, 0.6314, 0.0042, 3, 0.37, 0.0, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.r_arm_cart_pub.publish(ps)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99636:Expr_L151_C12", "label": "publish()", "type": "expression", "loc": [151, 151], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99636:If_L148_C8", "vector": [8, 3, 0.6398, 0.0042, 3, 0.37, 1.0, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.l_arm_cart_pub.publish(ps)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L154_C4", "label": "go_cep_jtt", "type": "function", "loc": [154, 165], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99636:ClassDef_L52_C0", "vector": [2, 1, 0.6758, 0.0508, 1, 0.02, 0.6667, 219, 0, 3, 0, 0, 0, 0, 7], "semantic": {"name": "go_cep_jtt", "arg_names": ["self", "arm", "p"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def go_cep_jtt(self, arm, p):\n step_size = 0.01\n sleep_time = 0.1\n cep_p, cep_rot = self.get_cep_jtt(arm)\n unit_vec = (p-cep_p)\n unit_vec = unit_vec / np.linalg.norm(unit_vec)\n while np.linalg.norm(p-cep_p) > step_size:\n cep_p += unit_vec * step_size"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99636:Assign_L155_C8", "label": "step_size =", "type": "assigned_variable", "loc": [155, 155], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L154_C4", "vector": [14, 2, 0.6568, 0.0042, 2, 0.57, 0.0, 764, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "step_size", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " step_size = 0.01"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99636:Assign_L156_C8", "label": "sleep_time =", "type": "assigned_variable", "loc": [156, 156], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L154_C4", "vector": [14, 2, 0.661, 0.0042, 2, 0.57, 0.1429, 355, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "sleep_time", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " sleep_time = 0.1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99636:Assign_L157_C8", "label": "cep_p, cep_rot = get_cep_jtt()", "type": "assigned_variable", "loc": [157, 157], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L154_C4", "vector": [14, 2, 0.6653, 0.0042, 2, 0.57, 0.2857, 891, 3, 1, 0, 0, 532, 10, 1], "semantic": {"name": "cep_p, cep_rot", "arg_names": [], "import_names": [], "rhs_call_name": "get_cep_jtt", "annotation": ""}, "snippet": " cep_p, cep_rot = self.get_cep_jtt(arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99636:Assign_L158_C8", "label": "unit_vec =", "type": "assigned_variable", "loc": [158, 158], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L154_C4", "vector": [14, 2, 0.6695, 0.0042, 2, 0.57, 0.4286, 372, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "unit_vec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " unit_vec = (p-cep_p)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99636:Assign_L159_C8", "label": "unit_vec =", "type": "assigned_variable", "loc": [159, 159], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L154_C4", "vector": [14, 2, 0.6737, 0.0042, 2, 0.57, 0.5714, 372, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "unit_vec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " unit_vec = unit_vec / np.linalg.norm(unit_vec)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99636:While_L160_C8", "label": "while", "type": "while", "loc": [160, 163], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L154_C4", "vector": [5, 2, 0.6843, 0.0169, 2, 0.57, 0.7143, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while np.linalg.norm(p-cep_p) > step_size:\n cep_p += unit_vec * step_size\n self.set_cep_jtt(arm, cep_p)\n rospy.sleep(sleep_time)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99636:Expr_L162_C12", "label": "set_cep_jtt()", "type": "expression", "loc": [162, 162], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99636:While_L160_C8", "vector": [8, 3, 0.6864, 0.0042, 3, 0.96, 0.0, 820, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "set_cep_jtt", "arg_names": [], "import_names": [], "rhs_call_name": "set_cep_jtt", "annotation": ""}, "snippet": " self.set_cep_jtt(arm, cep_p)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99636:Expr_L163_C12", "label": "sleep()", "type": "expression", "loc": [163, 163], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99636:While_L160_C8", "vector": [8, 3, 0.6907, 0.0042, 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(sleep_time)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99636:Expr_L164_C8", "label": "set_cep_jtt()", "type": "expression", "loc": [164, 164], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L154_C4", "vector": [8, 2, 0.6949, 0.0042, 2, 0.57, 0.8571, 820, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "set_cep_jtt", "arg_names": [], "import_names": [], "rhs_call_name": "set_cep_jtt", "annotation": ""}, "snippet": " self.set_cep_jtt(arm, p)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99636:Expr_L165_C8", "label": "sleep()", "type": "expression", "loc": [165, 165], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L154_C4", "vector": [8, 2, 0.6992, 0.0042, 2, 0.57, 1.0, 476, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " rospy.sleep(sleep_time)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L177_C4", "label": "move_gripper", "type": "function", "loc": [177, 178], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99636:ClassDef_L52_C0", "vector": [2, 1, 0.7521, 0.0085, 1, 0.02, 0.7778, 327, 0, 4, 0, 0, 0, 0, 3], "semantic": {"name": "move_gripper", "arg_names": ["self", "arm", "amount", "effort"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def move_gripper(self, arm, amount=0.08, effort = 15):\n self.gripper_action_client[arm].send_goal(Pr2GripperCommandGoal(Pr2GripperCommand(position=amount, max_effort = effort)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99636:Expr_L178_C8", "label": "send_goal()", "type": "expression", "loc": [178, 178], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L177_C4", "vector": [8, 2, 0.7542, 0.0042, 2, 0.93, 0.0, 184, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "send_goal", "arg_names": [], "import_names": [], "rhs_call_name": "send_goal", "annotation": ""}, "snippet": " self.gripper_action_client[arm].send_goal(Pr2GripperCommandGoal(Pr2GripperCommand(position=amount, max_effort = effort)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L184_C4", "label": "open_gripper", "type": "function", "loc": [184, 185], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99636:ClassDef_L52_C0", "vector": [2, 1, 0.7818, 0.0085, 1, 0.02, 0.8889, 833, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "open_gripper", "arg_names": ["self", "arm"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def open_gripper(self, arm):\n self.move_gripper(arm, 0.08, -1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99636:Expr_L185_C8", "label": "move_gripper()", "type": "expression", "loc": [185, 185], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L184_C4", "vector": [8, 2, 0.7839, 0.0042, 2, 0.13, 0.0, 327, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "move_gripper", "arg_names": [], "import_names": [], "rhs_call_name": "move_gripper", "annotation": ""}, "snippet": " self.move_gripper(arm, 0.08, -1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L191_C4", "label": "close_gripper", "type": "function", "loc": [191, 192], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99636:ClassDef_L52_C0", "vector": [2, 1, 0.8114, 0.0085, 1, 0.02, 1.0, 807, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "close_gripper", "arg_names": ["self", "arm", "effort"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def close_gripper(self, arm, effort = 15):\n self.move_gripper(arm, 0.0, effort)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99636:Expr_L192_C8", "label": "move_gripper()", "type": "expression", "loc": [192, 192], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L191_C4", "vector": [8, 2, 0.8136, 0.0042, 2, 0.55, 0.0, 327, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "move_gripper", "arg_names": [], "import_names": [], "rhs_call_name": "move_gripper", "annotation": ""}, "snippet": " self.move_gripper(arm, 0.0, effort)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99636:If_L201_C0", "label": "if", "type": "if", "loc": [201, 234], "level": 0, "parent": null, "vector": [4, 0, 0.9216, 0.1441, 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 rospy.init_node(node_name, anonymous = True)\n log(\"Node initialized\")\n\n pr2_arm = PR2Arms()\n\n# #------- testing set JEP ---------------\n# raw_input('Hit ENTER to begin')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99636:Expr_L202_C4", "label": "init_node()", "type": "expression", "loc": [202, 202], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99636:If_L201_C0", "vector": [8, 1, 0.8559, 0.0042, 1, 0.85, 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_99636:Expr_L203_C4", "label": "log()", "type": "expression", "loc": [203, 203], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99636:If_L201_C0", "vector": [8, 1, 0.8602, 0.0042, 1, 0.85, 0.0714, 432, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "log", "arg_names": [], "import_names": [], "rhs_call_name": "log", "annotation": ""}, "snippet": " log(\"Node initialized\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99636:Assign_L205_C4", "label": "pr2_arm = PR2Arms()", "type": "assigned_variable", "loc": [205, 205], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99636:If_L201_C0", "vector": [14, 1, 0.8686, 0.0042, 1, 0.85, 0.1429, 280, 3, 0, 0, 0, 694, 10, 1], "semantic": {"name": "pr2_arm", "arg_names": [], "import_names": [], "rhs_call_name": "PR2Arms", "annotation": ""}, "snippet": " pr2_arm = PR2Arms()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99636:Assign_L209_C4", "label": "r_arm, l_arm =", "type": "assigned_variable", "loc": [209, 209], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99636:If_L201_C0", "vector": [14, 1, 0.8856, 0.0042, 1, 0.85, 0.2143, 451, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "r_arm, l_arm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " r_arm, l_arm = 0, 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99636:Expr_L219_C4", "label": "raw_input()", "type": "expression", "loc": [219, 219], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99636:If_L201_C0", "vector": [8, 1, 0.928, 0.0042, 1, 0.85, 0.2857, 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')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99636:Assign_L220_C4", "label": "p1 =", "type": "assigned_variable", "loc": [220, 220], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99636:If_L201_C0", "vector": [14, 1, 0.9322, 0.0042, 1, 0.85, 0.3571, 87, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "p1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p1 = np.matrix([0.62, 0.0, 0.16]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99636:Expr_L221_C4", "label": "go_cep_jtt()", "type": "expression", "loc": [221, 221], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99636:If_L201_C0", "vector": [8, 1, 0.9364, 0.0042, 1, 0.85, 0.4286, 219, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "go_cep_jtt", "arg_names": [], "import_names": [], "rhs_call_name": "go_cep_jtt", "annotation": ""}, "snippet": " pr2_arm.go_cep_jtt(r_arm, p1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99636:Expr_L225_C4", "label": "raw_input()", "type": "expression", "loc": [225, 225], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99636:If_L201_C0", "vector": [8, 1, 0.9534, 0.0042, 1, 0.85, 0.5, 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')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99636:Assign_L226_C4", "label": "p2 =", "type": "assigned_variable", "loc": [226, 226], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99636:If_L201_C0", "vector": [14, 1, 0.9576, 0.0042, 1, 0.85, 0.5714, 843, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "p2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p2 = np.matrix([0.600+0.06, 0.106, -0.32]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99636:Expr_L227_C4", "label": "go_cep_jtt()", "type": "expression", "loc": [227, 227], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99636:If_L201_C0", "vector": [8, 1, 0.9619, 0.0042, 1, 0.85, 0.6429, 219, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "go_cep_jtt", "arg_names": [], "import_names": [], "rhs_call_name": "go_cep_jtt", "annotation": ""}, "snippet": " pr2_arm.go_cep_jtt(r_arm, p2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99636:Expr_L229_C4", "label": "raw_input()", "type": "expression", "loc": [229, 229], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99636:If_L201_C0", "vector": [8, 1, 0.9703, 0.0042, 1, 0.85, 0.7143, 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')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99636:Expr_L230_C4", "label": "go_cep_jtt()", "type": "expression", "loc": [230, 230], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99636:If_L201_C0", "vector": [8, 1, 0.9746, 0.0042, 1, 0.85, 0.7857, 219, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "go_cep_jtt", "arg_names": [], "import_names": [], "rhs_call_name": "go_cep_jtt", "annotation": ""}, "snippet": " pr2_arm.go_cep_jtt(r_arm, p1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99636:Expr_L232_C4", "label": "raw_input()", "type": "expression", "loc": [232, 232], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99636:If_L201_C0", "vector": [8, 1, 0.9831, 0.0042, 1, 0.85, 0.8571, 821, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "raw_input", "arg_names": [], "import_names": [], "rhs_call_name": "raw_input", "annotation": ""}, "snippet": " raw_input('Hit ENTER to go home')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99636:Assign_L233_C4", "label": "home =", "type": "assigned_variable", "loc": [233, 233], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99636:If_L201_C0", "vector": [14, 1, 0.9873, 0.0042, 1, 0.85, 0.9286, 475, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "home", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " home = np.matrix([0.23, -0.6, -0.05]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99636:Expr_L234_C4", "label": "go_cep_jtt()", "type": "expression", "loc": [234, 234], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99636:If_L201_C0", "vector": [8, 1, 0.9915, 0.0042, 1, 0.85, 1.0, 219, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "go_cep_jtt", "arg_names": [], "import_names": [], "rhs_call_name": "go_cep_jtt", "annotation": ""}, "snippet": " pr2_arm.go_cep_jtt(r_arm, home)"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99636:Expr_L45_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99636:ClassDef_L52_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L61_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99636:Expr_L63_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99636:Assign_L65_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99636:Assign_L66_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99636:Assign_L67_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99636:Expr_L69_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99636:Expr_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99636:Assign_L72_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99636:Assign_L73_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99636:Assign_L74_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99636:Expr_L76_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99636:Expr_L77_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99636:Assign_L79_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99636:Expr_L81_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99636:Expr_L83_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99636:ClassDef_L52_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L85_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L85_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99636:Assign_L86_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L85_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99636:Assign_L88_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L85_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99636:Assign_L89_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L85_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99636:Assign_L90_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L85_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99636:Assign_L91_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L85_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99636:Assign_L93_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L85_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99636:Assign_L94_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L85_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99636:Assign_L95_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L85_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99636:Assign_L96_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L85_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99636:Assign_L97_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L85_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99636:Assign_L98_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L85_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99636:Assign_L99_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L85_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99636:Assign_L100_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L85_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99636:Assign_L101_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99636:ClassDef_L52_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L103_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L103_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99636:Assign_L104_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L103_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99636:Assign_L105_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L103_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99636:Assign_L106_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L103_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99636:Assign_L107_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L103_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99636:Assign_L108_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99636:ClassDef_L52_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L110_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L110_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99636:If_L111_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99636:If_L111_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99636:Return_L112_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99636:If_L111_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99636:Return_L114_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99636:ClassDef_L52_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L116_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L116_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99636:If_L117_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99636:If_L117_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99636:If_L118_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99636:If_L118_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99636:Return_L119_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99636:If_L118_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99636:Return_L121_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99636:If_L117_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99636:Return_L123_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99636:ClassDef_L52_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L126_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L126_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99636:If_L127_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99636:If_L127_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99636:Assign_L128_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L126_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99636:Assign_L129_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L126_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99636:Assign_L130_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L126_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99636:Assign_L131_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L126_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99636:Assign_L133_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L126_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99636:Assign_L134_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L126_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99636:Assign_L135_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L126_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99636:If_L137_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99636:If_L137_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99636:If_L138_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99636:If_L138_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99636:Assign_L139_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99636:If_L138_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99636:Assign_L141_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L126_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99636:Assign_L143_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L126_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99636:Assign_L144_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L126_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99636:Assign_L145_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L126_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99636:Assign_L146_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L126_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99636:Assign_L147_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L126_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99636:If_L148_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99636:If_L148_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99636:Expr_L149_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99636:If_L148_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99636:Expr_L151_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99636:ClassDef_L52_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L154_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L154_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99636:Assign_L155_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L154_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99636:Assign_L156_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L154_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99636:Assign_L157_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L154_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99636:Assign_L158_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L154_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99636:Assign_L159_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L154_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99636:While_L160_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99636:While_L160_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99636:Expr_L162_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99636:While_L160_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99636:Expr_L163_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L154_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99636:Expr_L164_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L154_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99636:Expr_L165_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99636:ClassDef_L52_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L177_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L177_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99636:Expr_L178_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99636:ClassDef_L52_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L184_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L184_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99636:Expr_L185_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99636:ClassDef_L52_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L191_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99636:FunctionDef_L191_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99636:Expr_L192_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99636:If_L201_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99636:Expr_L202_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99636:If_L201_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99636:Expr_L203_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99636:If_L201_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99636:Assign_L205_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99636:If_L201_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99636:Assign_L209_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99636:If_L201_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99636:Expr_L219_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99636:If_L201_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99636:Assign_L220_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99636:If_L201_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99636:Expr_L221_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99636:If_L201_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99636:Expr_L225_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99636:If_L201_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99636:Assign_L226_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99636:If_L201_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99636:Expr_L227_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99636:If_L201_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99636:Expr_L229_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99636:If_L201_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99636:Expr_L230_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99636:If_L201_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99636:Expr_L232_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99636:If_L201_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99636:Assign_L233_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99636:If_L201_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99636:Expr_L234_C4"}]
#!/usr/bin/env python # # Copyright (c) 2009, Georgia Tech Research Corporation # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # * Neither the name of the Georgia Tech Research Corporation nor the # names of its contributors may be used to endorse or promote products # derived from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY GEORGIA TECH RESEARCH CORPORATION ''AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL GEORGIA TECH BE LIABLE FOR ANY DIRECT, INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # #Author: Marc Killpack import roslib roslib.load_manifest('pr2_playpen') from UI_segment_object.srv import GetObject import rospy import sys import optparse p = optparse.OptionParser() p.add_option('--node', action='store', type='string', dest='node') p.add_option('--serv', action='store', type='string', dest='service') opt, args = p.parse_args() rospy.init_node(opt.node) rospy.wait_for_service(opt.service) pub_filtered_cloud = rospy.ServiceProxy(opt.service, GetObject) r = rospy.Rate(30) while not rospy.is_shutdown(): pub_filtered_cloud() r.sleep()
ajibawa-2023/Python-Code-Large/train/row_99637
17
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_99637:Import_L30_C0", "label": "roslib import roslib", "type": "import", "loc": [30, 30], "level": 0, "parent": null, "vector": [1, 0, 0.5882, 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_99637:Expr_L31_C0", "label": "load_manifest()", "type": "expression", "loc": [31, 31], "level": 0, "parent": null, "vector": [8, 0, 0.6078, 0.0196, 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('pr2_playpen')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99637:ImportFrom_L32_C0", "label": "from UI_segment_object.srv import GetObject", "type": "import", "loc": [32, 32], "level": 0, "parent": null, "vector": [1, 0, 0.6275, 0.0196, 0, 0.66, 0.1429, 363, 0, 1, 0, 0, 363, 0, 0], "semantic": {"name": "UI_segment_object.srv", "arg_names": [], "import_names": ["GetObject"], "rhs_call_name": "", "annotation": ""}, "snippet": "from UI_segment_object.srv import GetObject"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99637:Import_L33_C0", "label": "rospy import rospy", "type": "import", "loc": [33, 33], "level": 0, "parent": null, "vector": [1, 0, 0.6471, 0.0196, 0, 0.66, 0.2143, 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_99637:Import_L34_C0", "label": "sys import sys", "type": "import", "loc": [34, 34], "level": 0, "parent": null, "vector": [1, 0, 0.6667, 0.0196, 0, 0.66, 0.2857, 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_99637:Import_L36_C0", "label": "optparse import optparse", "type": "import", "loc": [36, 36], "level": 0, "parent": null, "vector": [1, 0, 0.7059, 0.0196, 0, 0.66, 0.3571, 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_99637:Assign_L37_C0", "label": "p = OptionParser()", "type": "assigned_variable", "loc": [37, 37], "level": 0, "parent": null, "vector": [14, 0, 0.7255, 0.0196, 0, 0.66, 0.4286, 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_99637:Expr_L39_C0", "label": "add_option()", "type": "expression", "loc": [39, 39], "level": 0, "parent": null, "vector": [8, 0, 0.7647, 0.0196, 0, 0.66, 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('--node', action='store', type='string', dest='node')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99637:Expr_L40_C0", "label": "add_option()", "type": "expression", "loc": [40, 40], "level": 0, "parent": null, "vector": [8, 0, 0.7843, 0.0196, 0, 0.66, 0.5714, 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('--serv', action='store', type='string', dest='service')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99637:Assign_L42_C0", "label": "opt, args = parse_args()", "type": "assigned_variable", "loc": [42, 42], "level": 0, "parent": null, "vector": [14, 0, 0.8235, 0.0196, 0, 0.66, 0.6429, 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_99637:Expr_L44_C0", "label": "init_node()", "type": "expression", "loc": [44, 44], "level": 0, "parent": null, "vector": [8, 0, 0.8627, 0.0196, 0, 0.66, 0.7143, 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(opt.node)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99637:Expr_L45_C0", "label": "wait_for_service()", "type": "expression", "loc": [45, 45], "level": 0, "parent": null, "vector": [8, 0, 0.8824, 0.0196, 0, 0.66, 0.7857, 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(opt.service)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99637:Assign_L46_C0", "label": "pub_filtered_cloud = ServiceProxy()", "type": "assigned_variable", "loc": [46, 46], "level": 0, "parent": null, "vector": [14, 0, 0.902, 0.0196, 0, 0.66, 0.8571, 949, 3, 2, 0, 0, 915, 10, 1], "semantic": {"name": "pub_filtered_cloud", "arg_names": [], "import_names": [], "rhs_call_name": "ServiceProxy", "annotation": ""}, "snippet": "pub_filtered_cloud = rospy.ServiceProxy(opt.service, GetObject)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99637:Assign_L47_C0", "label": "r = Rate()", "type": "assigned_variable", "loc": [47, 47], "level": 0, "parent": null, "vector": [14, 0, 0.9216, 0.0196, 0, 0.66, 0.9286, 436, 3, 1, 0, 0, 543, 10, 1], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "Rate", "annotation": ""}, "snippet": "r = rospy.Rate(30)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99637:While_L49_C0", "label": "while", "type": "while", "loc": [49, 51], "level": 0, "parent": null, "vector": [5, 0, 0.9804, 0.0588, 0, 0.66, 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 pub_filtered_cloud()\n r.sleep()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99637:Expr_L50_C4", "label": "pub_filtered_cloud()", "type": "expression", "loc": [50, 50], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99637:While_L49_C0", "vector": [8, 1, 0.9804, 0.0196, 1, 0.51, 0.0, 949, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "pub_filtered_cloud", "arg_names": [], "import_names": [], "rhs_call_name": "pub_filtered_cloud", "annotation": ""}, "snippet": " pub_filtered_cloud()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99637:Expr_L51_C4", "label": "sleep()", "type": "expression", "loc": [51, 51], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99637:While_L49_C0", "vector": [8, 1, 1.0, 0.0196, 1, 0.51, 1.0, 476, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " r.sleep()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99637:While_L49_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99637:Expr_L50_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99637:While_L49_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99637:Expr_L51_C4"}]